From nobody Mon Jul 28 01:13:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4br0q700PHz63LRP; Mon, 28 Jul 2025 01:13:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4br0q66CMDz3d4Z; Mon, 28 Jul 2025 01:13:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753665218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4tX2qeSEDEOosTuklwj3Y/4WFKfyNdD5RQU9DSkQiXs=; b=yXQqLmBloFprP6ub9cf5W+LBRuT7EvGsC569R7RdFJ7D881hceo14V6IZndZNgdUfcO7T9 Jdox/HIuMn12URdxXvB0lk+cgM4CydS4i66VXepGfy4gKqOYA0ewGrVBTfj7y2Mf1gxL24 SulgO4b5ZcivsS3uB0M9sEV17AnJ62BTe9gaAD619jVPvbucpHTP/LloImTJhhV1lmLqJ7 Il+R3PINDGX+DJHaQp8tT5ZRmP2K8GZ3soXrv46LIVHIcQjjq7QYotBzyZaOvgD+xPBlGi nmrZY63ZxAHCF6hsguPKPUCP0tQ8ZpULzkSvtHagnk8nOd2+koEm5PNhwHvo7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753665218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4tX2qeSEDEOosTuklwj3Y/4WFKfyNdD5RQU9DSkQiXs=; b=mFnPEZiGBvD2Ja719bl+xxwvRKSbQjX1zeTfQ/iNoUhABOvK09ViuHfOZ17f5F2POMGmQ0 n0v8/WmxGXO7jlNTFHKTiAUPmYd2deujhbvIfKTPG/5odxgP8BIIbAMoH+P7WHF2D/yM0t yltnRkTgntcJsmxp5c0kgZYH9isyWHRXD0pagKWs9ndDfqEHaXxj8o6k+KFWvP3vVVy3j/ fG9VHMbuCDFNmBzLWLxPJwjSWBtjhqgVhndbeLG+OUt3gnOGElA3uMSmDsU8oNtz5Tq4tb FZ19B1QeVk4+WF7tiXHmpdnFHM/scwig/sqbL9Y1YkWOt+JaSFm5GtAdyfVhtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753665218; a=rsa-sha256; cv=none; b=fB/melGZlURFcigT+BFYRvswhD8crCc6ohIrUzbZz4Y15H91DPablOlcI+8cYLC7lZ6l9y 6vW1GKaRuKrgTteRMBH5BKheLNLL6UgXgJkT9cTmhCKdc02yuhOmSDqR7JxM2BAcm3pVSY ogbm9vaGx0BvqCk9v7VwWDTsi5D0RBDQIiLT6h1Qivi/352YTU74Ad6jzUptNf6bAQTY/V UrZbLHNf1apuNJ+bLQTMrWqmN+yjdei+T0Z89hQjJx7nEEge3/qJDqP+6NNe2RI9N/TkoT JhEzAb234VQFlQkoTFKx10R6H82M0mIzzeQUlRWGxs4T5OvlYwEuYm+rgmjVcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4br0q65n7wz8PB; Mon, 28 Jul 2025 01:13:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56S1Dc7G094269; Mon, 28 Jul 2025 01:13:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56S1DcLc094266; Mon, 28 Jul 2025 01:13:38 GMT (envelope-from git) Date: Mon, 28 Jul 2025 01:13:38 GMT Message-Id: <202507280113.56S1DcLc094266@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: 04a6dc7974ee - main - chroot.8: Be more precise when describing '-u', '-g' and '-G' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 04a6dc7974ee02004c9ccbb0c28d14a3271fb56a Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=04a6dc7974ee02004c9ccbb0c28d14a3271fb56a commit 04a6dc7974ee02004c9ccbb0c28d14a3271fb56a Author: Olivier Certner AuthorDate: 2025-07-25 06:36:17 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 01:11:12 +0000 chroot.8: Be more precise when describing '-u', '-g' and '-G' Reviewed by: kevans, ziaee MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51511 --- usr.sbin/chroot/chroot.8 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/usr.sbin/chroot/chroot.8 b/usr.sbin/chroot/chroot.8 index f26b7e937da9..4a1a5a396631 100644 --- a/usr.sbin/chroot/chroot.8 +++ b/usr.sbin/chroot/chroot.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 20, 2021 +.Dd July 25, 2025 .Dt CHROOT 8 .Os .Sh NAME @@ -52,13 +52,15 @@ or an interactive copy of the user's login shell. The options are as follows: .Bl -tag -width "-G group[,group ...]" .It Fl G Ar group Ns Op Cm \&, Ns Ar group ... -Run the command with the permissions of the specified groups. +Run the command with the specified groups as supplementary groups. .It Fl g Ar group -Run the command with the permissions of the specified -.Ar group . +Run the command with the specified +.Ar group +as the real, effective and saved groups. .It Fl u Ar user -Run the command as the -.Ar user . +Run the command with the specified +.Ar user +as the real, effective and saved users. .It Fl n Use the .Dv PROC_NO_NEW_PRIVS_CTL From nobody Mon Jul 28 03:26:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4br3mC6rFsz63T1V; Mon, 28 Jul 2025 03:26:19 +0000 (UTC) (envelope-from rick.macklem@gmail.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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4br3mB6l8Qz3rx9; Mon, 28 Jul 2025 03:26:18 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=lmR5KZ46; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::62c as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-ae0c571f137so756180966b.0; Sun, 27 Jul 2025 20:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753673176; x=1754277976; 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=c1H9Ih+KAkk2kX3rl72F8y7LaWROU3bZPzGMp1wMGEk=; b=lmR5KZ46ycg4uPk+ehTBV7NYvYT168P8fUA4UZ7D8O0PNubbyDdVoA3p6fQQNU2045 vBl5V7f/B6P1BoQhdq3FVjDfU5VcmlfOEIn01YMKq2saJH0QvWC+D9pmhPTaHwoovK4x Vc9vErjn1RbTIO9AdasfLz6Kqn3/q7nB9P3Xgs2JDhxjq/13vltdBK9/C2cAtANd4x57 MOeFFphU9n09pS848CoS1JzvSZiTt6yXyoxyif+MYcdigEWZWkN2w5cA+BJK/B0J/jBj vzuw8arUbwo0Hisx1engIC9zC2DZ66fmbMnvzSYWdW08jLDod1v45hnd8j68184/X8jX UnvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753673176; x=1754277976; 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=c1H9Ih+KAkk2kX3rl72F8y7LaWROU3bZPzGMp1wMGEk=; b=eNlhagraTGEIFtDwvur1hooSMoe2EVDNKiafH3ihJKi3bRIV0NhB+uPsOtlXbWRp5z FipbYe1w6skFfyS0DaFbbcgDZg6MS/z3ATZJPgT1gj89XnAft0CPxOHxtXbVq7bh1rfN sSLFVPltoE9EyjmMyrsKlf0XolwAXSz4eYFHlPDV6xe4xtlNsT+2+eEgquX7KLxXrzPd dEUVM5Ltyi1l9LHB4+CbBOQJCzAHGMvFBkjXJxrrUcZPq6aWcUsKo9qnT38BO5RDvkbg uPY6Zs2m9v7KzqZgotIuh7BbKBD6bvBkJ3Cm2NXl3YqeH2jHzyixB5lFoEnJeHnv74fq q8fw== X-Forwarded-Encrypted: i=1; AJvYcCVFgpn/kLi64jOlmHNkHxXXTvCHl+LsT1o2Gt1o+fUCuNyEG/IzYmODwka4sOCpTuFYCbNh2cpRfdiZCi5AfEbbid4v8Iw=@freebsd.org, AJvYcCVWgJ82SD42UH0C94Va6wCDKqgEkRqNaZGSEU9Bg3wkWxU+epc93wb1/zsjrqkNM9ju+5ONF6AXFkvIcs2c8NvdzHB7OQ==@freebsd.org, AJvYcCXHt9LkM6pTQyfSdtEBlgcCGM7AOpwYREU6iA+/tw99T+NndxoyDUfWYGvM+t/YM34+6PMWawMHm6IvcjoSw0U=@freebsd.org, AJvYcCXSNN7yH+/3c3QU0yPX4/hQ8sgE17D3JxDsS4Q4z1S0qOn9hSj4nsPwjo5AA8acEbmcTQ==@freebsd.org, AJvYcCXaPZfbfi0fuhBmiiC6pWUnj+ixP7pI9lkdzTbnWxMlqCs60f4+WRijQe7ms4ahWzYgB1eNZjsF@freebsd.org X-Gm-Message-State: AOJu0YzPEuTV8hPmTq9lbgbUX1HAr1s25AL6Jv95dh6SgYb8K30LMULY Wrktndjvgtwm5nAHkf7a8X+ELjzmfiChd82DRtdHh6c2RRKjOSntyLvYmghchjI/2A0Nr9lgrWM Ugv7WOshqcpPhd8L7NZABIJ88t3SjeQ== X-Gm-Gg: ASbGncswlOCtbnV+h2W4um1momfHhh+j4OFJD5Cvf7KeK6cvXrbl7oI0oYD9WWk7CBT tumS0Ak/wcKL41uZ9LHyLIQRgslo/yahGiKgDkDnRkqoe/a1OaPANN2L4WxNKIWe7mzDlLhzVWj gTC6dJkJ8BzqWF59KqvtHM5+JajaU2g0RVTY8IGgNOpxPGrfsdUpq+UmwQMOyP5xnui4kemfh7p kM/a+zq8AdjRjDa8v4kBHHu/y9I+siPTY3haQ== X-Google-Smtp-Source: AGHT+IHuo9AquuB8cAylU68dD5EFkB4IJCFUDdrt0g7X7a5SXavndElGxlgsTlH2vBljPsDNXGvKk6abB6/sg9nPJiw= X-Received: by 2002:a17:906:9fd2:b0:af1:1dfd:30f4 with SMTP id a640c23a62f3a-af619b0f686mr1019371166b.47.1753673176043; Sun, 27 Jul 2025 20:26:16 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: <20250722155941.AC7EB121@slippy.cwsent.com> From: Rick Macklem Date: Sun, 27 Jul 2025 20:26:03 -0700 X-Gm-Features: Ac12FXwdU5J8UHBsziy22fnlEBhZ0VCKYBVB8IS2Op1ZJ5rw2vsmV3g9oR6rMYg Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Cy Schubert Cc: Konstantin Belousov , Jessica Clarke , Cy Schubert , "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-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.99)[-0.992]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62c:from] X-Rspamd-Queue-Id: 4br3mB6l8Qz3rx9 X-Spamd-Bar: --- On Tue, Jul 22, 2025 at 9:00=E2=80=AFAM Cy Schubert 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. > > In message , Konstantin Belousov writes: > > On Mon, Jul 21, 2025 at 07:46:45AM -0700, Cy Schubert wrote: > > > In message <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org>, Jessic= a > > > Clarke w > > > rites: > > > > On 21 Jul 2025, at 15:10, Cy Schubert wrote: > > > > >=3D20 > > > > > The branch main has been updated by cy: > > > > >=3D20 > > > > > URL: =3D > > > > https://cgit.FreeBSD.org/src/commit/?id=3D3Dc7da9fb90b0b6385e99bb77= 47476359 > > b=3D > > > > 712993fa > > > > >=3D20 > > > > > commit c7da9fb90b0b6385e99bb7747476359b712993fa > > > > > Author: Cy Schubert > > > > > AuthorDate: 2025-07-19 14:11:18 +0000 > > > > > Commit: Cy Schubert > > > > > CommitDate: 2025-07-21 14:07:22 +0000 > > > > >=3D20 > > > > > KRB5: Enable MIT KRB5 by default > > > > >=3D20 > > > > > Set WITH_MITKRB5=3D3Dyes as the default. > > > > >=3D20 > > > > > Rebuild all USES=3D3Dgssapi ports is recommended. > > > > >=3D20 > > > > > A clean buildworld is required. > > > > > > > > That=3DE2=3D80=3D99s going to be quite annoying and cause a lot of = issues =3D > > > > given > > > > WITH_CLEAN is now the default. Can we do something in depend-cleanu= p.sh > > > > to delete everything from the obj tree that needs to be rebuilt if = we > > > > detect the wrong kerberos implementation was previously built? > > > > > > All binaries that depend on any kerberos libraries must be rebuilt. > > > WITHOUT_CLEAN will fail at various spots. Meta mode should take care = of > > > this for us. > > Does the statement mean that ABI for the base libraries was broken? > > If yes, and the new libs have the same name as the old, we must bump > > dso versions. > > Three new libs have the same names. Most don't. The three with the same > names are libkrb5, libgssapi_krb5 and libcom_err. > > libgssapi_krb5 is a merge of the Heimdal libgssapi_* files. For example, > there is no libgssapi_spnego in MIT. > > The libcom_err contains the same but updated MIT functions. > > libkrb5 removes Heimdal-only functions. > > There is no libasn1 nor libroken in MIT. > > The differences are outlined at https://k5wiki.kerberos.org/wiki/Samba%27= s_u > se_of_Heimdal_symbols,_with_MIT_differences. I know diddly about how libraries are handled, but is it possible to put th= e old Heimdal 1.5.2 libraries somewhere (semi-private) under different names? I ask because it is going to be very difficult to port the gssd to the new libraries. The problem is that the KGSSAPI code assumes some stuff very specific to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you'll see what I mean. (There's code that parses the keys etc out of the internally generated tokens. I have no idea where to even find the information on how/where the MIT code hides this stuff and it a large part of krb5_mech.c looks like it will have to be re-written to work with the MIT libraries.) rick > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e**(i*pi)+1=3D0 > > From nobody Mon Jul 28 03:58:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4br4TH3qqSz63VN1; Mon, 28 Jul 2025 03:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4br4TH35DXz3wtY; Mon, 28 Jul 2025 03:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753675107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=it6beBkL4LTRBB5U1nu2FL4buZgSAf7gpnLM+5pG9TY=; b=aSj3UveyNBGgXiEd7ad7SgMKwz+ucUa479ez4a05m9Eh3BSpm30m0sVmRZh7Z39X50krxT FQ+VbcasE5i0C1TmzxDcBtZ+86xHzygiBQOeDIah2tunZ77H9P/uoZ0gQWnyROMgwG/1Dd uk0SIFzU41XAsmZejS2WJkz7/tA2gL7LyMRq9XJlwwSgYjQUo9cj/AUDvS14NzDCMeCX8/ vmzuCmC4kwBGoMuBZKp0Mp7rXA23eHn1HN2FjoHRV/wjNeqiS09VpUwwVQX/N6v7yimUSo JSuUgTmF3lzfMPnfF5jgI6cy+ofYxPht2BbeV2xwMynaxMpWuI7Noy3Sj7Hg7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753675107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=it6beBkL4LTRBB5U1nu2FL4buZgSAf7gpnLM+5pG9TY=; b=OY7sCxI8ftLovD/qP7kXnVbWImeCU0PehSSpGw9R2A9+LrWgHHTwFfIOllZ/79asAJBort C3E92+TiB95Ddi/rjaV55YjFFTLna02cIUZ2xzl+N0d+x2QxXplGDS+zrIGpduPUWg2qvz YIFD5Ml4c9Uo6pulS35vQfF7HIDzrKeh8yV3PIm7twnPOoF7PtCJvCnLUude/WKVqfVXY8 0JQ9Esy1dyDibeSr2F19cShezZPoRoh5r2ABIczIKTCoSc6MzVSzAjHCnxhv3EIeVJuKd+ ikLRsiOFerkUVdLZqMtNrl4oEkRY1F/1DyUKaEOkCEehN1niXIqJkmuPRNsNIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753675107; a=rsa-sha256; cv=none; b=HVxrFrQcJMtq+1czeE96TWBK68Oq4dzL/RUIgosq1jcN/1Ipju+xz1HMor7tLMbkNgaGoF sUvH9c+zDdkZXNVgQFbmWKS7ZTE84pmt5u4W6Rv3/eyOx9VphoVqBVTtCd2krpO0yf5XpD PE5QCbP50MPKJ1Yi2iU2E2PGXEWcnyWxkjvyCQHDhOMuZHyJRnwGNqqnWtY/qBrIm+UtLx UW0apdQ2C6d0zmY7f/bsvJqoUHH+0xcFl3TzSaN2pb5LCGcIACyxMSqT71gQnRGwMRdBNK ebuEzsK36YNtQ1DUP+ojeFzryfFr1v6j/DX+yYj0iM96jqLwrVNp2QP/Kfqrpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4br4TH2SQ1zDNX; Mon, 28 Jul 2025 03:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56S3wRT1096607; Mon, 28 Jul 2025 03:58:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56S3wRDV096604; Mon, 28 Jul 2025 03:58:27 GMT (envelope-from git) Date: Mon, 28 Jul 2025 03:58:27 GMT Message-Id: <202507280358.56S3wRDV096604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: c0fae431fd6a - main - krb5: Chase dd0ec030f8fd updating to current DSO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0fae431fd6ae9092d5f04da108b024f750834f1 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c0fae431fd6ae9092d5f04da108b024f750834f1 commit c0fae431fd6ae9092d5f04da108b024f750834f1 Author: Cy Schubert AuthorDate: 2025-07-28 03:57:30 +0000 Commit: Cy Schubert CommitDate: 2025-07-28 03:58:20 +0000 krb5: Chase dd0ec030f8fd updating to current DSO Fixes: dd0ec030f8fd --- etc/gss-krb5/mech | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/etc/gss-krb5/mech b/etc/gss-krb5/mech index 94fed68a24eb..b13f665705c5 100644 --- a/etc/gss-krb5/mech +++ b/etc/gss-krb5/mech @@ -1,10 +1,10 @@ # # Name OID Library name Kernel module -kerberosv5 1.2.840.113554.1.2.2 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 -kerberosv5 1.2.840.113554.1.2.3 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 -kerberosv5 1.3.6.1.5.5.2 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 -kerberosv5 1.2.840.48018.1.2.2.1 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 -kerberosv5 1.2.840.48018.1.2.2.2 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 -kerberosv5 1.2.840.48018.1.2.2.4 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 -kerberosv5 1.2.840.48018.1.2.2.5 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 -kerberosv5 1.3.5.1.5.2 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 +kerberosv5 1.2.840.113554.1.2.2 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 +kerberosv5 1.2.840.113554.1.2.3 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 +kerberosv5 1.3.6.1.5.5.2 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 +kerberosv5 1.2.840.48018.1.2.2.1 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 +kerberosv5 1.2.840.48018.1.2.2.2 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 +kerberosv5 1.2.840.48018.1.2.2.4 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 +kerberosv5 1.2.840.48018.1.2.2.5 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 +kerberosv5 1.3.5.1.5.2 /usr/lib/libgssapi_krb5.so.122 kgssapi_krb5 From nobody Mon Jul 28 05:00:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4br5s83pNgz61pvZ; Mon, 28 Jul 2025 05:00:44 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4br5s75Kbdz42fK; Mon, 28 Jul 2025 05:00:43 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.32 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id fzHruOWqo9JM2gFycuOoUZ; Mon, 28 Jul 2025 05:00:42 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id gFybuJLTOJhBPgFycutGVs; Mon, 28 Jul 2025 05:00:42 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=688703fa a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=6gsJtrw7AAAA:8 a=EkcXrb_YAAAA:8 a=hF2rLc1pAAAA:8 a=YxBL1-UpAAAA:8 a=caNyfLVYzJr0Zn2PVDUA:9 a=CjuIK1q_8ugA:10 a=pJONDuH_yeJkak6KR8-4:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=O9OM7dhJW_8Hj9EqqvKN:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id A17EC199; Sun, 27 Jul 2025 22:00:40 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 6C1BA2B; Sun, 27 Jul 2025 22:00:40 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Rick Macklem cc: Cy Schubert , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default In-reply-to: References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> Comments: In-reply-to Rick Macklem message dated "Sun, 27 Jul 2025 20:26:03 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 27 Jul 2025 22:00:40 -0700 Message-Id: <20250728050040.6C1BA2B@slippy.cwsent.com> X-CMAE-Envelope: MS4xfEKXngI1biWo/g6DHR/jIjXnDIwXSEakgARSB7GXPwQemIRoQppie94+0DFgZ+3pcH3j/jO68Gp5QusmTqHpoivxjadtbXKldeT7vDifaaUZZE9Bv1Ba Ql4y1syfhDTyFmo4UH7aC+KpWfjpFYfTAUGQBHEc8aCqP5y9ZzTk1pVE5JPJxQfflaSWuFDRQzSe6TdvmgcUF/1/fkjHV0ugophjkt4lALpiv1mhOCC/Rpy2 RKN7ociiSUSQmACGlM4Mqp5vfqZeO/3Xn6wFt80+nQ9yrz8fOM8//8pm/T4/ZmlSzaHg3eA/C+8XItnOP1Ef8eySSSuc3MdRTUArNpRDbHOsgRPwUFaoe/SO /ckvPOJb0qczFZ5gecsJP6kQ3oSypEC0GW5Vst0NPQrOBYEd1Du06f3sAwATAmF1xRJrWdn8 X-Spamd-Result: default: False [-2.52 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.91)[-0.911]; NEURAL_HAM_LONG(-0.71)[-0.712]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.32:from]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[cschubert.com,gmail.com,freebsd.org]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[8]; R_DKIM_NA(0.00)[]; TAGGED_RCPT(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4br5s75Kbdz42fK X-Spamd-Bar: -- In message , Rick Macklem writes: > On Tue, Jul 22, 2025 at 9:00=E2=80=AFAM Cy Schubert com> 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. > > > > In message , Konstantin Belousov writes: > > > On Mon, Jul 21, 2025 at 07:46:45AM -0700, Cy Schubert wrote: > > > > In message <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org>, Jessic= > a > > > > Clarke w > > > > rites: > > > > > On 21 Jul 2025, at 15:10, Cy Schubert wrote: > > > > > >=3D20 > > > > > > The branch main has been updated by cy: > > > > > >=3D20 > > > > > > URL: =3D > > > > > https://cgit.FreeBSD.org/src/commit/?id=3D3Dc7da9fb90b0b6385e99bb77= > 47476359 > > > b=3D > > > > > 712993fa > > > > > >=3D20 > > > > > > commit c7da9fb90b0b6385e99bb7747476359b712993fa > > > > > > Author: Cy Schubert > > > > > > AuthorDate: 2025-07-19 14:11:18 +0000 > > > > > > Commit: Cy Schubert > > > > > > CommitDate: 2025-07-21 14:07:22 +0000 > > > > > >=3D20 > > > > > > KRB5: Enable MIT KRB5 by default > > > > > >=3D20 > > > > > > Set WITH_MITKRB5=3D3Dyes as the default. > > > > > >=3D20 > > > > > > Rebuild all USES=3D3Dgssapi ports is recommended. > > > > > >=3D20 > > > > > > A clean buildworld is required. > > > > > > > > > > That=3DE2=3D80=3D99s going to be quite annoying and cause a lot of = > issues =3D > > > > > given > > > > > WITH_CLEAN is now the default. Can we do something in depend-cleanu= > p.sh > > > > > to delete everything from the obj tree that needs to be rebuilt if = > we > > > > > detect the wrong kerberos implementation was previously built? > > > > > > > > All binaries that depend on any kerberos libraries must be rebuilt. > > > > WITHOUT_CLEAN will fail at various spots. Meta mode should take care = > of > > > > this for us. > > > Does the statement mean that ABI for the base libraries was broken? > > > If yes, and the new libs have the same name as the old, we must bump > > > dso versions. > > > > Three new libs have the same names. Most don't. The three with the same > > names are libkrb5, libgssapi_krb5 and libcom_err. > > > > libgssapi_krb5 is a merge of the Heimdal libgssapi_* files. For example, > > there is no libgssapi_spnego in MIT. > > > > The libcom_err contains the same but updated MIT functions. > > > > libkrb5 removes Heimdal-only functions. > > > > There is no libasn1 nor libroken in MIT. > > > > The differences are outlined at https://k5wiki.kerberos.org/wiki/Samba%27= > s_u > > se_of_Heimdal_symbols,_with_MIT_differences. > I know diddly about how libraries are handled, but is it possible to put th= > e > old Heimdal 1.5.2 libraries somewhere (semi-private) under different names? > > I ask because it is going to be very difficult to port the gssd to the > new libraries. I can take a look at it. However any app that issues GSSAPI calls will eventually call the MIT library as defined in /etc/gss/mech. The 1.2.840.113554.1.2.2 OID will point to the MIT gssapi_krb5.so instead of the Heimdal gssapi_krb5. > > The problem is that the KGSSAPI code assumes some stuff very specific > to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you'll see > what I mean. (There's code that parses the keys etc out of the internally > generated tokens. I have no idea where to even find the information on > how/where the MIT code hides this stuff and it a large part of krb5_mech.c > looks like it will have to be re-written to work with the MIT libraries.) Unfortunately some apps make use of private data that Kerberos does not share. As gssd issues GSSAPI calls through libgssapi which in turn calls lilbgssapi_krb5 supplied by the installed Kerberos (MIT or Heimdal) an alternate libgssapi will also be needed. I cannot guarantee this will work because of potential prebuild conflicts. But it's certainly worth a try. Another option may be to revert WITH_MITKRB5 until 16 to give us more time to solve this without the Heimdal libraries. Short answer, I'm certainly willing to try to have Heimdal and MIT libraries coexist. I think the show stopper could be conflicting header files in prebuild, though I think I can put those in /usr/include/heimdal or some place like it. Libraries would need to be named libheim*. This would work well with our build system. I'm not sure how this might affect pkgbase. It would probably be best for WITH_MITKRB5 to be disabled while working on this. As some here who I've intimated to, a life thing happened here that has complicated things. > > rick > > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e**(i*pi)+1=3D0 > > > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Mon Jul 28 06:39:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4br8340rBBz61wS3; Mon, 28 Jul 2025 06:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4br83404mNz47Jn; Mon, 28 Jul 2025 06:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753684768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2aPBiIIIEVKiQFHF55HNyM2ELj4qNnaV53Ewj4zF1Tc=; b=Ihc1djagH8pKL7zePOkq20vTSY+IWiv8Mtd4anUhW7sXFUB/8kJXfWSQYxoSgTaSYEBQxJ HYOKWK+1DdWqsb1GgvO4doBloWncbXZhI6r7+5b7hc/rNl7qILUHkErs4Bnd0IRkSY/gf7 FDR7wmbcWZUy7v7AzoW2itJrzAYA/Y71C0g3lVVZH59L5/W+wJKI5QdZK3tXN9CRlyak9i om4DaHfHS4pTdK84b1sUjo0IMTy7x7Y7hKOhpv90FBG6fVUisJFhSVrAWHE1WT/ZMvuYHM PFIE19MFENdK8bdesee0PvYGjyXDEYqZ6EzEiD0+muJOjKOcDmlKMCWtTltxHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753684768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2aPBiIIIEVKiQFHF55HNyM2ELj4qNnaV53Ewj4zF1Tc=; b=ieLHoOF0L1oQ2T7YElriSOk+2+p5Ba4U3odnIiaD2KbYdw5ODlpw7i+ZeHZDiGaV6hIZ3y PdSv4E+V5DeCYXaWXahPj0tcn5mwrZeGqg1iSG19IhCmfI/T7Zco46bR37HMD/+4/pChr2 QJSm6WzGEi9SHakj/tOsi6uGNNYr2M3LaAeMLqv27FMHoYQcr8Mp49FXoE8O3JlKLkemct H++nyZW7VYTvfl3fxlUqQXSos7aR/bmY7A3p8fJEUqPmKRAmnR/M014QWadnVLG41Qd9em iSafA8qiHD6GqczyieVKY67YcpfKKQcNXAXHBfHFnA1/UqGAL/GZCPqdYkEgHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753684768; a=rsa-sha256; cv=none; b=F+PG5n+tnh1NUFyCinOGN62l/yY6ezBdz3i0Uwp9emRR6s1l6kq9ZM+YyNdKKVgF3WpHyy CRj6oA5qPCaW1B9syqu5w0abqJUs2XrXhFTgQvYjeq2qfg9kVBPJZtXYkB3OWtx7k468+y wYpKdPbXYAQv37IYy1sQjuunaf9dxVshWf504Ihdo5OHcgKZLbc288L7FTOUJimV2Y4HQT HDKyb91IckYR1iXLvBWkkeWWUM6tTKRak3ci034rsv/hkP/CmZd0qzMtinlUo/2rTDBjli ApU5XuoDOomuLoal1dijlBNVVGrnyYwVYNDBSHMcAI9RnsmWSFqP5sgrVpUpvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4br8336W5dzbNJ; Mon, 28 Jul 2025 06:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56S6dRn3097898; Mon, 28 Jul 2025 06:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56S6dRoM097895; Mon, 28 Jul 2025 06:39:27 GMT (envelope-from git) Date: Mon, 28 Jul 2025 06:39:27 GMT Message-Id: <202507280639.56S6dRoM097895@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: 8a69eb88fa00 - main - Obsoletefiles.inc: Add architecture-specific 'runq.h' headers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 8a69eb88fa00bb0ce85439d91cfdbd71426ffd0e Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8a69eb88fa00bb0ce85439d91cfdbd71426ffd0e commit 8a69eb88fa00bb0ce85439d91cfdbd71426ffd0e Author: Olivier Certner AuthorDate: 2025-07-28 03:10:26 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 06:38:44 +0000 Obsoletefiles.inc: Add architecture-specific 'runq.h' headers These were removed in commit 2fefe2c88b31 ("runq: Deduce most parameters, remove machine headers"). MFC with: 2fefe2c88b31 ("runq: Deduce most parameters, remove machine headers") Sponsored by: The FreeBSD Foundation --- ObsoleteFiles.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index f1e230f91e95..2aa914ab089f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250728: Machine versions of 'runq.h' do not exist anymore +OLD_FILES+=usr/include/machine/runq.h + # 20250726: MIT KRB5 DSO bump OLD_LIBS+=usr/lib/libcom_err.so.121 OLD_LIBS+=usr/lib/libgssapi_krb5.so.121 From nobody Mon Jul 28 08:19:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brBHD4NX5z62n6m; Mon, 28 Jul 2025 08:20:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4brBHC5zCtz3K7D; Mon, 28 Jul 2025 08:20:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none) Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56S8Jtbb008839; Mon, 28 Jul 2025 11:19:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56S8Jtbb008839 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56S8Jtn7008838; Mon, 28 Jul 2025 11:19:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Jul 2025 11:19:55 +0300 From: Konstantin Belousov To: Rick Macklem Cc: Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default Message-ID: References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Result: default: False [2.03 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989]; NEURAL_SPAM_LONG(0.98)[0.982]; NEURAL_SPAM_SHORT(0.54)[0.541]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_LAST(0.00)[]; HAS_XAW(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; TAGGED_RCPT(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_SEVEN(0.00)[7]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4brBHC5zCtz3K7D X-Spamd-Bar: ++ On Sun, Jul 27, 2025 at 08:26:03PM -0700, Rick Macklem wrote: > On Tue, Jul 22, 2025 at 9:00 AM Cy Schubert 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. > > > > In message , Konstantin Belousov writes: > > > On Mon, Jul 21, 2025 at 07:46:45AM -0700, Cy Schubert wrote: > > > > In message <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org>, Jessica > > > > Clarke w > > > > rites: > > > > > On 21 Jul 2025, at 15:10, Cy Schubert wrote: > > > > > >=20 > > > > > > The branch main has been updated by cy: > > > > > >=20 > > > > > > URL: = > > > > > https://cgit.FreeBSD.org/src/commit/?id=3Dc7da9fb90b0b6385e99bb7747476359 > > > b= > > > > > 712993fa > > > > > >=20 > > > > > > commit c7da9fb90b0b6385e99bb7747476359b712993fa > > > > > > Author: Cy Schubert > > > > > > AuthorDate: 2025-07-19 14:11:18 +0000 > > > > > > Commit: Cy Schubert > > > > > > CommitDate: 2025-07-21 14:07:22 +0000 > > > > > >=20 > > > > > > KRB5: Enable MIT KRB5 by default > > > > > >=20 > > > > > > Set WITH_MITKRB5=3Dyes as the default. > > > > > >=20 > > > > > > Rebuild all USES=3Dgssapi ports is recommended. > > > > > >=20 > > > > > > A clean buildworld is required. > > > > > > > > > > That=E2=80=99s going to be quite annoying and cause a lot of issues = > > > > > given > > > > > WITH_CLEAN is now the default. Can we do something in depend-cleanup.sh > > > > > to delete everything from the obj tree that needs to be rebuilt if we > > > > > detect the wrong kerberos implementation was previously built? > > > > > > > > All binaries that depend on any kerberos libraries must be rebuilt. > > > > WITHOUT_CLEAN will fail at various spots. Meta mode should take care of > > > > this for us. > > > Does the statement mean that ABI for the base libraries was broken? > > > If yes, and the new libs have the same name as the old, we must bump > > > dso versions. > > > > Three new libs have the same names. Most don't. The three with the same > > names are libkrb5, libgssapi_krb5 and libcom_err. > > > > libgssapi_krb5 is a merge of the Heimdal libgssapi_* files. For example, > > there is no libgssapi_spnego in MIT. > > > > The libcom_err contains the same but updated MIT functions. > > > > libkrb5 removes Heimdal-only functions. > > > > There is no libasn1 nor libroken in MIT. > > > > The differences are outlined at https://k5wiki.kerberos.org/wiki/Samba%27s_u > > se_of_Heimdal_symbols,_with_MIT_differences. > I know diddly about how libraries are handled, but is it possible to put the > old Heimdal 1.5.2 libraries somewhere (semi-private) under different names? > > I ask because it is going to be very difficult to port the gssd to the > new libraries. > > The problem is that the KGSSAPI code assumes some stuff very specific > to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you'll see > what I mean. (There's code that parses the keys etc out of the internally > generated tokens. I have no idea where to even find the information on > how/where the MIT code hides this stuff and it a large part of krb5_mech.c > looks like it will have to be re-written to work with the MIT libraries.) It might be better to extract the required bits and keep just them. Perhaps even moving that bits from vendor to FreeBSD-owned code area. I do not think that keeping large pieces of code in vendor without updates is a good plan. From nobody Mon Jul 28 09:13:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brCST2y6dz62qRs; Mon, 28 Jul 2025 09:13:13 +0000 (UTC) (envelope-from ivy@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brCST1xWSz3QyG; Mon, 28 Jul 2025 09:13:13 +0000 (UTC) (envelope-from ivy@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753693993; 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=IjGFa02JbaG216k//2DpV/DHBlqIgSaZDyh/wgHtIFQ=; b=IlUSFhOVEqnVwDLXhjPrlHRO+QgPuW/7rLyEV13HRcjagu8XeCNcL9ZbfQ7BtZBepV8d7j ZUw8wxk5liaOk4muT+J175oruSrZqh5HnS4Ob8V9kWy3OgWcO3X8+dY3Uhe8L8wUk3cbzz cwthoWCwcd2f29PPYInNSem1RMKMMxoWwOXYP90lCFN3+ArFfSFijhvhjkVFhenEEYxDAn rQNrmuQXWZDh/sL88rReVzQa8Z0dWn6bdv8akH1TPuw8vwlKqhYgWcgdckS1N9mFF0rsOg rDKjA2T36kToOj8vlqLOJ5KGHz0cePeUuHd4Cjc/uzfB6fZfsRSBNxvIBvACQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753693993; 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=IjGFa02JbaG216k//2DpV/DHBlqIgSaZDyh/wgHtIFQ=; b=SJSTz9j/0vHwcIzUzdWR3nR4me0HgW6YDt7/9rzmTDS+w0utrYqSrYFHMMllYj6j7bnUDW t1wNSGbTB+W4Mv3jLcXn7IrBU659Oi4lA5jLvgT6Jm4GW+19WMhQo+mdabjMOHzSLHzB52 zaS57ufj1hzBYOFc6MHx9oBRi3m57ycHQ/+2mLVEFdO4Y7RjjB5PcU0kR6UBHl7eznv7n7 O4SkAh459B0QuGfPmg/4ryVQFS8ktLcqssEd+Nbm3P4lVjmCKVHi+L1lfAwAXImdw0lxMd 46fKDoQVokDYEWgTThki4xwwbA8TP185jXavynXuOkUTc/30GNs9qwlyoqbjKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753693993; a=rsa-sha256; cv=none; b=FXJTLhCBBgN/IVoR4ToRYiWFTpiQwEiBq1iKDwDNv4T4LEOJGs/vMMmpBJKI42VFouFf0X RJZ6dn+F5VI36RNz1M9W9NCMtpFKevv1cP4kwoDHekam5moeqOT1RHECXZRVs3l00onz7U L3dNBwso1gwIm9K9gG5UyaSHvTWkcc4HZEI+8EOnoCDURHsf43PovALMpsj+g3ja+bgm7e GmbX468xCvXcwfwPwZwEgB6DyhvEApp478BdUex8DGqFeA4MvVParJptu6IdRplQ2M5x0I 2czwvXDpkZj+dC7cJzUz5jryEhAfz+PVJh9wx7q0fKGA6EX3Cjt1KIKGVkueMQ== Received: by freefall.freebsd.org (Postfix, from userid 1532) id 1A0A416591; Mon, 28 Jul 2025 09:13:13 +0000 (UTC) Date: Mon, 28 Jul 2025 10:13:13 +0100 From: Lexi Winter To: Rick Macklem Cc: Cy Schubert , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default Message-ID: Mail-Followup-To: Rick Macklem , Cy Schubert , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BU0Fl/nyPhDCAGZo" Content-Disposition: inline In-Reply-To: --BU0Fl/nyPhDCAGZo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi Rick, Rick Macklem: > I know diddly about how libraries are handled, but is it possible to put = the > old Heimdal 1.5.2 libraries somewhere (semi-private) under different name= s? >=20 > I ask because it is going to be very difficult to port the gssd to the > new libraries. note that one of the reasons we need a newer Kerberos is that our ancient Heimdal doesn't support modern ticket algorithms like SHA-256. if gssd continued to use the old Heimdal code, would it be able to load these new tickets? if not, this wouldn't be very useful even if it did technically work. --BU0Fl/nyPhDCAGZo Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaIc/JAAKCRD1nT63mIK/ YHzuAPwL2jsH61JQiczk8cbBz3FC+o7VQkknqAFHHiTAL4OC0QEArht2DwLxIwpp b82fXgmIUtGIexJ8W5ksN407lo5FggA= =BRjU -----END PGP SIGNATURE----- --BU0Fl/nyPhDCAGZo-- From nobody Mon Jul 28 12:43:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brJ6l2ymDz632p9; Mon, 28 Jul 2025 12:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brJ6l2Ft7z3lkY; Mon, 28 Jul 2025 12:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WnuKuQMjlYcd5no0JuUlozOf7O3V3AIH93/0ZXrS8vs=; b=fo0uag0HFBPABS69TlwNeGXTDdfl92SquFAj0PnyVfRDctIiedMrkF9ItqfHCnh9hMmTfh jrvtNSPdZq47I0SuKdlTEWHMYAMKiS0icTcOpuyxj6FVMocTxrsro18PC00ZZPd6pQzHzr s8VYou49aps2O0ZD/W27b0iGb+2vpcDtX4noIAP5rexyDOw1tIy1p0Lp6jug7LrSFI5TqX YHywMIzCslJsjPvNUTOYX4qwi8jS8GAvpdybqbyf03TBuzNN0sQKRlqZg+V7d/GBqC1ZAy Hriad9Jd509TWPn8HsjYK7Zz51yxwV2l6xrrkyd76fGjlmZ46qIlXQo4tsGxFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WnuKuQMjlYcd5no0JuUlozOf7O3V3AIH93/0ZXrS8vs=; b=OsTA/vaTYOT8wEck/W4b1lCXSunU1JLOR0KFjUEFKLX79wC834H2Dr5yLdB44jz7dti4lk XoO4b4uZC7JagIa7/LVOKuPH3hVXSOkuLotY4mz52gz/GeeU399LXgsAiWHZtYewwWSvH/ bc1fHhpcCKNhTbKSyU9+hTKeNk5q1lZyP22Lmuw3OwGFqxdnYYrlPxmR0XtezidTXSXW32 tqWU6rG0RblHtY2V49V2pzDD1crxEkbMa4zVjzfsBl7LVEVGh+CtNzNWBmg8s5HAwZOrqd FpA9wqjWiGaDRWtT3ijrDGJ6WFad+kcpVuCbbrot26Cc1bX3s0ZUnJJdwMNb/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753706591; a=rsa-sha256; cv=none; b=BKF8mqETo8Zfj0ILyWtLlO4THjXKf8hZz7kLKJ6w/CrClMp8hySpl+k/UcL1m4Tk305V2T RTwLONVNrlqnPOK8e7mt7ymEHxIEA4fhIPhPea+yMfCzYjCJB4IBGwS1j+t6MzXFsMBTSM iJYmwFU0hC+EuCMt7Jw1Rp8cVyKKuzply1LU7GDo1Q4IPyBDL+F0dXbzbPztE4hex9vixu 2F4nfIC2Sq4wuC1qOTwzI7mszheLOl7WI1NM88suHjL4MAP3+0S7ADRSniVDLWC7NjKe6S JSPLQbHlGmvXfI+WAQZinadbA8KLkmMnDjf8o6TudbQkydt2tuGk87RynJnwHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brJ6l1k3tzlsn; Mon, 28 Jul 2025 12:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SChBS2092084; Mon, 28 Jul 2025 12:43:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SChB7N092081; Mon, 28 Jul 2025 12:43:11 GMT (envelope-from git) Date: Mon, 28 Jul 2025 12:43:11 GMT Message-Id: <202507281243.56SChB7N092081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 44a5649bc3a2 - stable/14 - tests/sys/net/if_bridge_test: fix MTU test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 44a5649bc3a25b9e18980b80ecbbd8df41244d19 Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=44a5649bc3a25b9e18980b80ecbbd8df41244d19 commit 44a5649bc3a25b9e18980b80ecbbd8df41244d19 Author: Lexi Winter AuthorDate: 2025-07-25 23:11:39 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 09:20:44 +0000 tests/sys/net/if_bridge_test: fix MTU test "ifconfig gif0 ether" doesn't return any output, so this wasn't correctly checking the MTU on the gif interface. Remove "ether". Reviewed by: zlei, kp Differential Revision: https://reviews.freebsd.org/D51245 (cherry picked from commit e6ef675de261b15ed66d434d054a6e5e69308ce5) --- tests/sys/net/if_bridge_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 2698b5cb887b..5438f67cf637 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -537,7 +537,7 @@ get_mtu() { intf=$1 - ifconfig ${intf} ether | awk '$5 == "mtu" { print $6 }' + ifconfig ${intf} | awk '$5 == "mtu" { print $6 }' } check_mtu() @@ -546,7 +546,7 @@ check_mtu() expected=$2 mtu=$(get_mtu $intf) - if [ $mtu -ne $expected ]; + if [ "$mtu" -ne "$expected" ]; then atf_fail "Expected MTU of $expected on $intf but found $mtu" fi From nobody Mon Jul 28 12:43:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brJ6m3VX8z632T5; Mon, 28 Jul 2025 12:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brJ6m2mdzz3mBh; Mon, 28 Jul 2025 12:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C92H34u3tQOJ+hSecqSgPZ2tCXzmxvWr4ZKTNEwV2+I=; b=mI0qoTF+MeTh0SJpe/BA0K5UaNq5vg/n4WLjH4GnsLqX2AcvnhtxzLYDSHznlmH3jWBf0q BioSa7ycdy9lvLfPV+0TCoqu7pl21EAhwmFZ+csUwKfdJdA17X4HbTVX19+fCrm4yzwVhL 05MU6+ucxKSRv+MdieamS2flpo9Q2/NT4F5ifBP7Wm8Ek83dc2D+BpNOjecBsz+xadpRG/ eoNs3H/WbAO5gV0yjGtYw5Fb4FbTX/8JLNykhTS5hKheEx6F5pV9ZBioPrk9orG827PjVq /iLd8LHi2x3UUZQoOYUMVZwDyvzz84658eMi0h6WU3RiwBFsF14saMrJfT3ivw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C92H34u3tQOJ+hSecqSgPZ2tCXzmxvWr4ZKTNEwV2+I=; b=x8T2jpQTn2vLAkbPMTuwOyFrsmug9iAB+/w4hkq6c1FWdeAhpZ3cFxjloKyhHj7FYRknAC v1NMQQtuFsfO+P6atcuN60hfEKC7u7p9Tfb/GYwzqJ3CDR/mqiqDLNrLXZL72a7JZdACXR WIlZf3GqSmefu1ehXP9j85mdzPvBypUUrbjnjx6UuNVAaW4WOFV1eYBD/9Ey15El1M/0PD UjYOXmDboyYL66VuBy/xu0y4pxw8nNDRpg1RqPL6ddNZitvyP9JDoSk00lUR1U/mCNb0jN iq0X//90gQEhP/vr5MVQED98SSa7Kti0FXB+ajDea/fQT/Xl7W9XLWmCd9FEZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753706592; a=rsa-sha256; cv=none; b=l1kMP1fLEobI0Gu4att5F+7kdPdl5mSk1hyfpgmkyWWZM/34VIw8b79nce8LItArx5Bg2H xvLHn6V9NTMWNGVjvHXZ8S4RajjSMq8ZXOpeNIAeX0iU+oabRIlyd1vTLZ6RWkS6Ya0s+O mu6xzCOil6fZUbsaxmfsP7+k/BdrDwkhm1+/ojDDIjV5vEfgIFrG76lzDFVl+gI0T1wfN3 ec9beg/+51030WKLNB/APrKGztkI5HzANh4dnWZvc1dvrCowCveuwvavqa/UvtkHEf3Upo XZtOqfMooY8FDQlw8koQl6cILUqiTd/d3BLGMU+WqSnKSyTTROPRQ8yStqpEWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brJ6m2Mq9zmCg; Mon, 28 Jul 2025 12:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SChCS4092117; Mon, 28 Jul 2025 12:43:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SChCvM092114; Mon, 28 Jul 2025 12:43:12 GMT (envelope-from git) Date: Mon, 28 Jul 2025 12:43:12 GMT Message-Id: <202507281243.56SChCvM092114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 4f2140aa9677 - stable/14 - crash.8: update a little List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4f2140aa96773ac6f9d4f63290d79b4b9a6d48bf Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=4f2140aa96773ac6f9d4f63290d79b4b9a6d48bf commit 4f2140aa96773ac6f9d4f63290d79b4b9a6d48bf Author: Lexi Winter AuthorDate: 2025-07-25 13:59:58 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 09:21:39 +0000 crash.8: update a little Replace "cannot mount root" (which is no longer a panic) with a brief description of the mountroot> prompt, and recommend using "system install media" rather than the fixit floppy. Remove "timeout table full" entirely since this panic no longer exists. MFC after: 3 days Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D51512 (cherry picked from commit c9868af774ec24bcf6914fc971378e9723eb44ab) --- share/man/man8/crash.8 | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/share/man/man8/crash.8 b/share/man/man8/crash.8 index 27c9c56533a5..fdb9b7213847 100644 --- a/share/man/man8/crash.8 +++ b/share/man/man8/crash.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 23, 2011 +.Dd July 25, 2025 .Dt CRASH 8 .Os .Sh NAME @@ -71,18 +71,19 @@ Left unstated in all cases is the possibility that hardware or software error produced the message in some unexpected way. .Pp .Bl -diag -compact -.It "cannot mount root" -This panic message results from a failure to mount the root file system -during the bootstrap process. -Either the root file system has been corrupted, -or the system is attempting to use the wrong device as root file system. -Usually, an alternate copy of the system binary or an alternate root -file system can be used to bring up the system to investigate. -Most often -this is done by the use of the boot floppy you used to install the system, -and then using the -.Dq fixit -floppy. +.It Mounting from failed with error +The system was unable to mount the configured root filesystem. +Either the root filesystem has been corrupted, +or the system is attempting to use the wrong device as root filesystem. +.Pp +This is not a panic message; rather it is followed by an interactive +.Sy mountroot> +prompt where the operator can list detected devices and filesystems, +and select an alternative root filesystem to mount. +Alternatively, the system can be booted from recovery media to repair +the situation. +The system install media provides a live environment which is suitable +for this task. .Pp .It "init: not found" This is not a panic message, as reboots are likely to be futile. @@ -108,11 +109,6 @@ after a crash, hardware failures, or other condition that should not normally occur. A file system check will normally correct the problem. .Pp -.It "timeout table full" -This really should not be a panic, but until the data structure -involved is made to be extensible, running out of entries causes a crash. -If this happens, make the timeout table bigger. -.Pp .\" .It "trap type %d, code = %x, v = %x" .\" An unexpected trap has occurred within the system; the trap types are: .\" .Bl -column xxxx -offset indent From nobody Mon Jul 28 12:43:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brJ6p3vXDz632RD; Mon, 28 Jul 2025 12:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brJ6p16jBz3lkj; Mon, 28 Jul 2025 12:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+EmnI8gz//GYoYcYaClMAVE9tMtmxMBXx4Gxy+cQiTk=; b=RlWKrpSzkvFRy8HzJNtJcqaOgrMtG5YIKTTf9fpzdKyd1J64YSAPcXbgqjgsKFf+grMfPF qk+lnM6DmLyyGjiclRSHoYY9i1t5LrpRSMiOpHZ2yrljNGN0fMF5frDpG0jU1zLKwtoCSv uOauUzV24sne3jGUu+VSbf7LJub/XwrBRfxRiRJgVN2iwnry5m/H/QFsf5d43HfZP8Hzpe HW06CjcD/3W5nwEleYgxSXtNrsjzgwKPhr2wQ+onTccCcKxH7k5RxoBB+GdE3fqzzhan1r 8rxkcWgwEFdAwOdoTetubAmrSM4iqra6HFPc5M3PQiXh2jGwllcYO5vn/oLIbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+EmnI8gz//GYoYcYaClMAVE9tMtmxMBXx4Gxy+cQiTk=; b=bwbJagKJp8EgbVMJ7GrKmp7/kxJeuhZ6ImtaVk3TWKg/87F3yOvIhh828vSdc5a7837Wp5 JupURKttZg09CPy24taCTMSoJC3PiM6t+6kCwIkfHSeZa/UP/LGHuKAjcn2dQV41JpipP4 jxiYIS0/WWFqQWgip5zUXH+LFP9b1PodmU6mrxzkv0mCTebwhO5gbX5QmkilC/LULWEYxc j5+KrLPXOtoxmsksGdRBpUjJL1Y00iR+QqnlYxrDyEaealjGfzcKi2Q2JGYz8joC3kKZI7 icRIfeOjR0eU0j756wrHMUdRt+lLtXzcM+aLiZwZ+8UbAg4IRE6egPAK0p56cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753706594; a=rsa-sha256; cv=none; b=JoaV8er77GjXpmaHgcQpJfzrdUXQhAt25v3mR223uy/UxkZybESWLRxUzEMnLiBKEmjyz0 riPO16ZguS1UROK6nNaP6CWIYBFAgbaeEW8YaryN7Xxzd64wxhvy7xb83/JHIvja6BIuDt mtRzxiYMfKQqxLCt9nr0JxpmYK5EFlx5d25dn+lGznNys2Kyyl4PygFICCsbv/5oyBDk1U 4um/5IK0cpUyrlxBX59W6WYFTmruCrXn0gxsgABUl//1firudQLJzOF2fL2BSIYEWQIK3a NYDenobX8vbo3TUKGTPRS6k8WNmhdcZaS/ATR0NQUd7H5m1c6OdvTNDcdecyLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brJ6n3Md7zmdc; Mon, 28 Jul 2025 12:43:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SChDpD092155; Mon, 28 Jul 2025 12:43:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SChDY5092152; Mon, 28 Jul 2025 12:43:13 GMT (envelope-from git) Date: Mon, 28 Jul 2025 12:43:13 GMT Message-Id: <202507281243.56SChDY5092152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: f72c7affddfe - stable/14 - pom.6: add a more complete bibliography List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f72c7affddfe2c97cb8b3fd11a4dbf03ef69c9ff Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=f72c7affddfe2c97cb8b3fd11a4dbf03ef69c9ff commit f72c7affddfe2c97cb8b3fd11a4dbf03ef69c9ff Author: Lexi Winter AuthorDate: 2025-07-24 21:12:50 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 09:22:13 +0000 pom.6: add a more complete bibliography Source: Wikipedia (cherry picked from commit bf0ee5f2175a3c6eb52f9fc74b93b445d37a6086) --- usr.bin/pom/pom.6 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.bin/pom/pom.6 b/usr.bin/pom/pom.6 index 7b8248ed78a0..7d41d0c5ec61 100644 --- a/usr.bin/pom/pom.6 +++ b/usr.bin/pom/pom.6 @@ -27,7 +27,7 @@ .\" .\" @(#)pom.6 8.1 (Berkeley) 5/31/93 .\" -.Dd July 14, 2010 +.Dd July 24, 2025 .Dt POM 6 .Os .Sh NAME @@ -62,4 +62,10 @@ but not has been specified, it will calculate the phase of the moon on that day at midnight. .Sh SEE ALSO -`Practical Astronomy with Your Calculator' by Duffett-Smith. +.Rs +.%A Peter Duffett-Smith +.%B Practical Astronomy with Your Calculator +.%I Cambridge University Press +.%C Cambridge, UK +.%D 1979 +.Re From nobody Mon Jul 28 12:46:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brJBQ34l5z632XQ; Mon, 28 Jul 2025 12:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brJBQ125Lz3mfc; Mon, 28 Jul 2025 12:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mXUaeYJvZG2tC+ZzsEfzWofXdpyOd+sPq6WVUkTfWnc=; b=j4UGByFAm60nssEjwqCGtSYH4hqIaJlnYIBRPbgoaoRgKoKJ+PNyRR7ZGNuijmT/hrjcHB UswlhAID26LNtrMIzmH8shB2EgvcorS2WhEmWjbKKBp2h9vCBXNT9SAVF+TvLoNTXTNlm/ d3gdX77nb0sefP5HKRipoUe9p5HRZVo4RiwBB56Tex8WD9APtSTJMoNbsLzyqv8iJ2hnL8 49mAAjdFn8uIqlPu6TCYW7+FumEA5fZ42bx4j/YDYxj6Ns5cGZuK8XjsCcFamD19dqoQAV tsH7fd0pVUhLWRYm07UwsrKsz5SWeYYZgp2I62aXY+E0v1rDaeXHIr64t8BRoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mXUaeYJvZG2tC+ZzsEfzWofXdpyOd+sPq6WVUkTfWnc=; b=g5JRynwhKowOkMauk2uS95gYb2tlnia8fpLgy2rP9rSIZwxwRJv24cypWcBXmxNPHvVGgx sNtB7Rl5Y1E9/o11fRZQNmcyjNKgIcQ59ujWOYZliPj2VVJhOhh+6bzMeNfJysGAgxrKeV 9fSG2YqMtppAG8rnhelMpJaX+lyc7aULPgWhAy67BEOIUdrmHBYCVd2D2mFA1amgojJb1v pzUr5v6Xuu8mhnugAIQCCCHBwh7gDHRU+sKUVPTKhPai/nuez1p2JQY3xAasCGNYLe7ArM o3SNBF23GwQIMWE0i+sKLBCxqISduCkp+2+HhW3imZCOmVqoZeYK9MT+ok8UAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753706782; a=rsa-sha256; cv=none; b=F8Yc/9GRGZS/lBbRTLM8Z5nElsTkS8YTTk+jtYIHFa6RaKo2Tt7EYS4XK9pAi4X6m3E3r2 d7py8f+TIXqJJP5YGcNqnrnS4PEbNKyAJXs4Dv/eXCf9w4oMtxqWMOAS75JySNKYXMRT3t IRACdHXlJv9ACdw46zE25CeESP/8uLwQoE43x3sHFmM5/umVNkPqUQRq1QiYba0U/rWV7t oHEXk+jE5HCEFqCGcGKjtPNAO4Oq3dnrmfjhP0VEmWOK4N/yEuYo6XB6FCsyK28PwKxBVj 4QK+9l9DPbr+GD7nnj1CbKlwwFnKNMABiXjuK5rfjmADRYVWzSLkC2Ccw08Bag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brJBQ085vzmbS; Mon, 28 Jul 2025 12:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SCkLuq093222; Mon, 28 Jul 2025 12:46:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SCkLvf093219; Mon, 28 Jul 2025 12:46:21 GMT (envelope-from git) Date: Mon, 28 Jul 2025 12:46:21 GMT Message-Id: <202507281246.56SCkLvf093219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: ad023bc26e10 - main - clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad023bc26e106e28e1b4845f991b52b533bd0802 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=ad023bc26e106e28e1b4845f991b52b533bd0802 commit ad023bc26e106e28e1b4845f991b52b533bd0802 Author: Lexi Winter AuthorDate: 2025-07-27 10:53:19 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 09:17:36 +0000 clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC} ${.ALLSRC} can include the dependency OptParser.td, which causes llvm-tblgen to fail since it only accepts a single input argument. Use ${TDFILE} directly instead, which matches the other invocations of tblgen in the LLVM Makefiles. Fixes: d3c06bed2c16 ("clang: install clang-scan-deps") MFC after: 3 days Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D51569 --- usr.bin/clang/clang-scan-deps/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/clang/clang-scan-deps/Makefile b/usr.bin/clang/clang-scan-deps/Makefile index 16fecdb88867..8da12faccc45 100644 --- a/usr.bin/clang/clang-scan-deps/Makefile +++ b/usr.bin/clang/clang-scan-deps/Makefile @@ -10,13 +10,14 @@ SRCS+= ClangScanDeps.cpp \ .include "${SRCTOP}/lib/clang/clang.pre.mk" CFLAGS+= -I${.OBJDIR} -TDFILE= Opts.td -INCFILE= ${TDFILE:.td=.inc} + +INCFILE= Opts.inc +TDFILE= ${LLVM_BASE}/${SRCDIR}/Opts.td GENOPT= -gen-opt-parser-defs ${INCFILE}: ${TDFILE} ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} DEPENDFILES+= ${TGHDRS:C/$/.d/} From nobody Mon Jul 28 12:46:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brJBR2Qkqz632RV; Mon, 28 Jul 2025 12:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brJBR0YR1z3msj; Mon, 28 Jul 2025 12:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hr1WfClYr2fMYvNWbmmKHIypyFy+ZeZyK3S4N1F+fvU=; b=ERaSQP/tVEAsgRJh9S720HkBO1IFJLRPWDQZfH2RqTJ/RwK4GBXUbkRc3y4zzEAKf6oea/ 4ukR7lQWBf8XKhH/5QC89oivkHjYFjFCD/X2an4AhSvor2GUMP5aSC8J2JlgbZ0z+NSFZj MOT/3eqg3IXbR1erXTStdyd/4L3Buxom+mubCEq8XAp7d4I5BUpPQNMM0Rw5PSWNbafqwl YqVDKayDUFgxZ1V50StGbUEhIrklOaT1PDaugg+VlIEnMSfTS6f7qdWCKvNbie8bqR8SFR CsdBMisENhoxvj1AaCx7dJV8A6gg2b4mASQLRAIZovPEI2km6L/f+1JvyCEi6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hr1WfClYr2fMYvNWbmmKHIypyFy+ZeZyK3S4N1F+fvU=; b=DpvhGnoTgdVstcNYbV/g3MFjSD7YOe6ADoxWasHOVyWzI9r+jY9sKTqxFMAfTefBrY4SPY K0xcfqY/3D+BP7bPRxbuxfFLl1Xs5kNLCDGA2JSScYqO2xHmMDkhMl6JEYzM/XSjnzN6rg /Smn7yLtuIZFSAwSOc79jHnBi81vGCaYmV4BUKQv8xoqbVTR8gCd3bItXFqu7/9ZEs8RRL svyYVi05UhiPTkXh5OpaTUUh0vpmyP+fchi/CJBfw/4KOOQbtuhfqnWcinUOKVbDSOmnm6 UrIWEe1I0sW7hwYdQFzIH73f2yi3S3IlX+46/xL/Z53ZB1Edvl3Vta/zKr16zA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753706783; a=rsa-sha256; cv=none; b=xAL3Z1x1xR3j0zvuxBJFKThRXY067wfbjkA7PVu+7v8Ts4BA11dFhY8eMckLeFWd0XIK4M kxv+I47i7I+8PMdniG8DBmJIwAj0jJyybIy8sxG13yPF7AjY44izySxcG5Wa63189NzQ2i 9L9NmXSnvbJ++8Kzw5A54tUwAUZ4S6A4q1qWt2DwSniWtF3trrT+aqeCEosU+0EgaqScJn v2P4ly6zdWQHx0HNtWPKzNiEEGAfqlJvarutz8zF45ewB/A7abCbs5bvKYLRJf0z1T0TSk ES6zSsz1rlKlajcmjiQSMpCRyQwSSpbeKU1uCOiVWv6a+7t/KVTKc53bDQYK6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brJBR00L9zmbT; Mon, 28 Jul 2025 12:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SCkMfa093262; Mon, 28 Jul 2025 12:46:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SCkMle093259; Mon, 28 Jul 2025 12:46:22 GMT (envelope-from git) Date: Mon, 28 Jul 2025 12:46:22 GMT Message-Id: <202507281246.56SCkMle093259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 14f57afb852d - main - bmake: Add a package for bmake and share/mk List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14f57afb852ddac57d3a277aef375cda5666c620 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=14f57afb852ddac57d3a277aef375cda5666c620 commit 14f57afb852ddac57d3a277aef375cda5666c620 Author: Lexi Winter AuthorDate: 2025-07-27 11:24:33 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 09:17:36 +0000 bmake: Add a package for bmake and share/mk bmake along with /usr/share/mk seems to meet the criteria for being in its own package: it's self-contained and the majority of users (who are using binary packages) don't need to install it, so it doesn't belong in FreeBSD-utilities. Instead, put it in its own package. Add a dependency on the new package from: - sendmail (uses make to build its configuration) - NIS (uses make to build the database). But not from examples, because while some of the examples do require make, they are intended as examples rather than something to be used directly. Reviewed by: manu, sjg Differential Revision: https://reviews.freebsd.org/D50149 --- UPDATING | 5 +++++ release/packages/ucl/bmake-all.ucl | 5 +++++ release/packages/ucl/sendmail.ucl | 7 +++++++ release/packages/ucl/yp.ucl | 7 +++++++ share/mk/Makefile | 1 + usr.bin/bmake/Makefile.inc | 2 ++ 6 files changed, 27 insertions(+) diff --git a/UPDATING b/UPDATING index 611bb62eefcc..5fb9574dfb0f 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250727: + bmake (i.e., /usr/bin/make and /usr/share/mk) has moved to a new + package, FreeBSD-bmake. If you use pkgbase and you need make, you + should install this package. + 20250727: LLVM's debugging assertions are now disabled in main by default. The WITH_LLVM_ASSERTIONS src.conf(5) knob should be used to diff --git a/release/packages/ucl/bmake-all.ucl b/release/packages/ucl/bmake-all.ucl new file mode 100644 index 000000000000..ee8175d1dd8a --- /dev/null +++ b/release/packages/ucl/bmake-all.ucl @@ -0,0 +1,5 @@ +comment = "Program maintenance utility" +desc = < +PACKAGE= bmake FILES= \ auto.obj.mk \ bsd.README \ diff --git a/usr.bin/bmake/Makefile.inc b/usr.bin/bmake/Makefile.inc index 5140bd18bb37..a064563a2283 100644 --- a/usr.bin/bmake/Makefile.inc +++ b/usr.bin/bmake/Makefile.inc @@ -3,6 +3,8 @@ MK_host_egacy= no .sinclude +PACKAGE?= bmake + .if defined(.PARSEDIR) # make sure this is available to unit-tests/Makefile .export SRCTOP From nobody Mon Jul 28 12:46:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brJBS3YrSz631lB; Mon, 28 Jul 2025 12:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brJBS2kBKz3mw7; Mon, 28 Jul 2025 12:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h54xAd8PSXMDRsRQ76hLJ/0RzY6jlUiDjbur/uSUvio=; b=uhDwLmQJ0/ebTTgm10dnxzXHPJ5RZkzkW8akZ6RzECYogSJoR4nhf8LYaN6GNPpm4Jtu0v SToA+y45r7ZN9D/wObHBQ8yvf4QNPLSjb0HzEYUDJQVzWb/mVXzvGRtwjd/pKmG55JAER7 VlxBQMB3AzWmGdqQfLGLN3TQUI22X0/1Rr7ep+enByelr61ZP0DM4Rwz8XWxHBaK9VRu/7 zQ2UAdDrFw76lYUjyBEC0ouUabwQ6vHbbiTI4zlBiUIajZQyG9hBzB6N5uexJtjeblxDI8 /Gtyz0/T3o+Yo0eEGeOklakzuP/6FtrMfIe/yOfvrUDFzRTZsoky6J3ZviVHTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h54xAd8PSXMDRsRQ76hLJ/0RzY6jlUiDjbur/uSUvio=; b=X9BM7nkLEk4f9YteeGzHfLvWzo/Wz8UsCPnCFTMWcpDDtNvRx5LVQCgmDYmrFls6FnNeJI eiMJ6pM9C8luyJclyxpetApllaVs+3mYs2yLd6YUzrJfbHSO2KhKwKTZ8n0RdWigarSGNh jRhv5+9vZf/yNhrCLWSI0YRRhxgQGUymP0PjDV94815r64F/AzMmNADb/Udj+Jh7fEN+EN YJw+2i0zk1KMJm/GeqiF8rYTXCXZFtvZfsPjNRDU8KoAYhGTaswj1Y/yYDKMo9MHLfo4Hy 29+LHPxXKbFr9lr3lk82EVLZ2m6yYTKcF9UeW1stHcaMH8uRJS4XdHKygozlWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753706784; a=rsa-sha256; cv=none; b=x7/R60UNbjMFqcN60GxdT1Pc15Asf3jJ3cLYKOWcQsRUhi0/N/Pbu0JUlVlXveMmSNDOBI 9vsmlwvhFjmRIXDpvXp2wNCWYkqJMRxXjXbW21OqpxC6n8ci+/oFfgcQIFDl7mgF4midbo jQDPOEnHvmKnyTCvL9h/jwawEBCS/+SzWN0upYWEDKMs+2ofoIVsoLazOiEdOGmDmrEKDE X5qDCYDmTH/Xxh4iBJIhACGW67Vv5CwGjrRzSCOjfyGDLECbAKafdUbC2VBlCB44Em0fsR XTZlFuvW1TD2ZyUmEClqQIoJmOTibK1dF6XrwITDm0txqEJ5YYmqWKWz2EjWKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brJBS1Gf6zmbV; Mon, 28 Jul 2025 12:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SCkOtq093295; Mon, 28 Jul 2025 12:46:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SCkOYm093292; Mon, 28 Jul 2025 12:46:24 GMT (envelope-from git) Date: Mon, 28 Jul 2025 12:46:24 GMT Message-Id: <202507281246.56SCkOYm093292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: f252caf0015a - main - bridge: exterr-ize List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f252caf0015a892b2c362719d0098ed654c65bc3 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=f252caf0015a892b2c362719d0098ed654c65bc3 commit f252caf0015a892b2c362719d0098ed654c65bc3 Author: Lexi Winter AuthorDate: 2025-07-27 15:09:49 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 09:17:36 +0000 bridge: exterr-ize While here, tweak a couple of comments and order includes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51181 --- sys/net/if_bridge.c | 146 ++++++++++++++++++++++++++++++--------------------- sys/sys/exterr_cat.h | 1 + 2 files changed, 88 insertions(+), 59 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 5b3ee740d75e..3327c863468f 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -76,31 +76,34 @@ * heterogeneous bridges). */ -#include #include "opt_inet.h" #include "opt_inet6.h" +#define EXTERR_CATEGORY EXTERR_CAT_BRIDGE + #include +#include /* string functions */ #include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include #include -#include -#include #include /* for net/if.h */ #include -#include /* string functions */ -#include -#include #include #include +#include + #include -#include -#include -#include -#include -#include #include #include @@ -986,31 +989,37 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCGDRVSPEC: case SIOCSDRVSPEC: if (ifd->ifd_cmd >= bridge_control_table_size) { - error = EINVAL; + error = EXTERROR(EINVAL, "Invalid control command"); break; } bc = &bridge_control_table[ifd->ifd_cmd]; if (cmd == SIOCGDRVSPEC && (bc->bc_flags & BC_F_COPYOUT) == 0) { - error = EINVAL; + error = EXTERROR(EINVAL, + "Inappropriate ioctl for command " + "(expected SIOCSDRVSPEC)"); break; } else if (cmd == SIOCSDRVSPEC && (bc->bc_flags & BC_F_COPYOUT) != 0) { - error = EINVAL; + error = EXTERROR(EINVAL, + "Inappropriate ioctl for command " + "(expected SIOCGDRVSPEC)"); break; } if (bc->bc_flags & BC_F_SUSER) { error = priv_check(td, PRIV_NET_BRIDGE); - if (error) + if (error) { + EXTERROR(error, "PRIV_NET_BRIDGE required"); break; + } } if (ifd->ifd_len != bc->bc_argsize || ifd->ifd_len > sizeof(args)) { - error = EINVAL; + error = EXTERROR(EINVAL, "Invalid argument size"); break; } @@ -1062,7 +1071,8 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) oldmtu = sc->sc_ifp->if_mtu; if (ifr->ifr_mtu < IF_MINMTU) { - error = EINVAL; + error = EXTERROR(EINVAL, + "Requested MTU is lower than IF_MINMTU"); break; } if (CK_LIST_EMPTY(&sc->sc_iflist)) { @@ -1088,6 +1098,8 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) (*bif->bif_ifp->if_ioctl)(bif->bif_ifp, SIOCSIFMTU, (caddr_t)ifr); } + EXTERROR(error, + "Failed to set MTU on member interface"); } else { sc->sc_ifp->if_mtu = ifr->ifr_mtu; } @@ -1125,14 +1137,14 @@ bridge_mutecaps(struct bridge_softc *sc) mask = BRIDGE_IFCAPS_MASK; CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { - /* Every member must support it or its disabled */ + /* Every member must support it or it's disabled */ mask &= bif->bif_savedcaps; } CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { enabled = bif->bif_ifp->if_capenable; enabled &= ~BRIDGE_IFCAPS_STRIP; - /* strip off mask bits and enable them again if allowed */ + /* Strip off mask bits and enable them again if allowed */ enabled &= ~BRIDGE_IFCAPS_MASK; enabled |= mask; bridge_set_ifcap(sc, bif, enabled); @@ -1282,7 +1294,7 @@ bridge_delete_member(struct bridge_softc *sc, struct bridge_iflist *bif, #endif break; } - /* reneable any interface capabilities */ + /* Re-enable any interface capabilities */ bridge_set_ifcap(sc, bif, bif->bif_savedcaps); } bstp_destroy(&bif->bif_stp); /* prepare to free */ @@ -1318,21 +1330,25 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) ifs = ifunit(req->ifbr_ifsname); if (ifs == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "No such interface", + req->ifbr_ifsname)); if (ifs->if_ioctl == NULL) /* must be supported */ - return (EINVAL); + return (EXTERROR(EINVAL, "Interface must support ioctl(2)")); /* If it's in the span list, it can't be a member. */ CK_LIST_FOREACH(bif, &sc->sc_spanlist, bif_next) if (ifs == bif->bif_ifp) - return (EBUSY); + return (EXTERROR(EBUSY, + "Span interface cannot be a member")); if (ifs->if_bridge) { struct bridge_iflist *sbif = ifs->if_bridge; if (sbif->bif_sc == sc) - return (EEXIST); + return (EXTERROR(EEXIST, + "Interface is already a member of this bridge")); - return (EBUSY); + return (EXTERROR(EBUSY, + "Interface is already a member of another bridge")); } switch (ifs->if_type) { @@ -1342,7 +1358,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) /* permitted interface types */ break; default: - return (EINVAL); + return (EXTERROR(EINVAL, "Unsupported interface type")); } #ifdef INET6 @@ -1394,11 +1410,15 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) CK_STAILQ_FOREACH(ifa, &ifs->if_addrhead, ifa_link) { #ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) - return (EINVAL); + return (EXTERROR(EINVAL, + "Member interface may not have " + "an IPv4 address configured")); #endif #ifdef INET6 if (ifa->ifa_addr->sa_family == AF_INET6) - return (EINVAL); + return (EXTERROR(EINVAL, + "Member interface may not have " + "an IPv6 address configured")); #endif } } @@ -1420,7 +1440,8 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) " new member %s\n", sc->sc_ifp->if_xname, ifr.ifr_mtu, ifs->if_xname); - return (EINVAL); + return (EXTERROR(EINVAL, + "Failed to set MTU on new member")); } } @@ -1482,7 +1503,7 @@ bridge_ioctl_del(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); bridge_delete_member(sc, bif, 0); @@ -1498,7 +1519,7 @@ bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); bp = &bif->bif_stp; req->ifbr_ifsflags = bif->bif_flags; @@ -1541,12 +1562,12 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); bp = &bif->bif_stp; if (req->ifbr_ifsflags & IFBIF_SPAN) /* SPAN is readonly */ - return (EINVAL); + return (EXTERROR(EINVAL, "Span interface cannot be modified")); NET_EPOCH_ENTER(et); @@ -1555,7 +1576,8 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) error = bstp_enable(&bif->bif_stp); if (error) { NET_EPOCH_EXIT(et); - return (error); + return (EXTERROR(error, + "Failed to enable STP")); } } } else { @@ -1724,7 +1746,7 @@ bridge_ioctl_saddr(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifba_ifsname); if (bif == NULL) { NET_EPOCH_EXIT(et); - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); } /* bridge_rtupdate() may acquire the lock. */ @@ -1858,7 +1880,7 @@ bridge_ioctl_sifprio(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); return (bstp_set_port_priority(&bif->bif_stp, req->ifbr_priority)); } @@ -1871,7 +1893,7 @@ bridge_ioctl_sifcost(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); return (bstp_set_path_cost(&bif->bif_stp, req->ifbr_path_cost)); } @@ -1884,7 +1906,7 @@ bridge_ioctl_sifmaxaddr(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); bif->bif_addrmax = req->ifbr_addrmax; return (0); @@ -1898,10 +1920,10 @@ bridge_ioctl_sifuntagged(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); if (req->ifbr_untagged > DOT1Q_VID_MAX) - return (EINVAL); + return (EXTERROR(EINVAL, "Invalid VLAN ID")); if (req->ifbr_untagged != DOT1Q_VID_NULL) bif->bif_flags |= IFBIF_VLANFILTER; @@ -1917,12 +1939,12 @@ bridge_ioctl_sifvlanset(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->bv_ifname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); /* Reject invalid VIDs. */ if (BRVLAN_TEST(&req->bv_set, DOT1Q_VID_NULL) || BRVLAN_TEST(&req->bv_set, DOT1Q_VID_RSVD_IMPL)) - return (EINVAL); + return (EXTERROR(EINVAL, "Invalid VLAN ID in set")); switch (req->bv_op) { /* Replace the existing vlan set with the new set */ @@ -1942,7 +1964,8 @@ bridge_ioctl_sifvlanset(struct bridge_softc *sc, void *arg) /* Invalid or unknown operation */ default: - return (EINVAL); + return (EXTERROR(EINVAL, + "Unsupported BRDGSIFVLANSET operation")); } /* @@ -1962,7 +1985,7 @@ bridge_ioctl_gifvlanset(struct bridge_softc *sc, void *arg) bif = bridge_lookup_member(sc, req->bv_ifname); if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a bridge member")); BIT_COPY(BRVLAN_SETSIZE, &bif->bif_vlan_set, &req->bv_set); return (0); @@ -1977,14 +2000,16 @@ bridge_ioctl_addspan(struct bridge_softc *sc, void *arg) ifs = ifunit(req->ifbr_ifsname); if (ifs == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "No such interface")); CK_LIST_FOREACH(bif, &sc->sc_spanlist, bif_next) if (ifs == bif->bif_ifp) - return (EBUSY); + return (EXTERROR(EBUSY, + "Interface is already a span port")); if (ifs->if_bridge != NULL) - return (EBUSY); + return (EXTERROR(EEXIST, + "Interface is already a bridge member")); switch (ifs->if_type) { case IFT_ETHER: @@ -1992,7 +2017,7 @@ bridge_ioctl_addspan(struct bridge_softc *sc, void *arg) case IFT_L2VLAN: break; default: - return (EINVAL); + return (EXTERROR(EINVAL, "Unsupported interface type")); } bif = malloc(sizeof(*bif), M_DEVBUF, M_NOWAIT|M_ZERO); @@ -2016,14 +2041,14 @@ bridge_ioctl_delspan(struct bridge_softc *sc, void *arg) ifs = ifunit(req->ifbr_ifsname); if (ifs == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "No such interface")); CK_LIST_FOREACH(bif, &sc->sc_spanlist, bif_next) if (ifs == bif->bif_ifp) break; if (bif == NULL) - return (ENOENT); + return (EXTERROR(ENOENT, "Interface is not a span port")); bridge_delete_span(sc, bif); @@ -3244,10 +3269,11 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t *dst, BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(sc); /* Check the source address is valid and not multicast. */ - if (ETHER_IS_MULTICAST(dst) || - (dst[0] == 0 && dst[1] == 0 && dst[2] == 0 && - dst[3] == 0 && dst[4] == 0 && dst[5] == 0) != 0) - return (EINVAL); + if (ETHER_IS_MULTICAST(dst)) + return (EXTERROR(EINVAL, "Multicast address not permitted")); + if (dst[0] == 0 && dst[1] == 0 && dst[2] == 0 && + dst[3] == 0 && dst[4] == 0 && dst[5] == 0) + return (EXTERROR(EINVAL, "Zero address not permitted")); /* * A route for this destination might already exist. If so, @@ -3266,13 +3292,14 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t *dst, if (sc->sc_brtcnt >= sc->sc_brtmax) { sc->sc_brtexceeded++; BRIDGE_RT_UNLOCK(sc); - return (ENOSPC); + return (EXTERROR(ENOSPC, "Address table is full")); } /* Check per interface address limits (if enabled) */ if (bif->bif_addrmax && bif->bif_addrcnt >= bif->bif_addrmax) { bif->bif_addrexceeded++; BRIDGE_RT_UNLOCK(sc); - return (ENOSPC); + return (EXTERROR(ENOSPC, + "Interface address limit exceeded")); } /* @@ -3283,7 +3310,8 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t *dst, brt = uma_zalloc(V_bridge_rtnode_zone, M_NOWAIT | M_ZERO); if (brt == NULL) { BRIDGE_RT_UNLOCK(sc); - return (ENOMEM); + return (EXTERROR(ENOMEM, + "Cannot allocate address node")); } brt->brt_vnet = curvnet; @@ -3631,7 +3659,7 @@ bridge_rtnode_insert(struct bridge_softc *sc, struct bridge_rtnode *brt) do { dir = bridge_rtnode_addr_cmp(brt->brt_addr, lbrt->brt_addr); if (dir == 0 && brt->brt_vlan == lbrt->brt_vlan) - return (EEXIST); + return (EXTERROR(EEXIST, "Address already exists")); if (dir > 0) { CK_LIST_INSERT_BEFORE(lbrt, brt, brt_hash); goto out; diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index cab94ac511a5..a8e1f56e132e 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -18,6 +18,7 @@ #define EXTERR_CAT_FUSE 4 #define EXTERR_CAT_INOTIFY 5 #define EXTERR_CAT_GENIO 6 +#define EXTERR_CAT_BRIDGE 7 #endif From nobody Mon Jul 28 12:46:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brJBV04YNz631lC; Mon, 28 Jul 2025 12:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brJBT2lySz3msn; Mon, 28 Jul 2025 12:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YAEMTRWnOuq0BqJn76ctXifkBEBqHDC05uZ0YgZi6nw=; b=gpj8nCxjGb3AxTjFEv1WbTmpzMTtg9bSX7WjTEYyUjZ6sfZ53rsGr7fe9wOdQGGu5eA2D1 lQ+3G3HwErddR3rSzEXMJWBL9jXdTFfcQztAKO9uHX1mEsUiNsNNmASP4lcRxqxCW2X2cy wBl0dxA32RJA0DuWP4SLyFfGa020rtX5W/5ygVsptUqfVf3JF3fpoMs33OloQ8bp1kras0 8xyTr3yLKjuwb3eBbmYVBaL98bAhmoK19WNO7lnSdL0RIkkkvMrwoZkiHNDdmyurUv49OF cxnLZcHGJiqYVpck+DP+06siZFR7ZFhFhdu/eHEME0gDp5x5f14lAlbZpOnDhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753706785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YAEMTRWnOuq0BqJn76ctXifkBEBqHDC05uZ0YgZi6nw=; b=M27/e4/+ATJQJi6VLtji5YpsNmqwlts+pArRxV1LdG0pYrw8eKEeI4rgKP6/Qd6xhtUsVM GzlvxkorBlonS8roCAw0amWOgVvtvlvdWaeaX2wx40ZzXkgz91JeCqC2kmZxcGvTaNf5y6 qSZkB74knpPWILJGWVQdUR1S/ZO/B0rgN0oT/jlWxNW3RklOjpmkkZJ59ezocrome8I0+Q rWgvLw6RahNwiSoWibwKosj2+jxq/x0Be/r1QxlDditnRYO+V+Cg5N2Xxnn2dcgp40uXA9 8vMzekUAE9H6cA8/FLkC3gPv738CTMe5uqK48PAM3E37LJaKXYkvL14aukuAZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753706785; a=rsa-sha256; cv=none; b=iMnlA5nO9FQyr2koMn7FKp1H/HqlkoSzlRcOutEV0Dvg0GnHJyiBsl7XjnvW+zYQw86Uzn sxxk9SFrc1XPIvF8HKHYUkEb6N7Vkctp1BcX3C7o1eU52r3ZqHH69RiYIT+c8gtJblaY5E frK/x0qu6t8R8wF6DAjI66YNOppQhNqSmsBCatCnNQ0pFsA7ZdSOAcdmiEXv/TDMFS5od5 Xd86s8PsZU4+x5oqMnHiS1/rMn5JcmU1ziq9PMDfEShfwJ+VNPsLRD7S8k2uKVaETZnEnr E2mi3AMFtaGKv7FFjhf8jx0xmwFTMpN7v3F/2mkHfe+AlhGmaS8uHotmVnAIPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brJBT1ty5zmT5; Mon, 28 Jul 2025 12:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SCkP6R093328; Mon, 28 Jul 2025 12:46:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SCkPHS093325; Mon, 28 Jul 2025 12:46:25 GMT (envelope-from git) Date: Mon, 28 Jul 2025 12:46:25 GMT Message-Id: <202507281246.56SCkPHS093325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 16045420e7f8 - main - bsdinstall: use the canonical name for compression List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16045420e7f83489ecd5e2163aa9bb11236962f5 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=16045420e7f83489ecd5e2163aa9bb11236962f5 commit 16045420e7f83489ecd5e2163aa9bb11236962f5 Author: Lexi Winter AuthorDate: 2025-07-28 12:45:26 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 12:45:26 +0000 bsdinstall: use the canonical name for compression According to zfsprops(7), the canonical property for the compression algorithm is "compression", with "compress" accepted as an alternate name. Use the canonical name in bsdinstall. While here, change "lz4" to "on" so we pick up any future changes in the default compression algorithm. MFC after: 1 week Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D51572 --- usr.sbin/bsdinstall/bsdinstall.8 | 2 +- usr.sbin/bsdinstall/scripts/zfsboot | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index 8fadacab9189..181abdcf9d05 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -451,7 +451,7 @@ Each option must be preceded by the -O flag to be taken into consideration or the pool will not be created due to errors using the command .Cm zpool . Default: -.Dq Li "-O compress=lz4 -O atime=off" +.Dq Li "-O compression=on -O atime=off" .It Ev ZFSBOOT_BEROOT_NAME Name for the boot environment parent dataset. This is a non-mountable dataset meant to be a parent dataset where different diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 60feec28e888..a3c1e2ddb89f 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -51,7 +51,7 @@ f_include $BSDCFG_SHARE/variable.subr # # Default options to use when creating zroot pool # -: ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compress=lz4 -O atime=off} +: ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compression=on -O atime=off} # # Default name for the boot environment parent dataset From nobody Mon Jul 28 13:23:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brK1M0GlHz634Cq; Mon, 28 Jul 2025 13:23:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brK1L6V0vz3sl8; Mon, 28 Jul 2025 13:23:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5X4JoNEKbXpOyg4BuBLpLNprxnO3HfEKAkDRI/HdUrI=; b=mhh6OBiN2SHwJeY0xv71ubYcku7/hHnmpHU5jQ2PmJX144/UMjt+FYs1sk15gHcc5sFOeG 3L7cofdX0KYD91FpKvr4JCkqFWvHJ4IUsqa29HJjT7gNWPSyGIAxzbxEB+PoMeJHNw3G8u w/m6ISTCpuGec0gOwNvVYX430DQh5mkrtl1S79FneEvf6IiL6KHEmrCV8nK+6EVb+mBecB Z48hfTlCmJdKLbbtHhDLTWGhRjLIT4HJZUDcvk0GxAyy7kQgD4kA+jGLZ+rBB8EoiKG78r zPzzMdmIhk0aBOjVE0XBHHYHDJHA4AUtzB1UQB2gn0U5HTmOk73Yfj0rqaqfGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5X4JoNEKbXpOyg4BuBLpLNprxnO3HfEKAkDRI/HdUrI=; b=j/a5qvR4v7ocmLkMHIZIGvjK6Ev6kL+Ade8SVdv+B9Yp6nxb6PQeLgCeYyYUW9tboJaZi9 kQ6wF4AJcDSX85hyr9QMZ+4LlciheIzUH9z18nyMbWTvrqfgNDsWqPq7L7YgaTK58rwRpc +oeLwiSakbhBa0x6Gz6B5EIgJFc/1CCVCVukLhfHnO0Ehh6GNI0vlLvOKN05mN6WSLXGWR ZK0p0S+JimOY+kfOcQRg+1N3IOAy7nUf/KI0QQh1VMtbTY2CowRfQQ1AJ1LejYZyTVLgCh HZOBNc3VjucQvZf80P7eomM9ijxHG28pGDxgCfVKPZDOfUKUqP2B8SQwprHqwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709014; a=rsa-sha256; cv=none; b=MJrX6N3DsdayvrsmK9NdHt0yqFd4LKB+n85zHNBXCVi5vItYgcfWKJXllyvnAzN1WblrZP gkPRPz6Z+poIOod2aOufDl+ayNTnJgzIfp4ojrcGm6Au57Uw1zRZqUDJEEUyKOe/A+Jqm0 SqLJLZaWJVQ+3DN7WZcMX3tlksMEf7IihbsVzanoKxqKJgjyHtD9gVroaA0jA+XfLD/fhP euZDBdKGStqPDbK/az+wp5jVpSWdYjb9ozbkLkM72cVYLw6EHthUix9lARWKWzd95C8YHK 1Xo+D7ntqqyBPukBz3XnMOmwdwLF0aG0lHIaLCl4P+e1ghO/tGX6E0KxC5fMsw== 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 "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4brK1L3mxwzvCY; Mon, 28 Jul 2025 13:23:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id A10E243DDF; Mon, 28 Jul 2025 15:23:31 +0200 (CEST) From: Kristof Provost To: Warner Losh , Eric Joyner Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 430f1acc451c - main - ice(4): Add MAC filter and VLAN resource limits to VFs Date: Mon, 28 Jul 2025 15:23:30 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> References: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I=E2=80=99m not sure if it=E2=80=99s this specific commit or another one = in the recent dev/ice updates, but the arm64 LINT-FDT, LINT-ACPI and LINT= builds all fail. This is from arm64-LINT: ld: error: undefined symbol: ice_iov_attach >>> referenced by if_ice_iflib.c:859 (/usr/src/sys/dev/ice/if_ice_iflib.= c:859) >>> if_ice_iflib.o:(ice_if_attach_post) ld: error: undefined symbol: ice_iov_detach >>> referenced by if_ice_iflib.c:989 (/usr/src/sys/dev/ice/if_ice_iflib.= c:989) >>> if_ice_iflib.o:(ice_if_detach) >>> referenced by if_ice_iflib.c:2323 (/usr/src/sys/dev/ice/if_ice_iflib= =2Ec:2323) >>> if_ice_iflib.o:(ice_if_update_admin_status) >>> referenced by if_ice_iflib.c:2376 (/usr/src/sys/dev/ice/if_ice_iflib= =2Ec:2376) >>> if_ice_iflib.o:(ice_transition_safe_mode) ld: error: undefined symbol: ice_iov_add_vf >>> referenced by if_ice_iflib.c:3464 (/usr/src/sys/dev/ice/if_ice_iflib= =2Ec:3464) >>> if_ice_iflib.o:(ice_if_iov_vf_add) ld: error: undefined symbol: ice_iov_init >>> referenced by if_ice_iflib.c:3429 (/usr/src/sys/dev/ice/if_ice_iflib= =2Ec:3429) >>> if_ice_iflib.o:(ice_if_iov_init) ld: error: undefined symbol: ice_iov_uninit >>> referenced by if_ice_iflib.c:3445 (/usr/src/sys/dev/ice/if_ice_iflib= =2Ec:3445) >>> if_ice_iflib.o:(ice_if_iov_uninit) ld: error: undefined symbol: ice_iov_handle_vflr >>> referenced by if_ice_iflib.c:3480 (/usr/src/sys/dev/ice/if_ice_iflib= =2Ec:3480) >>> if_ice_iflib.o:(ice_if_vflr_handle) ld: error: undefined symbol: ice_vc_notify_all_vfs_link_state >>> referenced by if_ice_iflib.c:757 (/usr/src/sys/dev/ice/if_ice_iflib.= c:757) >>> if_ice_iflib.o:(ice_update_link_status) ld: error: undefined symbol: ice_vc_handle_vf_msg >>> referenced by ice_lib.c:2285 (/usr/src/sys/dev/ice/ice_lib.c:2285) >>> ice_lib.o:(ice_process_ctrlq) *** [kernel.full] Error code 1 =E2=80=94 Kristof On 18 Jul 2025, at 21:16, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D430f1acc451c7084d1d5aa7d= f7e7ecccea1a8b51 > > commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 > Author: Eric Joyner > AuthorDate: 2024-10-17 22:19:09 +0000 > Commit: Warner Losh > CommitDate: 2025-07-18 19:16:17 +0000 > > ice(4): Add MAC filter and VLAN resource limits to VFs > > Adds two new parameters to iovctl config for VLAN filter limits and= MAC > filter limits and gives them defaults of 64 and 16, respectively. > > These are intended to limit the number of resources that a VF can > consume so that any one VF cannot starve an other VFs or the PF of > filters. > > Signed-off-by: Eric Joyner > Signed-off-by: Krzysztof Galazka > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 > --- > sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++++++++++++++-= -- > sys/dev/ice/ice_iov.h | 8 ++++++++ > 2 files changed, 50 insertions(+), 3 deletions(-) > > diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c > index fc37a0e7679c..e06c7eb56f7a 100644 > --- a/sys/dev/ice/ice_iov.c > +++ b/sys/dev/ice/ice_iov.c > @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc) > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); > pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", > IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); > + pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed", > + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT); > + pci_iov_schema_add_uint16(vf_schema, "max-mac-filters", > + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT); > > error =3D pci_iov_attach(dev, pf_schema, vf_schema); > if (error !=3D 0) { > @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum= , const nvlist_t *params) > > vsi->mirror_src_vsi =3D nvlist_get_number(params, "mirror-src-vsi"); > > + vf->vlan_limit =3D nvlist_get_number(params, "max-vlan-allowed"); > + vf->mac_filter_limit =3D nvlist_get_number(params, "max-mac-filters")= ; > + > vf->vf_flags |=3D VF_FLAG_VLAN_CAP; > > /* Create and setup VSI in HW */ > @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > struct virtchnl_ether_addr_list *addr_list; > struct ice_hw *hw =3D &sc->hw; > + u16 added_addr_cnt =3D 0; > int error =3D 0; > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > + if (addr_list->num_elements > > + (vf->mac_filter_limit - vf->mac_filter_cnt)) { > + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > + goto done; > + } > + > for (int i =3D 0; i < addr_list->num_elements; i++) { > u8 *addr =3D addr_list->list[i].addr; > > @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > "%s: VF-%d: Error adding MAC addr for VSI %d\n", > __func__, vf->vf_num, vf->vsi->idx); > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > - goto done; > + continue; > } > + /* Don't count VF's MAC against its MAC filter limit */ > + if (memcmp(addr, vf->mac, ETHER_ADDR_LEN)) > + added_addr_cnt++; > } > > + vf->mac_filter_cnt +=3D added_addr_cnt; > + > done: > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR, > v_status, NULL, 0, NULL); > @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struc= t ice_vf *vf, u8 *msg_buf) > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > struct virtchnl_ether_addr_list *addr_list; > struct ice_hw *hw =3D &sc->hw; > + u16 deleted_addr_cnt =3D 0; > int error =3D 0; > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > "%s: VF-%d: Error removing MAC addr for VSI %d\n", > __func__, vf->vf_num, vf->vsi->idx); > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > - goto done; > + continue; > } > + /* Don't count VF's MAC against its MAC filter limit */ > + if (memcmp(addr_list->list[i].addr, vf->mac, ETHER_ADDR_LEN)) > + deleted_addr_cnt++; > } > > -done: > + if (deleted_addr_cnt >=3D vf->mac_filter_cnt) > + vf->mac_filter_cnt =3D 0; > + else > + vf->mac_filter_cnt -=3D deleted_addr_cnt; > + > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR, > v_status, NULL, 0, NULL); > } > @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct i= ce_vf *vf, u8 *msg_buf) > goto done; > } > > + if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) { > + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > + goto done; > + } > + > status =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, > vlan_list->num_elements); > if (status) { > @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ic= e_vf *vf, u8 *msg_buf) > goto done; > } > > + vf->vlan_cnt +=3D vlan_list->num_elements; > + > done: > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, > v_status, NULL, 0, NULL); > @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct i= ce_vf *vf, u8 *msg_buf) > goto done; > } > > + if (vlan_list->num_elements >=3D vf->vlan_cnt) > + vf->vlan_cnt =3D 0; > + else > + vf->vlan_cnt -=3D vlan_list->num_elements; > + > done: > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, > v_status, NULL, 0, NULL); > diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h > index c2ac5fcd5c94..c4fb3e932e3f 100644 > --- a/sys/dev/ice/ice_iov.h > +++ b/sys/dev/ice/ice_iov.h > @@ -85,6 +85,11 @@ struct ice_vf { > u16 vf_num; > struct virtchnl_version_info version; > > + u16 mac_filter_limit; > + u16 mac_filter_cnt; > + u16 vlan_limit; > + u16 vlan_cnt; > + > u16 num_irq_vectors; > u16 *vf_imap; > struct ice_irq_vector *tx_irqvs; > @@ -101,6 +106,9 @@ struct ice_vf { > #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC | \ > FLAG_VF_MULTICAST_PROMISC) > > +#define ICE_DEFAULT_VF_VLAN_LIMIT 64 > +#define ICE_DEFAULT_VF_FILTER_LIMIT 16 > + > int ice_iov_attach(struct ice_softc *sc); > int ice_iov_detach(struct ice_softc *sc); From nobody Mon Jul 28 13:31:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKB320t0z634n2; Mon, 28 Jul 2025 13:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKB30zr8z3tTm; Mon, 28 Jul 2025 13:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+o25H69hxQ3et0t8XhmqwxS4xlWzsx6yNtG2ujCPpYU=; b=DUIDpfqDGE9xpvBo+ujVkWa+0Xh0/ccznIdlMpq9VkL1eWVVR84qJwcisVUcf8SHCV399D nPWgZZnFR5gmWAl+td6pbueggYPbCc50Y7dnhkzPUDbi7jn1T4opCp8D3sjVIWuI7OzW0x f38SJjSrnUCZq42xrcMNYm6Z1xqEUJYWcr3Ro3+QAuOiOy8S5rHziNwglYLIuOGyKW3MB9 7648lNpiG7x98wrKtTdKXRY7KAbVtkdS5najUeIyUp5E3x9nh3ZmmaAWnQibMBTWxzT6wW Z9K7eNAzdS+BIfAPrJEKqdQc3hGGDGSjGhZ4Jegnvl/XJtiIWBXv78/1E0uZRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+o25H69hxQ3et0t8XhmqwxS4xlWzsx6yNtG2ujCPpYU=; b=UKAk1iDBEj/WSYswhCbPqAnG4ornSSZGPRCqWbp3u0GxxxDhF/eSWY9tV+oK+sx7nB1VjT ePBvh1ez7aS+ywJ+sywnfVsrhp6gHM2Cs+KPb0BXfWU5GeQ/GodwwuGrAGNFG4imljOVjT MZ6mbCbg5hsB+iMsV5xNJnJtNo8iBEcYJpn+hGo0kY0GuIjsbtyasXWLRYqMH/7H3yvo2C f1BUUwMQnnEFMfyXM0DyyUhh/etSm0qES4nYv5r7m4/xqaxO8fgkKOmmdX5fe/rYz1G06e qILykXGPYjk0hx2T0Z1GkOiEmpNdYWSDAu1p/Yk4EreyyEQHxY68iYZKjt5EZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709467; a=rsa-sha256; cv=none; b=gWh688OZaWjNpWe4lOmcHKvQuH6Vow8DjHbTrzqNHEhmPr1GHAhnpfxhE+Ek+55WzmHrjX SMs0mc2pNeVQ5Z8JZIX/PK8kXJiTmKnzQWifFjHzYwQFDtRcKAqxd4h3+2QHDtyOVDCZa8 xIjNUOzTnzxuSl6jY3TEh9yYXD20Raop6Bl2HNtZ8Upp9LowYu2bMp4ecJwbyueQ/qd+pR jkCoPDUydfLO4I0Kf0B4lJlynTm7T7S6Je8yofzmG78qem244P+XdGC4SToIOW/7UHBdea DCQVGX0sR4KhucptoBSMZTJsFZSRpyekANfyn8lL0mpt8FvzSNIgV5mhbFNARw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKB30VmNznfC; Mon, 28 Jul 2025 13:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDV7xj079855; Mon, 28 Jul 2025 13:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDV7GU079852; Mon, 28 Jul 2025 13:31:07 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:07 GMT Message-Id: <202507281331.56SDV7GU079852@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: 68d289075c76 - stable/14 - sys/param.h: Split some macros into new List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 68d289075c766bd742913023a56569863121021b Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=68d289075c766bd742913023a56569863121021b commit 68d289075c766bd742913023a56569863121021b Author: Olivier Certner AuthorDate: 2025-06-06 20:25:21 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:27:52 +0000 sys/param.h: Split some macros into new Goal is to avoid having to include the full just to get some common useful macros. More macros can be moved into it as needed. This is in preparation for using NBBY and howmany() from . Reviewed by: kib, imp (both older version) MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50880 (cherry picked from commit b93161a7e38d37ce560ca562b1f1c18f73551cc2) --- sys/sys/_param.h | 28 ++++++++++++++++++++++++++++ sys/sys/param.h | 15 ++------------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/sys/sys/_param.h b/sys/sys/_param.h new file mode 100644 index 000000000000..a7ea071c456a --- /dev/null +++ b/sys/sys/_param.h @@ -0,0 +1,28 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + */ + +#ifndef _SYS__PARAM_H_ +#define _SYS__PARAM_H_ + +#define NBBY 8 /* number of bits in a byte */ +#define NBPW sizeof(int) /* number of bytes per word (integer) */ + +/* + * Macros for counting and rounding. + */ +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#define rounddown(x, y) (((x)/(y))*(y)) +#define rounddown2(x, y) __align_down(x, y) /* if y is power of two */ +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ +#define roundup2(x, y) __align_up(x, y) /* if y is powers of two */ +#define powerof2(x) ((((x)-1)&(x))==0) + +#endif /* _SYS__PARAM_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 68cbc92b5791..74490f5e6e0e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -40,6 +40,7 @@ #define _SYS_PARAM_H_ #include +#include #define BSD 199506 /* System version (year & month). */ #define BSD4_3 1 @@ -251,9 +252,6 @@ #define NZERO 0 /* default "nice" */ -#define NBBY 8 /* number of bits in a byte */ -#define NBPW sizeof(int) /* number of bytes per word (integer) */ - #define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ #define NODEV (dev_t)(-1) /* non-existent device */ @@ -317,16 +315,7 @@ #define isclr(a,i) \ ((((const unsigned char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0) -/* Macros for counting and rounding. */ -#ifndef howmany -#define howmany(x, y) (((x)+((y)-1))/(y)) -#endif -#define nitems(x) (sizeof((x)) / sizeof((x)[0])) -#define rounddown(x, y) (((x)/(y))*(y)) -#define rounddown2(x, y) __align_down(x, y) /* if y is power of two */ -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ -#define roundup2(x, y) __align_up(x, y) /* if y is powers of two */ -#define powerof2(x) ((((x)-1)&(x))==0) +/* Macros for counting and rounding provided by . */ /* Macros for min/max. */ #define MIN(a,b) (((a)<(b))?(a):(b)) From nobody Mon Jul 28 13:31:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKB44d9Gz634vW; Mon, 28 Jul 2025 13:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKB42MMyz3tDd; Mon, 28 Jul 2025 13:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zTqj4DKyDqXD6giLw6lwz9FQ4wZGKhsxw2QMIgt3T9Q=; b=fY0X6+CB+wdRrom/zhxwOnFo3cYwO12rlpS2tWGECXnFW8YuDkVO23mN8HynFHWN6ITwfy VtNBNAbSqL7CMVFsuqeOs208phV8Ck8hCGBW6P89GE7j8Vz/vMGRfnmQ/VTHv5tKu/lsF0 CA1oMUok0V5tXEMEmPw2uLFaghE6YN+e4hu8ytRj0/HX/9VUVeztfFJcsm5HEYcJ5JGalr rSY8QwGH14NMEgVxuvqjAiJ0Tp0AxO0bAaY8XT+jY4R0RnZusj4Alm605jvzw9l79Dht05 eTbgaCmm0zKDl6M7FzkO7ptZXlBWDQllAxY0dsgZjz64R6o3WpbkzW0elBjk7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zTqj4DKyDqXD6giLw6lwz9FQ4wZGKhsxw2QMIgt3T9Q=; b=dKFtYecV4rMfmizWqCFFprXJ+8AAq1MYzxaDcilYY1a8p/uPd85Ee3yw3zGAKMP5vBN0bI qX6J9aHTY2ucXbYYDamwGiXF+63WoPfuhn8gmbUn3ffgX6Sd5IMB/TYSICBC72w9NZAOqk 2NMVV9WXsErxr48i1/99uUXIPG+95/+RavBbfPZCd8XY1beN6xEdsmwAnYTMq8lhTwbJvl XzB2WunquCUlaEbw8U4PMFsntGCYDQnR52hSJmVePaw+Z19YKfNtExTK6aA63oeu55o6GK K5ht0OgqCc2ZGmNxYahzna3f80IvUTd5v4rNpRQSvbfHH17Ba0WPDl4urv5ByQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709468; a=rsa-sha256; cv=none; b=md43TV0XDHD6IRGyBP7Ft0732dWMdCMQRbjfG8ve7WE608lQ3pnrVXUQDmi/yTWqGn43vN V7Uqj0pTkAd/ZWCc7c90jdHBiXV1OQFIJNHws4yUS+t/GOUtkTzPWaHLWJ+bvsrv3tViF7 YhYUJbx9j9E6XcN6pDw8UUEz6gcSbzXMLXk9cwOs/W7BF2FQKU/DXWVLsry/tT6/YOgyNJ 7BT8r9ZY+Y5d4+g0R8BtWCQ8OX+3CWROJ5/fo6qHFtg1W0vQfJXx6WfzHwseWGKfN9D9Zf 4ZLNYCLEJtKuVbxiTj8HcH5eg5lqot3X+FyNgugeq0UKXCzODY0bMUeqFhAG7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKB41BWHznfD; Mon, 28 Jul 2025 13:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDV8dT079889; Mon, 28 Jul 2025 13:31:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDV8bm079886; Mon, 28 Jul 2025 13:31:08 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:08 GMT Message-Id: <202507281331.56SDV8bm079886@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: fac3e1d3bc19 - stable/14 - runq: Deduce most parameters, remove machine headers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fac3e1d3bc1900617c1995289b2eefaf55e96c68 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fac3e1d3bc1900617c1995289b2eefaf55e96c68 commit fac3e1d3bc1900617c1995289b2eefaf55e96c68 Author: Olivier Certner AuthorDate: 2024-02-26 18:12:42 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:27:58 +0000 runq: Deduce most parameters, remove machine headers The 'runq' machinery now depends on only two settable parameters, RQ_MAX_PRIO, the maximum priority number that can be accepted, the minimum being 0, and RQ_PPQ, the number of priorities per queue (to reduce the number of queues). All other parameters are deduced from these ones. Also, all architectures automatically get a runq word that is their natural word. RQB_FFS() always was 'ffsl() - 1' except for amd64 where it was 'bsfq()'. Now that all these finally call compiler builtins, the resulting assembly code is the same, so there is no cost to removing this special case. After all these changes, headers have no more purpose, so remove them. While here, fix potentially confusing parameter name for RQB_WORD() and RQB_BIT(). While here, include all necessary headers so that can be included standalone. No functional change (intended). Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 2fefe2c88b31dc7f173c9424f3eb13d49e98d55a) --- sys/amd64/include/runq.h | 46 -------------------------------------- sys/arm/include/runq.h | 46 -------------------------------------- sys/arm64/include/runq.h | 50 ----------------------------------------- sys/i386/include/runq.h | 46 -------------------------------------- sys/kern/kern_switch.c | 6 ++--- sys/kern/sched_ule.c | 6 ++--- sys/powerpc/include/runq.h | 55 ---------------------------------------------- sys/riscv/include/runq.h | 44 ------------------------------------- sys/sys/runq.h | 25 ++++++++++++++++++--- 9 files changed, 27 insertions(+), 297 deletions(-) diff --git a/sys/amd64/include/runq.h b/sys/amd64/include/runq.h deleted file mode 100644 index 8d3b55be11a8..000000000000 --- a/sys/amd64/include/runq.h +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2001 Jake Burkholder - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 _MACHINE_RUNQ_H_ -#define _MACHINE_RUNQ_H_ - -#define RQB_LEN (1) /* Number of priority status words. */ -#define RQB_L2BPW (6) /* Log2(sizeof(rqb_word_t) * NBBY)). */ -#define RQB_BPW (1<> RQB_L2BPW) - -#define RQB_FFS(word) (bsfq(word)) - -/* - * Type of run queue status word. - */ -typedef u_int64_t rqb_word_t; - -#endif diff --git a/sys/arm/include/runq.h b/sys/arm/include/runq.h deleted file mode 100644 index c461a0702599..000000000000 --- a/sys/arm/include/runq.h +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2001 Jake Burkholder - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 _MACHINE_RUNQ_H_ -#define _MACHINE_RUNQ_H_ - -#define RQB_LEN (2) /* Number of priority status words. */ -#define RQB_L2BPW (5) /* Log2(sizeof(rqb_word_t) * NBBY)). */ -#define RQB_BPW (1<> RQB_L2BPW) - -#define RQB_FFS(word) (ffs(word) - 1) - -/* - * Type of run queue status word. - */ -typedef u_int32_t rqb_word_t; - -#endif diff --git a/sys/arm64/include/runq.h b/sys/arm64/include/runq.h deleted file mode 100644 index 5076bd9169df..000000000000 --- a/sys/arm64/include/runq.h +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * Copyright (c) 2001 Jake Burkholder - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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. - */ - -#ifdef __arm__ -#include -#else /* !__arm__ */ - -#ifndef _MACHINE_RUNQ_H_ -#define _MACHINE_RUNQ_H_ - -#define RQB_LEN (1) /* Number of priority status words. */ -#define RQB_L2BPW (6) /* Log2(sizeof(rqb_word_t) * NBBY)). */ -#define RQB_BPW (1<> RQB_L2BPW) - -#define RQB_FFS(word) (ffsl(word) - 1) - -/* - * Type of run queue status word. - */ -typedef unsigned long rqb_word_t; - -#endif - -#endif /* !__arm__ */ diff --git a/sys/i386/include/runq.h b/sys/i386/include/runq.h deleted file mode 100644 index c461a0702599..000000000000 --- a/sys/i386/include/runq.h +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2001 Jake Burkholder - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 _MACHINE_RUNQ_H_ -#define _MACHINE_RUNQ_H_ - -#define RQB_LEN (2) /* Number of priority status words. */ -#define RQB_L2BPW (5) /* Log2(sizeof(rqb_word_t) * NBBY)). */ -#define RQB_BPW (1<> RQB_L2BPW) - -#define RQB_FFS(word) (ffs(word) - 1) - -/* - * Type of run queue status word. - */ -typedef u_int32_t rqb_word_t; - -#endif diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 191d58edf4c4..610566bcfacf 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -57,8 +57,6 @@ #endif #endif -CTASSERT((RQB_BPW * RQB_LEN) == RQ_NQS); - /* * kern.sched.preemption allows user space to determine if preemption support * is compiled in or not. It is not currently a boot or runtime flag that @@ -297,7 +295,7 @@ runq_findbit(struct runq *rq) rqb = &rq->rq_status; for (i = 0; i < RQB_LEN; i++) if (rqb->rqb_bits[i]) { - pri = RQB_FFS(rqb->rqb_bits[i]) + (i << RQB_L2BPW); + pri = RQB_FFS(rqb->rqb_bits[i]) + i * RQB_BPW; CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d pri=%d", rqb->rqb_bits[i], i, pri); return (pri); @@ -323,7 +321,7 @@ again: mask = rqb->rqb_bits[i] & mask; if (mask == 0) continue; - pri = RQB_FFS(mask) + (i << RQB_L2BPW); + pri = RQB_FFS(mask) + i * RQB_BPW; CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d pri=%d", mask, i, pri); return (pri); diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 1aa95e984033..b30e3ac673f5 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -397,7 +397,7 @@ runq_print(struct runq *rq) i, rq->rq_status.rqb_bits[i]); for (j = 0; j < RQB_BPW; j++) if (rq->rq_status.rqb_bits[i] & (1ul << j)) { - pri = j + (i << RQB_L2BPW); + pri = j + i * RQB_BPW; rqh = &rq->rq_queues[pri]; TAILQ_FOREACH(td, rqh, td_runq) { printf("\t\t\ttd %p(%s) priority %d rqindex %d pri %d\n", @@ -1203,7 +1203,7 @@ again: for (; bit < RQB_BPW; bit++) { if ((rqb->rqb_bits[i] & (1ul << bit)) == 0) continue; - rqh = &rq->rq_queues[bit + (i << RQB_L2BPW)]; + rqh = &rq->rq_queues[bit + i * RQB_BPW]; TAILQ_FOREACH(td, rqh, td_runq) { if (first) { if (THREAD_CAN_MIGRATE(td) && @@ -1244,7 +1244,7 @@ runq_steal(struct runq *rq, int cpu) for (bit = 0; bit < RQB_BPW; bit++) { if ((rqb->rqb_bits[word] & (1ul << bit)) == 0) continue; - rqh = &rq->rq_queues[bit + (word << RQB_L2BPW)]; + rqh = &rq->rq_queues[bit + word * RQB_BPW]; TAILQ_FOREACH(td, rqh, td_runq) if (THREAD_CAN_MIGRATE(td) && THREAD_CAN_SCHED(td, cpu)) diff --git a/sys/powerpc/include/runq.h b/sys/powerpc/include/runq.h deleted file mode 100644 index 83ffacde4053..000000000000 --- a/sys/powerpc/include/runq.h +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2001 Jake Burkholder - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 _MACHINE_RUNQ_H_ -#define _MACHINE_RUNQ_H_ - -#ifdef __powerpc64__ -#define RQB_LEN (1UL) /* Number of priority status words. */ -#define RQB_L2BPW (6UL) /* Log2(sizeof(rqb_word_t) * NBBY)). */ -#else -#define RQB_LEN (2) /* Number of priority status words. */ -#define RQB_L2BPW (5) /* Log2(sizeof(rqb_word_t) * NBBY)). */ -#endif -#define RQB_BPW (1UL<> RQB_L2BPW) - -#define RQB_FFS(word) (ffsl(word) - 1) - -/* - * Type of run queue status word. - */ -#ifdef __powerpc64__ -typedef u_int64_t rqb_word_t; -#else -typedef u_int32_t rqb_word_t; -#endif - -#endif diff --git a/sys/riscv/include/runq.h b/sys/riscv/include/runq.h deleted file mode 100644 index 3a7de010cd72..000000000000 --- a/sys/riscv/include/runq.h +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * Copyright (c) 2001 Jake Burkholder - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 _MACHINE_RUNQ_H_ -#define _MACHINE_RUNQ_H_ - -#define RQB_LEN (1) /* Number of priority status words. */ -#define RQB_L2BPW (6) /* Log2(sizeof(rqb_word_t) * NBBY)). */ -#define RQB_BPW (1<> RQB_L2BPW) - -#define RQB_FFS(word) (ffsl(word) - 1) - -/* - * Type of run queue status word. - */ -typedef unsigned long rqb_word_t; - -#endif diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 1a54e83a7db3..d40fee25846e 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -29,7 +29,14 @@ #ifndef _RUNQ_H_ #define _RUNQ_H_ -#include +#include +#include + +#ifdef _KERNEL +#include +#else +#include +#endif struct thread; @@ -37,8 +44,20 @@ struct thread; * Run queue parameters. */ -#define RQ_NQS (64) /* Number of run queues. */ -#define RQ_PPQ (4) /* Priorities per queue. */ +#define RQ_MAX_PRIO (255) /* Maximum priority (minimum is 0). */ +#define RQ_PPQ (4) /* Priorities per queue. */ + +/* + * Deduced from the above parameters and machine ones. + */ +typedef unsigned long rqb_word_t; /* runq's status words type. */ + +#define RQ_NQS (howmany(RQ_MAX_PRIO + 1, RQ_PPQ)) /* Number of run queues. */ +#define RQB_BPW (sizeof(rqb_word_t) * NBBY) /* Bits per runq word. */ +#define RQB_LEN (howmany(RQ_NQS, RQB_BPW)) /* Words to cover RQ_NQS queues. */ +#define RQB_WORD(idx) ((idx) / RQB_BPW) +#define RQB_BIT(idx) (1ul << ((idx) % RQB_BPW)) +#define RQB_FFS(word) (ffsl((long)(word)) - 1) /* Assumes two-complement. */ /* * Head of run queues. From nobody Mon Jul 28 13:31:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKB60FGyz634yF; Mon, 28 Jul 2025 13:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKB54jK3z3tBJ; Mon, 28 Jul 2025 13:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SXKCrmdvD5uf+moFyvJPcZsUlgX2/dihjNuZiWC/92A=; b=lxJtrOxJBeCMP7McV9j+ROAS4gQXnxM1CTb1YsdEApVaFNaKqIvC4UQhNpvH13qgctiuq1 nM7k0u+oQY86ZXziFQwV060BNlDOUG13Kufmu0AAZkOo7/P3OAw+egF85GoJWr8MqUFfAP /K9+krFjWUfnWKyRemhnzW8nNYcV/Zv5nvakvwdGq/oL21uBfGSIKXlqE80mDweJtUlu/B 5QhhZBeNG0Snm3rmI2Nmx6GVfy4Rah95lgQV6kpGJifju3ej+2hWNIOCqALPR4qCgFKAy2 iWRJ9yHd+oKuHOa/cpbwcmtPo6zGEzjBX9Y8zPUK2WJIXAfB7pO+Ni87RkpL9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SXKCrmdvD5uf+moFyvJPcZsUlgX2/dihjNuZiWC/92A=; b=G3mof4PRyC3CY86PugtkcD6xWkE6Rv2UjPtDdJdvSCK+q7uTYO8nQhKrC7iI2blndoHYEw +SkOcVJs4zv5DK7vlbfGi8H9IzKPyd0wY8yFayyKN8HD8uypwyU5KkJWvIi9MOmbt9I8Id l5cZftvCkQH8OvYbX44zaXZeCUudzc/ZD1XjSOo1pvy/Ay0zhGksvcbZBB0QlTTX2G1/nd lE7Ztw+82eCGiuEba4Hcvbi5DzkWnt61SDQd1qeLOvw5Vx/k1xcWfnbydwvUkQ40KKcF2E Z5EDmA1UKI6MQzMPOHwAM5FyDH1dMSNdGEjROGzXhli+r2P4L+WVgqnf597GnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709469; a=rsa-sha256; cv=none; b=rJLfa7ioogNcuPUN32A62srbf9gR4SuwW7xlOmKl6IOJ0kgqu+kwr/B6OPVYBX7XrFHIoZ oxJuEI3MViTGTl3dDP2Inm0TYS8rcvaact87JH5uy0ut7YG4GeGYY4EbInw5HCvrvZZo3L X8+TfIdxUKosT1xNzEN+R32SKKJWhwSgit8NmCtt1yVaHwk2lwk44EQwHMEXOXs01WM66l CtwNKBYYd2ND1ioYYOSEShewe7X2I98N1coi6z1E8M4hNRMSmdWKPnlwtGV8bH/wcuaqL3 XSYB5ZQ22kkX5ymkVmw7bH3VEfr50zLqgHTcnRDDPwUWoLq/8NlTlYldgWE/vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKB52RbvznFx; Mon, 28 Jul 2025 13:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDV9uT079922; Mon, 28 Jul 2025 13:31:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDV9pk079919; Mon, 28 Jul 2025 13:31:09 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:09 GMT Message-Id: <202507281331.56SDV9pk079919@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: 3f5f50ca526f - stable/14 - runq: More selective includes of to reduce pollution List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f5f50ca526fd485aacf0198c6f1ecc948e4bade Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3f5f50ca526fd485aacf0198c6f1ecc948e4bade commit 3f5f50ca526fd485aacf0198c6f1ecc948e4bade Author: Olivier Certner AuthorDate: 2024-03-27 17:54:54 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:00 +0000 runq: More selective includes of to reduce pollution doesn't need . Remove this include and add it back for kernel files that relied on the pollution. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit c21c24adde9822a7f364e131ad7b0c4008723502) --- sys/dev/usb/usb_process.h | 1 - sys/kern/kern_switch.c | 1 + sys/kern/sched_4bsd.c | 1 + sys/kern/sched_ule.c | 1 + sys/sys/proc.h | 1 - 5 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/usb_process.h b/sys/dev/usb/usb_process.h index 745d214d2106..1962bdb8b607 100644 --- a/sys/dev/usb/usb_process.h +++ b/sys/dev/usb/usb_process.h @@ -31,7 +31,6 @@ #ifndef USB_GLOBAL_INCLUDE_FILE #include #include -#include #endif /* defines */ diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 610566bcfacf..58dfc8fc8497 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index ff1e57746404..bd8da419736a 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index b30e3ac673f5..c3b980dd2924 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 4981a5894941..a094af09a21a 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -55,7 +55,6 @@ #include #include #include /* XXX. */ -#include #include #include #include From nobody Mon Jul 28 13:31:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKB83QfPz634n5; Mon, 28 Jul 2025 13:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKB70TjFz3tDx; Mon, 28 Jul 2025 13:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MiLz85OTmOwdDybECKhTFf4LBiDzMbq2wA1qPTgjZ8s=; b=ou3YGMcONJEo8tSll2RdrpcCW5rZ8wuvtHc1dAJWJRu8TpvjjtXd59bKdkis+xpODn9ELJ CEf36me/eSmlPpurVUZAjPxvH74KLV+WVBOJ07Wr+VZCyJOlk9aZ+sOG9EO5x708Cj7qYW pN657uUSXtxyD8nVerY4yVxirZ698zJ27ULHxETjaYiWGQ2lqnxXzex4g6izA/mMahSCA5 NMQ4qNzdlPzACwv2yTwLiTwK5Zq26+utA2i8CQzLmY31Nhkpc/4tj078ta6q2qMJ5AxQhf V64eWvWx2Iw8UZK/rnD8MoBelhgV58exGrQzne0X4htJMy2NI8Z1MvMCM8pMIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MiLz85OTmOwdDybECKhTFf4LBiDzMbq2wA1qPTgjZ8s=; b=IvocnxePQfoQRSFVmIuSCUIi9E6b5d+QX9iznMQx2sMUApeXnbXRqtktu6jOPfHZEb0Qup G1rd8Bnnzfr3Uj2lOK0hFRT7iCTh56iVqUX+pIutYBijb7BhYtX2HfWVwHH6952TzCgzcd IltVLB46xTrdLn05OlL/0RIdsOS5SL5ha3iXgIhyePpkGYpee5G5N7FJXNXnAtXmaJI6Nk qG5cpNT2vVL+HdqrVoFfcPi2best+CYvVrljkGG7W5LxHLs7dLWh4lz1uCzd2kxlwOIipB GrWkVZqCLH+3RbBEb9agHRwfAtkYpRSevQdddP9hOxDOMV26kHH6nb+FCM7C7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709471; a=rsa-sha256; cv=none; b=ZgdHiyh2hCbKdZ31WGskTUSU4avDoN33WzPO+I01eQAB331TIV8sCpT82ErhOWplzxfU+7 KTdPaQZGdCJr46FUl0E5ImdjUJ5UC//oi6uEIgQwQ3Hj7uLNyP0yuk89HlZXuLZ+DmiNiS I7RXtCp1r7ppbIbcnTVNsnbQXmPBqMBS6KhpLETUdvR+iDs5ucgLVh/4ijRqIWk98d3QSC +EKDAduOvBQLoHAYawjnzhh2YD1/Wmq8lpJZDtZqQrndoKTd9G8MauBNpRENp5IYxl0enm w+hekO61ot/0MWZF/pGugOgCfjf5MbP5ug7l/c8xEfMPNz/4E1jjDmY3K9sTkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKB63JMBznfF; Mon, 28 Jul 2025 13:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVAdq079958; Mon, 28 Jul 2025 13:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVAaB079955; Mon, 28 Jul 2025 13:31:10 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:10 GMT Message-Id: <202507281331.56SDVAaB079955@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: 3020792db818 - stable/14 - runq: Hide function prototypes under _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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3020792db81819455f3b9ad6ca29f420c54e6971 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3020792db81819455f3b9ad6ca29f420c54e6971 commit 3020792db81819455f3b9ad6ca29f420c54e6971 Author: Olivier Certner AuthorDate: 2024-03-28 13:32:17 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:01 +0000 runq: Hide function prototypes under _KERNEL And some structure definitions as well. This header really is not supposed to be included by userland, so should just error in this case. However, there is one remaining use for it in a test: Getting the value of RQ_PPQ to ensure a big enough priority level difference in order to guarantee that a realtime thread preempts another. This use will soon be obsoleted by guaranteeing that a realtime thread always preempts another one with lower priority, even if the priority level is very close. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 28b54827f5c10212de752a8e2c4eaf07170d242c) --- sys/sys/runq.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/sys/runq.h b/sys/sys/runq.h index d40fee25846e..b9cfa847617b 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -30,7 +30,6 @@ #define _RUNQ_H_ #include -#include #ifdef _KERNEL #include @@ -38,8 +37,6 @@ #include #endif -struct thread; - /* * Run queue parameters. */ @@ -59,6 +56,12 @@ typedef unsigned long rqb_word_t; /* runq's status words type. */ #define RQB_BIT(idx) (1ul << ((idx) % RQB_BPW)) #define RQB_FFS(word) (ffsl((long)(word)) - 1) /* Assumes two-complement. */ + +#ifdef _KERNEL +#include + +struct thread; + /* * Head of run queues. */ @@ -90,5 +93,6 @@ struct thread *runq_choose_fuzz(struct runq *, int); void runq_init(struct runq *); void runq_remove(struct runq *, struct thread *); void runq_remove_idx(struct runq *, struct thread *, u_char *); +#endif /* _KERNEL */ #endif From nobody Mon Jul 28 13:31:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKB91vwjz634vY; Mon, 28 Jul 2025 13:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKB74g5dz3tN2; Mon, 28 Jul 2025 13:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o4UBIjDp/xuFGSJqD14xAevRmboeDlpgrNH1d3Xq2ec=; b=B7mXg8T+cQVjewAxJOGs6bY6FgXllpZFUUdydSfglRXp9cR2BWejKPo733EGskTSx16H6Y rU2Y/BlzcGh0t2L4Pz/+SGgGasaSiaQp5jDtjTwsAJby1tC/YPYKmVLAi6MOM6ZXn2ZYbh ypaYCY7Vi3AYehEEpdkutqEBjmM2csR8/ETbLCj2gvK+O4kgEOq1nF7CH0nZv7FwrQZnIf AmD2eHkhdheQVAg50/hCX/fZDdu00x1CTJQpUugt5vCt9/BX0WSB5LZ8QK+OkzfoEr9eTg fUsXJD5/YssDYVtPEt24tkQKUSJKJAvdTlrJDOpQY+QKNRXETRdHB34KYQWmmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o4UBIjDp/xuFGSJqD14xAevRmboeDlpgrNH1d3Xq2ec=; b=Ttiu3pujESHIZZE0zZlmDKTVtc4LjCFsWTFBWXW2SVIxGncnYqTOOnWasT7VR6Dn0p84SU /8JNeikUpLXiRR4IX9wFPvzc7gL0u1jYPJUckiFgTAdBfHnHgYm9jVUvSRk6cEhi8etvix JhlPBFiTHKxnr7M5LhrcofXwQjoaA+a/OhxUYcOwRh5z/riopFL9nOEJGDD733PoBBbdFX MH1EUdjbPwgObhAzt2S5D5q1EwvftN9fz3dgEDc/8TDWUk8eKDBw0hAu7p4niH+UcWg95A h8ovBMPLHT6s0iHZ7UzscTPlJo4SwjyEYC8b+yCO6Pm2hRGo3hKMAkrl8QrMsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709471; a=rsa-sha256; cv=none; b=CWzbc8TiODzTmHypinRrsgk/BkMCH65HRfCrrZlTj5fRjt8INGqRUb1FDTIDunaZfGBSOM cCnW4+8S1OguOGIQp85Qs8vD4zVumrKW5CNHmDyiz47CwPgMnTPsCXxgwGtkh2CHvQe/uV OxOvq8GAU5fC35YXCwP8qDrA7/2Z2m4y5KwsmJEW5XwdmDPxnid8Z6OD9uZoT8cC250Nj3 /juKRi/ww6Wax/QI9W0i7EZ+qLQwjjtLbErRy6Nj4g+0hmvAbewSZQwxTucgMdNboj5cXU e2Svp5TEtzs17RVbvIgzU2PQVy5Y80ZeHiMP4a8SzjqMsKSjdEUFJ/RKiQvu/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKB73zQKznfH; Mon, 28 Jul 2025 13:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVBAi079993; Mon, 28 Jul 2025 13:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVBQ3079990; Mon, 28 Jul 2025 13:31:11 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:11 GMT Message-Id: <202507281331.56SDVBQ3079990@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: 55731b34c3ff - stable/14 - runq: API tidy up: 'pri' => 'idx', 'idx' as int, remove runq_remove_idx() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 55731b34c3ffa651c7b4bb78ff797e58d95a8b59 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=55731b34c3ffa651c7b4bb78ff797e58d95a8b59 commit 55731b34c3ffa651c7b4bb78ff797e58d95a8b59 Author: Olivier Certner AuthorDate: 2024-02-27 17:44:12 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:03 +0000 runq: API tidy up: 'pri' => 'idx', 'idx' as int, remove runq_remove_idx() Make sure that external and internal users are aware that the runqueue API always expects queue indices, and not priority levels. Name arithmetic arguments in 'runq.h' for better immediate reference. Use plain integers to pass indices instead of 'u_char' (using the latter probably doesn't bring any gain, and an 'int' makes the API agnostic to a number of queues greater than 256). Add a static assertion that RQ_NQS can't be strictly greater than 256 as long as the 'td_rqindex' thread field is of type 'u_char'. Add a new macro CHECK_IDX() that checks that an index is non-negative and below RQ_NQS, and use it in all low-level functions (and "public" ones when they don't need to call the former). While here, remove runq_remove_idx(), as it knows a bit too much of ULE's internals, in particular by treating the whole runqueue as round-robin, which we are going to change. Instead, have runq_remove() return whether the queue from which the thread was removed is now empty, and leverage this information in tdq_runq_rem() (sched_ule(4)). While here, re-implement runq_add() on top of runq_add_idx() to remove its duplicated code (all lines except one). Introduce the new RQ_PRI_TO_IDX() macro to convert a priority to a queue index, and use it in runq_add() (many more uses will be introduced in later commits). While here, rename runq_check() to runq_not_empty() and have it return a boolean instead of an 'int', and same for sched_runnable() as an impact (and while here, fix a small style violation in sched_4bsd(4)'s version). While here, simplify sched_runnable(). While here, make standalone include-wise. No functional change intended. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit a11926f2a5f00b57ebff5bd548c9904b7f6e5800) --- sys/kern/kern_switch.c | 199 ++++++++++++++++++++++++------------------------- sys/kern/sched_4bsd.c | 11 +-- sys/kern/sched_ule.c | 37 ++++----- sys/sys/runq.h | 16 ++-- sys/sys/sched.h | 11 ++- 5 files changed, 137 insertions(+), 137 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 58dfc8fc8497..5c529862bc53 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -252,6 +252,15 @@ critical_exit_KBI(void) /************************************************************************ * SYSTEM RUN QUEUE manipulations and tests * ************************************************************************/ +_Static_assert(RQ_NQS <= 256, + "'td_rqindex' must be turned into a bigger unsigned type"); +/* A macro instead of a function to get the proper calling function's name. */ +#define CHECK_IDX(idx) ({ \ + __typeof(idx) _idx __unused = (idx); \ + KASSERT(0 <= _idx && _idx < RQ_NQS, \ + ("%s: %s out of range: %d", __func__, __STRING(idx), _idx)); \ +}) + /* * Initialize a run structure. */ @@ -266,92 +275,93 @@ runq_init(struct runq *rq) } /* - * Clear the status bit of the queue corresponding to priority level pri, - * indicating that it is empty. + * Clear the status bit of the queue at index 'idx', indicating that it is + * empty. */ static __inline void -runq_clrbit(struct runq *rq, int pri) +runq_clrbit(struct runq *rq, int idx) { struct rqbits *rqb; + CHECK_IDX(idx); rqb = &rq->rq_status; CTR4(KTR_RUNQ, "runq_clrbit: bits=%#x %#x bit=%#x word=%d", - rqb->rqb_bits[RQB_WORD(pri)], - rqb->rqb_bits[RQB_WORD(pri)] & ~RQB_BIT(pri), - RQB_BIT(pri), RQB_WORD(pri)); - rqb->rqb_bits[RQB_WORD(pri)] &= ~RQB_BIT(pri); + rqb->rqb_bits[RQB_WORD(idx)], + rqb->rqb_bits[RQB_WORD(idx)] & ~RQB_BIT(idx), + RQB_BIT(idx), RQB_WORD(idx)); + rqb->rqb_bits[RQB_WORD(idx)] &= ~RQB_BIT(idx); } /* * Find the index of the first non-empty run queue. This is done by - * scanning the status bits, a set bit indicates a non-empty queue. + * scanning the status bits, a set bit indicating a non-empty queue. */ static __inline int runq_findbit(struct runq *rq) { struct rqbits *rqb; - int pri; - int i; + int idx, i; rqb = &rq->rq_status; for (i = 0; i < RQB_LEN; i++) if (rqb->rqb_bits[i]) { - pri = RQB_FFS(rqb->rqb_bits[i]) + i * RQB_BPW; - CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d pri=%d", - rqb->rqb_bits[i], i, pri); - return (pri); + idx = RQB_FFS(rqb->rqb_bits[i]) + i * RQB_BPW; + CHECK_IDX(idx); + CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d idx=%d", + rqb->rqb_bits[i], i, idx); + return (idx); } return (-1); } static __inline int -runq_findbit_from(struct runq *rq, u_char pri) +runq_findbit_from(struct runq *rq, int idx) { struct rqbits *rqb; rqb_word_t mask; int i; - /* - * Set the mask for the first word so we ignore priorities before 'pri'. - */ - mask = (rqb_word_t)-1 << (pri & (RQB_BPW - 1)); + CHECK_IDX(idx); + /* Set the mask for the first word so we ignore indices before 'idx'. */ + mask = (rqb_word_t)-1 << (idx & (RQB_BPW - 1)); rqb = &rq->rq_status; again: - for (i = RQB_WORD(pri); i < RQB_LEN; mask = -1, i++) { + for (i = RQB_WORD(idx); i < RQB_LEN; mask = -1, i++) { mask = rqb->rqb_bits[i] & mask; if (mask == 0) continue; - pri = RQB_FFS(mask) + i * RQB_BPW; - CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d pri=%d", - mask, i, pri); - return (pri); + idx = RQB_FFS(mask) + i * RQB_BPW; + CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d idx=%d", + mask, i, idx); + return (idx); } - if (pri == 0) + if (idx == 0) return (-1); /* * Wrap back around to the beginning of the list just once so we * scan the whole thing. */ - pri = 0; + idx = 0; goto again; } /* - * Set the status bit of the queue corresponding to priority level pri, - * indicating that it is non-empty. + * Set the status bit of the queue at index 'idx', indicating that it is + * non-empty. */ static __inline void -runq_setbit(struct runq *rq, int pri) +runq_setbit(struct runq *rq, int idx) { struct rqbits *rqb; + CHECK_IDX(idx); rqb = &rq->rq_status; CTR4(KTR_RUNQ, "runq_setbit: bits=%#x %#x bit=%#x word=%d", - rqb->rqb_bits[RQB_WORD(pri)], - rqb->rqb_bits[RQB_WORD(pri)] | RQB_BIT(pri), - RQB_BIT(pri), RQB_WORD(pri)); - rqb->rqb_bits[RQB_WORD(pri)] |= RQB_BIT(pri); + rqb->rqb_bits[RQB_WORD(idx)], + rqb->rqb_bits[RQB_WORD(idx)] | RQB_BIT(idx), + RQB_BIT(idx), RQB_WORD(idx)); + rqb->rqb_bits[RQB_WORD(idx)] |= RQB_BIT(idx); } /* @@ -361,46 +371,38 @@ runq_setbit(struct runq *rq, int pri) void runq_add(struct runq *rq, struct thread *td, int flags) { - struct rqhead *rqh; - int pri; - - pri = td->td_priority / RQ_PPQ; - td->td_rqindex = pri; - runq_setbit(rq, pri); - rqh = &rq->rq_queues[pri]; - CTR4(KTR_RUNQ, "runq_add: td=%p pri=%d %d rqh=%p", - td, td->td_priority, pri, rqh); - if (flags & SRQ_PREEMPTED) { - TAILQ_INSERT_HEAD(rqh, td, td_runq); - } else { - TAILQ_INSERT_TAIL(rqh, td, td_runq); - } + + runq_add_idx(rq, td, RQ_PRI_TO_IDX(td->td_priority), flags); } void -runq_add_pri(struct runq *rq, struct thread *td, u_char pri, int flags) +runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) { struct rqhead *rqh; - KASSERT(pri < RQ_NQS, ("runq_add_pri: %d out of range", pri)); - td->td_rqindex = pri; - runq_setbit(rq, pri); - rqh = &rq->rq_queues[pri]; - CTR4(KTR_RUNQ, "runq_add_pri: td=%p pri=%d idx=%d rqh=%p", - td, td->td_priority, pri, rqh); + /* + * runq_setbit() asserts 'idx' is non-negative and below 'RQ_NQS', and + * a static assert earlier in this file ensures that 'RQ_NQS' is no more + * than 256. + */ + td->td_rqindex = idx; + runq_setbit(rq, idx); + rqh = &rq->rq_queues[idx]; + CTR4(KTR_RUNQ, "runq_add_idx: td=%p pri=%d idx=%d rqh=%p", + td, td->td_priority, idx, rqh); if (flags & SRQ_PREEMPTED) { TAILQ_INSERT_HEAD(rqh, td, td_runq); } else { TAILQ_INSERT_TAIL(rqh, td, td_runq); } } + /* - * Return true if there are runnable processes of any priority on the run - * queue, false otherwise. Has no side effects, does not modify the run - * queue structure. + * Return true if there are some processes of any priority on the run queue, + * false otherwise. Has no side effects. */ -int -runq_check(struct runq *rq) +bool +runq_not_empty(struct runq *rq) { struct rqbits *rqb; int i; @@ -408,13 +410,13 @@ runq_check(struct runq *rq) rqb = &rq->rq_status; for (i = 0; i < RQB_LEN; i++) if (rqb->rqb_bits[i]) { - CTR2(KTR_RUNQ, "runq_check: bits=%#x i=%d", + CTR2(KTR_RUNQ, "runq_not_empty: bits=%#x i=%d", rqb->rqb_bits[i], i); - return (1); + return (true); } - CTR0(KTR_RUNQ, "runq_check: empty"); + CTR0(KTR_RUNQ, "runq_not_empty: empty"); - return (0); + return (false); } /* @@ -425,10 +427,10 @@ runq_choose_fuzz(struct runq *rq, int fuzz) { struct rqhead *rqh; struct thread *td; - int pri; + int idx; - while ((pri = runq_findbit(rq)) != -1) { - rqh = &rq->rq_queues[pri]; + while ((idx = runq_findbit(rq)) != -1) { + rqh = &rq->rq_queues[idx]; /* fuzz == 1 is normal.. 0 or less are ignored */ if (fuzz > 1) { /* @@ -451,10 +453,10 @@ runq_choose_fuzz(struct runq *rq, int fuzz) td = TAILQ_FIRST(rqh); KASSERT(td != NULL, ("runq_choose_fuzz: no proc on busy queue")); CTR3(KTR_RUNQ, - "runq_choose_fuzz: pri=%d thread=%p rqh=%p", pri, td, rqh); + "runq_choose_fuzz: idx=%d thread=%p rqh=%p", idx, td, rqh); return (td); } - CTR1(KTR_RUNQ, "runq_choose_fuzz: idleproc pri=%d", pri); + CTR1(KTR_RUNQ, "runq_choose_fuzz: idleproc idx=%d", idx); return (NULL); } @@ -467,71 +469,64 @@ runq_choose(struct runq *rq) { struct rqhead *rqh; struct thread *td; - int pri; + int idx; - while ((pri = runq_findbit(rq)) != -1) { - rqh = &rq->rq_queues[pri]; + while ((idx = runq_findbit(rq)) != -1) { + rqh = &rq->rq_queues[idx]; td = TAILQ_FIRST(rqh); KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); CTR3(KTR_RUNQ, - "runq_choose: pri=%d thread=%p rqh=%p", pri, td, rqh); + "runq_choose: idx=%d thread=%p rqh=%p", idx, td, rqh); return (td); } - CTR1(KTR_RUNQ, "runq_choose: idlethread pri=%d", pri); + CTR1(KTR_RUNQ, "runq_choose: idlethread idx=%d", idx); return (NULL); } struct thread * -runq_choose_from(struct runq *rq, u_char idx) +runq_choose_from(struct runq *rq, int from_idx) { struct rqhead *rqh; struct thread *td; - int pri; + int idx; - if ((pri = runq_findbit_from(rq, idx)) != -1) { - rqh = &rq->rq_queues[pri]; + if ((idx = runq_findbit_from(rq, from_idx)) != -1) { + rqh = &rq->rq_queues[idx]; td = TAILQ_FIRST(rqh); KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); CTR4(KTR_RUNQ, - "runq_choose_from: pri=%d thread=%p idx=%d rqh=%p", - pri, td, td->td_rqindex, rqh); + "runq_choose_from: idx=%d thread=%p idx=%d rqh=%p", + idx, td, td->td_rqindex, rqh); return (td); } - CTR1(KTR_RUNQ, "runq_choose_from: idlethread pri=%d", pri); + CTR1(KTR_RUNQ, "runq_choose_from: idlethread idx=%d", idx); return (NULL); } /* * Remove the thread from the queue specified by its priority, and clear the * corresponding status bit if the queue becomes empty. - * Caller must set state afterwards. + * + * Returns whether the corresponding queue is empty after removal. */ -void +bool runq_remove(struct runq *rq, struct thread *td) -{ - - runq_remove_idx(rq, td, NULL); -} - -void -runq_remove_idx(struct runq *rq, struct thread *td, u_char *idx) { struct rqhead *rqh; - u_char pri; - - KASSERT(td->td_flags & TDF_INMEM, - ("runq_remove_idx: thread swapped out")); - pri = td->td_rqindex; - KASSERT(pri < RQ_NQS, ("runq_remove_idx: Invalid index %d\n", pri)); - rqh = &rq->rq_queues[pri]; - CTR4(KTR_RUNQ, "runq_remove_idx: td=%p, pri=%d %d rqh=%p", - td, td->td_priority, pri, rqh); + int idx; + + KASSERT(td->td_flags & TDF_INMEM, ("runq_remove: Thread swapped out")); + idx = td->td_rqindex; + CHECK_IDX(idx); + rqh = &rq->rq_queues[idx]; + CTR4(KTR_RUNQ, "runq_remove: td=%p pri=%d idx=%d rqh=%p", + td, td->td_priority, idx, rqh); TAILQ_REMOVE(rqh, td, td_runq); if (TAILQ_EMPTY(rqh)) { - CTR0(KTR_RUNQ, "runq_remove_idx: empty"); - runq_clrbit(rq, pri); - if (idx != NULL && *idx == pri) - *idx = (pri + 1) % RQ_NQS; + runq_clrbit(rq, idx); + CTR1(KTR_RUNQ, "runq_remove: queue at idx=%d now empty", idx); + return (true); } + return (false); } diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index bd8da419736a..c6b789d060c3 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -684,13 +684,14 @@ schedinit_ap(void) /* Nothing needed. */ } -int +bool sched_runnable(void) { #ifdef SMP - return runq_check(&runq) + runq_check(&runq_pcpu[PCPU_GET(cpuid)]); + return (runq_not_empty(&runq) || + runq_not_empty(&runq_pcpu[PCPU_GET(cpuid)])); #else - return runq_check(&runq); + return (runq_not_empty(&runq)); #endif } @@ -872,7 +873,7 @@ sched_priority(struct thread *td, u_char prio) if (td->td_priority == prio) return; td->td_priority = prio; - if (TD_ON_RUNQ(td) && td->td_rqindex != (prio / RQ_PPQ)) { + if (TD_ON_RUNQ(td) && td->td_rqindex != RQ_PRI_TO_IDX(prio)) { sched_rem(td); sched_add(td, SRQ_BORING | SRQ_HOLDTD); } @@ -1683,7 +1684,7 @@ sched_idletd(void *dummy) for (;;) { mtx_assert(&Giant, MA_NOTOWNED); - while (sched_runnable() == 0) { + while (!sched_runnable()) { cpu_idle(stat->idlecalls + stat->oldidlecalls > 64); stat->idlecalls++; } diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index c3b980dd2924..13bef8ca9c1c 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -514,14 +514,14 @@ tdq_runq_add(struct tdq *tdq, struct thread *td, int flags) pri = (unsigned char)(pri - 1) % RQ_NQS; } else pri = tdq->tdq_ridx; - runq_add_pri(ts->ts_runq, td, pri, flags); + runq_add_idx(ts->ts_runq, td, pri, flags); return; } else ts->ts_runq = &tdq->tdq_idle; runq_add(ts->ts_runq, td, flags); } -/* +/* * Remove a thread from a run-queue. This typically happens when a thread * is selected to run. Running threads are not on the queue and the * transferable count does not reflect them. @@ -530,6 +530,7 @@ static __inline void tdq_runq_rem(struct tdq *tdq, struct thread *td) { struct td_sched *ts; + bool queue_empty; ts = td_get_sched(td); TDQ_LOCK_ASSERT(tdq, MA_OWNED); @@ -540,13 +541,16 @@ tdq_runq_rem(struct tdq *tdq, struct thread *td) tdq->tdq_transferable--; ts->ts_flags &= ~TSF_XFERABLE; } - if (ts->ts_runq == &tdq->tdq_timeshare) { - if (tdq->tdq_idx != tdq->tdq_ridx) - runq_remove_idx(ts->ts_runq, td, &tdq->tdq_ridx); - else - runq_remove_idx(ts->ts_runq, td, NULL); - } else - runq_remove(ts->ts_runq, td); + queue_empty = runq_remove(ts->ts_runq, td); + /* + * If thread has a batch priority and the queue from which it was + * removed is now empty, advance the batch's queue removal index if it + * lags with respect to the batch's queue insertion index. + */ + if (queue_empty && PRI_MIN_BATCH <= td->td_priority && + td->td_priority <= PRI_MAX_BATCH && + tdq->tdq_idx != tdq->tdq_ridx && tdq->tdq_ridx == td->td_rqindex) + tdq->tdq_ridx = (tdq->tdq_ridx + 1) % RQ_NQS; } /* @@ -2656,24 +2660,13 @@ sched_estcpu(struct thread *td __unused) * Return whether the current CPU has runnable tasks. Used for in-kernel * cooperative idle threads. */ -int +bool sched_runnable(void) { struct tdq *tdq; - int load; - - load = 1; tdq = TDQ_SELF(); - if ((curthread->td_flags & TDF_IDLETD) != 0) { - if (TDQ_LOAD(tdq) > 0) - goto out; - } else - if (TDQ_LOAD(tdq) - 1 > 0) - goto out; - load = 0; -out: - return (load); + return (TDQ_LOAD(tdq) > (TD_IS_IDLETHREAD(curthread) ? 0 : 1)); } /* diff --git a/sys/sys/runq.h b/sys/sys/runq.h index b9cfa847617b..693a3666d7a8 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -50,6 +50,8 @@ typedef unsigned long rqb_word_t; /* runq's status words type. */ #define RQ_NQS (howmany(RQ_MAX_PRIO + 1, RQ_PPQ)) /* Number of run queues. */ +#define RQ_PRI_TO_IDX(pri) ((pri) / RQ_PPQ) /* Priority to queue index. */ + #define RQB_BPW (sizeof(rqb_word_t) * NBBY) /* Bits per runq word. */ #define RQB_LEN (howmany(RQ_NQS, RQB_BPW)) /* Words to cover RQ_NQS queues. */ #define RQB_WORD(idx) ((idx) / RQB_BPW) @@ -58,6 +60,7 @@ typedef unsigned long rqb_word_t; /* runq's status words type. */ #ifdef _KERNEL +#include /* For bool. */ #include struct thread; @@ -84,15 +87,14 @@ struct runq { struct rqhead rq_queues[RQ_NQS]; }; -void runq_add(struct runq *, struct thread *, int); -void runq_add_pri(struct runq *, struct thread *, u_char, int); -int runq_check(struct runq *); +void runq_add(struct runq *, struct thread *, int _flags); +void runq_add_idx(struct runq *, struct thread *, int _idx, int _flags); +bool runq_not_empty(struct runq *); struct thread *runq_choose(struct runq *); -struct thread *runq_choose_from(struct runq *, u_char); -struct thread *runq_choose_fuzz(struct runq *, int); +struct thread *runq_choose_from(struct runq *, int _idx); +struct thread *runq_choose_fuzz(struct runq *, int _fuzz); void runq_init(struct runq *); -void runq_remove(struct runq *, struct thread *); -void runq_remove_idx(struct runq *, struct thread *, u_char *); +bool runq_remove(struct runq *, struct thread *); #endif /* _KERNEL */ #endif diff --git a/sys/sys/sched.h b/sys/sys/sched.h index 933f05385675..f5f48c5323c0 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -63,6 +63,15 @@ #define _SCHED_H_ #ifdef _KERNEL + +#include +#ifdef SCHED_STATS +#include +#endif + +struct proc; +struct thread; + /* * General scheduling info. * @@ -74,7 +83,7 @@ */ int sched_load(void); int sched_rr_interval(void); -int sched_runnable(void); +bool sched_runnable(void); /* * Proc related scheduling hooks. From nobody Mon Jul 28 13:31:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBB1rCmz634XX; Mon, 28 Jul 2025 13:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKB86Xsrz3tHB; Mon, 28 Jul 2025 13:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fOrEZIOnL+2H38XdyPblSpcJYUVPHbQ6RkSvPAC2oI=; b=ywO8Jmb/cJAsE++K+DV8ILkgW+RAldPs4gsUmM3juZrwUXcAGKuB+y8UW18SV/IBsvQG8F kH3LS5JZKyxKghtoQTN+9qqs4UAsLZ6O2P0q8BAkfrmhZ6iC90t+byLYePkX/hSYfMVVfS dQxCvkBqqW6ZAwG7Hyw4pYRV1FyNhnLCa0yJsWzV5bOFEmva6zOb0oHkGrTd9Ve0BgrAUt DuACgqBRzrjxzUisTRt7kTTRZe/jI3qOav8Mzg5gB1YuxPiBEJPGVmulNACQZhVrtR4HfI mKosmeeOhY0eUejyPxSJXRzGHvxvkf0FTO/N6n9CtIvyj4FV/8ebc8SXH2nwjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1fOrEZIOnL+2H38XdyPblSpcJYUVPHbQ6RkSvPAC2oI=; b=D1CcOasflOavDK4J21rF2RPV+jbAZAW9MP8zuJhcU7SmCmpifukWIsY04fH1agdOd4OMSn t5OI1YZC9eQGcPZLE3eFGogM8uPmcNuAjtz9R0CUB9wYTO37Vp6PG+Ue/M58FmmBz8DOpd /PC0/Aj0KMAID/CIWN/YB1q7KOpgWC3XqWO7uVOTo1GtFJEXsJCHLhmfn0wL4kL+PUweDi JVtsCsGO0a+V5DwOdXAuKdynb3AQ3FYCA28y71EL+znmx/3ufB33VlTuiMt0FlUYTjCgtz sWE80VvzgmtmTb56WWffc84P9C97Q6YRolylTxBoUSo42rbmD4YBvQdPYJNvyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709472; a=rsa-sha256; cv=none; b=aGBg1Drghs9CrxVD3dWBSrJyDElyNxNkvKGWnuz5t8JFN8vatrZJdOzqj2bIIFYMAEfWuM QMna8/Ygdg+pG8FENECXxnBLy0/XJcMlLl+l6DL6ZLVUdEOJAfMWp7h0ZvuVSWjzko/Swq LeIRoJNcT25HJTwmMuyn2k80/hPq5zCJu/XaS8sUkztBvOxhenD2lkO2aaoiAk0GY/nqRd SkbLeqAiFr3wN9W26D+XB9DLdWuAppCeplcH5PAlNdNnKdDOS8PkOUJeUWETdUTr4O5oE4 wNi2OL1Z7KAwwwCxEnF6goVVoc3C4/GXpkhiEIOMcauVFcrCQAu8PQXaS4+NUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKB84fJFznJQ; Mon, 28 Jul 2025 13:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVCs9080025; Mon, 28 Jul 2025 13:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVCP9080022; Mon, 28 Jul 2025 13:31:12 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:12 GMT Message-Id: <202507281331.56SDVCP9080022@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: b6e0a4f51747 - stable/14 - runq: Clarity and style pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b6e0a4f51747375dfe80fda19a64930912a8ac33 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b6e0a4f51747375dfe80fda19a64930912a8ac33 commit b6e0a4f51747375dfe80fda19a64930912a8ac33 Author: Olivier Certner AuthorDate: 2024-03-01 09:47:13 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:04 +0000 runq: Clarity and style pass In runq_choose() and runq_choose_fuzz(), replace an unnecessary 'while' with an 'if', and separate assignment and test of 'idx' into two lines. Add missing parentheses to one 'sizeof' operator. Remove superfluous brackets for one-line "then" and "else" branches (to match style elsewhere in the file). Declare loop indices in their 'for'. Test for non-empty bit sets with an explicit '!= 0'. Move TABs in some prototypes of (should not split the return type specifier, but instead separate the type specifier with the function declarator). No functional change intended. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 57540a0666f6bfebf55c905dceac36230c0743c5) --- sys/kern/kern_switch.c | 24 ++++++++++++------------ sys/sys/runq.h | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 5c529862bc53..906efca4bb51 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -269,7 +269,7 @@ runq_init(struct runq *rq) { int i; - bzero(rq, sizeof *rq); + bzero(rq, sizeof(*rq)); for (i = 0; i < RQ_NQS; i++) TAILQ_INIT(&rq->rq_queues[i]); } @@ -300,11 +300,11 @@ static __inline int runq_findbit(struct runq *rq) { struct rqbits *rqb; - int idx, i; + int idx; rqb = &rq->rq_status; - for (i = 0; i < RQB_LEN; i++) - if (rqb->rqb_bits[i]) { + for (int i = 0; i < RQB_LEN; i++) + if (rqb->rqb_bits[i] != 0) { idx = RQB_FFS(rqb->rqb_bits[i]) + i * RQB_BPW; CHECK_IDX(idx); CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d idx=%d", @@ -390,11 +390,10 @@ runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) rqh = &rq->rq_queues[idx]; CTR4(KTR_RUNQ, "runq_add_idx: td=%p pri=%d idx=%d rqh=%p", td, td->td_priority, idx, rqh); - if (flags & SRQ_PREEMPTED) { + if (flags & SRQ_PREEMPTED) TAILQ_INSERT_HEAD(rqh, td, td_runq); - } else { + else TAILQ_INSERT_TAIL(rqh, td, td_runq); - } } /* @@ -405,11 +404,10 @@ bool runq_not_empty(struct runq *rq) { struct rqbits *rqb; - int i; rqb = &rq->rq_status; - for (i = 0; i < RQB_LEN; i++) - if (rqb->rqb_bits[i]) { + for (int i = 0; i < RQB_LEN; i++) + if (rqb->rqb_bits[i] != 0) { CTR2(KTR_RUNQ, "runq_not_empty: bits=%#x i=%d", rqb->rqb_bits[i], i); return (true); @@ -429,7 +427,8 @@ runq_choose_fuzz(struct runq *rq, int fuzz) struct thread *td; int idx; - while ((idx = runq_findbit(rq)) != -1) { + idx = runq_findbit(rq); + if (idx != -1) { rqh = &rq->rq_queues[idx]; /* fuzz == 1 is normal.. 0 or less are ignored */ if (fuzz > 1) { @@ -471,7 +470,8 @@ runq_choose(struct runq *rq) struct thread *td; int idx; - while ((idx = runq_findbit(rq)) != -1) { + idx = runq_findbit(rq); + if (idx != -1) { rqh = &rq->rq_queues[idx]; td = TAILQ_FIRST(rqh); KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 693a3666d7a8..030b4bb370a8 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -90,9 +90,9 @@ struct runq { void runq_add(struct runq *, struct thread *, int _flags); void runq_add_idx(struct runq *, struct thread *, int _idx, int _flags); bool runq_not_empty(struct runq *); -struct thread *runq_choose(struct runq *); -struct thread *runq_choose_from(struct runq *, int _idx); -struct thread *runq_choose_fuzz(struct runq *, int _fuzz); +struct thread *runq_choose(struct runq *); +struct thread *runq_choose_from(struct runq *, int _idx); +struct thread *runq_choose_fuzz(struct runq *, int _fuzz); void runq_init(struct runq *); bool runq_remove(struct runq *, struct thread *); #endif /* _KERNEL */ From nobody Mon Jul 28 13:31:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBC5vfkz634vd; Mon, 28 Jul 2025 13:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKB96xbTz3tXb; Mon, 28 Jul 2025 13:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nmPZX0vMcAGokn2iOCvHVF2C32+k/FMP+TB8eSARYNs=; b=N6Qyc91D4CBgoyiaHeD23Ie1zQeBc/GO7wAjplMNLLI6UCc/wHS128vfxbcXh23OCgrksS +PnKDw3HvQKsB+BDMxYq+FMQYUInV5sgrNHq1mVd8twLCNwcwXoosxJl0UsBE8Pb8Q9dMb eBHkDi9sv1gjFYj2J3I5/yWtmVX55KuyVWe4B6R/j/tzZ+/JC9WkmgiwkknjxmFw3m7HZc ov71MJBkaoSK99mEQGJGebAH6Xt2DZFK4z+qsnwXCIwC0l973nwZoD4H5qgpSM7aZGr/wo QDNZUwzdeYKccNVtWaCUWzHrZJ8qwbKe3SXMSF3pH+fFsLknAy1S+pXerwnQIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nmPZX0vMcAGokn2iOCvHVF2C32+k/FMP+TB8eSARYNs=; b=KDxRFyoe98WnIB54c91TVLPRUggfNBv7s6e3aeQb2d8RvysdaHjJkV+pYuu3qc5oamq34S cs3xW81ZCSsbcLT2c2Imm9ZE+ohOSqImIKIBUz5qypqppe18rVqSHyIXL5i5b3RTEscOn0 K6YZhnlkXL833sVf+OF5JLvqZ9Zp/+npTSAbZRLw25rR6OOxgFTqcn04z2rVKxN1QKvbU4 tT4ql66Jktxh4Icj6p9fYnXoPgG7nk1hLiu1fxHHrWG5PCzSM/N/WILkWBMMNf5C0lOyP4 PkSAojK68fuL+0xzSKyEIbp9bMyhALj0sq0VdyABVFtPVY+v9UGHKF6hYm5Vbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709473; a=rsa-sha256; cv=none; b=brtx1QDLj+GEl7Ydhh3gJdhDzBIQmfliPbKc89JJmVtJRw4Tzxy+c1VePedLJiStSzVMNI oitBY9CVmVvJ3Hoc1QVdFB7U3zIKbCyuecyfLeepnettmq0Sr37reXbSGkTKB6pVcr9Nlb C1mKIXJzW6x47qEZN8q0RChzucdmgYjeT1mpbY74YlJAveGByMJ2EOQ4/hMcgx4/fZEwz6 eo6NtUymynHwSjxxnRKZGxms8Uk+DbpQkbxv5Xg83dJ970FEXrm7xbazcjZb0MFNDlfCPT /KXoLs1qytF/LXho2/PpmINDvsZluMlcJbUoxK4u6PqTg/bTRtSCgTRE52sLvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKB95cwjznfn; Mon, 28 Jul 2025 13:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVD9a080057; Mon, 28 Jul 2025 13:31:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVDoI080054; Mon, 28 Jul 2025 13:31:13 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:13 GMT Message-Id: <202507281331.56SDVDoI080054@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: 000ffb6f24c4 - stable/14 - runq: More macros; Better and more consistent naming List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 000ffb6f24c498bc665b887fafdd1bd4e96f598f Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=000ffb6f24c498bc665b887fafdd1bd4e96f598f commit 000ffb6f24c498bc665b887fafdd1bd4e96f598f Author: Olivier Certner AuthorDate: 2024-04-23 11:33:02 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:06 +0000 runq: More macros; Better and more consistent naming Most existing macros have ambiguous names regarding which index they operate on (queue, word, bit?), so have been renamed to improve clarity. Use the 'RQSW_' prefix for all macros related to status words, and change the status word type name accordingly. Rename RQB_FFS() to RQSW_BSF() to remove confusion about the return value (ffs*() return bit indices starting at 1, or 0 if the input is 0, whereas BSF on x86 returns 0-based indices, which is what the current code assumes). While here, add a check (under INVARIANTS) that RQSW_BSF() isn't called with 0 as an argument. Also, rename 'rqb_bits_t' to the more concise 'rqsw_t', 'struct rqbits' to 'struct rq_status', its 'rqb_bits' field to 'rq_sw' (it designates an array of words, not bits), and the type 'rqhead' to 'rq_queue' Add macros computing a queue index from a status word index and a bit in order to factorize code. If the precise index of the bit is known, callers can use RQSW_TO_QUEUE_IDX() to get the corresponding queue index, whereas if they want the one corresponding to the first (least-significant): set bit in a given status word (corresponding to the non-empty queue with lower index in the status word), they can use RQSW_FIRST_QUEUE_IDX() instead. Add RQSW_BIT_IDX(), which computes the correspond bit's index in the corresponding status word. This allows more code factorization (even if most uses will be eliminated in a later commit) and makes what is computed clearer. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 7e2502e3dec989ea31e5300ade759a721718548d) --- sys/kern/kern_switch.c | 114 ++++++++++++++++++++++++------------------------- sys/kern/sched_4bsd.c | 2 +- sys/kern/sched_ule.c | 56 ++++++++++++------------ sys/sys/runq.h | 40 ++++++++++------- 4 files changed, 111 insertions(+), 101 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 906efca4bb51..9e63709d0acc 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -281,15 +281,15 @@ runq_init(struct runq *rq) static __inline void runq_clrbit(struct runq *rq, int idx) { - struct rqbits *rqb; + struct rq_status *rqs; CHECK_IDX(idx); - rqb = &rq->rq_status; + rqs = &rq->rq_status; CTR4(KTR_RUNQ, "runq_clrbit: bits=%#x %#x bit=%#x word=%d", - rqb->rqb_bits[RQB_WORD(idx)], - rqb->rqb_bits[RQB_WORD(idx)] & ~RQB_BIT(idx), - RQB_BIT(idx), RQB_WORD(idx)); - rqb->rqb_bits[RQB_WORD(idx)] &= ~RQB_BIT(idx); + rqs->rq_sw[RQSW_IDX(idx)], + rqs->rq_sw[RQSW_IDX(idx)] & ~RQSW_BIT(idx), + RQSW_BIT(idx), RQSW_IDX(idx)); + rqs->rq_sw[RQSW_IDX(idx)] &= ~RQSW_BIT(idx); } /* @@ -299,16 +299,16 @@ runq_clrbit(struct runq *rq, int idx) static __inline int runq_findbit(struct runq *rq) { - struct rqbits *rqb; + struct rq_status *rqs; int idx; - rqb = &rq->rq_status; - for (int i = 0; i < RQB_LEN; i++) - if (rqb->rqb_bits[i] != 0) { - idx = RQB_FFS(rqb->rqb_bits[i]) + i * RQB_BPW; + rqs = &rq->rq_status; + for (int i = 0; i < RQSW_NB; i++) + if (rqs->rq_sw[i] != 0) { + idx = RQSW_FIRST_QUEUE_IDX(i, rqs->rq_sw[i]); CHECK_IDX(idx); CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d idx=%d", - rqb->rqb_bits[i], i, idx); + rqs->rq_sw[i], i, idx); return (idx); } @@ -318,20 +318,20 @@ runq_findbit(struct runq *rq) static __inline int runq_findbit_from(struct runq *rq, int idx) { - struct rqbits *rqb; - rqb_word_t mask; + struct rq_status *rqs; + rqsw_t mask; int i; CHECK_IDX(idx); /* Set the mask for the first word so we ignore indices before 'idx'. */ - mask = (rqb_word_t)-1 << (idx & (RQB_BPW - 1)); - rqb = &rq->rq_status; + mask = (rqsw_t)-1 << RQSW_BIT_IDX(idx); + rqs = &rq->rq_status; again: - for (i = RQB_WORD(idx); i < RQB_LEN; mask = -1, i++) { - mask = rqb->rqb_bits[i] & mask; + for (i = RQSW_IDX(idx); i < RQSW_NB; mask = -1, i++) { + mask = rqs->rq_sw[i] & mask; if (mask == 0) continue; - idx = RQB_FFS(mask) + i * RQB_BPW; + idx = RQSW_FIRST_QUEUE_IDX(i, mask); CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d idx=%d", mask, i, idx); return (idx); @@ -353,15 +353,15 @@ again: static __inline void runq_setbit(struct runq *rq, int idx) { - struct rqbits *rqb; + struct rq_status *rqs; CHECK_IDX(idx); - rqb = &rq->rq_status; + rqs = &rq->rq_status; CTR4(KTR_RUNQ, "runq_setbit: bits=%#x %#x bit=%#x word=%d", - rqb->rqb_bits[RQB_WORD(idx)], - rqb->rqb_bits[RQB_WORD(idx)] | RQB_BIT(idx), - RQB_BIT(idx), RQB_WORD(idx)); - rqb->rqb_bits[RQB_WORD(idx)] |= RQB_BIT(idx); + rqs->rq_sw[RQSW_IDX(idx)], + rqs->rq_sw[RQSW_IDX(idx)] | RQSW_BIT(idx), + RQSW_BIT(idx), RQSW_IDX(idx)); + rqs->rq_sw[RQSW_IDX(idx)] |= RQSW_BIT(idx); } /* @@ -372,13 +372,13 @@ void runq_add(struct runq *rq, struct thread *td, int flags) { - runq_add_idx(rq, td, RQ_PRI_TO_IDX(td->td_priority), flags); + runq_add_idx(rq, td, RQ_PRI_TO_QUEUE_IDX(td->td_priority), flags); } void runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) { - struct rqhead *rqh; + struct rq_queue *rqq; /* * runq_setbit() asserts 'idx' is non-negative and below 'RQ_NQS', and @@ -387,13 +387,13 @@ runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) */ td->td_rqindex = idx; runq_setbit(rq, idx); - rqh = &rq->rq_queues[idx]; - CTR4(KTR_RUNQ, "runq_add_idx: td=%p pri=%d idx=%d rqh=%p", - td, td->td_priority, idx, rqh); + rqq = &rq->rq_queues[idx]; + CTR4(KTR_RUNQ, "runq_add_idx: td=%p pri=%d idx=%d rqq=%p", + td, td->td_priority, idx, rqq); if (flags & SRQ_PREEMPTED) - TAILQ_INSERT_HEAD(rqh, td, td_runq); + TAILQ_INSERT_HEAD(rqq, td, td_runq); else - TAILQ_INSERT_TAIL(rqh, td, td_runq); + TAILQ_INSERT_TAIL(rqq, td, td_runq); } /* @@ -403,13 +403,13 @@ runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) bool runq_not_empty(struct runq *rq) { - struct rqbits *rqb; + struct rq_status *rqs; - rqb = &rq->rq_status; - for (int i = 0; i < RQB_LEN; i++) - if (rqb->rqb_bits[i] != 0) { + rqs = &rq->rq_status; + for (int i = 0; i < RQSW_NB; i++) + if (rqs->rq_sw[i] != 0) { CTR2(KTR_RUNQ, "runq_not_empty: bits=%#x i=%d", - rqb->rqb_bits[i], i); + rqs->rq_sw[i], i); return (true); } CTR0(KTR_RUNQ, "runq_not_empty: empty"); @@ -423,13 +423,13 @@ runq_not_empty(struct runq *rq) struct thread * runq_choose_fuzz(struct runq *rq, int fuzz) { - struct rqhead *rqh; + struct rq_queue *rqq; struct thread *td; int idx; idx = runq_findbit(rq); if (idx != -1) { - rqh = &rq->rq_queues[idx]; + rqq = &rq->rq_queues[idx]; /* fuzz == 1 is normal.. 0 or less are ignored */ if (fuzz > 1) { /* @@ -439,7 +439,7 @@ runq_choose_fuzz(struct runq *rq, int fuzz) int count = fuzz; int cpu = PCPU_GET(cpuid); struct thread *td2; - td2 = td = TAILQ_FIRST(rqh); + td2 = td = TAILQ_FIRST(rqq); while (count-- && td2) { if (td2->td_lastcpu == cpu) { @@ -449,10 +449,10 @@ runq_choose_fuzz(struct runq *rq, int fuzz) td2 = TAILQ_NEXT(td2, td_runq); } } else - td = TAILQ_FIRST(rqh); + td = TAILQ_FIRST(rqq); KASSERT(td != NULL, ("runq_choose_fuzz: no proc on busy queue")); CTR3(KTR_RUNQ, - "runq_choose_fuzz: idx=%d thread=%p rqh=%p", idx, td, rqh); + "runq_choose_fuzz: idx=%d thread=%p rqq=%p", idx, td, rqq); return (td); } CTR1(KTR_RUNQ, "runq_choose_fuzz: idleproc idx=%d", idx); @@ -466,17 +466,17 @@ runq_choose_fuzz(struct runq *rq, int fuzz) struct thread * runq_choose(struct runq *rq) { - struct rqhead *rqh; + struct rq_queue *rqq; struct thread *td; int idx; idx = runq_findbit(rq); if (idx != -1) { - rqh = &rq->rq_queues[idx]; - td = TAILQ_FIRST(rqh); + rqq = &rq->rq_queues[idx]; + td = TAILQ_FIRST(rqq); KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); CTR3(KTR_RUNQ, - "runq_choose: idx=%d thread=%p rqh=%p", idx, td, rqh); + "runq_choose: idx=%d thread=%p rqq=%p", idx, td, rqq); return (td); } CTR1(KTR_RUNQ, "runq_choose: idlethread idx=%d", idx); @@ -487,17 +487,17 @@ runq_choose(struct runq *rq) struct thread * runq_choose_from(struct runq *rq, int from_idx) { - struct rqhead *rqh; + struct rq_queue *rqq; struct thread *td; int idx; if ((idx = runq_findbit_from(rq, from_idx)) != -1) { - rqh = &rq->rq_queues[idx]; - td = TAILQ_FIRST(rqh); + rqq = &rq->rq_queues[idx]; + td = TAILQ_FIRST(rqq); KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); CTR4(KTR_RUNQ, - "runq_choose_from: idx=%d thread=%p idx=%d rqh=%p", - idx, td, td->td_rqindex, rqh); + "runq_choose_from: idx=%d thread=%p idx=%d rqq=%p", + idx, td, td->td_rqindex, rqq); return (td); } CTR1(KTR_RUNQ, "runq_choose_from: idlethread idx=%d", idx); @@ -513,17 +513,17 @@ runq_choose_from(struct runq *rq, int from_idx) bool runq_remove(struct runq *rq, struct thread *td) { - struct rqhead *rqh; + struct rq_queue *rqq; int idx; KASSERT(td->td_flags & TDF_INMEM, ("runq_remove: Thread swapped out")); idx = td->td_rqindex; CHECK_IDX(idx); - rqh = &rq->rq_queues[idx]; - CTR4(KTR_RUNQ, "runq_remove: td=%p pri=%d idx=%d rqh=%p", - td, td->td_priority, idx, rqh); - TAILQ_REMOVE(rqh, td, td_runq); - if (TAILQ_EMPTY(rqh)) { + rqq = &rq->rq_queues[idx]; + CTR4(KTR_RUNQ, "runq_remove: td=%p pri=%d idx=%d rqq=%p", + td, td->td_priority, idx, rqq); + TAILQ_REMOVE(rqq, td, td_runq); + if (TAILQ_EMPTY(rqq)) { runq_clrbit(rq, idx); CTR1(KTR_RUNQ, "runq_remove: queue at idx=%d now empty", idx); return (true); diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index c6b789d060c3..c204e4a5676e 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -873,7 +873,7 @@ sched_priority(struct thread *td, u_char prio) if (td->td_priority == prio) return; td->td_priority = prio; - if (TD_ON_RUNQ(td) && td->td_rqindex != RQ_PRI_TO_IDX(prio)) { + if (TD_ON_RUNQ(td) && td->td_rqindex != RQ_PRI_TO_QUEUE_IDX(prio)) { sched_rem(td); sched_add(td, SRQ_BORING | SRQ_HOLDTD); } diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 13bef8ca9c1c..8fdc71c21e64 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -387,20 +387,20 @@ SDT_PROBE_DEFINE2(sched, , , surrender, "struct thread *", static void runq_print(struct runq *rq) { - struct rqhead *rqh; + struct rq_queue *rqq; struct thread *td; int pri; int j; int i; - for (i = 0; i < RQB_LEN; i++) { + for (i = 0; i < RQSW_NB; i++) { printf("\t\trunq bits %d 0x%zx\n", - i, rq->rq_status.rqb_bits[i]); - for (j = 0; j < RQB_BPW; j++) - if (rq->rq_status.rqb_bits[i] & (1ul << j)) { - pri = j + i * RQB_BPW; - rqh = &rq->rq_queues[pri]; - TAILQ_FOREACH(td, rqh, td_runq) { + i, rq->rq_status.rq_sw[i]); + for (j = 0; j < RQSW_BPW; j++) + if (rq->rq_status.rq_sw[i] & (1ul << j)) { + pri = RQSW_TO_QUEUE_IDX(i, j); + rqq = &rq->rq_queues[pri]; + TAILQ_FOREACH(td, rqq, td_runq) { printf("\t\t\ttd %p(%s) priority %d rqindex %d pri %d\n", td, td->td_name, td->td_priority, td->td_rqindex, pri); @@ -1190,26 +1190,26 @@ tdq_notify(struct tdq *tdq, int lowpri) static struct thread * runq_steal_from(struct runq *rq, int cpu, u_char start) { - struct rqbits *rqb; - struct rqhead *rqh; + struct rq_status *rqs; + struct rq_queue *rqq; struct thread *td, *first; int bit; int i; - rqb = &rq->rq_status; - bit = start & (RQB_BPW -1); + rqs = &rq->rq_status; + bit = RQSW_BIT_IDX(start); first = NULL; again: - for (i = RQB_WORD(start); i < RQB_LEN; bit = 0, i++) { - if (rqb->rqb_bits[i] == 0) + for (i = RQSW_IDX(start); i < RQSW_NB; bit = 0, i++) { + if (rqs->rq_sw[i] == 0) continue; if (bit == 0) - bit = RQB_FFS(rqb->rqb_bits[i]); - for (; bit < RQB_BPW; bit++) { - if ((rqb->rqb_bits[i] & (1ul << bit)) == 0) + bit = RQSW_BSF(rqs->rq_sw[i]); + for (; bit < RQSW_BPW; bit++) { + if ((rqs->rq_sw[i] & (1ul << bit)) == 0) continue; - rqh = &rq->rq_queues[bit + i * RQB_BPW]; - TAILQ_FOREACH(td, rqh, td_runq) { + rqq = &rq->rq_queues[RQSW_TO_QUEUE_IDX(i, bit)]; + TAILQ_FOREACH(td, rqq, td_runq) { if (first) { if (THREAD_CAN_MIGRATE(td) && THREAD_CAN_SCHED(td, cpu)) @@ -1236,21 +1236,21 @@ again: static struct thread * runq_steal(struct runq *rq, int cpu) { - struct rqhead *rqh; - struct rqbits *rqb; + struct rq_queue *rqq; + struct rq_status *rqs; struct thread *td; int word; int bit; - rqb = &rq->rq_status; - for (word = 0; word < RQB_LEN; word++) { - if (rqb->rqb_bits[word] == 0) + rqs = &rq->rq_status; + for (word = 0; word < RQSW_NB; word++) { + if (rqs->rq_sw[word] == 0) continue; - for (bit = 0; bit < RQB_BPW; bit++) { - if ((rqb->rqb_bits[word] & (1ul << bit)) == 0) + for (bit = 0; bit < RQSW_BPW; bit++) { + if ((rqs->rq_sw[word] & (1ul << bit)) == 0) continue; - rqh = &rq->rq_queues[bit + word * RQB_BPW]; - TAILQ_FOREACH(td, rqh, td_runq) + rqq = &rq->rq_queues[RQSW_TO_QUEUE_IDX(word, bit)]; + TAILQ_FOREACH(td, rqq, td_runq) if (THREAD_CAN_MIGRATE(td) && THREAD_CAN_SCHED(td, cpu)) return (td); diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 030b4bb370a8..80a1fad0a089 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -47,16 +47,26 @@ /* * Deduced from the above parameters and machine ones. */ -typedef unsigned long rqb_word_t; /* runq's status words type. */ - #define RQ_NQS (howmany(RQ_MAX_PRIO + 1, RQ_PPQ)) /* Number of run queues. */ -#define RQ_PRI_TO_IDX(pri) ((pri) / RQ_PPQ) /* Priority to queue index. */ - -#define RQB_BPW (sizeof(rqb_word_t) * NBBY) /* Bits per runq word. */ -#define RQB_LEN (howmany(RQ_NQS, RQB_BPW)) /* Words to cover RQ_NQS queues. */ -#define RQB_WORD(idx) ((idx) / RQB_BPW) -#define RQB_BIT(idx) (1ul << ((idx) % RQB_BPW)) -#define RQB_FFS(word) (ffsl((long)(word)) - 1) /* Assumes two-complement. */ +#define RQ_PRI_TO_QUEUE_IDX(pri) ((pri) / RQ_PPQ) /* Priority to queue index. */ + +typedef unsigned long rqsw_t; /* runq's status words type. */ +#define RQSW_BPW (sizeof(rqsw_t) * NBBY) /* Bits per runq word. */ + +/* Number of status words to cover RQ_NQS queues. */ +#define RQSW_NB (howmany(RQ_NQS, RQSW_BPW)) +#define RQSW_IDX(idx) ((idx) / RQSW_BPW) +#define RQSW_BIT_IDX(idx) ((idx) % RQSW_BPW) +#define RQSW_BIT(idx) (1ul << RQSW_BIT_IDX(idx)) +#define RQSW_BSF(word) __extension__ ({ \ + int _res = ffsl((long)(word)); /* Assumes two-complement. */ \ + MPASS(_res > 0); \ + _res - 1; \ +}) +#define RQSW_TO_QUEUE_IDX(word_idx, bit_idx) \ + (((word_idx) * RQSW_BPW) + (bit_idx)) +#define RQSW_FIRST_QUEUE_IDX(word_idx, word) \ + RQSW_TO_QUEUE_IDX(word_idx, RQSW_BSF(word)) #ifdef _KERNEL @@ -66,16 +76,16 @@ typedef unsigned long rqb_word_t; /* runq's status words type. */ struct thread; /* - * Head of run queues. + * The queue for a given index as a list of threads. */ -TAILQ_HEAD(rqhead, thread); +TAILQ_HEAD(rq_queue, thread); /* * Bit array which maintains the status of a run queue. When a queue is * non-empty the bit corresponding to the queue number will be set. */ -struct rqbits { - rqb_word_t rqb_bits[RQB_LEN]; +struct rq_status { + rqsw_t rq_sw[RQSW_NB]; }; /* @@ -83,8 +93,8 @@ struct rqbits { * are placed, and a structure to maintain the status of each queue. */ struct runq { - struct rqbits rq_status; - struct rqhead rq_queues[RQ_NQS]; + struct rq_status rq_status; + struct rq_queue rq_queues[RQ_NQS]; }; void runq_add(struct runq *, struct thread *, int _flags); From nobody Mon Jul 28 13:31:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBD4Jhgz634WG; Mon, 28 Jul 2025 13:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBD21g9z3tby; Mon, 28 Jul 2025 13:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVqaGJu2yTtt945uaBEBZS9vxm/WgNIvqrZRivNKHDY=; b=Gc/1vqnEpUq3rBuVCMxs8XZPh17QicW5NOWFw6WAzHFoHrOoxtoUV+uZnYIOSMYJn6wK/u VK7gNOTFxDLPILELTVnU6oy+nJiSCjeTtthz0QJSz4m/3FCDj2sextYrYhXOjtlA4pGanX 3+5FxyhzMmSIhmCmZ8AkIgRHiIBacV3VDX+qAp0NHLeag1BW/95yu4kZ0k7+b/RCIYwunC 4ZmfZ1/Cf7LBQ0hEl7BCEx+rLqh57IO0qjlIWbeZgsux6HH2kG6J07wESZmojghO0ybiQU Hail8eGRQGirl9vyRyPpsACF+8r4TA86TdCm6luxD4eclr0Q3+it+DxAeN6mMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVqaGJu2yTtt945uaBEBZS9vxm/WgNIvqrZRivNKHDY=; b=S/iatzdrwi+bM4PrJTDnCDsAJOJJBFBMumOJUmDwCjXLE8JqQWRFFj9dswSJ2IbuhV62VP YbwM2qP3hpc0q7i70oC7tYOttwc5GptuU1uxH0MQwY1KhpEWN/9BXNm9aIoDI6+dT6FZf8 EVlgyOWX+X+EPpnPR7dBCgQFRMDPslnirRPJv2IR1tU+eH6YRSXf9zGPx0r2vjNtVV+hAB IUxuAw+mSxt+ccvPRNtZmO44+bZlD1EHPYMNzuLUGt/ow5AaOV7EIjrTZBC0hKAlTgO8Mw NcRArnlOIbHgzLrXJwPbT85ocxKXiAajEaW7r4/vpNJEkjYN/AckEfqpPjODAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709476; a=rsa-sha256; cv=none; b=ZdPFLH5wSsrFu4oY158bMPgA6mPW1ktj4VEy4QRcEyGaXMHqhJXJtmlePBFUIsrbgYbFRV dkZbPiwVG3BGx+zQjkNPIJBPqFZoW2nJkKoDpD6Eo6ms0Fk0reaNLGbnKSN1YU4MmvVFsA /Wt6eNQ5VQlcLpl6rsxpZLEdIzQQYqQj9SEHsjrMHN4SUADHdtQNfhuRmeL6DcQ0wQPs2g BVrrs3sFszUj+62gGEh3o/oq7/ecTLE1tFA1zLzDXON2vBwEudlLZEPVSg0wQ59zItRkqJ TUXgKvVyldk2cg2gdXmo/FX3aQt3dqn3AcSoVl1mKrxi8LkCAez2t8g2Lsot+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 4brKBD0P7zznG1; Mon, 28 Jul 2025 13:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVFUM080121; Mon, 28 Jul 2025 13:31:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVFAk080118; Mon, 28 Jul 2025 13:31:15 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:15 GMT Message-Id: <202507281331.56SDVFAk080118@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: de0e1a3abf8b - stable/14 - runq: Revamp runq_find*(), new runq_find_range() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: de0e1a3abf8b144650173e639337c31a3eaf874f Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=de0e1a3abf8b144650173e639337c31a3eaf874f commit de0e1a3abf8b144650173e639337c31a3eaf874f Author: Olivier Certner AuthorDate: 2024-02-29 08:57:10 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:09 +0000 runq: Revamp runq_find*(), new runq_find_range() Rename existing functions to use the simpler prefix 'runq_findq' instead of 'runq_findbit' (that they work on top of bit runs is an implementation detail). Add runq_findq_range(), which takes a range of indices to operate on (bounds included). This is in preparation for changing ULE to use a single runqueue, since it needs to treat the timesharing range differently. Rename runq_findbit_from() to runq_findq_circular(), which is more descriptive. To reduce code duplication, have runq_findq() and runq_findq_circular() leverage runq_findq_range() internally. For the latter, this also brings a small algorithmic improvement, since previously the second pass (from queue 0) would cover the whole runqueue if it was completely empty, scanning again empty queues after the start index. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 439dc920f2d88e3fe2869a2845f15d8ab44cc051) --- sys/kern/kern_switch.c | 101 ++++++++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 43 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 69e6f4818e40..a321aecc55fb 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -370,57 +370,72 @@ runq_remove(struct runq *rq, struct thread *td) } /* - * Find the index of the first non-empty run queue. This is done by - * scanning the status bits, a set bit indicating a non-empty queue. + * Find the index of the first (i.e., having lower index) non-empty queue in the + * passed range (bounds included). This is done by scanning the status bits, + * a set bit indicating a non-empty queue. Returns -1 if all queues in the range + * are empty. */ -static __inline int -runq_findbit(struct runq *rq) +static int +runq_findq_range(const struct runq *const rq, const int lvl_min, + const int lvl_max) { - struct rq_status *rqs; - int idx; + rqsw_t const (*const rqsw)[RQSW_NB] = &rq->rq_status.rq_sw; + rqsw_t w; + int i, last, idx; + + CHECK_IDX(lvl_min); + CHECK_IDX(lvl_max); + KASSERT(lvl_min <= lvl_max, + ("lvl_min: %d > lvl_max: %d!", lvl_min, lvl_max)); + + i = RQSW_IDX(lvl_min); + last = RQSW_IDX(lvl_max); + /* Clear bits for runqueues below 'lvl_min'. */ + w = (*rqsw)[i] & ~(RQSW_BIT(lvl_min) - 1); + if (i == last) + goto last_mask; + if (w != 0) + goto return_idx; + + for (++i; i < last; ++i) { + w = (*rqsw)[i]; + if (w != 0) + goto return_idx; + } - rqs = &rq->rq_status; - for (int i = 0; i < RQSW_NB; i++) - if (rqs->rq_sw[i] != 0) { - idx = RQSW_FIRST_QUEUE_IDX(i, rqs->rq_sw[i]); - CHECK_IDX(idx); - CTR3(KTR_RUNQ, "runq_findbit: bits=%#x i=%d idx=%d", - rqs->rq_sw[i], i, idx); - return (idx); - } + MPASS(i == last); + w = (*rqsw)[i]; +last_mask: + /* Clear bits for runqueues above 'lvl_max'. */ + w &= (RQSW_BIT(lvl_max) - 1) | RQSW_BIT(lvl_max); + if (w != 0) + goto return_idx; return (-1); +return_idx: + idx = RQSW_FIRST_QUEUE_IDX(i, w); + CTR4(KTR_RUNQ, "runq_findq_range: bits=%#x->%#x i=%d idx=%d", + (*rqsw)[i], w, i, idx); + return (idx); } static __inline int -runq_findbit_from(struct runq *rq, int idx) +runq_findq_circular(struct runq *const rq, int start_idx) { - struct rq_status *rqs; - rqsw_t mask; - int i; + int idx; - CHECK_IDX(idx); - /* Set the mask for the first word so we ignore indices before 'idx'. */ - mask = (rqsw_t)-1 << RQSW_BIT_IDX(idx); - rqs = &rq->rq_status; -again: - for (i = RQSW_IDX(idx); i < RQSW_NB; mask = -1, i++) { - mask = rqs->rq_sw[i] & mask; - if (mask == 0) - continue; - idx = RQSW_FIRST_QUEUE_IDX(i, mask); - CTR3(KTR_RUNQ, "runq_findbit_from: bits=%#x i=%d idx=%d", - mask, i, idx); + idx = runq_findq_range(rq, start_idx, RQ_NQS - 1); + if (idx != -1 || start_idx == 0) return (idx); - } - if (idx == 0) - return (-1); - /* - * Wrap back around to the beginning of the list just once so we - * scan the whole thing. - */ - idx = 0; - goto again; + + return (runq_findq_range(rq, 0, start_idx - 1)); +} + +static __inline int +runq_findq(struct runq *const rq) +{ + + return (runq_findq_range(rq, 0, RQ_NQS - 1)); } /* @@ -454,7 +469,7 @@ runq_choose(struct runq *rq) struct thread *td; int idx; - idx = runq_findbit(rq); + idx = runq_findq(rq); if (idx != -1) { rqq = &rq->rq_queues[idx]; td = TAILQ_FIRST(rqq); @@ -478,7 +493,7 @@ runq_choose_fuzz(struct runq *rq, int fuzz) struct thread *td; int idx; - idx = runq_findbit(rq); + idx = runq_findq(rq); if (idx != -1) { rqq = &rq->rq_queues[idx]; /* fuzz == 1 is normal.. 0 or less are ignored */ @@ -518,7 +533,7 @@ runq_choose_from(struct runq *rq, int from_idx) struct thread *td; int idx; - if ((idx = runq_findbit_from(rq, from_idx)) != -1) { + if ((idx = runq_findq_circular(rq, from_idx)) != -1) { rqq = &rq->rq_queues[idx]; td = TAILQ_FIRST(rqq); KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); From nobody Mon Jul 28 13:31:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBC5xvbz634n6; Mon, 28 Jul 2025 13:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBB6zqLz3tbW; Mon, 28 Jul 2025 13:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lSRSvDh+GpcCsD53ecBMDmjYQMB9sB31Qil6FQPT1hE=; b=JsohuKHw77q9P6AUO2q+rKejMxEEI2i1tD7Z9CRK3iFUh/70zQkvw1GNfJx+2ULVRIN98+ FHpVbFmv1S9Qz1YwSVB8uPOKxwxL7ogfYxko/fCG45zsy3rriPl8t67RELSkUiLaHwtkCM KDZiki3k6KkEr7lwlJ3DTKTSKVtL6fZ2YgLCwpdau1EShIJYFfhptyf7SACv4nxUSSuj4K KX4aUWGGBNlIXX9ncuBFXUFeR+LNPf2zmqeqGAS73E8oIMMGpE4Kdea2lYtZ5bDJUH2Xvd pnY0irmkOWh+yDQgfJ+Wi9sohynmdz5lRPbmesuRgKojvJY0VsCYzpI8/nF7lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lSRSvDh+GpcCsD53ecBMDmjYQMB9sB31Qil6FQPT1hE=; b=TsATvKcykVnmkjNEv9O/NC2zpneu5r7zIYXly/mgpPg8ARPXz7UW5BUYMmmxH0WJrbH0RW CbNkbJgrNeuQ4kDx2oYfOQGauX6YNpWLaUjcVG5yF390pWhGq4U7MK3q3l91hlzpdfI+fR BFxurS3oQPWf6N1ImQqsjI5zrtZ6GriYy2Jv03f/KEETa4ep9dDjQcLDNjXMbnh9iTx82m cWuttHuCjO840pWdpTqpevXY3zx2dcuoChKEfEf/VEJJ45PdPcPS5HWVTcR3o1mfxvCoz7 WA3Ks/CLqrhGqIZKDgN1JrseTE5RgH4u18uLO6RHEyFPWlkcOLAQQ6bsltlanw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709475; a=rsa-sha256; cv=none; b=fPcEwL6IoTuTWFLhkxBaZNcWso87b9WGyMW/xjDcAgziKhACt8jZj9wJn7JpsDapoDRQcq /0WtgOSlgrTDFP8sZbupuhXWVwtYyttpNuchp5+kW4XyzH8dzpSSiU5hBg1YM4REytX0IM hrbgO4IGexoebxD6iwU4Ra3RCNxAay0n1XzCe6Lj8YpvEQ7BCrcO392LBPaL2oVdb3PIh+ WIPDkm3IWSd8KPbLlV5ioCBjw+0COCjZaRp480Jx+cBRYNcLjFCd42r+Or4Afh6mUO4vIy zOcPhYRUpIONmEahrmw65STPkH9ebS8hr8RxO0ocvLG2AQq5L88ufrgNkxAF4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBB6YKLznfp; Mon, 28 Jul 2025 13:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVE8U080089; Mon, 28 Jul 2025 13:31:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVEqN080086; Mon, 28 Jul 2025 13:31:14 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:14 GMT Message-Id: <202507281331.56SDVEqN080086@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: 606087082472 - stable/14 - runq: Re-order functions more logically List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 60608708247207a69d3ec88e4cb05b066d3f3b74 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=60608708247207a69d3ec88e4cb05b066d3f3b74 commit 60608708247207a69d3ec88e4cb05b066d3f3b74 Author: Olivier Certner AuthorDate: 2024-03-01 13:26:39 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:07 +0000 runq: Re-order functions more logically No code change in moved functions. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 200fc93dace76cf251460adc58ca809c36031f3e) --- sys/kern/kern_switch.c | 201 +++++++++++++++++++++++++------------------------ sys/sys/runq.h | 7 +- 2 files changed, 105 insertions(+), 103 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 9e63709d0acc..69e6f4818e40 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -274,6 +274,24 @@ runq_init(struct runq *rq) TAILQ_INIT(&rq->rq_queues[i]); } +/* + * Set the status bit of the queue at index 'idx', indicating that it is + * non-empty. + */ +static __inline void +runq_setbit(struct runq *rq, int idx) +{ + struct rq_status *rqs; + + CHECK_IDX(idx); + rqs = &rq->rq_status; + CTR4(KTR_RUNQ, "runq_setbit: bits=%#x %#x bit=%#x word=%d", + rqs->rq_sw[RQSW_IDX(idx)], + rqs->rq_sw[RQSW_IDX(idx)] | RQSW_BIT(idx), + RQSW_BIT(idx), RQSW_IDX(idx)); + rqs->rq_sw[RQSW_IDX(idx)] |= RQSW_BIT(idx); +} + /* * Clear the status bit of the queue at index 'idx', indicating that it is * empty. @@ -292,6 +310,65 @@ runq_clrbit(struct runq *rq, int idx) rqs->rq_sw[RQSW_IDX(idx)] &= ~RQSW_BIT(idx); } +/* + * Add the thread to the queue specified by its priority, and set the + * corresponding status bit. + */ +void +runq_add(struct runq *rq, struct thread *td, int flags) +{ + + runq_add_idx(rq, td, RQ_PRI_TO_QUEUE_IDX(td->td_priority), flags); +} + +void +runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) +{ + struct rq_queue *rqq; + + /* + * runq_setbit() asserts 'idx' is non-negative and below 'RQ_NQS', and + * a static assert earlier in this file ensures that 'RQ_NQS' is no more + * than 256. + */ + td->td_rqindex = idx; + runq_setbit(rq, idx); + rqq = &rq->rq_queues[idx]; + CTR4(KTR_RUNQ, "runq_add_idx: td=%p pri=%d idx=%d rqq=%p", + td, td->td_priority, idx, rqq); + if (flags & SRQ_PREEMPTED) + TAILQ_INSERT_HEAD(rqq, td, td_runq); + else + TAILQ_INSERT_TAIL(rqq, td, td_runq); +} + +/* + * Remove the thread from the queue specified by its priority, and clear the + * corresponding status bit if the queue becomes empty. + * + * Returns whether the corresponding queue is empty after removal. + */ +bool +runq_remove(struct runq *rq, struct thread *td) +{ + struct rq_queue *rqq; + int idx; + + KASSERT(td->td_flags & TDF_INMEM, ("runq_remove: Thread swapped out")); + idx = td->td_rqindex; + CHECK_IDX(idx); + rqq = &rq->rq_queues[idx]; + CTR4(KTR_RUNQ, "runq_remove: td=%p pri=%d idx=%d rqq=%p", + td, td->td_priority, idx, rqq); + TAILQ_REMOVE(rqq, td, td_runq); + if (TAILQ_EMPTY(rqq)) { + runq_clrbit(rq, idx); + CTR1(KTR_RUNQ, "runq_remove: queue at idx=%d now empty", idx); + return (true); + } + return (false); +} + /* * Find the index of the first non-empty run queue. This is done by * scanning the status bits, a set bit indicating a non-empty queue. @@ -346,56 +423,6 @@ again: goto again; } -/* - * Set the status bit of the queue at index 'idx', indicating that it is - * non-empty. - */ -static __inline void -runq_setbit(struct runq *rq, int idx) -{ - struct rq_status *rqs; - - CHECK_IDX(idx); - rqs = &rq->rq_status; - CTR4(KTR_RUNQ, "runq_setbit: bits=%#x %#x bit=%#x word=%d", - rqs->rq_sw[RQSW_IDX(idx)], - rqs->rq_sw[RQSW_IDX(idx)] | RQSW_BIT(idx), - RQSW_BIT(idx), RQSW_IDX(idx)); - rqs->rq_sw[RQSW_IDX(idx)] |= RQSW_BIT(idx); -} - -/* - * Add the thread to the queue specified by its priority, and set the - * corresponding status bit. - */ -void -runq_add(struct runq *rq, struct thread *td, int flags) -{ - - runq_add_idx(rq, td, RQ_PRI_TO_QUEUE_IDX(td->td_priority), flags); -} - -void -runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) -{ - struct rq_queue *rqq; - - /* - * runq_setbit() asserts 'idx' is non-negative and below 'RQ_NQS', and - * a static assert earlier in this file ensures that 'RQ_NQS' is no more - * than 256. - */ - td->td_rqindex = idx; - runq_setbit(rq, idx); - rqq = &rq->rq_queues[idx]; - CTR4(KTR_RUNQ, "runq_add_idx: td=%p pri=%d idx=%d rqq=%p", - td, td->td_priority, idx, rqq); - if (flags & SRQ_PREEMPTED) - TAILQ_INSERT_HEAD(rqq, td, td_runq); - else - TAILQ_INSERT_TAIL(rqq, td, td_runq); -} - /* * Return true if there are some processes of any priority on the run queue, * false otherwise. Has no side effects. @@ -417,6 +444,30 @@ runq_not_empty(struct runq *rq) return (false); } +/* + * Find the highest priority process on the run queue. + */ +struct thread * +runq_choose(struct runq *rq) +{ + struct rq_queue *rqq; + struct thread *td; + int idx; + + idx = runq_findbit(rq); + if (idx != -1) { + rqq = &rq->rq_queues[idx]; + td = TAILQ_FIRST(rqq); + KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); + CTR3(KTR_RUNQ, + "runq_choose: idx=%d thread=%p rqq=%p", idx, td, rqq); + return (td); + } + CTR1(KTR_RUNQ, "runq_choose: idlethread idx=%d", idx); + + return (NULL); +} + /* * Find the highest priority process on the run queue. */ @@ -460,30 +511,6 @@ runq_choose_fuzz(struct runq *rq, int fuzz) return (NULL); } -/* - * Find the highest priority process on the run queue. - */ -struct thread * -runq_choose(struct runq *rq) -{ - struct rq_queue *rqq; - struct thread *td; - int idx; - - idx = runq_findbit(rq); - if (idx != -1) { - rqq = &rq->rq_queues[idx]; - td = TAILQ_FIRST(rqq); - KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); - CTR3(KTR_RUNQ, - "runq_choose: idx=%d thread=%p rqq=%p", idx, td, rqq); - return (td); - } - CTR1(KTR_RUNQ, "runq_choose: idlethread idx=%d", idx); - - return (NULL); -} - struct thread * runq_choose_from(struct runq *rq, int from_idx) { @@ -504,29 +531,3 @@ runq_choose_from(struct runq *rq, int from_idx) return (NULL); } -/* - * Remove the thread from the queue specified by its priority, and clear the - * corresponding status bit if the queue becomes empty. - * - * Returns whether the corresponding queue is empty after removal. - */ -bool -runq_remove(struct runq *rq, struct thread *td) -{ - struct rq_queue *rqq; - int idx; - - KASSERT(td->td_flags & TDF_INMEM, ("runq_remove: Thread swapped out")); - idx = td->td_rqindex; - CHECK_IDX(idx); - rqq = &rq->rq_queues[idx]; - CTR4(KTR_RUNQ, "runq_remove: td=%p pri=%d idx=%d rqq=%p", - td, td->td_priority, idx, rqq); - TAILQ_REMOVE(rqq, td, td_runq); - if (TAILQ_EMPTY(rqq)) { - runq_clrbit(rq, idx); - CTR1(KTR_RUNQ, "runq_remove: queue at idx=%d now empty", idx); - return (true); - } - return (false); -} diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 80a1fad0a089..c570dd25503b 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -97,14 +97,15 @@ struct runq { struct rq_queue rq_queues[RQ_NQS]; }; +void runq_init(struct runq *); void runq_add(struct runq *, struct thread *, int _flags); void runq_add_idx(struct runq *, struct thread *, int _idx, int _flags); +bool runq_remove(struct runq *, struct thread *); + bool runq_not_empty(struct runq *); struct thread *runq_choose(struct runq *); -struct thread *runq_choose_from(struct runq *, int _idx); struct thread *runq_choose_fuzz(struct runq *, int _fuzz); -void runq_init(struct runq *); -bool runq_remove(struct runq *, struct thread *); +struct thread *runq_choose_from(struct runq *, int _idx); #endif /* _KERNEL */ #endif From nobody Mon Jul 28 13:31:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBG6Zhkz634sS; Mon, 28 Jul 2025 13:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBG2jXgz3tTS; Mon, 28 Jul 2025 13:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GfMA9t5m0OBzdrShjxP/rT6fh674H5mLq7q9S0r7Py4=; b=Udc/bbvjPXCcpGT4g1Gos7sK5jkTXHT5oKpzneshotY6piwyDvxdpXQfpK5OJM7ydlguY5 Re4H975Vyj6FKEpvojZzE7HQl9nf5KlpWnehLxLCfzXMpM4uRSTZnsgICqA3+tG3oze0an FurJies2CFrNezmBajBneXwG0PTBhLSLCj/5NvFfQXiP5Wh1Fc+2cyHJSCnErSLJHaN90n nL+2ZqaZGIlJ0p1L/Xf3J/qpsjJR9L0O+2b6850GcGUoSTJo6PUyCfUKgcdWUvb6I1Cq/m zpOYtiQ7ckLaqgBZEuV8O+sZffc4aQ3y9QHwl0T4n+onvRs0dBJae4F137Ce8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GfMA9t5m0OBzdrShjxP/rT6fh674H5mLq7q9S0r7Py4=; b=fRd2CotlYabmm2O+pAjeRcVf6ZG1u0Q/3nU95/Fkbw3mY53n41u8d5dEHUsQNKRoSGKcCS TGSVeAO9+o6WHOnY7mC+CRaNdshJLeuVUkW20d1kgCuaZdH3HMSyejQVfZuKKBOJFGENoa Hy99bSd4ZLwjQaXA+JZg2xu2G+EDcxC2YMM2DdQqHE2EizFyY30waohbWe20IzlbwFvVFO ST4ocdm9vc/e/8059Qi0L1ixPOedChKn3NwJZpsrSV6u8uMQ2KDN8SC9wEt19GGwNMkWJz XhNynm+ogLOwKJQ2dPS5UAjivVb1WXtdxQMEuC7gv0MT4+M47WKA8+A/yiK3yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709478; a=rsa-sha256; cv=none; b=RDtuuKnRYBFKvTD72Vl3oVbQ7sF4XlT7/5xpHnpnIjmiLxUXQGz+aPT7wsEqFqtqpO20if DW1XqJVbZ03Nk7T7z+hMUbmF8VzM4yjwsOull1hWxp0xm0EXopV7+zKE5t4Lf9gORuaGgz 9ztMB7TkZc0DF8SIKE+oqNxT58JVm14ywaNcdaF5Pd3jTjczsXOCQhStgMId6GtTfiiM7c OzkEGbrYBemPd85Z7CTcMzqRUngC0uxe4j8CAfd/EAvXiiDsRugSO683YSDHcb4RVUn6R2 j8BjnDmZTs5wTM0F/1x+Ju7L6w7NLNjpj3KDMfYiSM6aVR/V6MbbPExyvEzYaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBG1wXlznRH; Mon, 28 Jul 2025 13:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVIuO080195; Mon, 28 Jul 2025 13:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVIJB080192; Mon, 28 Jul 2025 13:31:18 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:18 GMT Message-Id: <202507281331.56SDVIJB080192@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: bd97078d704b - stable/14 - runq: Tidy up and rename runq_setbit() and runq_clrbit() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bd97078d704b59341bc05674e89e4d0c9eb2351e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bd97078d704b59341bc05674e89e4d0c9eb2351e commit bd97078d704b59341bc05674e89e4d0c9eb2351e Author: Olivier Certner AuthorDate: 2024-03-01 20:41:23 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:12 +0000 runq: Tidy up and rename runq_setbit() and runq_clrbit() Factorize common sub-expressions in a separate helper (runq_sw_apply()) for better readability. Rename these functions so that the names refer to the use cases rather than the implementations. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 757bab06fb59abca8b7fda38e8f546ff7c2d3280) --- sys/kern/kern_switch.c | 104 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 76 insertions(+), 28 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 59925c10c30d..eb39ca88992c 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -261,6 +261,21 @@ _Static_assert(RQ_NQS <= 256, ("%s: %s out of range: %d", __func__, __STRING(idx), _idx)); \ }) +/* Status words' individual bit manipulators' internals. */ +typedef uintptr_t runq_sw_op(int idx, int sw_idx, rqsw_t sw_bit, + rqsw_t *swp); +static inline uintptr_t runq_sw_apply(struct runq *rq, int idx, + runq_sw_op *op); + +static inline uintptr_t runq_sw_set_not_empty_op(int idx, int sw_idx, + rqsw_t sw_bit, rqsw_t *swp); +static inline uintptr_t runq_sw_set_empty_op(int idx, int sw_idx, + rqsw_t sw_bit, rqsw_t *swp); + +/* Status words' individual bit manipulators. */ +static inline void runq_sw_set_not_empty(struct runq *rq, int idx); +static inline void runq_sw_set_empty(struct runq *rq, int idx); + /* * Initialize a run structure. */ @@ -275,39 +290,72 @@ runq_init(struct runq *rq) } /* - * Set the status bit of the queue at index 'idx', indicating that it is - * non-empty. + * Helper to implement functions operating on a particular status word bit. + * + * The operator is passed the initial 'idx', the corresponding status word index + * in 'rq_status' in 'sw_idx', a status word with only that bit set in 'sw_bit' + * and a pointer to the corresponding status word in 'swp'. */ -static __inline void -runq_setbit(struct runq *rq, int idx) +static inline uintptr_t +runq_sw_apply(struct runq *rq, int idx, runq_sw_op *op) { - struct rq_status *rqs; + rqsw_t *swp; + rqsw_t sw_bit; + int sw_idx; CHECK_IDX(idx); - rqs = &rq->rq_status; - CTR4(KTR_RUNQ, "runq_setbit: bits=%#x %#x bit=%#x word=%d", - rqs->rq_sw[RQSW_IDX(idx)], - rqs->rq_sw[RQSW_IDX(idx)] | RQSW_BIT(idx), - RQSW_BIT(idx), RQSW_IDX(idx)); - rqs->rq_sw[RQSW_IDX(idx)] |= RQSW_BIT(idx); + + sw_idx = RQSW_IDX(idx); + sw_bit = RQSW_BIT(idx); + swp = &rq->rq_status.rq_sw[sw_idx]; + + return (op(idx, sw_idx, sw_bit, swp)); +} + +static inline uintptr_t +runq_sw_set_not_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp) +{ + rqsw_t old_sw __unused = *swp; + + *swp |= sw_bit; + CTR4(KTR_RUNQ, "runq_sw_set_not_empty: idx=%d sw_idx=%d bits=%#x->%#x", + idx, sw_idx, old_sw, *swp); + return (0); } /* - * Clear the status bit of the queue at index 'idx', indicating that it is - * empty. + * Modify the status words to indicate that some queue is not empty. + * + * Sets the status bit corresponding to the queue at index 'idx'. */ -static __inline void -runq_clrbit(struct runq *rq, int idx) +static inline void +runq_sw_set_not_empty(struct runq *rq, int idx) { - struct rq_status *rqs; - CHECK_IDX(idx); - rqs = &rq->rq_status; - CTR4(KTR_RUNQ, "runq_clrbit: bits=%#x %#x bit=%#x word=%d", - rqs->rq_sw[RQSW_IDX(idx)], - rqs->rq_sw[RQSW_IDX(idx)] & ~RQSW_BIT(idx), - RQSW_BIT(idx), RQSW_IDX(idx)); - rqs->rq_sw[RQSW_IDX(idx)] &= ~RQSW_BIT(idx); + (void)runq_sw_apply(rq, idx, &runq_sw_set_not_empty_op); +} + +static inline uintptr_t +runq_sw_set_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp) +{ + rqsw_t old_sw __unused = *swp; + + *swp &= ~sw_bit; + CTR4(KTR_RUNQ, "runq_sw_set_empty: idx=%d sw_idx=%d bits=%#x->%#x", + idx, sw_idx, old_sw, *swp); + return (0); +} + +/* + * Modify the status words to indicate that some queue is empty. + * + * Clears the status bit corresponding to the queue at index 'idx'. + */ +static inline void +runq_sw_set_empty(struct runq *rq, int idx) +{ + + (void)runq_sw_apply(rq, idx, &runq_sw_set_empty_op); } /* @@ -327,12 +375,12 @@ runq_add_idx(struct runq *rq, struct thread *td, int idx, int flags) struct rq_queue *rqq; /* - * runq_setbit() asserts 'idx' is non-negative and below 'RQ_NQS', and - * a static assert earlier in this file ensures that 'RQ_NQS' is no more - * than 256. + * runq_sw_*() functions assert that 'idx' is non-negative and below + * 'RQ_NQS', and a static assert earlier in this file ensures that + * 'RQ_NQS' is no more than 256. */ td->td_rqindex = idx; - runq_setbit(rq, idx); + runq_sw_set_not_empty(rq, idx); rqq = &rq->rq_queues[idx]; CTR4(KTR_RUNQ, "runq_add_idx: td=%p pri=%d idx=%d rqq=%p", td, td->td_priority, idx, rqq); @@ -362,7 +410,7 @@ runq_remove(struct runq *rq, struct thread *td) td, td->td_priority, idx, rqq); TAILQ_REMOVE(rqq, td, td_runq); if (TAILQ_EMPTY(rqq)) { - runq_clrbit(rq, idx); + runq_sw_set_empty(rq, idx); CTR1(KTR_RUNQ, "runq_remove: queue at idx=%d now empty", idx); return (true); } From nobody Mon Jul 28 13:31:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBG1ZXLz634sR; Mon, 28 Jul 2025 13:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBF1CN6z3tdZ; Mon, 28 Jul 2025 13:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2H+EuLVnwdNlNi5xx0CksPZDce1DIyD1UGj8i16Ru2E=; b=uFSEHQRv0ZYkWpfofwzPvg7CpYGj/DXpHQAHGjc1v5aGGrhLEtuXEUzrYJAjWHC4IdCh9k N5Pz0J342KR97eBo21lnK2BLQb9EeW/7mQ72aQHA44ox+ZOxYwJvBOvmyR8y94UoOn9iNf IXnF9TE+w4HHFx1mULwWo89AQaQByX0VUG0czl5c0fdX1Li/DN/uWItoxv6IlxKu6wI9x0 M1JEg9Np3ZUFtajNCPy8RJ5zAzVi2+I5IUQM/YYHqSaHvXQob0vBW7VKEN7C+0y7KO0XLv LLi6mFh214pQPyc7BMbgwfneUMmtPhhwuFcUwDq+GtlV8MH6SICURY9/EJqt+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2H+EuLVnwdNlNi5xx0CksPZDce1DIyD1UGj8i16Ru2E=; b=Lawk7gYAMQs2BiVODbJpNrWN8SsaTV2E/lZO9ZnmKey1pMuhIQ8wvJ7Q+ON7znskOtyp5w Zu6e+7fVDi3JNNgXYcbKCzWOXcJanbEtgfWztB3xGL2xzXSTxI0CqMcsECnJ1PjhvvJgTr CJN06JmhrVmIApltvc0vZ4C/VXJ4+mPR/bFZL9RDZ2UJUYY6FA4ZypB6n7/4WUzDlpYckb YRGVKQyuAb3oZEIksRDi8cO/1dlRBHQ1CAKi5V79cxTU6XaOI97cokXizX5VnaQWyHbwFY nnpfteLvENdIrdgQGQ16F5udSWOWnh5KJ6FVcVAdPYX7G4eV/68EJriK/Pa/Rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709477; a=rsa-sha256; cv=none; b=CPsDjFfhsCtJLUbtK/uyOBeX+AltBtkj3TNWRrAoVhHCHqzssfBhpaCfW2JlTQ3RhWnrMK 52gDkxG8hFO4DMxJt8uYM26Ij4f2QXN6VsflU8Pz85+iqP1U87Lx48JC32Yg20AQQnr/FK vMgrb4ZgZNThUf1z6qlb3+ZMlidI58Oyh9oq78SpJS4t8v7cxf2a3bhHqrmFTohBoKazQw ARzgoZkwCWrKjSI27iGFShtodN6QdNbtvhrK0PL0+s4LcgcKufFQn/m5TBJnIzOKkG0/EI wu+S5GlB2rH6YZp9O5IzEHktBWL+d6bBb5BeicJ7cOyrjvPFXlCVMZbioHSc8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBF0g1ZznCK; Mon, 28 Jul 2025 13:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVHm8080163; Mon, 28 Jul 2025 13:31:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVH3U080159; Mon, 28 Jul 2025 13:31:17 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:17 GMT Message-Id: <202507281331.56SDVH3U080159@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: bfd59136bece - stable/14 - runq: runq_check(): Re-implement on top of runq_findq() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bfd59136bece048f2c4646d6e7a1ba48a3ce7a36 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bfd59136bece048f2c4646d6e7a1ba48a3ce7a36 commit bfd59136bece048f2c4646d6e7a1ba48a3ce7a36 Author: Olivier Certner AuthorDate: 2024-02-29 18:10:58 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:10 +0000 runq: runq_check(): Re-implement on top of runq_findq() Remove one more loop and duplicated code, with the benefit of less instruction cache pollution at the expense of a few cycles more for the function calls and computing 'idx' (however, this gives a better diagnostic message). Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit de78657a3aef3c2efbcbdf9ea73a95283c91fab0) --- sys/kern/kern_switch.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index a321aecc55fb..59925c10c30d 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -445,17 +445,15 @@ runq_findq(struct runq *const rq) bool runq_not_empty(struct runq *rq) { - struct rq_status *rqs; + int idx; - rqs = &rq->rq_status; - for (int i = 0; i < RQSW_NB; i++) - if (rqs->rq_sw[i] != 0) { - CTR2(KTR_RUNQ, "runq_not_empty: bits=%#x i=%d", - rqs->rq_sw[i], i); - return (true); - } - CTR0(KTR_RUNQ, "runq_not_empty: empty"); + idx = runq_findq(rq); + if (idx != -1) { + CTR1(KTR_RUNQ, "runq_not_empty: idx=%d", idx); + return (true); + } + CTR0(KTR_RUNQ, "runq_not_empty: empty"); return (false); } From nobody Mon Jul 28 13:31:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBJ1j9Yz634sV; Mon, 28 Jul 2025 13:31:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBH4RYBz3tmx; Mon, 28 Jul 2025 13:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMwz7AJEjRolvaojgcbyDyCdhvplfO6SCv8X+Eoi4No=; b=tJP/UhJOAqTAsjvruefOBhAPbFPRI8wNMpoSkaslJLKAld/9Kztef2YLYO37qcuomB5erz Ipdl13wq4KcuEQ1YPc5k1AKg4cUSfGMf0UGlaRw9/YZjW91IAc2d04H16KS6+GyujOamxx BEjKcQhop+PVeNEf/CFSxP0Q2RM/PxTca8x90eTqH/11WIr6VlL3ALTT48lRg6CVS4VNh1 s7YjCqxU3UBga0zdMz/in6slCgwMNqGUxuiI2MUjiQ4NDlE+slZnZKO+fgDgbuO2h6jY6e vI1M4ZwtEUkJ4cybCqQe4Bs0R81Lg/EkGOUDUk3NCnXW3G0tRPgXqgva/yppmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMwz7AJEjRolvaojgcbyDyCdhvplfO6SCv8X+Eoi4No=; b=ZbJalYlzKHu/S+FhD035LNkO+000y4L1A0QJqgIijr6SIdtgZM9qJWwHEwfKhIuaPJWoo6 9oluuj6urzYLgllGfLH2CYbjyeqUy1gpwSKuawU+SvW8Pj4Kqxp5kjC6exLf+Afao1XxOa wFBsmey5dhdCxWcrYevhMrD74y+BcYBHTlqtwrPFvsPdD5oRKua/Jrhy6WVncGySVCCfqg 5flqJLPUgetVGqy8ZxaRnFQakSe2JeyoNTSi+R2NH0shgTbnttFmEnbvggaBSsw+O7YDs1 T0PCLh7XbH71rTS3FsA73m1BCVHOvw21mpbuGnk89SvhRspXRjVFeDl9NG4PMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709479; a=rsa-sha256; cv=none; b=M3POzX+yGQYZB+b1f2EDSohlHaw7KCUHY3OSH/wBP5mZiMzTwcp4dnUjaTuQ+dVLyrOgrc kUuagAbbPanPPpL37Bg5bSajWYgmMykn9anaCiJYAchWru2B4rEl4kIi+h6nepq/w0UYsn XpWiYeOh+oXt8SrwVIcllwlq8dRBi2pzkd7BWJROH0O9J0d0+bVnVAFDhi59fvCagZnhZx mFvGd+7fmwy8DOEvEJW/PJTQNmQJn3f0gbFYcLSDZcSPZ9X6ROsYqxZyBqu5WxbFKxhyaJ 1DuV7hZYr1ucIPiCphc4+U+sLIy49WhWJKdVel2/P7Jh9+5krTOjYMO6n4/gNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBH2sXtznCL; Mon, 28 Jul 2025 13:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVJfB080228; Mon, 28 Jul 2025 13:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVJbB080225; Mon, 28 Jul 2025 13:31:19 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:19 GMT Message-Id: <202507281331.56SDVJbB080225@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: 9eba574a6761 - stable/14 - runq: New function runq_is_queue_empty(); Use it in ULE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9eba574a676191e2f2aaaa0401dcd887e25fb961 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9eba574a676191e2f2aaaa0401dcd887e25fb961 commit 9eba574a676191e2f2aaaa0401dcd887e25fb961 Author: Olivier Certner AuthorDate: 2024-05-23 15:31:06 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:13 +0000 runq: New function runq_is_queue_empty(); Use it in ULE Indicates if some particular queue of the runqueue is empty. Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit a31193172cb98bd1fb242555ca8e122efff74258) --- sys/kern/kern_switch.c | 28 ++++++++++++++++++++++++++++ sys/kern/sched_ule.c | 2 +- sys/sys/runq.h | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index eb39ca88992c..b23dfa162c4f 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -271,10 +271,13 @@ static inline uintptr_t runq_sw_set_not_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp); static inline uintptr_t runq_sw_set_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp); +static inline uintptr_t runq_sw_is_empty_op(int idx, int sw_idx, + rqsw_t sw_bit, rqsw_t *swp); /* Status words' individual bit manipulators. */ static inline void runq_sw_set_not_empty(struct runq *rq, int idx); static inline void runq_sw_set_empty(struct runq *rq, int idx); +static inline bool runq_sw_is_empty(struct runq *rq, int idx); /* * Initialize a run structure. @@ -358,6 +361,31 @@ runq_sw_set_empty(struct runq *rq, int idx) (void)runq_sw_apply(rq, idx, &runq_sw_set_empty_op); } +static inline uintptr_t +runq_sw_is_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp) +{ + return ((*swp & sw_bit) == 0); +} + +/* + * Returns whether the status words indicate that some queue is empty. + */ +static inline bool +runq_sw_is_empty(struct runq *rq, int idx) +{ + return (runq_sw_apply(rq, idx, &runq_sw_is_empty_op)); +} + +/* + * Returns whether a particular queue is empty. + */ +bool +runq_is_queue_empty(struct runq *rq, int idx) +{ + + return (runq_sw_is_empty(rq, idx)); +} + /* * Add the thread to the queue specified by its priority, and set the * corresponding status bit. diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 8fdc71c21e64..d8abb911a887 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -2605,7 +2605,7 @@ sched_clock(struct thread *td, int cnt) */ if (tdq->tdq_idx == tdq->tdq_ridx) { tdq->tdq_idx = (tdq->tdq_idx + 1) % RQ_NQS; - if (TAILQ_EMPTY(&tdq->tdq_timeshare.rq_queues[tdq->tdq_ridx])) + if (runq_is_queue_empty(&tdq->tdq_timeshare, tdq->tdq_ridx)) tdq->tdq_ridx = tdq->tdq_idx; } ts = td_get_sched(td); diff --git a/sys/sys/runq.h b/sys/sys/runq.h index c570dd25503b..5156a7d8c307 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -98,6 +98,7 @@ struct runq { }; void runq_init(struct runq *); +bool runq_is_queue_empty(struct runq *, int _idx); void runq_add(struct runq *, struct thread *, int _flags); void runq_add_idx(struct runq *, struct thread *, int _idx, int _flags); bool runq_remove(struct runq *, struct thread *); From nobody Mon Jul 28 13:31:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBL1lWWz634qb; Mon, 28 Jul 2025 13:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBK54hZz3tnX; Mon, 28 Jul 2025 13:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mCzAcl5Q4kw+TEPeKwZWW65fYBnqtQX3NuF6DwxCC9c=; b=lM9ZDuNVXQGNR0/rWdVDqHAq2nq9AxWY5ApQqJgSarA6awtaYc0NlRxMkkxvxWygMcqgwT EiecPLKXmdWrAwHb2h2Af/civep94UgX11f4hjr5FOTSpMGi0pixycdyzEQ+g3CLCa6vPM bGUrC+kasbT2z7F25Ii+kH6GSU9MLbvAFdDLQh0RV+wbpjD0EMA9xWKxQIcCaWEoKm9Vth L9a0BFep6pkYdienaGQYkuFjzmrMfLAL9o+7lbWOl7uzEGECLOcIbmwEHVYibf/E3NkXWZ Cg7UFMHDdzqiTQi7BoytAEU67LKL3P0sfSE8AycQ57p60WO/tVbML4zb9B3Slw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mCzAcl5Q4kw+TEPeKwZWW65fYBnqtQX3NuF6DwxCC9c=; b=fn8Djj/SUbAMiZzCpiwpjIaqUbRqScemaEazEjNvZSHOUTisam6t5PPN0TZaQVOoa1MkDd VzzD4JVdZ2Nz1thsGIWP5rDxfaeUcIoud2baFZrbtoYYNaXDiJX9JDKiQOLrnjD+YUsaor bdGR8lFnZi5dSDcYnik6WSPvGkKQoSfmsgkjpKrADLDWSXZdhanc8ULv4ouJg3bzaYj4lW R8uNUDnlRRKAsRuudUvRRMFUfnuAvTUugLrqoqT+P6Q4Fd2TBuyMYC70qoFVfe1e8sLTap U99m74Xh8kSyXEe9fkvuP924YcSei4PXA/75ZL5Jl4kbcFP5+2KvgYrTZ+UD+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709481; a=rsa-sha256; cv=none; b=G/lT8m8gpE0EIOlqLQdJEp9RwhvcTb4VY+J5nBk+I1foQ7ejbgtjmzvcdqraes9n2TYKgz qQY+u0BBwU3upfvFlYTqhnAfNP/RiRDWLvZvLU+Lag0Dt40bPX60T+QE/kD4ejbsmE3Qu2 xZBwZ21jHFIPobkf9uDNai6ssclCPv1nxRr4g8XOzp+Ncza5VJUXlncGbFTVPweSFRAxPW Mj0U8m48RsTmYmVy8NArTB5oE8BFsry3cm+SOGoa7wvI97TGL9W/KM7rK/g4CkKHFq1Wsk AbzRxtOTPEzJAOdePlZsciTJZOJc2CK2sKwcYPl3nZaYpwLU7yVI+fhbZoZ6EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBK4P1pznNs; Mon, 28 Jul 2025 13:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVLRQ080294; Mon, 28 Jul 2025 13:31:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVLg3080291; Mon, 28 Jul 2025 13:31:21 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:21 GMT Message-Id: <202507281331.56SDVLg3080291@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: 952ccda22e27 - stable/14 - sched_ule: Re-implement stealing on top of runq common-code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 952ccda22e27a7321d07814bd19d2c407c366cd4 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=952ccda22e27a7321d07814bd19d2c407c366cd4 commit 952ccda22e27a7321d07814bd19d2c407c366cd4 Author: Olivier Certner AuthorDate: 2024-04-29 00:55:40 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:17 +0000 sched_ule: Re-implement stealing on top of runq common-code Stop using internal knowledge of runqueues. Remove duplicate boilerplate parts. Concretely, runq_steal() and runq_steal_from() are now implemented on top of runq_findq(). Besides considerably simplifying the code, this change also brings an algorithmic improvement since, previously, set bits in the runqueue's status words were found by testing each bit individually in a loop instead of using ffsl()/bsfl() (except for the first set bit per status word). This change also makes it more apparent that runq_steal_from() treats the first thread with highest priority specifically (which runq_steal() does not). MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45388 (cherry picked from commit f4be333bc56759d33dca49ab4d19eaf22134e844) --- sys/kern/sched_ule.c | 124 ++++++++++++++++++++++++++++----------------------- 1 file changed, 68 insertions(+), 56 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index d8abb911a887..2e01cf6c2484 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1183,51 +1183,68 @@ tdq_notify(struct tdq *tdq, int lowpri) ipi_cpu(cpu, IPI_PREEMPT); } -/* - * Steals load from a timeshare queue. Honors the rotating queue head - * index. - */ -static struct thread * -runq_steal_from(struct runq *rq, int cpu, u_char start) +struct runq_steal_pred_data { + struct thread *td; + struct thread *first; + int cpu; + bool use_first_last; +}; + +static bool +runq_steal_pred(const int idx, struct rq_queue *const q, void *const data) { - struct rq_status *rqs; - struct rq_queue *rqq; - struct thread *td, *first; - int bit; - int i; + struct runq_steal_pred_data *const d = data; + struct thread *td; - rqs = &rq->rq_status; - bit = RQSW_BIT_IDX(start); - first = NULL; -again: - for (i = RQSW_IDX(start); i < RQSW_NB; bit = 0, i++) { - if (rqs->rq_sw[i] == 0) + TAILQ_FOREACH(td, q, td_runq) { + if (d->use_first_last && d->first == NULL) { + d->first = td; continue; - if (bit == 0) - bit = RQSW_BSF(rqs->rq_sw[i]); - for (; bit < RQSW_BPW; bit++) { - if ((rqs->rq_sw[i] & (1ul << bit)) == 0) - continue; - rqq = &rq->rq_queues[RQSW_TO_QUEUE_IDX(i, bit)]; - TAILQ_FOREACH(td, rqq, td_runq) { - if (first) { - if (THREAD_CAN_MIGRATE(td) && - THREAD_CAN_SCHED(td, cpu)) - return (td); - } else - first = td; - } + } + + if (THREAD_CAN_MIGRATE(td) && THREAD_CAN_SCHED(td, d->cpu)) { + d->td = td; + return (true); } } - if (start != 0) { - start = 0; - goto again; + + return (false); +} + +/* + * Steals load from a timeshare queue. Honors the rotating queue head + * index. + */ +static inline struct thread * +runq_steal_from(struct runq *const rq, int cpu, int start_idx) +{ + struct runq_steal_pred_data data = { + .td = NULL, + .first = NULL, + .cpu = cpu, + .use_first_last = true + }; + int idx; + + idx = runq_findq(rq, start_idx, RQ_NQS - 1, &runq_steal_pred, &data); + if (idx != -1) + goto found; + + MPASS(data.td == NULL); + if (start_idx != 0) { + idx = runq_findq(rq, 0, start_idx - 1, &runq_steal_pred, &data); + if (idx != -1) + goto found; } - if (first && THREAD_CAN_MIGRATE(first) && - THREAD_CAN_SCHED(first, cpu)) - return (first); + MPASS(idx == -1 && data.td == NULL); + if (data.first != NULL && THREAD_CAN_MIGRATE(data.first) && + THREAD_CAN_SCHED(data.first, cpu)) + return (data.first); return (NULL); +found: + MPASS(data.td != NULL); + return (data.td); } /* @@ -1236,26 +1253,21 @@ again: static struct thread * runq_steal(struct runq *rq, int cpu) { - struct rq_queue *rqq; - struct rq_status *rqs; - struct thread *td; - int word; - int bit; - - rqs = &rq->rq_status; - for (word = 0; word < RQSW_NB; word++) { - if (rqs->rq_sw[word] == 0) - continue; - for (bit = 0; bit < RQSW_BPW; bit++) { - if ((rqs->rq_sw[word] & (1ul << bit)) == 0) - continue; - rqq = &rq->rq_queues[RQSW_TO_QUEUE_IDX(word, bit)]; - TAILQ_FOREACH(td, rqq, td_runq) - if (THREAD_CAN_MIGRATE(td) && - THREAD_CAN_SCHED(td, cpu)) - return (td); - } + struct runq_steal_pred_data data = { + .td = NULL, + .first = NULL, + .cpu = cpu, + .use_first_last = false + }; + int idx; + + idx = runq_findq(rq, 0, RQ_NQS - 1, &runq_steal_pred, &data); + if (idx != -1) { + MPASS(data.td != NULL); + return (data.td); } + + MPASS(data.td == NULL); return (NULL); } From nobody Mon Jul 28 13:31:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBK04GKz6351T; Mon, 28 Jul 2025 13:31:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBJ4s78z3tqS; Mon, 28 Jul 2025 13:31:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAKNE20Nh9JdMHx3xVenyTjm8JLUykTyP+2jFaw9cAI=; b=iBx3IEzOwnUnuNZZxwDztoO2xoF4ZPWUxBcY0F0uWl5/c7SHFJUeFA4lfGX0A7E72G9elw x/coBcXvA4jSNQr0PBo3ZHoIcoRxnhOVGTkjOTUcZY8dRtOIvZwrDM32wnxdrT0HWGQjYs WpmNDJBqUJQe52Zux9ptBuMHPiB4BIi0BpPZAdNnwCPpQ0GNgW1ZUpCbtdwWI0wMmxyEwy 8jvoIxmFFvhdcY5nesEGK3WHPgMfD33fBqamPdr1gAU3WARaROpYj4aqYsWW5ZGi6Mc86A eOv4KM5W/KI72vBHVHHq8jNWesOo0RAypySk2P4MOhDFdr6CPVpdxZFgKKmj4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AAKNE20Nh9JdMHx3xVenyTjm8JLUykTyP+2jFaw9cAI=; b=OIkqBFdljQtjD0Q4NIMtRcdXAsNP+hiV3g6LOdVyo0ydAAM6VQConOwpsX/6TkSoCKh5O7 eZCDML5eDGuiz/En9vhel6Mza0twpsugSS0QgnAkZ4Md5J++LF7+NvHoa2rbbT7xrZ6MjB ijU7+XX3FcahIDbtHKlCpNvlCOyBh+/STaA7/O0pUoIb7CWQFqejlO1Nn+uUhb64CVIdRD HWtHeV8hDyQkAc9BylU3vczLneAHoYbi7youAOYOqD45Ea5HxJd022NROI5CHW/wMvkmlK qs022jdddHYXrTlOpRa5Wz27XurXHzX6Z0aOnGwSUt4ulXbIVCYr1ykpbu+okg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709480; a=rsa-sha256; cv=none; b=hc3OOiq4ne7scYOvvSqkNhy10QTYHTPZM/+AtCIfpPxuPJkx2SGX26O6gGjz2Pna6l3tYI hRQtNna7PlPsfzpGO1z+a3pPeS72GfOKmxR+cN5ptldcN/GEywRl+ebTyr9UtAbVxZDKH1 Kfvvcmro4XhlRmDZqoCvBoeM+LJl5eimBVBgkEF8y51MWL43c40zOQtTNe/rqo2iTceftB 5AcM/sKEX435kW1iFjusz8orp7k3fBGIXS/WgTtEhuicAe6kspbBDRnY+JguVX1WmyE2IF buhTDIm5TYZzN72IR3AcUeuAX6AkdIuhb1BMy7BOQiyZYnjXaV6U7EB0lIBZIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBJ3ngMznG3; Mon, 28 Jul 2025 13:31:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVK1S080261; Mon, 28 Jul 2025 13:31:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVKBE080258; Mon, 28 Jul 2025 13:31:20 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:20 GMT Message-Id: <202507281331.56SDVKBE080258@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: 16cfdebb8b34 - stable/14 - runq: New runq_findq(), common low-level search implementation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 16cfdebb8b3466c27a7c4a42589c252353ccdad1 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=16cfdebb8b3466c27a7c4a42589c252353ccdad1 commit 16cfdebb8b3466c27a7c4a42589c252353ccdad1 Author: Olivier Certner AuthorDate: 2024-04-26 01:57:25 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:15 +0000 runq: New runq_findq(), common low-level search implementation That new runq_findq(), based on the implementation of the former runq_findq_range(), is intended to become the foundation and unique low-level implementation for all searches in a runqueue. In addition to a range of queues' indices, it takes a predicate function, allowing to: - Possibly skip a non-empty queue with higher priority (numerically lower index) on some criteria. This is not yet used but will be in a subsequent commit revising ULE's stealing machinery. - Choose a specific thread in the queue, not necessarily the first. - Return whatever information is deemed necessary. It helps to remove duplicated boilerplate code, including redundant assertions, and generally makes things much clearer. These effects will be even greater in a subsequent commit modifying ULE to use it. runq_first_thread_range() replaces the old runq_findq_range() (returns the first thread of the highest priority queue in the requested range), and runq_first_thread() the old runq_findq() (same, but considering all queues). Reviewed by: kib MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45387 (cherry picked from commit 9c3f4682bb90eeb85b0bbe8728a493e7d2ffece3) --- sys/kern/kern_switch.c | 203 ++++++++++++++++++++++++++++++------------------- sys/sys/runq.h | 13 +++- 2 files changed, 135 insertions(+), 81 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index b23dfa162c4f..9a05f3c90a80 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -445,15 +445,44 @@ runq_remove(struct runq *rq, struct thread *td) return (false); } +static inline int +runq_findq_status_word(struct runq *const rq, const int w_idx, + const rqsw_t w, runq_pred_t *const pred, void *const pred_data) +{ + struct rq_queue *q; + rqsw_t tw = w; + int idx, b_idx; + + while (tw != 0) { + b_idx = RQSW_BSF(tw); + idx = RQSW_TO_QUEUE_IDX(w_idx, b_idx); + q = &rq->rq_queues[idx]; + KASSERT(!TAILQ_EMPTY(q), + ("runq_findq(): No thread on non-empty queue with idx=%d", + idx)); + if (pred(idx, q, pred_data)) + return (idx); + tw &= ~RQSW_BIT(idx); + } + + return (-1); +} + /* - * Find the index of the first (i.e., having lower index) non-empty queue in the - * passed range (bounds included). This is done by scanning the status bits, - * a set bit indicating a non-empty queue. Returns -1 if all queues in the range - * are empty. + * Find in the passed range (bounds included) the index of the first (i.e., + * having lower index) non-empty queue that passes pred(). + * + * Considered queues are those with index 'lvl_min' up to 'lvl_max' (bounds + * included). If no queue matches, returns -1. + * + * This is done by scanning the status words (a set bit indicates a non-empty + * queue) and calling pred() with corresponding queue indices. pred() must + * return whether the corresponding queue is accepted. It is passed private + * data through 'pred_data', which can be used both for extra input and output. */ -static int -runq_findq_range(const struct runq *const rq, const int lvl_min, - const int lvl_max) +int +runq_findq(struct runq *const rq, const int lvl_min, const int lvl_max, + runq_pred_t *const pred, void *const pred_data) { rqsw_t const (*const rqsw)[RQSW_NB] = &rq->rq_status.rq_sw; rqsw_t w; @@ -470,12 +499,14 @@ runq_findq_range(const struct runq *const rq, const int lvl_min, w = (*rqsw)[i] & ~(RQSW_BIT(lvl_min) - 1); if (i == last) goto last_mask; - if (w != 0) + idx = runq_findq_status_word(rq, i, w, pred, pred_data); + if (idx != -1) goto return_idx; for (++i; i < last; ++i) { w = (*rqsw)[i]; - if (w != 0) + idx = runq_findq_status_word(rq, i, w, pred, pred_data); + if (idx != -1) goto return_idx; } @@ -484,34 +515,45 @@ runq_findq_range(const struct runq *const rq, const int lvl_min, last_mask: /* Clear bits for runqueues above 'lvl_max'. */ w &= (RQSW_BIT(lvl_max) - 1) | RQSW_BIT(lvl_max); - if (w != 0) + idx = runq_findq_status_word(rq, i, w, pred, pred_data); + if (idx != -1) goto return_idx; - return (-1); return_idx: - idx = RQSW_FIRST_QUEUE_IDX(i, w); - CTR4(KTR_RUNQ, "runq_findq_range: bits=%#x->%#x i=%d idx=%d", + CTR4(KTR_RUNQ, "runq_findq: bits=%#x->%#x i=%d idx=%d", (*rqsw)[i], w, i, idx); return (idx); } -static __inline int -runq_findq_circular(struct runq *const rq, int start_idx) +static bool +runq_first_thread_pred(const int idx, struct rq_queue *const q, void *const data) { - int idx; + struct thread **const tdp = data; + struct thread *const td = TAILQ_FIRST(q); - idx = runq_findq_range(rq, start_idx, RQ_NQS - 1); - if (idx != -1 || start_idx == 0) - return (idx); + *tdp = td; + return (true); +} - return (runq_findq_range(rq, 0, start_idx - 1)); +/* + * Inline this function for the benefit of this file's internal uses, but make + * sure it has an external definition as it is exported. + */ +extern inline struct thread * +runq_first_thread_range(struct runq *const rq, const int lvl_min, + const int lvl_max) +{ + struct thread *td = NULL; + + (void)runq_findq(rq, lvl_min, lvl_max, runq_first_thread_pred, &td); + return (td); } -static __inline int -runq_findq(struct runq *const rq) +static inline struct thread * +runq_first_thread(struct runq *const rq) { - return (runq_findq_range(rq, 0, RQ_NQS - 1)); + return (runq_first_thread_range(rq, 0, RQ_NQS - 1)); } /* @@ -521,11 +563,11 @@ runq_findq(struct runq *const rq) bool runq_not_empty(struct runq *rq) { - int idx; + struct thread *const td = runq_first_thread(rq); - idx = runq_findq(rq); - if (idx != -1) { - CTR1(KTR_RUNQ, "runq_not_empty: idx=%d", idx); + if (td != NULL) { + CTR2(KTR_RUNQ, "runq_not_empty: idx=%d, td=%p", + td->td_rqindex, td); return (true); } @@ -539,84 +581,85 @@ runq_not_empty(struct runq *rq) struct thread * runq_choose(struct runq *rq) { - struct rq_queue *rqq; struct thread *td; - int idx; - idx = runq_findq(rq); - if (idx != -1) { - rqq = &rq->rq_queues[idx]; - td = TAILQ_FIRST(rqq); - KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); - CTR3(KTR_RUNQ, - "runq_choose: idx=%d thread=%p rqq=%p", idx, td, rqq); + td = runq_first_thread(rq); + if (td != NULL) { + CTR2(KTR_RUNQ, "runq_choose: idx=%d td=%p", td->td_rqindex, td); return (td); } - CTR1(KTR_RUNQ, "runq_choose: idlethread idx=%d", idx); + CTR0(KTR_RUNQ, "runq_choose: idlethread"); return (NULL); } +struct runq_fuzz_pred_data { + int fuzz; + struct thread *td; +}; + +static bool +runq_fuzz_pred(const int idx, struct rq_queue *const q, void *const data) +{ + struct runq_fuzz_pred_data *const d = data; + const int fuzz = d->fuzz; + struct thread *td; + + td = TAILQ_FIRST(q); + + if (fuzz > 1) { + /* + * In the first couple of entries, check if + * there is one for our CPU as a preference. + */ + struct thread *td2 = td; + int count = fuzz; + int cpu = PCPU_GET(cpuid); + + while (count-- != 0 && td2 != NULL) { + if (td2->td_lastcpu == cpu) { + td = td2; + break; + } + td2 = TAILQ_NEXT(td2, td_runq); + } + } + + d->td = td; + return (true); +} + /* * Find the highest priority process on the run queue. */ struct thread * runq_choose_fuzz(struct runq *rq, int fuzz) { - struct rq_queue *rqq; - struct thread *td; + struct runq_fuzz_pred_data data = { + .fuzz = fuzz, + .td = NULL + }; int idx; - idx = runq_findq(rq); + idx = runq_findq(rq, 0, RQ_NQS - 1, runq_fuzz_pred, &data); if (idx != -1) { - rqq = &rq->rq_queues[idx]; - /* fuzz == 1 is normal.. 0 or less are ignored */ - if (fuzz > 1) { - /* - * In the first couple of entries, check if - * there is one for our CPU as a preference. - */ - int count = fuzz; - int cpu = PCPU_GET(cpuid); - struct thread *td2; - td2 = td = TAILQ_FIRST(rqq); - - while (count-- && td2) { - if (td2->td_lastcpu == cpu) { - td = td2; - break; - } - td2 = TAILQ_NEXT(td2, td_runq); - } - } else - td = TAILQ_FIRST(rqq); - KASSERT(td != NULL, ("runq_choose_fuzz: no proc on busy queue")); - CTR3(KTR_RUNQ, - "runq_choose_fuzz: idx=%d thread=%p rqq=%p", idx, td, rqq); - return (td); + MPASS(data.td != NULL); + CTR2(KTR_RUNQ, "runq_choose_fuzz: idx=%d td=%p", idx, data.td); + return (data.td); } - CTR1(KTR_RUNQ, "runq_choose_fuzz: idleproc idx=%d", idx); + MPASS(data.td == NULL); + CTR0(KTR_RUNQ, "runq_choose_fuzz: idlethread"); return (NULL); } struct thread * -runq_choose_from(struct runq *rq, int from_idx) +runq_choose_from(struct runq *const rq, int from_idx) { - struct rq_queue *rqq; struct thread *td; - int idx; - if ((idx = runq_findq_circular(rq, from_idx)) != -1) { - rqq = &rq->rq_queues[idx]; - td = TAILQ_FIRST(rqq); - KASSERT(td != NULL, ("runq_choose: no thread on busy queue")); - CTR4(KTR_RUNQ, - "runq_choose_from: idx=%d thread=%p idx=%d rqq=%p", - idx, td, td->td_rqindex, rqq); + td = runq_first_thread_range(rq, from_idx, RQ_NQS - 1); + if (td != NULL || from_idx == 0) return (td); - } - CTR1(KTR_RUNQ, "runq_choose_from: idlethread idx=%d", idx); - - return (NULL); + return (runq_first_thread_range(rq, 0, from_idx - 1)); } diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 5156a7d8c307..0a7f70fcfa16 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -103,7 +103,18 @@ void runq_add(struct runq *, struct thread *, int _flags); void runq_add_idx(struct runq *, struct thread *, int _idx, int _flags); bool runq_remove(struct runq *, struct thread *); -bool runq_not_empty(struct runq *); +/* + * Implementation helpers for common and scheduler-specific runq_choose*() + * functions. + */ +typedef bool runq_pred_t(int _idx, struct rq_queue *, void *_data); +int runq_findq(struct runq *const rq, const int lvl_min, + const int lvl_max, + runq_pred_t *const pred, void *const pred_data); +struct thread *runq_first_thread_range(struct runq *const rq, + const int lvl_min, const int lvl_max); + +bool runq_not_empty(struct runq *); struct thread *runq_choose(struct runq *); struct thread *runq_choose_fuzz(struct runq *, int _fuzz); struct thread *runq_choose_from(struct runq *, int _idx); From nobody Mon Jul 28 13:31:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBM3t6jz6351Z; Mon, 28 Jul 2025 13:31:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBL5fxpz3tYk; Mon, 28 Jul 2025 13:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fw2CmIAn2UIawjnwHwD86F/xl3qGAqJ+/kWi7VrnYgA=; b=ML1YGkIhk8C4lFzj7hq0P5eTZq5qtIcjXDCDgmUjYtGEFI/A0uDnBgipgA8lfQqDCVkKgB AN+cquWkuKCk3tcF5mJvkR+7wQ0rNIVe79D4qctUoHghRCgZpBMMz4r62HKvzWCgIVOWNy jbCBMTIII/4BHpAU+/RUpO9XRy5FXb+/Nc8f8rIPsXCz+WN7U35mivJDkNnow1J54YS0z3 34bqLOUDSW+T9Po68cPefekIEI5AIb03wbICqURlT06Zv7bp3JO5x3Yi1t60GtvT7q61en 3WGuRxzwfjZ339HbAp1cJ9y6jmQKbLON0ig2faqZP0yh2fLuT7pbUQBN1HOZWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fw2CmIAn2UIawjnwHwD86F/xl3qGAqJ+/kWi7VrnYgA=; b=oyH+/3m6CU+ugeo1Sa0b9qvcV2y5LDjRDOKu+LMv01QvIP7Wz1igImYDYrinEaBg/TX0Zu 8/FY4jUF+VYryikS65WtAW9Mh3GCDZCeQBB77DKNdMxNJjWcMEC3T+pYDGebs0byih9wm6 mCyulId2gJhuYzQhuRvAFGrc8WSjVtWEXhzeN9CB9wOhQ5uoMpfjlQGDEeLnIeVTIPxnOE 2BTOilGu19rmxkA2Cm3uAUpMHtX7u6wT6v4JohJhhqGZa6XVNCuN55pWR6WXcXdJ/vzFDM ziUSJNhJ30DSiLXXipPu+4WwwzytXdCVEKDNELi2OSuwk5k97CVn2e2Btx2u+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709482; a=rsa-sha256; cv=none; b=hOI6moF08nTK/T5oMeioUQQWHBcTw2PQ1+TP1VtGU9uiv8ga+5wmmQZVEGZqU6MpP0sIqI IdGDYGBOT6pdKlC/083LgUHb+0MzIHS6nYyp66nlCc7CDgttak/zOqzydTdAvE3dWTanl3 gvT6TPf6nYsc41BxX3oyk2ggQsJtXZODt1AhaTuuFAmtxddi5PO5ecOEoIoiXAiB79G9cP GCMdEMrZfDyX5/5YvpXjnqWLkJjOevFdOEvJXDFuj7VdLnPWv7b8sW/hhKR1akD235c1Rt 2XTy3U1qBfQV4VFQd1NF728wM/x+Gk6yVB54bScVSli/DBs/ibZO/ocdhVBdnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBL5Cc1znfM; Mon, 28 Jul 2025 13:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVMxC080333; Mon, 28 Jul 2025 13:31:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVM1u080330; Mon, 28 Jul 2025 13:31:22 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:22 GMT Message-Id: <202507281331.56SDVM1u080330@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: 0566e750c46c - stable/14 - sched_ule: runq_steal_from(): Suppress first thread special case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0566e750c46cea02b4fbdda5b31e83dafaeaeb15 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0566e750c46cea02b4fbdda5b31e83dafaeaeb15 commit 0566e750c46cea02b4fbdda5b31e83dafaeaeb15 Author: Olivier Certner AuthorDate: 2024-04-29 06:54:43 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:18 +0000 sched_ule: runq_steal_from(): Suppress first thread special case This special case was introduced as soon as commit "ULE 3.0" (ae7a6b38d53f, r171482, from July 2007). It caused runq_steal_from() to ignore the highest-priority thread while stealing. Its functionality was changed in commit "Rework CPU load balancing in SCHED_ULE" (36acfc6507aa, r232207, from February 2012), where the intent was to keep track of that first thread and return it if no other one was stealable, instead of returning NULL (no steal). Some bug prevented it from working in loaded cases (more than one thread, and all threads but the first one not stealable), which was subsequently fixed in commit "sched_ule(4): Fix interactive threads stealing." (bd84094a51c4, from September 2021). All the reasons for this mechanism we could second-guess were dubious at best. Jeff Roberson, ULE's main author, says in the differential revision that "The point was to move threads that are least likely to benefit from affinity because they are unlikely to run soon enough to take advantage of it.", to which we responded: "(snip) This may improve affinity in some cases, but at the same time we don't really know when the next thread on the queue is to run. Not stealing in this case also amounts to slightly violating the expected execution ordering and fairness.". As this twist doesn't seem to bring any performance improvement in general, let's just remove it. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45388 (cherry picked from commit fdf31d27476968456a8a389d8152370582756ef1) --- sys/kern/sched_ule.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 2e01cf6c2484..01eaabac3450 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1185,9 +1185,7 @@ tdq_notify(struct tdq *tdq, int lowpri) struct runq_steal_pred_data { struct thread *td; - struct thread *first; int cpu; - bool use_first_last; }; static bool @@ -1197,11 +1195,6 @@ runq_steal_pred(const int idx, struct rq_queue *const q, void *const data) struct thread *td; TAILQ_FOREACH(td, q, td_runq) { - if (d->use_first_last && d->first == NULL) { - d->first = td; - continue; - } - if (THREAD_CAN_MIGRATE(td) && THREAD_CAN_SCHED(td, d->cpu)) { d->td = td; return (true); @@ -1220,9 +1213,7 @@ runq_steal_from(struct runq *const rq, int cpu, int start_idx) { struct runq_steal_pred_data data = { .td = NULL, - .first = NULL, .cpu = cpu, - .use_first_last = true }; int idx; @@ -1238,9 +1229,6 @@ runq_steal_from(struct runq *const rq, int cpu, int start_idx) } MPASS(idx == -1 && data.td == NULL); - if (data.first != NULL && THREAD_CAN_MIGRATE(data.first) && - THREAD_CAN_SCHED(data.first, cpu)) - return (data.first); return (NULL); found: MPASS(data.td != NULL); @@ -1255,9 +1243,7 @@ runq_steal(struct runq *rq, int cpu) { struct runq_steal_pred_data data = { .td = NULL, - .first = NULL, .cpu = cpu, - .use_first_last = false }; int idx; From nobody Mon Jul 28 13:31:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBP2kvQz634lT; Mon, 28 Jul 2025 13:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBP0F72z3tjP; Mon, 28 Jul 2025 13:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KOfWXwI+L3efhmIcegIqV5Ifh8a7CYhgqCqvUdN35Nc=; b=yS3LcTtH9jWrrTB0eMr4MlwcoBZeN2aDe8eGgXk4pZn2cSKNG/aVcEFaNr8+AxJi0F+xhK trHz3RpnkE7hBmpvmc4iS16GQ8fuiy75RtbRAHBdgNVJ2TpUTzlwo42EOnyoQXXUICFufW HD7w2KrtVSTiaA1lURyWl3CfM3gHfAnEaO8wHTrzhNdFiLI5P1/rlFwy3YO5T4Z12iAbPG qeaqvJB4TKonpQz9ZzEYu/kFpxVEKkC+CFrj/C6zVeaDZDXTSXamlDawQuIHtrd2Z8eJMU es+tfldY+KfIPgN7/nY8NjRFy8XWqSmxvaiL5OJDGI+DS0OII+0GmcD7vqH0lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KOfWXwI+L3efhmIcegIqV5Ifh8a7CYhgqCqvUdN35Nc=; b=sU6xstUgoUqRkaH3FU9Rtye5SxqC1zH4/vdC4SviTabZh9t36w2IDOZB0ErlBPhqEP0AuB MT6hijM0/fpnkswL5ybSn+30ftTHkVLMS/xEAT1vgybSfwOMYsMAQraDo6O2lvSj4K42IE aZ73uO2eurgItOHh/n9inS5Lqwtrl/mdOCIuprB5eoJW2yFPBPIu1AiTxUQ0yTZCeFhp9r owUeoCP2S3EEGRUsEkolIF7rn0rXJdL+2+v/no2f5q2bjDVbxt88VO09mpnWkuIabx0iuZ iwU/aXt8v3FaBUJTysIIv0goO4Z8wTynVnPlaGOE8o7MTR0yPArEMa+SuPFyCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709485; a=rsa-sha256; cv=none; b=JoFjYCOprzrjPiqSw/eOQhupGWBYsfS+n693zKNWWgU7PU/V4tDtY4HohOGpvH/00qf10X YITHn5FrqsnUPQmLlen6rzNYFp1SwloHjouRQrT4xi3OvYEhxFP8NFaeXV3rlNP3WVYzum zlwqC5jwnr+e6maIL88UAyr5EAExNcDSJOPzgDFGZhjZTJ9WfM++C063t+G+8ioO7kZ3uZ EnJcRxIQca3JVYq43Xzg5kbrpqeV/0JplqMiOBFiLAAbgO/NP01fk3FDp+I2NaxqNK+j8H EPyk38RqfUSMw7mVLvzDx1ky0lgNq0qMAtKN5MR8Y7ANERLOJH0Ta+9GMFUscA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBN6xNkznJV; Mon, 28 Jul 2025 13:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVOU3080399; Mon, 28 Jul 2025 13:31:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVOqd080396; Mon, 28 Jul 2025 13:31:24 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:24 GMT Message-Id: <202507281331.56SDVOqd080396@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: 79dcda3d5df6 - stable/14 - Internal scheduling priorities: Always use symbolic 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 79dcda3d5df6ede0bb4a0afcaa7180af703a785d Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=79dcda3d5df6ede0bb4a0afcaa7180af703a785d commit 79dcda3d5df6ede0bb4a0afcaa7180af703a785d Author: Olivier Certner AuthorDate: 2024-05-22 15:29:22 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:20 +0000 Internal scheduling priorities: Always use symbolic ones Replace priorities specified by a base priority and some hardcoded offset value by symbolic constants. Hardcoded offsets prevent changing the difference between priorities without changing their relative ordering, and is generally a dangerous practice since the resulting priority may inadvertently belong to a different selection policy's range. Since RQ_PPQ is 4, differences of less than 4 are insignificant, so just remove them. These small differences have not been changed for years, so it is likely they have no real meaning (besides having no practical effect). One can still consult the changes history to recover them if ever needed. No functional change (intended). MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 (cherry picked from commit 8ecc41918066422d6788a67251b22d11a6efeddf) --- sys/cam/ctl/ctl.c | 4 ++-- sys/dev/firewire/firewirereg.h | 2 +- sys/dev/iicbus/iiconf.h | 2 +- sys/dev/ppbus/lpt.c | 2 +- sys/dev/ppbus/ppbconf.h | 2 +- sys/dev/smbus/smbconf.h | 2 +- sys/dev/syscons/syscons.c | 2 +- sys/dev/vkbd/vkbd.c | 14 +++++++------- sys/fs/fuse/fuse_device.c | 2 +- sys/fs/fuse/fuse_io.c | 2 +- sys/fs/fuse/fuse_ipc.c | 4 ++-- sys/fs/nfs/nfs_commonsubs.c | 2 +- sys/fs/nfsserver/nfs_nfsdcache.c | 6 +++--- sys/fs/nfsserver/nfs_nfsdstate.c | 4 ++-- sys/fs/smbfs/smbfs_io.c | 2 +- sys/kern/kern_rmlock.c | 7 ++++--- sys/kern/subr_log.c | 2 +- sys/kern/sysv_msg.c | 4 ++-- sys/kern/sysv_sem.c | 2 +- sys/kern/vfs_bio.c | 7 +++---- sys/kern/vfs_vnops.c | 12 ++++++------ sys/net/if_tuntap.c | 8 ++++---- sys/netgraph/ng_device.c | 2 +- sys/sys/buf.h | 4 ++-- sys/ufs/ffs/ffs_softdep.c | 6 +++--- sys/ufs/ffs/ffs_vnops.c | 3 +-- sys/ufs/ufs/ufs_quota.c | 22 +++++++++++----------- 27 files changed, 65 insertions(+), 66 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index f22b6ae924bc..0c2c21ba42fa 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -13424,7 +13424,7 @@ ctl_work_thread(void *arg) CTL_DEBUG_PRINT(("ctl_work_thread starting\n")); thread_lock(curthread); - sched_prio(curthread, PUSER - 1); + sched_prio(curthread, PRI_MAX_KERN); thread_unlock(curthread); while (!softc->shutdown) { @@ -13494,7 +13494,7 @@ ctl_thresh_thread(void *arg) CTL_DEBUG_PRINT(("ctl_thresh_thread starting\n")); thread_lock(curthread); - sched_prio(curthread, PUSER - 1); + sched_prio(curthread, PRI_MAX_KERN); thread_unlock(curthread); while (!softc->shutdown) { diff --git a/sys/dev/firewire/firewirereg.h b/sys/dev/firewire/firewirereg.h index 4d2d282dd22d..d17f7a15785a 100644 --- a/sys/dev/firewire/firewirereg.h +++ b/sys/dev/firewire/firewirereg.h @@ -293,7 +293,7 @@ extern int firewire_debug; extern devclass_t firewire_devclass; extern int firewire_phydma_enable; -#define FWPRI ((PZERO + 8) | PCATCH) +#define FWPRI (PWAIT | PCATCH) #define CALLOUT_INIT(x) callout_init(x, 1 /* mpsafe */) diff --git a/sys/dev/iicbus/iiconf.h b/sys/dev/iicbus/iiconf.h index ccf1661bba7f..2fe95c0e9f6d 100644 --- a/sys/dev/iicbus/iiconf.h +++ b/sys/dev/iicbus/iiconf.h @@ -32,7 +32,7 @@ #include -#define IICPRI (PZERO+8) /* XXX sleep/wakeup queue priority */ +#define IICPRI (PWAIT) /* XXX sleep/wakeup queue priority */ #define LSB 0x1 diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index 644e0f08008b..27cc7bb28f85 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -100,7 +100,7 @@ static int volatile lptflag = 1; #define LPINITRDY 4 /* wait up to 4 seconds for a ready */ #define LPTOUTINITIAL 10 /* initial timeout to wait for ready 1/10 s */ #define LPTOUTMAX 1 /* maximal timeout 1 s */ -#define LPPRI (PZERO+8) +#define LPPRI (PWAIT) #define BUFSIZE 1024 #define BUFSTATSIZE 32 diff --git a/sys/dev/ppbus/ppbconf.h b/sys/dev/ppbus/ppbconf.h index 0f6395121fba..66f45634ea6d 100644 --- a/sys/dev/ppbus/ppbconf.h +++ b/sys/dev/ppbus/ppbconf.h @@ -63,7 +63,7 @@ /* * Parallel Port Bus sleep/wakeup queue. */ -#define PPBPRI (PZERO+8) +#define PPBPRI (PWAIT) /* * Parallel Port Chipset mode masks. diff --git a/sys/dev/smbus/smbconf.h b/sys/dev/smbus/smbconf.h index 4c646df20a30..a6c320594064 100644 --- a/sys/dev/smbus/smbconf.h +++ b/sys/dev/smbus/smbconf.h @@ -30,7 +30,7 @@ #include -#define SMBPRI (PZERO+8) /* XXX sleep/wakeup queue priority */ +#define SMBPRI (PWAIT) /* XXX sleep/wakeup queue priority */ #define n(flags) (~(flags) & (flags)) diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index fd204491f8fc..c53b2b582663 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -1310,7 +1310,7 @@ sctty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) if (i == sc->cur_scp->index) return 0; error = - tsleep(VTY_WCHAN(sc, i), (PZERO + 1) | PCATCH, "waitvt", 0); + tsleep(VTY_WCHAN(sc, i), PZERO | PCATCH, "waitvt", 0); return error; case VT_GETACTIVE: /* get active vty # */ diff --git a/sys/dev/vkbd/vkbd.c b/sys/dev/vkbd/vkbd.c index 3dbf64063e33..27a7e626fa64 100644 --- a/sys/dev/vkbd/vkbd.c +++ b/sys/dev/vkbd/vkbd.c @@ -82,7 +82,7 @@ MALLOC_DEFINE(M_VKBD, KEYBOARD_NAME, "Virtual AT keyboard"); #define VKBD_UNLOCK(s) mtx_unlock(&(s)->ks_lock) #define VKBD_LOCK_ASSERT(s, w) mtx_assert(&(s)->ks_lock, w) #define VKBD_SLEEP(s, f, d, t) \ - msleep(&(s)->f, &(s)->ks_lock, PCATCH | (PZERO + 1), d, t) + msleep(&(s)->f, &(s)->ks_lock, PCATCH | PZERO, d, t) #else #define VKBD_LOCK_DECL #define VKBD_LOCK_INIT(s) @@ -90,7 +90,7 @@ MALLOC_DEFINE(M_VKBD, KEYBOARD_NAME, "Virtual AT keyboard"); #define VKBD_LOCK(s) #define VKBD_UNLOCK(s) #define VKBD_LOCK_ASSERT(s, w) -#define VKBD_SLEEP(s, f, d, t) tsleep(&(s)->f, PCATCH | (PZERO + 1), d, t) +#define VKBD_SLEEP(s, f, d, t) tsleep(&(s)->f, PCATCH | PZERO, d, t) #endif #define VKBD_KEYBOARD(d) \ @@ -268,8 +268,8 @@ vkbd_dev_close(struct cdev *dev, int foo, int bar, struct thread *td) VKBD_SLEEP(state, ks_task, "vkbdc", 0); /* wakeup poll()ers */ - selwakeuppri(&state->ks_rsel, PZERO + 1); - selwakeuppri(&state->ks_wsel, PZERO + 1); + selwakeuppri(&state->ks_rsel, PZERO); + selwakeuppri(&state->ks_wsel, PZERO); state->ks_flags &= ~OPEN; state->ks_dev = NULL; @@ -498,7 +498,7 @@ vkbd_status_changed(vkbd_state_t *state) if (!(state->ks_flags & STATUS)) { state->ks_flags |= STATUS; - selwakeuppri(&state->ks_rsel, PZERO + 1); + selwakeuppri(&state->ks_rsel, PZERO); wakeup(&state->ks_flags); } } @@ -531,7 +531,7 @@ vkbd_data_read(vkbd_state_t *state, int wait) q->head = 0; /* wakeup ks_inq writers/poll()ers */ - selwakeuppri(&state->ks_wsel, PZERO + 1); + selwakeuppri(&state->ks_wsel, PZERO); wakeup(q); return (c); @@ -1246,7 +1246,7 @@ vkbd_clear_state_locked(vkbd_state_t *state) /* flush ks_inq and wakeup writers/poll()ers */ state->ks_inq.head = state->ks_inq.tail = state->ks_inq.cc = 0; - selwakeuppri(&state->ks_wsel, PZERO + 1); + selwakeuppri(&state->ks_wsel, PZERO); wakeup(&state->ks_inq); } diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c index 2fd43bc742dc..26f764f1939c 100644 --- a/sys/fs/fuse/fuse_device.c +++ b/sys/fs/fuse/fuse_device.c @@ -153,7 +153,7 @@ fdata_dtor(void *arg) FUSE_LOCK(); fuse_lck_mtx_lock(fdata->aw_mtx); /* wakup poll()ers */ - selwakeuppri(&fdata->ks_rsel, PZERO + 1); + selwakeuppri(&fdata->ks_rsel, PZERO); /* Don't let syscall handlers wait in vain */ while ((tick = fuse_aw_pop(fdata))) { fuse_lck_mtx_lock(tick->tk_aw_mtx); diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c index 877da90b580b..f64344b64679 100644 --- a/sys/fs/fuse/fuse_io.c +++ b/sys/fs/fuse/fuse_io.c @@ -933,7 +933,7 @@ fuse_io_invalbuf(struct vnode *vp, struct thread *td) if (vp->v_mount->mnt_kern_flag & MNTK_UNMOUNTF) return EIO; fvdat->flag |= FN_FLUSHWANT; - tsleep(&fvdat->flag, PRIBIO + 2, "fusevinv", 2 * hz); + tsleep(&fvdat->flag, PRIBIO, "fusevinv", 2 * hz); error = 0; if (p != NULL) { PROC_LOCK(p); diff --git a/sys/fs/fuse/fuse_ipc.c b/sys/fs/fuse/fuse_ipc.c index 379306f8ef2e..164b7abdaa53 100644 --- a/sys/fs/fuse/fuse_ipc.c +++ b/sys/fs/fuse/fuse_ipc.c @@ -589,7 +589,7 @@ fdata_set_dead(struct fuse_data *data) fuse_lck_mtx_lock(data->ms_mtx); data->dataflags |= FSESS_DEAD; wakeup_one(data); - selwakeuppri(&data->ks_rsel, PZERO + 1); + selwakeuppri(&data->ks_rsel, PZERO); wakeup(&data->ticketer); fuse_lck_mtx_unlock(data->ms_mtx); FUSE_UNLOCK(); @@ -665,7 +665,7 @@ fuse_insert_message(struct fuse_ticket *ftick, bool urgent) else fuse_ms_push(ftick); wakeup_one(ftick->tk_data); - selwakeuppri(&ftick->tk_data->ks_rsel, PZERO + 1); + selwakeuppri(&ftick->tk_data->ks_rsel, PZERO); KNOTE_LOCKED(&ftick->tk_data->ks_rsel.si_note, 0); fuse_lck_mtx_unlock(ftick->tk_data->ms_mtx); } diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index c593264ef63e..cb9e32376170 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4670,7 +4670,7 @@ newnfs_sndlock(int *flagp) ts.tv_sec = 0; ts.tv_nsec = 0; (void) nfsmsleep((caddr_t)flagp, NFSSOCKMUTEXPTR, - PZERO - 1, "nfsndlck", &ts); + PVFS, "nfsndlck", &ts); } *flagp |= NFSR_SNDLOCK; NFSUNLOCKSOCK(); diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c index bf0ff4e84d98..de72187bbb91 100644 --- a/sys/fs/nfsserver/nfs_nfsdcache.c +++ b/sys/fs/nfsserver/nfs_nfsdcache.c @@ -392,7 +392,7 @@ loop: nfsaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) { if ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - (void)mtx_sleep(rp, mutex, (PZERO - 1) | PDROP, + (void)mtx_sleep(rp, mutex, PVFS | PDROP, "nfsrc", 10 * hz); goto loop; } @@ -678,7 +678,7 @@ tryagain: rp = hitrp; if ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - (void)mtx_sleep(rp, mutex, (PZERO - 1) | PDROP, + (void)mtx_sleep(rp, mutex, PVFS | PDROP, "nfsrc", 10 * hz); goto tryagain; } @@ -750,7 +750,7 @@ nfsrc_lock(struct nfsrvcache *rp) mtx_assert(mutex, MA_OWNED); while ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - (void)mtx_sleep(rp, mutex, PZERO - 1, "nfsrc", 0); + (void)mtx_sleep(rp, mutex, PVFS, "nfsrc", 0); } rp->rc_flag |= RC_LOCKED; } diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 6cd8c1c861ec..0f556adb697b 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -552,7 +552,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; - (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, + (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PVFS, "nfsd clp", 10 * hz); } NFSUNLOCKSTATE(); @@ -629,7 +629,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; - (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, + (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PVFS, "nfsdclp", 10 * hz); } NFSUNLOCKSTATE(); diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c index 324f38abd10e..35454998fc8e 100644 --- a/sys/fs/smbfs/smbfs_io.c +++ b/sys/fs/smbfs/smbfs_io.c @@ -629,7 +629,7 @@ smbfs_vinvalbuf(struct vnode *vp, struct thread *td) while (np->n_flag & NFLUSHINPROG) { np->n_flag |= NFLUSHWANT; - error = tsleep(&np->n_flag, PRIBIO + 2, "smfsvinv", 2 * hz); + error = tsleep(&np->n_flag, PRIBIO, "smfsvinv", 2 * hz); error = smb_td_intr(td); if (error == EINTR) return EINTR; diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 0867e9e14fee..c1633dd19de2 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -1010,7 +1010,8 @@ rms_rlock_fallback(struct rmslock *rms) mtx_lock(&rms->mtx); while (rms->writers > 0) - msleep(&rms->readers, &rms->mtx, PUSER - 1, mtx_name(&rms->mtx), 0); + msleep(&rms->readers, &rms->mtx, PRI_MAX_KERN, + mtx_name(&rms->mtx), 0); critical_enter(); rms_int_readers_inc(rms, rms_int_pcpu(rms)); mtx_unlock(&rms->mtx); @@ -1197,7 +1198,7 @@ rms_wlock(struct rmslock *rms) mtx_lock(&rms->mtx); rms->writers++; if (rms->writers > 1) { - msleep(&rms->owner, &rms->mtx, (PUSER - 1), + msleep(&rms->owner, &rms->mtx, PRI_MAX_KERN, mtx_name(&rms->mtx), 0); MPASS(rms->readers == 0); KASSERT(rms->owner == RMS_TRANSIENT, @@ -1213,7 +1214,7 @@ rms_wlock(struct rmslock *rms) rms_assert_no_pcpu_readers(rms); if (rms->readers > 0) { - msleep(&rms->writers, &rms->mtx, (PUSER - 1), + msleep(&rms->writers, &rms->mtx, PRI_MAX_KERN, mtx_name(&rms->mtx), 0); } diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index 5a6ebacb780c..993c71b68940 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -50,7 +50,7 @@ #include #include -#define LOG_RDPRI (PZERO + 1) +#define LOG_RDPRI PZERO #define LOG_ASYNC 0x04 diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 354a01fa7e3f..a545a0a54c25 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -893,7 +893,7 @@ kern_msgsnd(struct thread *td, int msqid, const void *msgp, we_own_it = 1; } DPRINTF(("msgsnd: goodnight\n")); - error = msleep(msqkptr, &msq_mtx, (PZERO - 4) | PCATCH, + error = msleep(msqkptr, &msq_mtx, PVFS | PCATCH, "msgsnd", hz); DPRINTF(("msgsnd: good morning, error=%d\n", error)); if (we_own_it) @@ -1302,7 +1302,7 @@ kern_msgrcv(struct thread *td, int msqid, void *msgp, size_t msgsz, long msgtyp, */ DPRINTF(("msgrcv: goodnight\n")); - error = msleep(msqkptr, &msq_mtx, (PZERO - 4) | PCATCH, + error = msleep(msqkptr, &msq_mtx, PVFS | PCATCH, "msgrcv", 0); DPRINTF(("msgrcv: good morning (error=%d)\n", error)); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 076851235ffa..a99e1a4de14e 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1308,7 +1308,7 @@ kern_semop(struct thread *td, int usemid, struct sembuf *usops, semptr->semncnt++; DPRINTF(("semop: good night!\n")); - error = msleep_sbt(semakptr, sema_mtxp, (PZERO - 4) | PCATCH, + error = msleep_sbt(semakptr, sema_mtxp, PVFS | PCATCH, "semwait", sbt, precision, C_ABSOLUTE); DPRINTF(("semop: good morning (error=%d)!\n", error)); /* return code is checked below, after sem[nz]cnt-- */ diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 4ae80e7e078d..92d850381e06 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -754,7 +754,7 @@ bufspace_wait(struct bufdomain *bd, struct vnode *vp, int gbflags, break; } error = msleep(&bd->bd_wanted, BD_LOCKPTR(bd), - (PRIBIO + 4) | slpflag, "newbuf", slptimeo); + PVFS | slpflag, "newbuf", slptimeo); if (error != 0) break; } @@ -2653,8 +2653,7 @@ bwillwrite(void) mtx_lock(&bdirtylock); while (buf_dirty_count_severe()) { bdirtywait = 1; - msleep(&bdirtywait, &bdirtylock, (PRIBIO + 4), - "flswai", 0); + msleep(&bdirtywait, &bdirtylock, PVFS, "flswai", 0); } mtx_unlock(&bdirtylock); } @@ -5214,7 +5213,7 @@ bufobj_wwait(struct bufobj *bo, int slpflag, int timeo) while (bo->bo_numoutput) { bo->bo_flag |= BO_WWAIT; error = msleep(&bo->bo_numoutput, BO_LOCKPTR(bo), - slpflag | (PRIBIO + 1), "bo_wwait", timeo); + slpflag | PRIBIO, "bo_wwait", timeo); if (error) break; } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index c3666ca99c26..79fee79295fb 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -795,7 +795,7 @@ foffset_lock(struct file *fp, int flags) } DROP_GIANT(); sleepq_add(&fp->f_vnread_flags, NULL, "vofflock", 0, 0); - sleepq_wait(&fp->f_vnread_flags, PUSER -1); + sleepq_wait(&fp->f_vnread_flags, PRI_MAX_KERN); PICKUP_GIANT(); sleepq_lock(&fp->f_vnread_flags); state = atomic_load_16(flagsp); @@ -857,7 +857,7 @@ foffset_lock(struct file *fp, int flags) if ((flags & FOF_NOLOCK) == 0) { while (fp->f_vnread_flags & FOFFSET_LOCKED) { fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; - msleep(&fp->f_vnread_flags, mtxp, PUSER -1, + msleep(&fp->f_vnread_flags, mtxp, PRI_MAX_KERN, "vofflock", 0); } fp->f_vnread_flags |= FOFFSET_LOCKED; @@ -1925,7 +1925,7 @@ vn_start_write_refed(struct mount *mp, int flags, bool mplocked) if (flags & V_PCATCH) mflags |= PCATCH; } - mflags |= (PUSER - 1); + mflags |= PRI_MAX_KERN; while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) { if ((flags & V_NOWAIT) != 0) { error = EWOULDBLOCK; @@ -2050,7 +2050,7 @@ vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags) if ((flags & V_PCATCH) != 0) mflags |= PCATCH; } - mflags |= (PUSER - 1) | PDROP; + mflags |= PRI_MAX_KERN | PDROP; error = msleep(&mp->mnt_flag, MNT_MTX(mp), mflags, "suspfs", 0); vfs_rel(mp); if (error == 0) @@ -2135,7 +2135,7 @@ vfs_write_suspend(struct mount *mp, int flags) return (EALREADY); } while (mp->mnt_kern_flag & MNTK_SUSPEND) - msleep(&mp->mnt_flag, MNT_MTX(mp), PUSER - 1, "wsuspfs", 0); + msleep(&mp->mnt_flag, MNT_MTX(mp), PRI_MAX_KERN, "wsuspfs", 0); /* * Unmount holds a write reference on the mount point. If we @@ -2156,7 +2156,7 @@ vfs_write_suspend(struct mount *mp, int flags) mp->mnt_susp_owner = curthread; if (mp->mnt_writeopcount > 0) (void) msleep(&mp->mnt_writeopcount, - MNT_MTX(mp), (PUSER - 1)|PDROP, "suspwt", 0); + MNT_MTX(mp), PRI_MAX_KERN | PDROP, "suspwt", 0); else MNT_IUNLOCK(mp); if ((error = VFS_SYNC(mp, MNT_SUSPEND)) != 0) { diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index a0275a7471e5..45d981de9fdb 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -866,7 +866,7 @@ tunstart(struct ifnet *ifp) tp->tun_flags &= ~TUN_RWAIT; wakeup(tp); } - selwakeuppri(&tp->tun_rsel, PZERO + 1); + selwakeuppri(&tp->tun_rsel, PZERO); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) { TUN_UNLOCK(tp); @@ -927,7 +927,7 @@ tunstart_l2(struct ifnet *ifp) TUN_LOCK(tp); } - selwakeuppri(&tp->tun_rsel, PZERO+1); + selwakeuppri(&tp->tun_rsel, PZERO); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* obytes are counted in ether_output */ } @@ -1201,7 +1201,7 @@ out: CURVNET_RESTORE(); funsetown(&tp->tun_sigio); - selwakeuppri(&tp->tun_rsel, PZERO + 1); + selwakeuppri(&tp->tun_rsel, PZERO); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); tp->tun_flags &= ~TUN_OPEN; @@ -1735,7 +1735,7 @@ tunread(struct cdev *dev, struct uio *uio, int flag) return (EWOULDBLOCK); } tp->tun_flags |= TUN_RWAIT; - error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | (PZERO + 1), + error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | PZERO, "tunread", 0); if (error != 0) { TUN_UNLOCK(tp); diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index 9269b3d16467..e4fcdfc635cb 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -462,7 +462,7 @@ ngdread(struct cdev *dev, struct uio *uio, int flag) mtx_lock(&priv->ngd_mtx); priv->flags |= NGDF_RWAIT; if ((error = msleep(priv, &priv->ngd_mtx, - PDROP | PCATCH | (PZERO + 1), + PDROP | PCATCH | PZERO, "ngdread", 0)) != 0) return (error); } diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 7c0ea9605e28..dd05d5a1df7d 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -298,7 +298,7 @@ struct buf { * Initialize a lock. */ #define BUF_LOCKINIT(bp, wmesg) \ - lockinit(&(bp)->b_lock, PRIBIO + 4, wmesg, 0, LK_NEW) + lockinit(&(bp)->b_lock, PVFS, wmesg, 0, LK_NEW) /* * * Get a lock sleeping non-interruptably until it becomes available. @@ -313,7 +313,7 @@ struct buf { */ #define BUF_TIMELOCK(bp, locktype, interlock, wmesg, catch, timo) \ _lockmgr_args_rw(&(bp)->b_lock, (locktype) | LK_TIMELOCK, \ - (interlock), (wmesg), (PRIBIO + 4) | (catch), (timo), \ + (interlock), (wmesg), PVFS | (catch), (timo), \ LOCK_FILE, LOCK_LINE) /* diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 316c978e1bdf..edf064549d85 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -499,7 +499,7 @@ softdep_check_suspend(struct mount *mp, while (mp->mnt_secondary_writes != 0) { BO_UNLOCK(bo); msleep(&mp->mnt_secondary_writes, MNT_MTX(mp), - (PUSER - 1) | PDROP, "secwr", 0); + PRI_MAX_KERN | PDROP, "secwr", 0); BO_LOCK(bo); MNT_ILOCK(mp); } @@ -14578,7 +14578,7 @@ softdep_check_suspend(struct mount *mp, while (mp->mnt_secondary_writes != 0) { BO_UNLOCK(bo); msleep(&mp->mnt_secondary_writes, MNT_MTX(mp), - (PUSER - 1) | PDROP, "secwr", 0); + PRI_MAX_KERN | PDROP, "secwr", 0); BO_LOCK(bo); MNT_ILOCK(mp); } @@ -14618,7 +14618,7 @@ softdep_check_suspend(struct mount *mp, BO_UNLOCK(bo); msleep(&mp->mnt_secondary_writes, MNT_MTX(mp), - (PUSER - 1) | PDROP, "secwr", 0); + PRI_MAX_KERN | PDROP, "secwr", 0); BO_LOCK(bo); continue; } diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 0f60f8061043..03dcb27ff6f7 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1402,8 +1402,7 @@ ffs_lock_ea(struct vnode *vp) VI_LOCK(vp); while (ip->i_flag & IN_EA_LOCKED) { UFS_INODE_SET_FLAG(ip, IN_EA_LOCKWAIT); - msleep(&ip->i_ea_refs, &vp->v_interlock, PINOD + 2, "ufs_ea", - 0); + msleep(&ip->i_ea_refs, &vp->v_interlock, PINOD, "ufs_ea", 0); } UFS_INODE_SET_FLAG(ip, IN_EA_LOCKED); VI_UNLOCK(vp); diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 78f539bcabd2..52fc6c08fdf9 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -181,7 +181,7 @@ chkdq(struct inode *ip, ufs2_daddr_t change, struct ucred *cred, int flags) if ((dq = ip->i_dquot[i]) == NODQUOT) continue; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "chkdq1"); + DQI_WAIT(dq, PINOD, "chkdq1"); ncurblocks = dq->dq_curblocks + change; if (ncurblocks >= 0) dq->dq_curblocks = ncurblocks; @@ -203,7 +203,7 @@ chkdq(struct inode *ip, ufs2_daddr_t change, struct ucred *cred, int flags) continue; warn = 0; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "chkdq2"); + DQI_WAIT(dq, PINOD, "chkdq2"); if (do_check) { error = chkdqchg(ip, change, cred, i, &warn); if (error) { @@ -217,7 +217,7 @@ chkdq(struct inode *ip, ufs2_daddr_t change, struct ucred *cred, int flags) if (dq == NODQUOT) continue; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "chkdq3"); + DQI_WAIT(dq, PINOD, "chkdq3"); ncurblocks = dq->dq_curblocks - change; if (ncurblocks >= 0) dq->dq_curblocks = ncurblocks; @@ -322,7 +322,7 @@ chkiq(struct inode *ip, int change, struct ucred *cred, int flags) if ((dq = ip->i_dquot[i]) == NODQUOT) continue; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "chkiq1"); + DQI_WAIT(dq, PINOD, "chkiq1"); if (dq->dq_curinodes >= -change) dq->dq_curinodes += change; else @@ -343,7 +343,7 @@ chkiq(struct inode *ip, int change, struct ucred *cred, int flags) continue; warn = 0; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "chkiq2"); + DQI_WAIT(dq, PINOD, "chkiq2"); if (do_check) { error = chkiqchg(ip, change, cred, i, &warn); if (error) { @@ -357,7 +357,7 @@ chkiq(struct inode *ip, int change, struct ucred *cred, int flags) if (dq == NODQUOT) continue; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "chkiq3"); + DQI_WAIT(dq, PINOD, "chkiq3"); if (dq->dq_curinodes >= change) dq->dq_curinodes -= change; else @@ -857,7 +857,7 @@ _setquota(struct thread *td, struct mount *mp, uint64_t id, int type, return (error); dq = ndq; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "setqta"); + DQI_WAIT(dq, PINOD, "setqta"); /* * Copy all but the current values. * Reset time limit if previously had no soft limit or were @@ -920,7 +920,7 @@ _setuse(struct thread *td, struct mount *mp, uint64_t id, int type, return (error); dq = ndq; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "setuse"); + DQI_WAIT(dq, PINOD, "setuse"); /* * Reset time limit if have a soft limit and were * previously under it, but are now over it. @@ -1316,7 +1316,7 @@ dqget(struct vnode *vp, uint64_t id, struct ufsmount *ump, int type, if (dq != NULL) { DQH_UNLOCK(); hfound: DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "dqget"); + DQI_WAIT(dq, PINOD, "dqget"); DQI_UNLOCK(dq); if (dq->dq_ump == NULL) { dqrele(vp, dq); @@ -1590,7 +1590,7 @@ dqsync(struct vnode *vp, struct dquot *dq) vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY); DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+2, "dqsync"); + DQI_WAIT(dq, PINOD, "dqsync"); if ((dq->dq_flags & DQ_MOD) == 0) goto out; dq->dq_flags |= DQ_LOCK; @@ -1744,7 +1744,7 @@ quotaadj(struct dquot **qrp, struct ufsmount *ump, int64_t blkcount) if ((dq = qrp[i]) == NODQUOT) continue; DQI_LOCK(dq); - DQI_WAIT(dq, PINOD+1, "adjqta"); + DQI_WAIT(dq, PINOD, "adjqta"); ncurblocks = dq->dq_curblocks + blkcount; if (ncurblocks >= 0) dq->dq_curblocks = ncurblocks; From nobody Mon Jul 28 13:31:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBN6Vgxz634sj; Mon, 28 Jul 2025 13:31:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBM6TFbz3tYn; Mon, 28 Jul 2025 13:31:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmpgBSvNvIXotvqR4sTfWwt/4bkXtAF3cG/CoONCBZ8=; b=Y2/kX0Il+/hbNEPXvtwwuN/EdzrQXsE0SUdXEGXugn7NAc263I0+8XczdkrTtsECn/CR1L WGfHg9HiqE0UWRtgGbQFaal1RTPzYe+WGsk6S6oG5XTYsD1mhUzyAFpDApDf8pi3CNrydT 1j0NccR8LgeiRP1KZOxQuaPEnXrmMRVNIJ3y6EBw91L6BTP/t8jYyozBo3KJT5vlOHiwvX YdfmpQa5hdf7rQrDgdTP6lNyKUMGE1oHj97K22wMJ2Gi2GFL/E4vst6KEP4wXwM0AxNoh9 mQg0AlRPw3xioMsRD87a39/YBI1WSQ7YVCXj/YyiTdkTu0mAb7KEMVAXE/Ik8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmpgBSvNvIXotvqR4sTfWwt/4bkXtAF3cG/CoONCBZ8=; b=qlPg5ivP9UgmA2+HNYDWlrFFa9Euh7fadba14Pteo5vap+/BYeWdhWrrnmvBB+vr87vHcB KLxVhABeQzS0xHYx4hNyd9mnSUtEKL3Cn0vHl8OxJZRLitYua4UlTSbuaN220l1rPNB9Km rqFcVEqxc3C2nbHg9nDmgbD/gHRBTT3nptBaO4GSH8L3xKIZa+r/kR7OgWxeZMabcYM7f3 22wn01ux4D1w1hiGrztTG8QMtMFufV++eOBds3JHZHQGYQc077zVVx/cOaV6PLlW8uGITz f7xm7o0DxjCPGNzx7E3xiezk5FrrToF5lrAEIEXZLrkR34kvMjq5cRiQxhyQRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709484; a=rsa-sha256; cv=none; b=edKmQbdLdXYy0h5ibNBGWFuuaCesrqFBokrQ+QmNtqH9J+82LMITAYM8+kUxl5S0m5Jwqg KKQEsRrn09qat3ujuZ++2oQfpV3p43ye+0zshaV88xFnhKmqZSu3XSCfWHOaApqa4gMGC1 ONS3oK1qBMKIHlar1CZFTFrnA8I393b4BEyWdVP1k/2CJtz6rPR3W7eod7VkOOACQoGGkJ 3sD1w0qFZ0pqhiHuNPV8If8bfYpvXCVUuSsGrOpZ505qJa1p2P/3FP/+bMY36dJqf6hzKF /u4qvUwB+rPTUMbKzIrujBWw/46jhtanKZ3PjsbkPRMnuvpGh4idEr0R8hSEOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBM5xKDznfq; Mon, 28 Jul 2025 13:31:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVNNG080366; Mon, 28 Jul 2025 13:31:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVNtn080363; Mon, 28 Jul 2025 13:31:23 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:23 GMT Message-Id: <202507281331.56SDVNtn080363@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: faa0b715592d - stable/14 - sched_ule: Use a single runqueue per CPU List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: faa0b715592ddc470fdaacb84f5efc3bbf2b1e69 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=faa0b715592ddc470fdaacb84f5efc3bbf2b1e69 commit faa0b715592ddc470fdaacb84f5efc3bbf2b1e69 Author: Olivier Certner AuthorDate: 2024-05-14 10:45:20 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:19 +0000 sched_ule: Use a single runqueue per CPU Previously, ULE would use 3 separate runqueues per CPU to store threads, one for each of its selection policies, which are realtime, timesharing and idle. They would be examined in this order, and the first thread found would be the one selected. This choice indeed appears as the easiest evolution from the single runqueue used by sched_4bsd (4BSD): It allows sharing most of the same runqueue code, which currently defines 64 levels per runqueue, while multiplying the number of levels (by 3). However, it has several important drawbacks: 1. The number of levels is the same for each selection policy. 64 is unnecessarily large for the idle policy (only 32 distinct levels would be necessary, given the 32 levels of our RTP_PRIO_IDLE and their future aliases in the to-be-introduced SCHED_IDLE POSIX scheduling policy) and unnecessary restrictive both for the realtime policy (which should include 32 distinct levels for PRI_REALTIME, given our implementation of SCHED_RR/SCHED_FIFO, leaving at most 32 levels for ULE's interactive processes where the current implementation provisions 48 (perhaps taking into account the spreading problem, see next point)) and the timesharing one (88 distinct levels currently provisioned). 2. A runqueue has only 64 distinct levels, and maps priorities in the range [0;255] to a queue index by just performing a division by 4. Priorities mapped to the same level are treated exactly the same from a scheduling perspective, which is generally both unexpected and incorrect. ULE's code tries to compensate for this aliasing in the timesharing selection policy, by spreading the 88 levels into 256, knowing the latter amount in the end to only 64 distinct ones. This scaling is unfortunately not performed for the other policies, breaking the expectations mentioned in the previous point about distinct priority levels. With this change, only a single runqueue is now used to store all threads, regardless of the scheduling policy ULE applies to them (going back to what 4BSD has always been doing). ULE's 3 selection policies are assigned non-overlapping ranges of levels, and helper functions have been created to select or steal a thread in these distinct ranges, preserving the "circular" queue mechanism for the timesharing selection policy that (tries to) prevent starvation in the face of permanent dynamic priority adjustments. This change allows to choose any arbitrary repartition of runqueue levels between selection policies. It is a prerequisite to the increase to 256 levels per runqueue, which will allow to dispense with all the drawbacks listed above. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45389 (cherry picked from commit baecdea10eb50ac20c2ed1fcd4171d3a609e90b5) --- sys/kern/kern_switch.c | 11 -- sys/kern/sched_ule.c | 305 ++++++++++++++++++++++++++++++------------------- sys/sys/runq.h | 1 - 3 files changed, 187 insertions(+), 130 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 9a05f3c90a80..264925ab954a 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -652,14 +652,3 @@ runq_choose_fuzz(struct runq *rq, int fuzz) CTR0(KTR_RUNQ, "runq_choose_fuzz: idlethread"); return (NULL); } - -struct thread * -runq_choose_from(struct runq *const rq, int from_idx) -{ - struct thread *td; - - td = runq_first_thread_range(rq, from_idx, RQ_NQS - 1); - if (td != NULL || from_idx == 0) - return (td); - return (runq_first_thread_range(rq, 0, from_idx - 1)); -} diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 01eaabac3450..29a4bfef3ea2 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -88,10 +88,9 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; * Thread scheduler specific section. All fields are protected * by the thread lock. */ -struct td_sched { - struct runq *ts_runq; /* Run-queue we're queued on. */ +struct td_sched { short ts_flags; /* TSF_* flags. */ - int ts_cpu; /* CPU that we have affinity for. */ + int ts_cpu; /* CPU we are on, or were last on. */ int ts_rltick; /* Real last tick, for affinity. */ int ts_slice; /* Ticks of slice remaining. */ u_int ts_slptime; /* Number of ticks we vol. slept */ @@ -131,23 +130,6 @@ _Static_assert(sizeof(struct thread) + sizeof(struct td_sched) <= #define PRI_MIN_BATCH (PRI_MIN_TIMESHARE + PRI_INTERACT_RANGE) #define PRI_MAX_BATCH PRI_MAX_TIMESHARE -/* - * Cpu percentage computation macros and defines. - * - * SCHED_TICK_SECS: Number of seconds to average the cpu usage across. - * SCHED_TICK_TARG: Number of hz ticks to average the cpu usage across. - * SCHED_TICK_MAX: Maximum number of ticks before scaling back. - * SCHED_TICK_SHIFT: Shift factor to avoid rounding away results. - * SCHED_TICK_HZ: Compute the number of hz ticks for a given ticks count. - * SCHED_TICK_TOTAL: Gives the amount of time we've been recording ticks. - */ -#define SCHED_TICK_SECS 10 -#define SCHED_TICK_TARG (hz * SCHED_TICK_SECS) -#define SCHED_TICK_MAX (SCHED_TICK_TARG + hz) -#define SCHED_TICK_SHIFT 10 -#define SCHED_TICK_HZ(ts) ((ts)->ts_ticks >> SCHED_TICK_SHIFT) -#define SCHED_TICK_TOTAL(ts) (max((ts)->ts_ltick - (ts)->ts_ftick, hz)) - /* * These macros determine priorities for non-interactive threads. They are * assigned a priority based on their recent cpu utilization as expressed @@ -170,6 +152,48 @@ _Static_assert(sizeof(struct thread) + sizeof(struct td_sched) <= (roundup(SCHED_TICK_TOTAL((ts)), SCHED_PRI_RANGE) / SCHED_PRI_RANGE)) #define SCHED_PRI_NICE(nice) (nice) +/* + * Runqueue indices for the implemented scheduling policies' priority bounds. + * + * In ULE's implementation, realtime policy covers the ITHD, REALTIME and + * INTERACT (see above) ranges, timesharing the BATCH range (see above), and + * idle policy the IDLE range. + * + * Priorities from these ranges must not be assigned to the same runqueue's + * queue. + */ +#define RQ_RT_POL_MIN (RQ_PRI_TO_QUEUE_IDX(PRI_MIN_ITHD)) +#define RQ_RT_POL_MAX (RQ_PRI_TO_QUEUE_IDX(PRI_MAX_INTERACT)) +#define RQ_TS_POL_MIN (RQ_PRI_TO_QUEUE_IDX(PRI_MIN_BATCH)) +#define RQ_TS_POL_MAX (RQ_PRI_TO_QUEUE_IDX(PRI_MAX_BATCH)) +#define RQ_ID_POL_MIN (RQ_PRI_TO_QUEUE_IDX(PRI_MIN_IDLE)) +#define RQ_ID_POL_MAX (RQ_PRI_TO_QUEUE_IDX(PRI_MAX_IDLE)) + +_Static_assert(RQ_RT_POL_MAX != RQ_TS_POL_MIN, + "ULE's realtime and timeshare policies' runqueue ranges overlap"); +_Static_assert(RQ_TS_POL_MAX != RQ_ID_POL_MIN, + "ULE's timeshare and idle policies' runqueue ranges overlap"); + +/* Helper to treat the timeshare range as a circular group of queues. */ +#define RQ_TS_POL_MODULO (RQ_TS_POL_MAX - RQ_TS_POL_MIN + 1) + +/* + * Cpu percentage computation macros and defines. + * + * SCHED_TICK_SECS: Number of seconds to average the cpu usage across. + * SCHED_TICK_TARG: Number of hz ticks to average the cpu usage across. + * SCHED_TICK_MAX: Maximum number of ticks before scaling back. + * SCHED_TICK_SHIFT: Shift factor to avoid rounding away results. + * SCHED_TICK_HZ: Compute the number of hz ticks for a given ticks count. + * SCHED_TICK_TOTAL: Gives the amount of time we've been recording ticks. + */ +#define SCHED_TICK_SECS 10 +#define SCHED_TICK_TARG (hz * SCHED_TICK_SECS) +#define SCHED_TICK_MAX (SCHED_TICK_TARG + hz) +#define SCHED_TICK_SHIFT 10 +#define SCHED_TICK_HZ(ts) ((ts)->ts_ticks >> SCHED_TICK_SHIFT) +#define SCHED_TICK_TOTAL(ts) (max((ts)->ts_ltick - (ts)->ts_ftick, hz)) + /* * These determine the interactivity of a process. Interactivity differs from * cpu utilization in that it expresses the voluntary time slept vs time ran @@ -253,12 +277,10 @@ struct tdq { short tdq_oldswitchcnt; /* (l) Switches last tick. */ u_char tdq_lowpri; /* (ts) Lowest priority thread. */ u_char tdq_owepreempt; /* (f) Remote preemption pending. */ - u_char tdq_idx; /* (t) Current insert index. */ - u_char tdq_ridx; /* (t) Current removal index. */ + u_char tdq_ts_off; /* (t) TS insertion offset. */ + u_char tdq_ts_deq_off; /* (t) TS dequeue offset. */ int tdq_id; /* (c) cpuid. */ - struct runq tdq_realtime; /* (t) real-time run queue. */ - struct runq tdq_timeshare; /* (t) timeshare run queue. */ - struct runq tdq_idle; /* (t) Queue of IDLE threads. */ + struct runq tdq_runq; /* (t) Run queue. */ char tdq_name[TDQ_NAME_LEN]; #ifdef KTR char tdq_loadname[TDQ_LOADNAME_LEN]; @@ -330,12 +352,17 @@ static void sched_interact_fork(struct thread *); static void sched_pctcpu_update(struct td_sched *, int); /* Operations on per processor queues */ +static inline struct thread *runq_choose_realtime(struct runq *const rq); +static inline struct thread *runq_choose_timeshare(struct runq *const rq, + int off); +static inline struct thread *runq_choose_idle(struct runq *const rq); static struct thread *tdq_choose(struct tdq *); + static void tdq_setup(struct tdq *, int i); static void tdq_load_add(struct tdq *, struct thread *); static void tdq_load_rem(struct tdq *, struct thread *); -static __inline void tdq_runq_add(struct tdq *, struct thread *, int); -static __inline void tdq_runq_rem(struct tdq *, struct thread *); +static inline void tdq_runq_add(struct tdq *, struct thread *, int); +static inline void tdq_runq_rem(struct tdq *, struct thread *); static inline int sched_shouldpreempt(int, int, int); static void tdq_print(int cpu); static void runq_print(struct runq *rq); @@ -344,8 +371,19 @@ static int tdq_add(struct tdq *, struct thread *, int); static int tdq_move(struct tdq *, struct tdq *); static int tdq_idled(struct tdq *); static void tdq_notify(struct tdq *, int lowpri); + +static bool runq_steal_pred(const int idx, struct rq_queue *const q, + void *const data); +static inline struct thread *runq_steal_range(struct runq *const rq, + const int lvl_min, const int lvl_max, int cpu); +static inline struct thread *runq_steal_realtime(struct runq *const rq, + int cpu); +static inline struct thread *runq_steal_timeshare(struct runq *const rq, + int cpu, int off); +static inline struct thread *runq_steal_idle(struct runq *const rq, + int cpu); static struct thread *tdq_steal(struct tdq *, int); -static struct thread *runq_steal(struct runq *, int); + static int sched_pickcpu(struct thread *, int); static void sched_balance(void); static bool sched_balance_pair(struct tdq *, struct tdq *); @@ -420,21 +458,17 @@ tdq_print(int cpu) tdq = TDQ_CPU(cpu); printf("tdq %d:\n", TDQ_ID(tdq)); - printf("\tlock %p\n", TDQ_LOCKPTR(tdq)); - printf("\tLock name: %s\n", tdq->tdq_name); - printf("\tload: %d\n", tdq->tdq_load); - printf("\tswitch cnt: %d\n", tdq->tdq_switchcnt); - printf("\told switch cnt: %d\n", tdq->tdq_oldswitchcnt); - printf("\ttimeshare idx: %d\n", tdq->tdq_idx); - printf("\ttimeshare ridx: %d\n", tdq->tdq_ridx); + printf("\tlock %p\n", TDQ_LOCKPTR(tdq)); + printf("\tLock name: %s\n", tdq->tdq_name); + printf("\tload: %d\n", tdq->tdq_load); + printf("\tswitch cnt: %d\n", tdq->tdq_switchcnt); + printf("\told switch cnt: %d\n", tdq->tdq_oldswitchcnt); + printf("\tTS insert offset: %d\n", tdq->tdq_ts_off); + printf("\tTS dequeue offset: %d\n", tdq->tdq_ts_deq_off); printf("\tload transferable: %d\n", tdq->tdq_transferable); printf("\tlowest priority: %d\n", tdq->tdq_lowpri); - printf("\trealtime runq:\n"); - runq_print(&tdq->tdq_realtime); - printf("\ttimeshare runq:\n"); - runq_print(&tdq->tdq_timeshare); - printf("\tidle runq:\n"); - runq_print(&tdq->tdq_idle); + printf("\trunq:\n"); + runq_print(&tdq->tdq_runq); } static inline int @@ -475,11 +509,11 @@ sched_shouldpreempt(int pri, int cpri, int remote) * date with what is actually on the run-queue. Selects the correct * queue position for timeshare threads. */ -static __inline void +static inline void tdq_runq_add(struct tdq *tdq, struct thread *td, int flags) { struct td_sched *ts; - u_char pri; + u_char pri, idx; TDQ_LOCK_ASSERT(tdq, MA_OWNED); THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED); @@ -491,34 +525,36 @@ tdq_runq_add(struct tdq *tdq, struct thread *td, int flags) tdq->tdq_transferable++; ts->ts_flags |= TSF_XFERABLE; } - if (pri < PRI_MIN_BATCH) { - ts->ts_runq = &tdq->tdq_realtime; - } else if (pri <= PRI_MAX_BATCH) { - ts->ts_runq = &tdq->tdq_timeshare; - KASSERT(pri <= PRI_MAX_BATCH && pri >= PRI_MIN_BATCH, - ("Invalid priority %d on timeshare runq", pri)); + if (PRI_MIN_BATCH <= pri && pri <= PRI_MAX_BATCH) { /* - * This queue contains only priorities between MIN and MAX - * batch. Use the whole queue to represent these values. + * The queues allocated to the batch range are not used as + * a simple array but as a "circular" one where the insertion + * index (derived from 'pri') is offset by 'tdq_ts_off'. 'idx' + * is first set to the offset of the wanted queue in the TS' + * selection policy range. */ - if ((flags & (SRQ_BORROWING|SRQ_PREEMPTED)) == 0) { - pri = RQ_NQS * (pri - PRI_MIN_BATCH) / PRI_BATCH_RANGE; - pri = (pri + tdq->tdq_idx) % RQ_NQS; + if ((flags & (SRQ_BORROWING|SRQ_PREEMPTED)) != 0) + /* Current queue from which processes are being run. */ + idx = tdq->tdq_ts_deq_off; + else { + idx = (RQ_PRI_TO_QUEUE_IDX(pri) - RQ_TS_POL_MIN + + tdq->tdq_ts_off) % RQ_TS_POL_MODULO; /* - * This effectively shortens the queue by one so we - * can have a one slot difference between idx and - * ridx while we wait for threads to drain. + * We avoid enqueuing low priority threads in the queue + * that we are still draining, effectively shortening + * the runqueue by one queue. */ - if (tdq->tdq_ridx != tdq->tdq_idx && - pri == tdq->tdq_ridx) - pri = (unsigned char)(pri - 1) % RQ_NQS; - } else - pri = tdq->tdq_ridx; - runq_add_idx(ts->ts_runq, td, pri, flags); - return; + if (tdq->tdq_ts_deq_off != tdq->tdq_ts_off && + idx == tdq->tdq_ts_deq_off) + /* Ensure the dividend is positive. */ + idx = (idx - 1 + RQ_TS_POL_MODULO) % + RQ_TS_POL_MODULO; + } + /* Absolute queue index. */ + idx += RQ_TS_POL_MIN; + runq_add_idx(&tdq->tdq_runq, td, idx, flags); } else - ts->ts_runq = &tdq->tdq_idle; - runq_add(ts->ts_runq, td, flags); + runq_add(&tdq->tdq_runq, td, flags); } /* @@ -526,7 +562,7 @@ tdq_runq_add(struct tdq *tdq, struct thread *td, int flags) * is selected to run. Running threads are not on the queue and the * transferable count does not reflect them. */ -static __inline void +static inline void tdq_runq_rem(struct tdq *tdq, struct thread *td) { struct td_sched *ts; @@ -535,13 +571,11 @@ tdq_runq_rem(struct tdq *tdq, struct thread *td) ts = td_get_sched(td); TDQ_LOCK_ASSERT(tdq, MA_OWNED); THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED); - KASSERT(ts->ts_runq != NULL, - ("tdq_runq_remove: thread %p null ts_runq", td)); if (ts->ts_flags & TSF_XFERABLE) { tdq->tdq_transferable--; ts->ts_flags &= ~TSF_XFERABLE; } - queue_empty = runq_remove(ts->ts_runq, td); + queue_empty = runq_remove(&tdq->tdq_runq, td); /* * If thread has a batch priority and the queue from which it was * removed is now empty, advance the batch's queue removal index if it @@ -549,8 +583,10 @@ tdq_runq_rem(struct tdq *tdq, struct thread *td) */ if (queue_empty && PRI_MIN_BATCH <= td->td_priority && td->td_priority <= PRI_MAX_BATCH && - tdq->tdq_idx != tdq->tdq_ridx && tdq->tdq_ridx == td->td_rqindex) - tdq->tdq_ridx = (tdq->tdq_ridx + 1) % RQ_NQS; + tdq->tdq_ts_off != tdq->tdq_ts_deq_off && + tdq->tdq_ts_deq_off + RQ_TS_POL_MIN == td->td_rqindex) + tdq->tdq_ts_deq_off = (tdq->tdq_ts_deq_off + 1) % + RQ_TS_POL_MODULO; } /* @@ -1205,11 +1241,11 @@ runq_steal_pred(const int idx, struct rq_queue *const q, void *const data) } /* - * Steals load from a timeshare queue. Honors the rotating queue head - * index. + * Steals load contained in queues with indices in the specified range. */ static inline struct thread * -runq_steal_from(struct runq *const rq, int cpu, int start_idx) +runq_steal_range(struct runq *const rq, const int lvl_min, const int lvl_max, + int cpu) { struct runq_steal_pred_data data = { .td = NULL, @@ -1217,46 +1253,50 @@ runq_steal_from(struct runq *const rq, int cpu, int start_idx) }; int idx; - idx = runq_findq(rq, start_idx, RQ_NQS - 1, &runq_steal_pred, &data); - if (idx != -1) - goto found; - - MPASS(data.td == NULL); - if (start_idx != 0) { - idx = runq_findq(rq, 0, start_idx - 1, &runq_steal_pred, &data); - if (idx != -1) - goto found; + idx = runq_findq(rq, lvl_min, lvl_max, &runq_steal_pred, &data); + if (idx != -1) { + MPASS(data.td != NULL); + return (data.td); } - MPASS(idx == -1 && data.td == NULL); + MPASS(data.td == NULL); return (NULL); -found: - MPASS(data.td != NULL); - return (data.td); +} + +static inline struct thread * +runq_steal_realtime(struct runq *const rq, int cpu) +{ + + return (runq_steal_range(rq, RQ_RT_POL_MIN, RQ_RT_POL_MAX, cpu)); } /* - * Steals load from a standard linear queue. + * Steals load from a timeshare queue. Honors the rotating queue head + * index. */ -static struct thread * -runq_steal(struct runq *rq, int cpu) +static inline struct thread * +runq_steal_timeshare(struct runq *const rq, int cpu, int off) { - struct runq_steal_pred_data data = { - .td = NULL, - .cpu = cpu, - }; - int idx; + struct thread *td; - idx = runq_findq(rq, 0, RQ_NQS - 1, &runq_steal_pred, &data); - if (idx != -1) { - MPASS(data.td != NULL); - return (data.td); - } + MPASS(0 <= off && off < RQ_TS_POL_MODULO); - MPASS(data.td == NULL); - return (NULL); + td = runq_steal_range(rq, RQ_TS_POL_MIN + off, RQ_TS_POL_MAX, cpu); + if (td != NULL || off == 0) + return (td); + + td = runq_steal_range(rq, RQ_TS_POL_MIN, RQ_TS_POL_MIN + off - 1, cpu); + return (td); +} + +static inline struct thread * +runq_steal_idle(struct runq *const rq, int cpu) +{ + + return (runq_steal_range(rq, RQ_ID_POL_MIN, RQ_ID_POL_MAX, cpu)); } + /* * Attempt to steal a thread in priority order from a thread queue. */ @@ -1266,12 +1306,13 @@ tdq_steal(struct tdq *tdq, int cpu) struct thread *td; TDQ_LOCK_ASSERT(tdq, MA_OWNED); - if ((td = runq_steal(&tdq->tdq_realtime, cpu)) != NULL) + td = runq_steal_realtime(&tdq->tdq_runq, cpu); + if (td != NULL) return (td); - if ((td = runq_steal_from(&tdq->tdq_timeshare, - cpu, tdq->tdq_ridx)) != NULL) + td = runq_steal_timeshare(&tdq->tdq_runq, cpu, tdq->tdq_ts_deq_off); + if (td != NULL) return (td); - return (runq_steal(&tdq->tdq_idle, cpu)); + return (runq_steal_idle(&tdq->tdq_runq, cpu)); } /* @@ -1453,6 +1494,35 @@ llc: } #endif +static inline struct thread * +runq_choose_realtime(struct runq *const rq) +{ + + return (runq_first_thread_range(rq, RQ_RT_POL_MIN, RQ_RT_POL_MAX)); +} + +static struct thread * +runq_choose_timeshare(struct runq *const rq, int off) +{ + struct thread *td; + + MPASS(0 <= off && off < RQ_TS_POL_MODULO); + + td = runq_first_thread_range(rq, RQ_TS_POL_MIN + off, RQ_TS_POL_MAX); + if (td != NULL || off == 0) + return (td); + + td = runq_first_thread_range(rq, RQ_TS_POL_MIN, RQ_TS_POL_MIN + off - 1); + return (td); +} + +static inline struct thread * +runq_choose_idle(struct runq *const rq) +{ + + return (runq_first_thread_range(rq, RQ_ID_POL_MIN, RQ_ID_POL_MAX)); +} + /* * Pick the highest priority task we have and return it. */ @@ -1462,17 +1532,17 @@ tdq_choose(struct tdq *tdq) struct thread *td; TDQ_LOCK_ASSERT(tdq, MA_OWNED); - td = runq_choose(&tdq->tdq_realtime); + td = runq_choose_realtime(&tdq->tdq_runq); if (td != NULL) return (td); - td = runq_choose_from(&tdq->tdq_timeshare, tdq->tdq_ridx); + td = runq_choose_timeshare(&tdq->tdq_runq, tdq->tdq_ts_deq_off); if (td != NULL) { KASSERT(td->td_priority >= PRI_MIN_BATCH, ("tdq_choose: Invalid priority on timeshare queue %d", td->td_priority)); return (td); } - td = runq_choose(&tdq->tdq_idle); + td = runq_choose_idle(&tdq->tdq_runq); if (td != NULL) { KASSERT(td->td_priority >= PRI_MIN_IDLE, ("tdq_choose: Invalid priority on idle queue %d", @@ -1492,9 +1562,7 @@ tdq_setup(struct tdq *tdq, int id) if (bootverbose) printf("ULE: setup cpu %d\n", id); - runq_init(&tdq->tdq_realtime); - runq_init(&tdq->tdq_timeshare); - runq_init(&tdq->tdq_idle); + runq_init(&tdq->tdq_runq); tdq->tdq_id = id; snprintf(tdq->tdq_name, sizeof(tdq->tdq_name), "sched lock %d", (int)TDQ_ID(tdq)); @@ -2598,13 +2666,14 @@ sched_clock(struct thread *td, int cnt) tdq->tdq_switchcnt = tdq->tdq_load; /* - * Advance the insert index once for each tick to ensure that all + * Advance the insert offset once for each tick to ensure that all * threads get a chance to run. */ - if (tdq->tdq_idx == tdq->tdq_ridx) { - tdq->tdq_idx = (tdq->tdq_idx + 1) % RQ_NQS; - if (runq_is_queue_empty(&tdq->tdq_timeshare, tdq->tdq_ridx)) - tdq->tdq_ridx = tdq->tdq_idx; + if (tdq->tdq_ts_off == tdq->tdq_ts_deq_off) { + tdq->tdq_ts_off = (tdq->tdq_ts_off + 1) % RQ_TS_POL_MODULO; + if (runq_is_queue_empty(&tdq->tdq_runq, + tdq->tdq_ts_deq_off + RQ_TS_POL_MIN)) + tdq->tdq_ts_deq_off = tdq->tdq_ts_off; } ts = td_get_sched(td); sched_pctcpu_update(ts, 1); diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 0a7f70fcfa16..5f415740099f 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -117,7 +117,6 @@ struct thread *runq_first_thread_range(struct runq *const rq, bool runq_not_empty(struct runq *); struct thread *runq_choose(struct runq *); struct thread *runq_choose_fuzz(struct runq *, int _fuzz); -struct thread *runq_choose_from(struct runq *, int _idx); #endif /* _KERNEL */ #endif From nobody Mon Jul 28 13:31:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBQ5pSdz634qd; Mon, 28 Jul 2025 13:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBQ1qgBz3tpb; Mon, 28 Jul 2025 13:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kVOrFPA9YLW5GSRmu+awRkVKRiR/tQfv1OO+TM301dw=; b=WjNJCL4fSWXYD43UbVJ01ijPU6Iwuv7dBP6nBUG2q4ErPIoellyK306CDWgdKHtrUt/Fr4 HJALtmXOMuCh2UmTTss42r4q8RCK+CRfS1zo+2rC3sQXRhut83+GMjSDUxR4Rm7KHTqin6 M30B9mmU5NtQ2R/5+AUpR/PKkJWD8agyrYjqy9dP2ljUdxEXJa/DRRdTv2EFLd9bqHCxZ5 0K0fmM6YbbC1WFqMpdOB1lNH+/G+gfv0FTPZuTC62Tpi58OfjXA8rfw8SuoVh0G7e0vyUB abQAVwwtIL70BQrlJ0LGxVHNE2cGKsGr7c4EsKqjy4lS/mNRjSrqol9wA3FI5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kVOrFPA9YLW5GSRmu+awRkVKRiR/tQfv1OO+TM301dw=; b=v1/tliLJKlvnKXqCeeILWG7idbzg9eoYVsYvy2belIP9g9g8J2qkYYKJX0a49NzNQYmA2a /5WPbbzIx6HdSMM9mFuiRzShXbZ1Lcut5+tT/gLmYRtGT2rK7Kpz/671akaK0ifc5upp6Q Xv3AbiQDYphOfcJcmQav/Ca7WQoiSi6NKBPrc+qDyaVQQWDuG2Pis6Sx88yzZWg3oAwLEg 6dF8rp/argoSMljE50V8bGlVGlhiestuNMbkcjIFV1/3eq2mJ8zaQTSyQ6MCbwbdzvdPJo jszfm8VH5/WSXHNU53ZFW+WmilSiEWEt+qcb27mcGIAWr8PJGSLN9AWre7DHFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709486; a=rsa-sha256; cv=none; b=SpPC1UQ3QP88VZsGG69J9blMgKHVeyZMPieU5R4Ez2e6FNgr71oWGBLesFsrqNsOdCJvsx l3eBDz/rHPbZzuQkmU/7LjohStO7gl3e08L98fPN2XSGG231OCCkBYm2Xvv+NHp02oSK47 WuRs+ugr83KmrMO2odJHzxlWz/U9Kjrfx5VqDWpw+LD7YNMSn0od9OJMI+3BtYVNNrXGjm leDrm5soBZBJ2Vry3NHWtD8aKA/FV0fFGSSfxSB7Noo3Zi1OEXm/kmQjzczwTaE3girQYF U/KIqo8fL+HXqGRc61nyO5UPDEqV8Y/NaNjQLWuf+Ti90MNBC+/APlssh/Y0aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBQ0kfXznJW; Mon, 28 Jul 2025 13:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVQxK080432; Mon, 28 Jul 2025 13:31:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVPhw080429; Mon, 28 Jul 2025 13:31:25 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:25 GMT Message-Id: <202507281331.56SDVPhw080429@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: c6a65bbee695 - stable/14 - zfs: spa: ZIO_TASKQ_ISSUE: Use symbolic 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c6a65bbee6959f50fa9313c63f31ff6e815b48d4 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c6a65bbee6959f50fa9313c63f31ff6e815b48d4 commit c6a65bbee6959f50fa9313c63f31ff6e815b48d4 Author: Olivier Certner AuthorDate: 2024-05-21 14:23:32 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:21 +0000 zfs: spa: ZIO_TASKQ_ISSUE: Use symbolic priority This allows to change the meaning of priority differences in FreeBSD without requiring code changes in ZFS. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 (cherry picked from commit fd141584cf89d7d24543ef5be83c6927a5d67ffa) --- .../openzfs/include/os/freebsd/spl/sys/proc.h | 4 +++- .../openzfs/include/os/linux/spl/sys/sysmacros.h | 4 +++- sys/contrib/openzfs/include/sys/zfs_context.h | 4 +++- sys/contrib/openzfs/module/zfs/spa.c | 21 +++------------------ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h index 96ba10e5679e..0d02a826870c 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/proc.h @@ -44,7 +44,9 @@ #ifdef _KERNEL #define CPU curcpu #define minclsyspri PRIBIO -#define defclsyspri minclsyspri +#define defclsyspri minclsyspri +/* Write issue taskq priority. */ +#define wtqclsyspri ((PVM + PRIBIO) / 2) #define maxclsyspri PVM #define max_ncpus (mp_maxid + 1) #define boot_max_ncpus (mp_maxid + 1) diff --git a/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h b/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h index 0e8390736309..96bb01e81541 100644 --- a/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h +++ b/sys/contrib/openzfs/include/os/linux/spl/sys/sysmacros.h @@ -91,8 +91,10 @@ * Treat shim tasks as SCHED_NORMAL tasks */ #define minclsyspri (MAX_PRIO-1) -#define maxclsyspri (MAX_RT_PRIO) #define defclsyspri (DEFAULT_PRIO) +/* Write issue taskq priority. */ +#define wtqclsyspri (MAX_RT_PRIO + 1) +#define maxclsyspri (MAX_RT_PRIO) #ifndef NICE_TO_PRIO #define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20) diff --git a/sys/contrib/openzfs/include/sys/zfs_context.h b/sys/contrib/openzfs/include/sys/zfs_context.h index 5dedb14c7fb5..accfa3d9da9f 100644 --- a/sys/contrib/openzfs/include/sys/zfs_context.h +++ b/sys/contrib/openzfs/include/sys/zfs_context.h @@ -620,8 +620,10 @@ extern void delay(clock_t ticks); * Process priorities as defined by setpriority(2) and getpriority(2). */ #define minclsyspri 19 -#define maxclsyspri -20 #define defclsyspri 0 +/* Write issue taskq priority. */ +#define wtqclsyspri -19 +#define maxclsyspri -20 #define CPU_SEQID ((uintptr_t)pthread_self() & (max_ncpus - 1)) #define CPU_SEQID_UNSTABLE CPU_SEQID diff --git a/sys/contrib/openzfs/module/zfs/spa.c b/sys/contrib/openzfs/module/zfs/spa.c index 886867b739f0..b140f55af973 100644 --- a/sys/contrib/openzfs/module/zfs/spa.c +++ b/sys/contrib/openzfs/module/zfs/spa.c @@ -1114,29 +1114,14 @@ spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q) tq = taskq_create_sysdc(name, value, 50, INT_MAX, spa->spa_proc, zio_taskq_basedc, flags); } else { - pri_t pri = maxclsyspri; /* * The write issue taskq can be extremely CPU * intensive. Run it at slightly less important * priority than the other taskqs. - * - * Under Linux and FreeBSD this means incrementing - * the priority value as opposed to platforms like - * illumos where it should be decremented. - * - * On FreeBSD, if priorities divided by four (RQ_PPQ) - * are equal then a difference between them is - * insignificant. */ - if (t == ZIO_TYPE_WRITE && q == ZIO_TASKQ_ISSUE) { -#if defined(__linux__) - pri++; -#elif defined(__FreeBSD__) - pri += 4; -#else -#error "unknown OS" -#endif - } + const pri_t pri = (t == ZIO_TYPE_WRITE && + q == ZIO_TASKQ_ISSUE) ? + wtqclsyspri : maxclsyspri; tq = taskq_create_proc(name, value, pri, 50, INT_MAX, spa->spa_proc, flags); } From nobody Mon Jul 28 13:31:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBS0d6Cz6351j; Mon, 28 Jul 2025 13:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBR4V2dz3tx4; Mon, 28 Jul 2025 13:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xVRUzmyOguvbVIwLe/h6SJkcLCFlylXnkuBqQze8Id4=; b=VZUOe1h6RfvJ/SWIen296mdE95Jtnk/IRdXrCGzKR0lVuwD/dRHU+qkvm70UuJVXhAdnAg Y+Obdi5lMXE6/rcqI50kzLMh4nEINtl7vM8dmTW7DCPcxGVCdBLqHUlpxQaNCtxa1Iw9LW rndnw08Nu3KFqDQbQNWuMXdwUCqspn21UaJLLEf08mea52sR5MwPEdMpjI8SIYRpt9QoU+ V5DhwG9kX1izaiJ0QzRooLMH02Uv4arUqUURvnHmb7o9xZVT0y+tNX3Ac3bw8887uhEFxo yegMVRWkBHKsoAWyTQQiP/huUOe1mqr4b1zy05/Ez0d2bsUbrUQw4StoObcfwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xVRUzmyOguvbVIwLe/h6SJkcLCFlylXnkuBqQze8Id4=; b=ZjGtsstxnVbgXVlp5P57QljxRayYslAzPiX+k1tGAA68TJJ7dt5b+sEapF3nGV5pMlH+/p xvCO7AFIuaRbAt7z0LgVaK81TWzjqYvxdyobDnTQMMt4JbR+keaSo68YGBnEmEj7sSmOPB Mm1kq3uDsPy3LItObY3d0i3QcpNFtDmZ3KTZh2NNs+a45dmPEt2pRqOTHd3OeT7mtHtvn6 iKigRUk6M5muNQPoXMXiP505ZGKtLhphTiqHia2kfVvnco60c05eHzwB1xmcT1dImxFhV7 H6Gb8LeEBjkWkTwvQfRPG/LM8k522RGFkaTDZ6Q9zr7aUOpxPN1K19sq2AMPRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709487; a=rsa-sha256; cv=none; b=aQQQQXgjPu2GlDriX5KxysM/VRYV6sXOTi8WpMorb20AkepvW4zX9fBcZ+aEtZhGj95/tK vQ5ZzMSsrh9dVK8FOGAu8U7QlDiNc5z03w0V4UiH08Mlv9eV55TEgBU04a2YdIzCuxQTIO LpjMn/E2cQACg3y42YVhr4xuXgOJlJ0V6BSMNQqY790mD9EBUkBkuqTokMzuA72AlhjeC+ 0qa/os8JiHFZjT/JBuy2STHZ8E7pQypCo8sEPgVtsaCRjkp/3rHbc75Mq+bkRDcIcSbyQu T5gGN4uNGsdzfFvXSjV9xfg6z89FubcacTC60cOS9nSteAo9FgDn4G5uhHHdog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBR1fv0znft; Mon, 28 Jul 2025 13:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVRg7080465; Mon, 28 Jul 2025 13:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVRGi080462; Mon, 28 Jul 2025 13:31:27 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:27 GMT Message-Id: <202507281331.56SDVRGi080462@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: 0f54758cbe91 - stable/14 - runq: Switch to 256 levels List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f54758cbe917bd8ba4160a97b9bf93b05922257 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0f54758cbe917bd8ba4160a97b9bf93b05922257 commit 0f54758cbe917bd8ba4160a97b9bf93b05922257 Author: Olivier Certner AuthorDate: 2024-05-14 12:36:33 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:23 +0000 runq: Switch to 256 levels This increases the number of levels from 64 to 256, which coincides with the distinct internal priority values (priority is currently encoded in a 'u_char', whose range is entirely used). With this change, we become POSIX-compliant for SCHED_FIFO/SCHED_RR in that we really provide 32 distinct priority levels for these policies. Previously, threads in the same "priority group", with priority groups defined as the threads in consecutive spans of 4 priority levels starting with level 0 up to 31 (so there are 8 groups), could not preempt or be preempted by each other even if they were assigned different priority levels. See also commit "sched_ule: Use a single runqueue per CPU" for all the drawbacks that this change also removes. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 (cherry picked from commit af8de65ef23e7e447916370851f39aea3f74e16a) --- sys/sys/runq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 5f415740099f..590463af192c 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -42,7 +42,7 @@ */ #define RQ_MAX_PRIO (255) /* Maximum priority (minimum is 0). */ -#define RQ_PPQ (4) /* Priorities per queue. */ +#define RQ_PPQ (1) /* Priorities per queue. */ /* * Deduced from the above parameters and machine ones. From nobody Mon Jul 28 13:31:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBS5M5Fz634lZ; Mon, 28 Jul 2025 13:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBS3SdDz3txK; Mon, 28 Jul 2025 13:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0/v8+3sXf7ZwmH4ktEO0bu6LB4b71ir5w3Jy33EGGQ=; b=Z3x1KnyqG4rZl1MIwln3ZnrMbEQzjitbiXCSTPXX5TpmBbxSjwm/rX0wiDqS+EvZOiL2i5 vJmt2ol1nFrk3uNb+dVwM+BO23rjBJVStRqbeozvPUMMUgPFCiXXBGtCdasD8qHHMIe21e 9VXtQzfS989aR3bFxum8I8+48nyJ5bwR7RNn1wrTU1Q/wzCCElEsB3+k6OPkEVQu+Q995x zfjgpHrAeyfczaK2MHTKZ4IE5O6VgtAeQaX9xy0dcZzzu8bKxqW36hwWFDBQ8o2Bg4akzM Dsp+XsoD3P2LeUkhW4WEx+Y0vts15bqRHbbWlqNreY3vD1rSXguXAOvrLwBs+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0/v8+3sXf7ZwmH4ktEO0bu6LB4b71ir5w3Jy33EGGQ=; b=GBq0O48yVF4tH4VrNOnY0K11Tk3cTNmZEzKeqCvzN2i3iIdcVJUjATVuYXoo+PAb7YDqwU LaJNY61fzxguN79PwT6NiuvNtsFBfXv6nlFXZzuZagfm1+6kfVwrUg4gLz2mmpQUyp5qWj N6zSRfMtAN+FtjE/5I+HnXR9rH5J3s0xl3PUe2qZ1UN//UycUnpRh8TF1k9xa4QWzrsD6c xjbrxwavyQUxAXh/sEOpZkPd1AceAPrFNA3fbtNyRFGwQwKj6mt3gdmjmvortUUbHextkr KU9qtAIivtMYsCdJGohDVf5WadcEBXYSisu8fb3Ydcr4j29lBH7JK24caaGjzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709488; a=rsa-sha256; cv=none; b=bs0hy/TyBQvVi0xtQoVP8VMqNM83fYtTQZxNYYQQgJqex76JhGyMUI02kLubH1ZrAjAIra bzOICfC3eSNo8cp/+Cn0Bqx5+NTqj7iIcQyzeNDCkXSun9sgx9Cyg6s3Wf8WZf+aWnzxbt tyctHbqdhe1z/xFfBT6I9xxoq5FaH720jhUUAUDKo0mVSlwcABWRLLbx5Cien9Jcci4L6q tRcVHKe+7midiGGKaRow32VCWoEgJcdAwcNU1lE4ntylxXlyLDGBLKv1EcUKQ9SfyYMM9d R1M7yyMa7fYFZ/qv/JtWHpuq/stZNsptA+2fg8oNfz58rZK7c817Lia6g0WG0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBS2N3xznNt; Mon, 28 Jul 2025 13:31:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVShw080504; Mon, 28 Jul 2025 13:31:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVSJn080501; Mon, 28 Jul 2025 13:31:28 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:28 GMT Message-Id: <202507281331.56SDVSJn080501@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: 590d12774f8f - stable/14 - runq: Bump __FreeBSD_version after switching to 256 levels List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 590d12774f8f921a3181dc0b893612925b041394 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=590d12774f8f921a3181dc0b893612925b041394 commit 590d12774f8f921a3181dc0b893612925b041394 Author: Olivier Certner AuthorDate: 2024-05-21 13:21:51 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:25 +0000 runq: Bump __FreeBSD_version after switching to 256 levels Corresponding to changing RQ_PPQ to 1. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 (cherry picked from commit e3a4b989d7f7d82f7ab8cefe0d665dbe6b74d316) --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 74490f5e6e0e..3c3f4093ee1f 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1403503 +#define __FreeBSD_version 1403504 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Mon Jul 28 13:31:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBW1V2dz634sp; Mon, 28 Jul 2025 13:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBV3vDjz3v02; Mon, 28 Jul 2025 13:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709490; h=from:from:reply-to:subject:subject: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+LfwrT078+41FrSWY7iEaxzRxHmsvmCQTnuFeeCQv4=; b=Ew7UQLLqXAoP463NYmGNe2a0QDCA1ki04NQQ/WPIEqCDbnYptpyaq0r2aY5f/8SezmShXs GPx0js5nxR0nlfAfg5d4oY26JoAs14CvCOlWJ7MBWtRVm3kOA9iJKwR4ECYlSLg1jzk/Bs x9Z96rJ/WFdI93+tyRkRRjmZM/vLEebmiojc26PL/pUOdNV4cWkD1at9NPLpx977mLFidb 2+C2OANEDA+8eMpGlMiJKmSVDDslLKKwIpIkRKk1mmznvxGpli+EMSFbUaVPt1M9PWLgzO 66CzRnIIcdfmwZdUS5AzDRKfEuBBKfIP94Ovb7wjT8pdVF12OMXs7xtw4Vhriw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709490; h=from:from:reply-to:subject:subject: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+LfwrT078+41FrSWY7iEaxzRxHmsvmCQTnuFeeCQv4=; b=KG8MG4ak57/EMVxYgDbCoJvpOBJKZoFINcyckFPNMibuVb4ZQ0fG5z2aPzlj+zi3EZrxnV NQ++Ky7maVrEwEHF0p581DKpYwNAdcAkBT+PiFvrypGRyUnWr5H/xeDbnzt0ApExb5P0ZP 41Vzhvj/HBbnfxenKKsX4hQgoJzJrHYif318MZhaRCrQ6Mfh1eqn7umpcB9COB3/GUHDPv iWoPwty4lLdE/f+KLxRfKICAG6D04ekgerlkR5WBSYcZgYYzRjWtU3Yh59AGc9aVYzEYoQ xHDGafY/HOYdbqdDAgI2g1Zto8Xq/LRjeY91v8qxiGWFq0hXQFipj7W2GQfrBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709490; a=rsa-sha256; cv=none; b=YnysQlu6ztOiJNyAyV5P/SswFU4b2uoRLIQpbvIzyMIqk0XRAcSB6u0s7ZwUY6pu0Vrj/C PvNTNFjKa+OsUnRe8kPR0OcPrzCJ3EV/Avq4cVSQq2YiCD9lXsanf1WlHEj9F5rPp9yuE+ 3fSAY9RJ61BD9I8y9hByZTCJlxmug+k0vN2uwvq4s8HJVjrlkA4e6XF8CNUrz1WMqjCexu cqUbgaI/5U7ez4lkSJIRg7ZPbwq2dGCYOqM372L614YyPQ9ozP45IBIOdrVPpUF4Vqgk8R DlGz07r0CbRhQ6HYyg/8WZPma8lcqqSSlX0HMhII6V1nxskxzt10MjiyeZXPog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBV3VtrznJb; Mon, 28 Jul 2025 13:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVUXK080655; Mon, 28 Jul 2025 13:31:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVU4w080641; Mon, 28 Jul 2025 13:31:30 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:30 GMT Message-Id: <202507281331.56SDVU4w080641@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: c6838df83578 - stable/14 - epoch_test: Assign different priorities using offset 1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c6838df8357825d2f49c138b8a7d9d0bfdcc4760 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c6838df8357825d2f49c138b8a7d9d0bfdcc4760 commit c6838df8357825d2f49c138b8a7d9d0bfdcc4760 Author: Olivier Certner AuthorDate: 2025-03-13 09:31:45 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:28 +0000 epoch_test: Assign different priorities using offset 1 Replace the hardcoded 4 (old RQ_PPQ) by 1 (new RQ_PPQ), as all priority levels are now treated differently. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit a2d1c3bc2bb44a824a8d1f688aa1fd3b66fa759b) --- sys/tests/epoch/epoch_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/tests/epoch/epoch_test.c b/sys/tests/epoch/epoch_test.c index e34b5de1c422..f25e03344b36 100644 --- a/sys/tests/epoch/epoch_test.c +++ b/sys/tests/epoch/epoch_test.c @@ -148,7 +148,7 @@ test_modinit(void) printf("%s: kthread_add(epoch_test): error %d", __func__, error); } else { - pri_off = (i*4)%pri_range; + pri_off = i%pri_range; td = testthreads[i]; thread_lock(td); sched_prio(td, PRI_MIN_REALTIME + pri_off); From nobody Mon Jul 28 13:31:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBV50Zrz634ql; Mon, 28 Jul 2025 13:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBT4R9Sz3ts0; Mon, 28 Jul 2025 13:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AE93Bxiq+dTBX/bZFo324OFNDiHNCw3adipXsyvXxoM=; b=BH4eJcJsXuczJm84A11dbfws6Y5SPqnRV056EHuzfmuRg8AdjC5yzXNBe5QyZiUUJSYzRd d1RRHh0VDpxla1tM8yIGOVmvWO8FE4ah7VIyns8XXsiJpnln3vKcC3UG0npC0iH1Vke6JM M/rpIZCmyb++YKzgo16x2wN6/35dkxIL3ciQzTYXmq4e9ifKq/vBcz2XchE93Kjc4zaJcX hNTR95Xw8IqQKkZxKch4+pdj9PFYoA+MB5iK+n1B0PUKJCn/rxHuJ1/p/yTqzwe9Qk1MsZ gXZ4U7WhRd9ckOxkyYTD3FEDO2vGNOaNCuoCieTCKOY176AJPlP0Yhvk+KKEoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AE93Bxiq+dTBX/bZFo324OFNDiHNCw3adipXsyvXxoM=; b=myDAgQQjifuvROGxNDsqPzJJYckqYPpIN7M5nO7ZXsI5w7egoWxjtJiJAH2vwk8LiZUu50 oTVJkgrw8XimH+IwwRZ2kZxoHP+yo6OQ/9pgPxBDkLa6DKq9FK/udHU0ON3OVKWrY4Ea4L U5tnDg5MUfBtXWBBx9yY7d6FrdqFzBnACG9g/ZUcBORAT2Hlf7GnZ52tVHlNqLgnmpTfnN gRkKSA+R7zXrAX8i9HjVKVAwXZzatM3HM7z1vN7kYDYxjbmDl56nB9ch9af6ZnI0AQwufD H46BQph4Q3EQKBxjDJP0NBT8isgi4DGO1SgDMHzRlC9R6cK0J1Rkml28uLCbHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709489; a=rsa-sha256; cv=none; b=sUENPscjqCadXnKb397msepAWDe6IB+vHIkkf6iU9iBHnaB8lLm8gjxR3f/8GWzeg3oluW 3ydw9QL8TgnyvMlPO0ngO2n2kNhX3vJ63CMn9oPoT3u89n4L0eq4pRDUSVWYNbFURFd3FY QF1QrkRuEgsDkVt8Sf/guXim5wWXRTIBUeRyOorRJghB2obnuwqXo6AZlzsy6TKatYQtJ4 81kty83cTU13Y2Run0iaFRirOpzOtk7NaWTSMGYUhgOtlANbl2S26nWv/382TU17+DhWcG gjvoj0CZ4jCwziI5r6c+3vY8agoz9D4IgJf+EQBVmrLOAmbvFRdNx5D/u6uo2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBT3W15znfR; Mon, 28 Jul 2025 13:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVTDH080540; Mon, 28 Jul 2025 13:31:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVTwE080536; Mon, 28 Jul 2025 13:31:29 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:29 GMT Message-Id: <202507281331.56SDVTwE080536@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: dcf352d69d91 - stable/14 - runq: Remove userland references to RQ_PPQ in rtprio contexts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dcf352d69d912823b7eb2fb0ed5a33ac4ce9b5c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=dcf352d69d912823b7eb2fb0ed5a33ac4ce9b5c9 commit dcf352d69d912823b7eb2fb0ed5a33ac4ce9b5c9 Author: Olivier Certner AuthorDate: 2024-05-21 13:00:23 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:26 +0000 runq: Remove userland references to RQ_PPQ in rtprio contexts Concerns only a single test (ptrace_test.c). MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 (cherry picked from commit b2a9ee2a72eabcfe7942cfbc2a576b5603ef218c) --- tests/sys/kern/ptrace_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 8831d298d554..b96e7d126b03 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -2029,7 +2028,7 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_signal, tc) sched_get_priority_min(SCHED_FIFO)) / 2; CHILD_REQUIRE(pthread_setschedparam(pthread_self(), SCHED_FIFO, &sched_param) == 0); - sched_param.sched_priority -= RQ_PPQ; + sched_param.sched_priority -= 1; CHILD_REQUIRE(pthread_setschedparam(t, SCHED_FIFO, &sched_param) == 0); @@ -2132,7 +2131,7 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) sched_get_priority_min(SCHED_FIFO)) / 2; CHILD_REQUIRE(pthread_setschedparam(pthread_self(), SCHED_FIFO, &sched_param) == 0); - sched_param.sched_priority -= RQ_PPQ; + sched_param.sched_priority -= 1; CHILD_REQUIRE(pthread_setschedparam(t, SCHED_FIFO, &sched_param) == 0); From nobody Mon Jul 28 13:31:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBX0b4Lz634lh; Mon, 28 Jul 2025 13:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBW5S8Xz3vBH; Mon, 28 Jul 2025 13:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FoLDJhHREjb+0TxgGUeXwb2V0CNSS2vQPMIZT2KLwaQ=; b=Ig4YCUxt1/AXakokOTjQNLSnVayuVM08qCBbY6DBRDoH4LSgIlhfBrKouw5AFNT4kE+D8V CgXsrJQxRahaDQsqjCFMoPwjA9Y3jKqczA5P17i6dcR2ZcOY2c/0ipef3+wjz4RlyAGlXa bCBdoEV6J3ZhOp7vjYEdKPxTD38Lbtzxh/GYbmvDA2RRQ3XENZbbcEQWNlFbH8aXCBUlfb n5SPA7SVYSjLggREVipb4yGwpd94OCjdZxnbjZk89q9NxzvwuBzVvJquH1h14wKYkXARh3 KIk9EpdJvQNhdjTZWwPS3QS+7zAFHboQYhFo4PYmCKezj1CPTf+KObfzXBXJMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FoLDJhHREjb+0TxgGUeXwb2V0CNSS2vQPMIZT2KLwaQ=; b=s67Fer9KvkBPRTUBawM0yr35CNe25HLvy/XTv+5oAx4kflX8vAppoHdTCd5zy4Ymg8qaLO 1fG3Qiq97A91IF0d0F31jQViY4HSVnz1sn9XJR1ZIryL+DbH9I4AVP6JgWeLqawEj/AV6y 28gGzSTqjf5t47Dc2SxYGTSZvORlzQijVC43ccb/LEz7D3XPzp/C4vlOTYG3lfLjAKjzUY JO0HooBztlBMK1IPOOHWGOZHE9GI32cCA2uYjKj1X1zL8rDXV0+XSIpkRsWa8+1FhyQXFA 4gYDGQWsEdw791No8h28fnVdt8DULV7M7n4xVCrII2ntrGZLp2coBUnccsPeXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709491; a=rsa-sha256; cv=none; b=Iq8y8g8KtcHfDVdhjZ8E0XGi+x2uIkXoWS95Q4sPLo2AgrkfF8/DuVYEeCBYb7TmCqQuqz 3huFDpTQsOSNiQzwzDwM9iL/iOV1rSQvlq2XXaiRUpw0NjwWmw/z2P0F+rlOc5cezCsHH6 YDrTmXHbRVbh4+HKvgfCpItpyskS+X7ZjORh7HPld/fuErMo/CBsHtq9+lhUVUBfGlFtOj Yw0v4Kq5cXMe8++Y1U4NKCagNACBVoNSDKeB7t1UsPOtJ4kbkYYG387JEDnX7IkO0I6oOz d4RwHZBHwCmAIoX0e2A9cle5zCm0uTke8MmyxFNzj5qYJ+a3TO/E1YTqaisy1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBW4kjwznfw; Mon, 28 Jul 2025 13:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVVeo081832; Mon, 28 Jul 2025 13:31:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVVHe081829; Mon, 28 Jul 2025 13:31:31 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:31 GMT Message-Id: <202507281331.56SDVVHe081829@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: 2a9e7fd346f6 - stable/14 - runq: Restrict to kernel only List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2a9e7fd346f669338a23b438a723f5d604957173 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2a9e7fd346f669338a23b438a723f5d604957173 commit 2a9e7fd346f669338a23b438a723f5d604957173 Author: Olivier Certner AuthorDate: 2024-05-21 13:05:54 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:29 +0000 runq: Restrict to kernel only MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 (cherry picked from commit 055b5b5f850da9d8355740b7a0698fa790c4f97d) --- sys/sys/runq.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 590463af192c..9e209538d9c2 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -29,13 +29,16 @@ #ifndef _RUNQ_H_ #define _RUNQ_H_ -#include +#ifndef _KERNEL +#error "no user-serviceable parts inside" +#endif -#ifdef _KERNEL +#include /* For bool. */ +#include #include -#else -#include -#endif +#include + +struct thread; /* * Run queue parameters. @@ -69,12 +72,6 @@ typedef unsigned long rqsw_t; /* runq's status words type. */ RQSW_TO_QUEUE_IDX(word_idx, RQSW_BSF(word)) -#ifdef _KERNEL -#include /* For bool. */ -#include - -struct thread; - /* * The queue for a given index as a list of threads. */ @@ -117,6 +114,5 @@ struct thread *runq_first_thread_range(struct runq *const rq, bool runq_not_empty(struct runq *); struct thread *runq_choose(struct runq *); struct thread *runq_choose_fuzz(struct runq *, int _fuzz); -#endif /* _KERNEL */ #endif From nobody Mon Jul 28 13:31:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBY0g6pz634nZ; Mon, 28 Jul 2025 13:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBX631lz3vBj; Mon, 28 Jul 2025 13:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7r9JnKmNcR0Egvwmws14AYb9BkwCXVrr/4pPFKgLlc=; b=DMPJqqiWPovxWD/6rzAjg62Cr3qvT19BKgl8w3Ru3f2nBA8unYdlwawa3QNDWERPv2OW9M 2ctQWiSC1FfU59BCLvxDcr31gzIHRCHpWECwPxL2K3OwoJ6pQYBIBzub4d79EvRAO7CBMu TcONZ/yd91EN27ksz5K4FvYxxTxy2ToC8LdHySijB8KwMH7xYlfK/PyN4s7QzOgaeSfcZ1 ZksonKjzo6oXiEX8858PsN8jurzs5/boPoeIpcDxFYifudbyn2cGIW1gFSkGuxLAWBXUVP hevRfbBYbHuCaC+TF1hpDXVYZj7JmvPPFuOMbX5NAsjxIl0QMDclRnhx2arC4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7r9JnKmNcR0Egvwmws14AYb9BkwCXVrr/4pPFKgLlc=; b=iBv51MIgOJirmBGd0VsYYml4gvQvTN3SfR9vV4qUHiPNyicHcz4ZxY6ziYrgY3o515jpCe vIP2UD7aoqlCHmk3nJDTy8oIewTbM28c7Xz/CIMHwA3MVz+KDG+x5ilvgtBEjP/xy0rInX pj7p6U1McHaZ/Vu+ohyZ96Z7c9hBi4MN8FgJ6iHd0Q3I379JCyvsFWOtQUg2374GEZf0nO MV/hGqE/Kqw0ycipgUneXvA9t9V1WCUo60MJaw0uAnW7WyXZJiKQjkFL3qoGhvXJr5MnQv aBjrtyj/mj6DH5J3kEDPywerqb3OZRIl8J+hyWzfAMP+2dhFsei8JNJLGbnxNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709492; a=rsa-sha256; cv=none; b=gdXfT/Px+7tUgaI300c2sKEhX9GvNWopHn/AIsjXbqMYSXFWfX1J6u2W+LxhqS57ORUzE1 ni9Ow9qWiaJ+twbGmDChEmn5UQ6zU1a3Hu15tf9RcuzwvZD7rvH3DAMjkiOQg+KjlOz1OW SC3IhvhS1FWf7QSi9ORI4vceuR8FS5fCrMQ5sWHcIM3kHZh/dRKxsPr2ZynJJEnMc1gs/Y /y0t8l3u9fgkECpLxc6Sdoq5Y/omwHBvWX+hFRJzUOfZWuJsILJLp6bFsoAl4mZ3Tux3w0 wx+/d7mif91P23wkwwf15wtcqcsD03Ine6G6rQADoSrR96BY7bgg2T602aRbZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBX5QrMznJc; Mon, 28 Jul 2025 13:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVWsr081939; Mon, 28 Jul 2025 13:31:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVWWt081936; Mon, 28 Jul 2025 13:31:32 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:32 GMT Message-Id: <202507281331.56SDVWWt081936@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: c42d06da488a - stable/14 - runq: Add copyright List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c42d06da488a12c110a7476a6b313e1fce890402 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c42d06da488a12c110a7476a6b313e1fce890402 commit c42d06da488a12c110a7476a6b313e1fce890402 Author: Olivier Certner AuthorDate: 2024-05-21 13:12:27 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:38 +0000 runq: Add copyright MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit d710acecc00f59dbcc1006ca330f0eeb1a133695) --- sys/kern/kern_switch.c | 5 +++++ sys/sys/runq.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 264925ab954a..bd0d987594ea 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -3,6 +3,11 @@ * * Copyright (c) 2001 Jake Burkholder * All rights reserved. + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Olivier Certner + * at Kumacom SARL 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 diff --git a/sys/sys/runq.h b/sys/sys/runq.h index 9e209538d9c2..fb9b9908fe57 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -3,6 +3,11 @@ * * Copyright (c) 2001 Jake Burkholder * All rights reserved. + * Copyright (c) 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Olivier Certner + * at Kumacom SARL 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 From nobody Mon Jul 28 13:31:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBb4FD5z634Y1; Mon, 28 Jul 2025 13:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBY75pkz3v8F; Mon, 28 Jul 2025 13:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQIu/wePMU3/VBIVBIw7ILszwtPn0f9yDpes47Stbx8=; b=nsu9ArgeWuNW1kZeGuyCHYLbiGzTuF6lN+lOp8ykJwuOB7ELfS1prq+QRRaBv2lrGwjEma JESgggDapLDjUDdkS7iXNjVhdCQZkFczykbPIQSG1FwNfYiaiEskn70GZar/0frEXrt1+i MGL6gLmUd9RZKTHR49pckBF0F+jnl7y3PzDawZa3XQfKWEZvcpqtZMOfPBJ+xDlGpZNWzF LbclfMjdRBITFAbytXHIXqZdQRLffGBTo+AFWkYqO1ItNJFGgYR5jgWyLu+8lThzbID8hO 6qJ9OkLNCJMHG/YKsHGaoOuakUL4nyQC8UEdse8m342IFxfwJb+G1trDgBXHnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQIu/wePMU3/VBIVBIw7ILszwtPn0f9yDpes47Stbx8=; b=Ww3PtNLc0ynjccoVYgWsE3iHP1DwYg86sGZukXsEIkZH9yh/KPoZ8Y3/iZXBQAPXuUpyxP c8sJBsq/wvzYtcQ18rnPzmSolvYjzyVH7HXbV62U9SnT1UNxF0e2njDheq+rrreWvF0F0q QIRIgR/Cw+fE/giGIeYnX+dZ/sZfhIsHIqSi6Tq/XfirZPqQiY7meL5Rl226GkkQhS1DpP DkCUCJb/e05vea02df7OWOgbgJTjuxcDCMCrhuv8MeM8mU9Xg7g1EOpKPBoYR2UtNjAkJZ tz5hD0wPhx6o9LJ7jrkLlemmFWIdC85v8lJzQPWCCMqnj+bA4GljcoK2B6/GSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709494; a=rsa-sha256; cv=none; b=MB/rwloxkaKJIwtl6cl4NBDJ4WN8/UL6MuTTY8C5ykzRnDRA8031t/8hC5UNATHwGKQe2a MqvfhSiHHYoQUm7ShgimZwmwg6iRXR0MyZMf6Hrj7SjTB6FmiofK6wMvaSLuSbjJlSVsGt zDOgtEBYi/jP64FscbSMvVZWlHYVt8Ka7cQeBdlwIzLiaxrbKWlxJTPGyi15WU0+0J9X1P XhIVdLq6kNEMUIb9cECyMG1HjYZ9NXkBaITB97U1wLODCmtupVZ9zdrWpAZgGtP37VANfj NpL/p+GJmBYAGPvquCpsnZ9OGUm+KcVRsWUCRXREtgbThH6ui7Mku50TM2ymbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBY6cKrznJd; Mon, 28 Jul 2025 13:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVXTC081977; Mon, 28 Jul 2025 13:31:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVXax081973; Mon, 28 Jul 2025 13:31:33 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:33 GMT Message-Id: <202507281331.56SDVXax081973@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: d83f27fe7378 - stable/14 - sched: Internal priority ranges: Reduce kernel, increase timeshare List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d83f27fe73787a3625aae3f36fd50bd4662db483 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d83f27fe73787a3625aae3f36fd50bd4662db483 commit d83f27fe73787a3625aae3f36fd50bd4662db483 Author: Olivier Certner AuthorDate: 2024-05-22 20:32:18 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:39 +0000 sched: Internal priority ranges: Reduce kernel, increase timeshare Now that a difference of 1 in priority level is significant, we can shrink the priority range reserved for kernel threads. Only four distinct levels are necessary for the bottom half (3 base levels and arguably an additional one for demoted interrupt threads that run for full time slices so that they finally don't compete with other ones). To leave room for other possible uses, we settle on 8 levels. Given the symbolic constants for the top half, 10 levels are currently necessary. We settle on 16 levels. This allows to enlarge the timesharing range, which covers ULE's both interactive and batch range, to 168 distinct levels from less than 64 ones for ULE (as of before the changes to make it use a single runqueue and have 256 distinct levels per runqueue) and 34 ones for 4BSD. While here, note that the realtime range is required to have at least 32 priority levels since: - POSIX mandates at least 32 distinct levels for the SCHED_RR/SCHED_FIFO scheduling policies. - We directly map contiguous priority levels ('sched_priority') of these scheduling policies to distinct, contiguous internal priority levels. Conversely, having at least 32 priority levels is enough to guarantee compliance to the POSIX requirement mentioned above because different internal priority levels are treated differently since commit "runq: Switch to 256 levels". While here, list explicit change restrictions for the realtime and idle range. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45391 (cherry picked from commit dee257c28d936bb7b459d3eda207531b3cf1bd4e) --- sys/sys/priority.h | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/sys/sys/priority.h b/sys/sys/priority.h index 4428a85c0987..93dd5aa90d95 100644 --- a/sys/sys/priority.h +++ b/sys/sys/priority.h @@ -64,17 +64,23 @@ */ /* - * Priorities range from 0 to 255, but differences of less then 4 (RQ_PPQ) - * are insignificant. Ranges are as follows: + * Priorities range from 0 to 255. Ranges are as follows: * - * Interrupt threads: 0 - 15 - * Realtime user threads: 16 - 47 - * Top half kernel threads: 48 - 87 - * Time sharing user threads: 88 - 223 + * Interrupt threads: 0 - 7 + * Realtime user threads: 8 - 39 + * Top half kernel threads: 40 - 55 + * Time sharing user threads: 56 - 223 * Idle user threads: 224 - 255 * - * XXX If/When the specific interrupt thread and top half thread ranges - * disappear, a larger range can be used for user processes. + * Priority levels of rtprio(2)'s RTP_PRIO_FIFO and RTP_PRIO_REALTIME and + * POSIX's SCHED_FIFO and SCHED_RR are directly mapped to the internal realtime + * range mentioned above by a simple translation. This range's length + * consequently cannot be changed without impacts on the scheduling priority + * code, and in any case must never be smaller than 32 for POSIX compliance and + * rtprio(2) backwards compatibility. Similarly, priority levels of rtprio(2)'s + * RTP_PRIO_IDLE are directly mapped to the internal idle range above (and, + * soon, those of the to-be-introduced SCHED_IDLE policy as well), so changing + * that range is subject to the same caveats and restrictions. */ #define PRI_MIN (0) /* Highest priority. */ @@ -88,34 +94,34 @@ * decay to lower priorities if they run for full time slices. */ #define PI_REALTIME (PRI_MIN_ITHD + 0) -#define PI_INTR (PRI_MIN_ITHD + 4) +#define PI_INTR (PRI_MIN_ITHD + 1) #define PI_AV PI_INTR #define PI_NET PI_INTR #define PI_DISK PI_INTR #define PI_TTY PI_INTR #define PI_DULL PI_INTR -#define PI_SOFT (PRI_MIN_ITHD + 8) +#define PI_SOFT (PRI_MIN_ITHD + 2) #define PI_SOFTCLOCK PI_SOFT #define PI_SWI(x) PI_SOFT -#define PRI_MIN_REALTIME (16) +#define PRI_MIN_REALTIME (8) #define PRI_MAX_REALTIME (PRI_MIN_KERN - 1) -#define PRI_MIN_KERN (48) +#define PRI_MIN_KERN (40) #define PRI_MAX_KERN (PRI_MIN_TIMESHARE - 1) #define PSWP (PRI_MIN_KERN + 0) -#define PVM (PRI_MIN_KERN + 4) -#define PINOD (PRI_MIN_KERN + 8) -#define PRIBIO (PRI_MIN_KERN + 12) -#define PVFS (PRI_MIN_KERN + 16) -#define PZERO (PRI_MIN_KERN + 20) -#define PSOCK (PRI_MIN_KERN + 24) -#define PWAIT (PRI_MIN_KERN + 28) -#define PLOCK (PRI_MIN_KERN + 32) -#define PPAUSE (PRI_MIN_KERN + 36) - -#define PRI_MIN_TIMESHARE (88) +#define PVM (PRI_MIN_KERN + 1) +#define PINOD (PRI_MIN_KERN + 2) +#define PRIBIO (PRI_MIN_KERN + 3) +#define PVFS (PRI_MIN_KERN + 4) +#define PZERO (PRI_MIN_KERN + 5) +#define PSOCK (PRI_MIN_KERN + 6) +#define PWAIT (PRI_MIN_KERN + 7) +#define PLOCK (PRI_MIN_KERN + 8) +#define PPAUSE (PRI_MIN_KERN + 9) + +#define PRI_MIN_TIMESHARE (56) #define PRI_MAX_TIMESHARE (PRI_MIN_IDLE - 1) #define PUSER (PRI_MIN_TIMESHARE) From nobody Mon Jul 28 13:31:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBd54jmz634tW; Mon, 28 Jul 2025 13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBd2T3Xz3vCZ; Mon, 28 Jul 2025 13:31:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5gqMLXgc6/ZYYe1kva//6WBrQ3a7Oq/CSgNgn5Eu4AE=; b=alc2upukvwzINyhlxnd++4qHc4WG20y9kQCu38ERWGQSZjHjDM6biWL2TYmwiUQhIPmY3i 2JS3pRcd11MEdx49FftFkMlU4e3XvzUhzZzBmwSON2fvDaKD9RBZgtwJSd+SEbGfPREGZH rixF8AeDOW/pOH/J3p//pupNz913Gsv5x4OAnE/MOZJGb43VmWmseOJYeTpOy1sY2D2EaP IhRQnLnFxyi0IvKeers8zJQisECZm0eubGRZNdGMvTiqIuELkwCkb1V7lz4zT3+Fmh8PVU kW7LWkKbS23FdcbRFVADyCi7LnPxRIJXRENBtqZIGqTsJM99NEMb6zfd5hJmng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5gqMLXgc6/ZYYe1kva//6WBrQ3a7Oq/CSgNgn5Eu4AE=; b=d2nKZa4I810ywOYXRXG78V8yq/crEpjVKvQ7xoc/5VFjQjy+oOMVzkjxUbae+KqUOPDDUo R4gOB8VPyRun/fxK4MmQf3GxgB/7X/ByfiiglfncS5UjQL0L7PBknymEqSHS04Dca3Skvf j/qC66I77HpjEk1SYcvUghwLSEHVKnfqDqdXDkQWiKZUpSN8MKF88IKdhrxEK/QN6URdWK wUHOTwWuSH12xwmlFRTCNGq8EuekQ7PWSRoRC2itlg3XsnavV21CpY3nqfvJ+vXEfPJPft zO7jM2hE39kUl6WXFx9IaBddwLfKu0HUG88+5CKToM9dRCf4JQbuLFii2siX0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709497; a=rsa-sha256; cv=none; b=DtAMpMa5j9K6F6IVuP8aBCBvcMeVyqRHqxoC7hxYDEZYgNtgOuEdE8dMA1aEbTY8tZiWo1 0wKQvd5LTBM7QOdSn2QtA8iTHpK03ivKWgaIRgA3W+/cjXzsoWvCyse+ia51Qptb5xHMmF ZWlB7kVQzJK94zlLRHocbyGOZokPPSylG0boHFszJJxDpCHCxv4REeJ7Ac5XWKinWYv3fo WGEoF3aLR5MzmQEz9F2RKEdnoLpcAW9h7GDVr6ev4DFFI3SXA0n5rBPFlBjOvqnB3Id79q byQMp8HG4lK3Gv/cPNTEukpzef81hzhN5PlOpP5JYWb4UucXgrpFzyp0dx59hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBd241mzns0; Mon, 28 Jul 2025 13:31:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVbSc082084; Mon, 28 Jul 2025 13:31:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVb9j082081; Mon, 28 Jul 2025 13:31:37 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:37 GMT Message-Id: <202507281331.56SDVb9j082081@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: 32766dde5bc3 - stable/14 - sched_4bsd: Move ESTCPULIM() after its macro dependencies List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 32766dde5bc35b4fd47550fb6cdf2ff745528773 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=32766dde5bc35b4fd47550fb6cdf2ff745528773 commit 32766dde5bc35b4fd47550fb6cdf2ff745528773 Author: Olivier Certner AuthorDate: 2024-05-21 11:59:40 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:41 +0000 sched_4bsd: Move ESTCPULIM() after its macro dependencies No functional change (intended). Also makes the comment about INVERSE_ESTCPU_WEIGHT() adjacent to its definition. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45392 (cherry picked from commit a454ff6b0440ec1a8e6b5c8154ad22c32df13c51) --- sys/kern/sched_4bsd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index c204e4a5676e..4cf5ec054d1c 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -73,15 +73,15 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; * INVERSE_ESTCPU_WEIGHT is only suitable for statclock() frequencies in * the range 100-256 Hz (approximately). */ -#define ESTCPULIM(e) \ - min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) - \ - RQ_PPQ) + INVERSE_ESTCPU_WEIGHT - 1) #ifdef SMP #define INVERSE_ESTCPU_WEIGHT (8 * smp_cpus) #else #define INVERSE_ESTCPU_WEIGHT 8 /* 1 / (priorities per estcpu level). */ #endif #define NICE_WEIGHT 1 /* Priorities per nice level. */ +#define ESTCPULIM(e) \ + min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) - \ + RQ_PPQ) + INVERSE_ESTCPU_WEIGHT - 1) #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) From nobody Mon Jul 28 13:31:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBb6ZF4z634tT; Mon, 28 Jul 2025 13:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBb15x3z3v3N; Mon, 28 Jul 2025 13:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qOXScGu6IAeyx8YYvli+1mCWKu3MNoBCH/AdyUof4bA=; b=rjNDqUFHw9iJumtTj0mRCBNmqz7siTpG2N4ltQ8zNvoD3SZkZkolSHmItxN7O8voic9SeY EXZo0GZNQqRYZL3pbPvgz0iHfMNLKGIzhboNsO0KxzzMplQ1b8Qfna2o6Lh4TyqvknadS4 +aWfhXmQ78NrEiyHZxR2pBzMARU8nDrVLorw9U9zWlo1lZz/ob9TkVT2yQZwRiS1hmp6JG XXuRvZkdPdUbdjOLdALzRriWa1t6jQOnPgUIjmUcXzvBC5iZ3Vq5Z86YXlOWGcZQ49EB/o L4Q1CnOIMvPsHXt3kTNxynpknhRkNlfUC6NyYT/ngWEEppov4FoB9SkgkOgkyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qOXScGu6IAeyx8YYvli+1mCWKu3MNoBCH/AdyUof4bA=; b=JyPQ3Ar9BfLuD5cNTsbEcOCIQNAOZnDdHGCuWUqwjQVRsggtLYr2eMuGSEtUoPGkIFM4Hf 6V2JG1DEnGgUFfEL0kFBXNMnob/Kr9dLRWvQ8f8c5OGVHVGiL3lQhM3I/4cclCtvFVKh0Q PFJflRNpZ9LC49JW0ox7rovh9gnOtZ30A/uwGmMhaJp/xY3L5paBrsuKz2ODPK7gjjgvHX OPjx0D+CEg9XWaaDXpBkH4tLW+6oIh4KXHrUV8WLjKcRfkj3AYhECkI9p7uJWppgbWDhmF Mng5Jn7OeTUTgx+GYUmIj6OJN9j3gKbXURFAaue1tmvz5Kh1CIZSymXiq5QeQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709495; a=rsa-sha256; cv=none; b=gm1Jj5nYb8WvlQ1vUcxh/mHTk0wmUtY/gvqCCKkBdw8+ALg9nb27xxOaWjbflhCNMATE5j yfIcwYFjZRFBPEia9XDVcBpwvaR0VxBllYDgjUc+iaGnNcjGTKcwBH+nSppYaNubyFj2jj 6TdJZcVx/9c69+YjaAvdp5KSKFQdCLr2nnSCc58GkHC9oQlM3ONTPw2emmsj4Segz9cEq+ RwEmVm6je/HK/YMguI1JQEVLXZE9jz8zzffkK4A4cO99tuE3YgHYQ/jd2bRJj92erJOtVV QKRFCM1ZXnybVoQrr/Q1Pcf6fDqF4LRI+xFQOhCtwXbM0i9CuzXCgin6S3SctQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBb0RK7znfV; Mon, 28 Jul 2025 13:31:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVYlH082013; Mon, 28 Jul 2025 13:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVY1Z082010; Mon, 28 Jul 2025 13:31:34 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:34 GMT Message-Id: <202507281331.56SDVY1Z082010@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: c1ca55eb93fd - stable/14 - sched_ule: Recover previous nice and anti-starvation behaviors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c1ca55eb93fd3ce9624258ce73d2ecec06d2d9c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c1ca55eb93fd3ce9624258ce73d2ecec06d2d9c3 commit c1ca55eb93fd3ce9624258ce73d2ecec06d2d9c3 Author: Olivier Certner AuthorDate: 2024-06-17 19:34:14 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:39 +0000 sched_ule: Recover previous nice and anti-starvation behaviors Justification for this change is to avoid disturbing ULE's behavior too much at this time. We however acknowledge that the effect of "nice" values is extremely weak and will most probably change it going forward. Tuning allows to mostly recover ULE's behavior prior to the switch to a single 256-queue runqueue and the increase of the timesharing priority levels' range. After this change, in a series of test involving two long-running processes with varying nice values competing for the same CPU, we observe that used CPU time ratios of the highest priority process to change by at most 1.15% and on average by 0.46% (absolute differences). In relative differences, they change by at most 2% and on average by 0.78%. In order to preserve these ratios, as the number of priority levels alloted to timesharing have been raised from 136 to 168 (and the subsets of them dedicated to either interactive or batch threads scaled accordingly), we keep the ratio of levels reserved to handle nice values to those reserved for CPU usage by applying a factor of 5/4 (which is close to 168/136). Time-based advance of the timesharing circular queue's head is ULE's main fairness and anti-starvation mechanism. The higher number of queues subject to the timesharing scheduling policy is now compensated by allowing a greater increment of the head offset per tick. Because there are now 109 queue levels dedicated to the timesharing scheduling policy (in contrast with the 168 levels alloted to timesharing levels, which include the former but also those dedicated to threads considered interactive) whereas there previously were 64 ones (priorities spread into a single, separate runqueue), we advance the circular queue's head 7/4 faster (a ratio close to 109/64). While here, take into account 'cnt' as the number of ticks when advancing the circular queue's head. This fix depends on the other code changes enabling incrementation by more than one. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46566 (cherry picked from commit 6792f3411f6d99e1698589835adbf6b7b51c7c74) --- sys/kern/sched_ule.c | 76 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 29a4bfef3ea2..8cd58cd32605 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -137,20 +137,20 @@ _Static_assert(sizeof(struct thread) + sizeof(struct td_sched) <= * and end of the MIN to MAX timeshare range are only reachable with negative * or positive nice respectively. * - * PRI_RANGE: Priority range for utilization dependent priorities. - * PRI_NRESV: Number of nice values. + * PRI_NRESV: Number of priority levels reserved to account for nice values. + * 5/4 is to preserve historical nice effect on computation ratios. + * PRI_RANGE: Length of range for priorities computed from CPU use. * PRI_TICKS: Compute a priority in PRI_RANGE from the ticks count and total. * PRI_NICE: Determines the part of the priority inherited from nice. */ -#define SCHED_PRI_NRESV (PRIO_MAX - PRIO_MIN) -#define SCHED_PRI_NHALF (SCHED_PRI_NRESV / 2) -#define SCHED_PRI_MIN (PRI_MIN_BATCH + SCHED_PRI_NHALF) -#define SCHED_PRI_MAX (PRI_MAX_BATCH - SCHED_PRI_NHALF) +#define SCHED_PRI_NRESV ((PRIO_MAX - PRIO_MIN) * 5 / 4) +#define SCHED_PRI_MIN (PRI_MIN_BATCH + (SCHED_PRI_NRESV / 2)) +#define SCHED_PRI_MAX (PRI_MAX_BATCH - (SCHED_PRI_NRESV / 2)) #define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN + 1) #define SCHED_PRI_TICKS(ts) \ (SCHED_TICK_HZ((ts)) / \ (roundup(SCHED_TICK_TOTAL((ts)), SCHED_PRI_RANGE) / SCHED_PRI_RANGE)) -#define SCHED_PRI_NICE(nice) (nice) +#define SCHED_PRI_NICE(nice) ((nice) * 5 / 4) /* * Runqueue indices for the implemented scheduling policies' priority bounds. @@ -279,6 +279,11 @@ struct tdq { u_char tdq_owepreempt; /* (f) Remote preemption pending. */ u_char tdq_ts_off; /* (t) TS insertion offset. */ u_char tdq_ts_deq_off; /* (t) TS dequeue offset. */ + /* + * (t) Number of (stathz) ticks since last offset incrementation + * correction. + */ + u_char tdq_ts_ticks; int tdq_id; /* (c) cpuid. */ struct runq tdq_runq; /* (t) Run queue. */ char tdq_name[TDQ_NAME_LEN]; @@ -362,6 +367,7 @@ static void tdq_setup(struct tdq *, int i); static void tdq_load_add(struct tdq *, struct thread *); static void tdq_load_rem(struct tdq *, struct thread *); static inline void tdq_runq_add(struct tdq *, struct thread *, int); +static inline void tdq_advance_ts_deq_off(struct tdq *, bool); static inline void tdq_runq_rem(struct tdq *, struct thread *); static inline int sched_shouldpreempt(int, int, int); static void tdq_print(int cpu); @@ -557,6 +563,33 @@ tdq_runq_add(struct tdq *tdq, struct thread *td, int flags) runq_add(&tdq->tdq_runq, td, flags); } +/* + * Advance the timesharing dequeue offset to the next non-empty queue or the + * insertion offset, whichever is closer. + * + * If 'deq_queue_known_empty' is true, then the queue where timesharing threads + * are currently removed for execution (pointed to by 'tdq_ts_deq_off') is + * assumed empty. Otherwise, this condition is checked for. + */ +static inline void +tdq_advance_ts_deq_off(struct tdq *tdq, bool deq_queue_known_empty) +{ + /* + * We chose a simple iterative algorithm since the difference between + * offsets is small in practice (see sched_clock()). + */ + while (tdq->tdq_ts_deq_off != tdq->tdq_ts_off) { + if (deq_queue_known_empty) + deq_queue_known_empty = false; + else if (!runq_is_queue_empty(&tdq->tdq_runq, + tdq->tdq_ts_deq_off + RQ_TS_POL_MIN)) + break; + + tdq->tdq_ts_deq_off = (tdq->tdq_ts_deq_off + 1) % + RQ_TS_POL_MODULO; + } +} + /* * Remove a thread from a run-queue. This typically happens when a thread * is selected to run. Running threads are not on the queue and the @@ -579,14 +612,13 @@ tdq_runq_rem(struct tdq *tdq, struct thread *td) /* * If thread has a batch priority and the queue from which it was * removed is now empty, advance the batch's queue removal index if it - * lags with respect to the batch's queue insertion index. + * lags with respect to the batch's queue insertion index, so that we + * may eventually be able to advance the latter in sched_clock(). */ - if (queue_empty && PRI_MIN_BATCH <= td->td_priority && - td->td_priority <= PRI_MAX_BATCH && - tdq->tdq_ts_off != tdq->tdq_ts_deq_off && + if (PRI_MIN_BATCH <= td->td_priority && + td->td_priority <= PRI_MAX_BATCH && queue_empty && tdq->tdq_ts_deq_off + RQ_TS_POL_MIN == td->td_rqindex) - tdq->tdq_ts_deq_off = (tdq->tdq_ts_deq_off + 1) % - RQ_TS_POL_MODULO; + tdq_advance_ts_deq_off(tdq, true); } /* @@ -2667,13 +2699,21 @@ sched_clock(struct thread *td, int cnt) /* * Advance the insert offset once for each tick to ensure that all - * threads get a chance to run. + * threads get a chance to run. In order not to change too much ULE's + * anti-starvation and "nice" behaviors after the switch to a single + * 256-queue runqueue, since the queue insert offset is incremented by + * 1 at every tick (provided the system is not too loaded) and there are + * now 109 distinct levels for the timesharing selection policy instead + * of 64 before (separate runqueue), we apply a factor 7/4 when + * increasing the insert offset, by incrementing it by 2 instead of + * 1 except for one in four ticks. */ if (tdq->tdq_ts_off == tdq->tdq_ts_deq_off) { - tdq->tdq_ts_off = (tdq->tdq_ts_off + 1) % RQ_TS_POL_MODULO; - if (runq_is_queue_empty(&tdq->tdq_runq, - tdq->tdq_ts_deq_off + RQ_TS_POL_MIN)) - tdq->tdq_ts_deq_off = tdq->tdq_ts_off; + tdq->tdq_ts_ticks += cnt; + tdq->tdq_ts_off = (tdq->tdq_ts_off + 2 * cnt - + tdq-> tdq_ts_ticks / 4) % RQ_TS_POL_MODULO; + tdq->tdq_ts_ticks %= 4; + tdq_advance_ts_deq_off(tdq, false); } ts = td_get_sched(td); sched_pctcpu_update(ts, 1); From nobody Mon Jul 28 13:31:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBc3WF5z634tV; Mon, 28 Jul 2025 13:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBc1VyKz3tyX; Mon, 28 Jul 2025 13: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=1753709496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FzLu+dIPTM1ccOzVTvvMAr3jBuYxK8FXA/DjiykS34s=; b=NyI+eJb7DX+/yuOM1P8MgxJeu9GoiQr2eVSFzafrbb6Vd4HiLMSxJNhKynTe7pXylmQb6f vuf6J7meD1p+iN1nocjPrxyK7xWH1tmxKjsZII8M2p2vYHY2faBcuvXuX7x8GTn+WySkXY S04Kv41DE7Lz/dLFPjxNcwVtn7FE1ZtTZiEiDmxnKvGrvCaHXZ4mEWzQ2XguiQSCe1vPxz Qph97eZnM3/dsWHgs8VfvPZAT4RPBhof3VShwtpu1lYBFkztzGbtCR6nY2Vc76aT7tt61W zFuWYdkmDCbzaxy/IIuGlZr0RPsMx+rLX/cgkTaSfxn1bGGxkV5vPCiyTefOaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FzLu+dIPTM1ccOzVTvvMAr3jBuYxK8FXA/DjiykS34s=; b=aQKJGrIcxnHK6ObNeCC1WDhPCvZl1DJTLb3N8aPvb+0x4BACbp8RA9cwm0kUhkn8qHEu8w JsjBsmswakbrOlgTZRt45z0asXeMzTmDUA/Cco0I3sROb1h9r2aZ6qyiYu8mjPTCrMp1rA L8b7zaDeCSC1V4eSu4O67KhMUXa0WkUlAP2FbzWAkIX3QYSNBKpFV3ZJauRoSZ6pgiVpVU OjVIpjofzW7oaoLxu4Kd3HufzRilz2oCMbE9XeR4Mmi3UUYYlwxtxy0FlZ8MwcMAYF13eZ cOXViFIcIJkwa8pyjQUfcOptjh8gCLQXxnqdCkq4j76LJZOWDRd1O+AeUYwyHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709496; a=rsa-sha256; cv=none; b=Dnn5np6m04dNZrWhujGbGHj4mkPVwVLWPFhIkl4kGay14zkZRqJk1NqDgcNJCZhYG+BulV RJN+DbJUbym9PB7KdbQqH2rnSwQA3OKQS2gOlGSgo6FIyUHAc5B3sE3wShnqoCRgpEqrZB +NFfSPr0v/asENXPxmsK3ypDZlLSfKxOWhPgojH2shS3STg2j0ZULnOfK8hJbSdMP/pgqa CvF1yqQgaBlid2yrLl1UkPLd5cF6xaa/cWO9W/sPzkyG7q3bZ+nE/Ly5tTzt3y7zw1i7Ea W2d4JG+72CcDvdeFszgqp2D8y3bft2ntU4VpI9O5ezyE6Mtt1hoNd1vxoEWfVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBc15xCznfy; Mon, 28 Jul 2025 13:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVai5082050; Mon, 28 Jul 2025 13:31:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVaQQ082047; Mon, 28 Jul 2025 13:31:36 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:36 GMT Message-Id: <202507281331.56SDVaQQ082047@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: 15056c43e87f - stable/14 - sched_ule: Sanitize CPU's use and priority computations, and ticks storage List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 15056c43e87f2fc451057b1812e23a8270ebcc1f Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=15056c43e87f2fc451057b1812e23a8270ebcc1f commit 15056c43e87f2fc451057b1812e23a8270ebcc1f Author: Olivier Certner AuthorDate: 2024-06-25 16:12:24 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:40 +0000 sched_ule: Sanitize CPU's use and priority computations, and ticks storage Computation of %CPU in sched_pctcpu() was overly complicated, wrong in the case of a non-maximal window (10 seconds span; this is always the case in practice as the window would oscillate between 10 and 11 seconds for continuously running processes) and performed unshifted for the first part, essentially losing precision (up to 9% for SCHED_TICK_SECS being 10), and with some uneffective shift for the second part. Conserve maximum precision by only shifting by the require amount to attain FSHIFT before dividing. Apply classical rounding to nearest instead of rounding down. To generally avoid wraparound problems with tick fields in 'struct td_sched' (as already happened once in sched_pctcpu_update()), make then all unsigned, and ensure 'ticks' is always converted to some 'u_int'. While here, fix SCHED_AFFINITY(). Rewrite sched_pctcpu_update() while keeping the existing formulas: - Fix the hole in the cliff case that in theory 'ts_ticks' can become greater than the window size if a running thread has not been accounted for too long (today cannot happen because of sched_clock()). - Make the decay ratio explicit and configurable (SCHED_CPU_DECAY_NUMER, SCHED_CPU_DECAY_DENOM). Set it to the current value (10/11), currently producing a 95% attenuation after about ~32s. This eases experimenting with changing it. Apply the ratio on shifted ticks for better precision, independently of the chosen value for SCHED_TICK_MAX/SCHED_TICK_SECS. - Remove redundant SCHED_TICK_TARG. Compute SCHED_TICK_MAX from SCHED_TICK_SECS, the latter now really specifying the maximum size of the %CPU estimation window. - Ensure it is immune to varying 'hz' (which today can't happen), so that after computation SCHED_TICK_RUN(ts) is mathematically guaranteed lower than SCHED_TICK_LENGTH(ts). - Thoroughly explain the current formula, and mention its main drawback (it is completely dependent on the frequency of calls to sched_pctcpu_update(), which currently manifests itself for sleeping threads). Rework sched_priority(): - Ensure 'p_nice' is read only once, to be immune to a concurrent change. - Clearly show that the computed priority is the sum of 3 components. Make them all positive by shifting the starting priority and shifting the nice value in SCHED_PRI_NICE(). - Compute the priority offset deriving from the %CPU with rounding to nearest. - Much more informative KASSERT() output with details regarding the priority computation. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46567 (cherry picked from commit a33225efb4bc2598e4caa1c1f7f715653e8b1fda) --- sys/kern/sched_ule.c | 192 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 116 insertions(+), 76 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 8cd58cd32605..b09d6dfc0f54 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -91,13 +91,14 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; struct td_sched { short ts_flags; /* TSF_* flags. */ int ts_cpu; /* CPU we are on, or were last on. */ - int ts_rltick; /* Real last tick, for affinity. */ - int ts_slice; /* Ticks of slice remaining. */ + u_int ts_rltick; /* Real last tick, for affinity. */ + u_int ts_slice; /* Ticks of slice remaining. */ + u_int ts_ftick; /* %CPU window's first tick */ + u_int ts_ltick; /* %CPU window's last tick */ + /* All ticks count below are stored shifted by SCHED_TICK_SHIFT. */ u_int ts_slptime; /* Number of ticks we vol. slept */ u_int ts_runtime; /* Number of ticks we were running */ - int ts_ltick; /* Last tick that we were running on */ - int ts_ftick; /* First tick that we were running on */ - int ts_ticks; /* Tick count */ + u_int ts_ticks; /* pctcpu window's running tick count */ #ifdef KTR char ts_name[TS_NAME_LEN]; #endif @@ -137,20 +138,14 @@ _Static_assert(sizeof(struct thread) + sizeof(struct td_sched) <= * and end of the MIN to MAX timeshare range are only reachable with negative * or positive nice respectively. * - * PRI_NRESV: Number of priority levels reserved to account for nice values. + * CPU_RANGE: Length of range for priorities computed from CPU use. + * NICE: Priority offset due to the nice value. * 5/4 is to preserve historical nice effect on computation ratios. - * PRI_RANGE: Length of range for priorities computed from CPU use. - * PRI_TICKS: Compute a priority in PRI_RANGE from the ticks count and total. - * PRI_NICE: Determines the part of the priority inherited from nice. + * NRESV: Number of priority levels reserved to account for nice values. */ -#define SCHED_PRI_NRESV ((PRIO_MAX - PRIO_MIN) * 5 / 4) -#define SCHED_PRI_MIN (PRI_MIN_BATCH + (SCHED_PRI_NRESV / 2)) -#define SCHED_PRI_MAX (PRI_MAX_BATCH - (SCHED_PRI_NRESV / 2)) -#define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN + 1) -#define SCHED_PRI_TICKS(ts) \ - (SCHED_TICK_HZ((ts)) / \ - (roundup(SCHED_TICK_TOTAL((ts)), SCHED_PRI_RANGE) / SCHED_PRI_RANGE)) -#define SCHED_PRI_NICE(nice) ((nice) * 5 / 4) +#define SCHED_PRI_CPU_RANGE (PRI_BATCH_RANGE - SCHED_PRI_NRESV) +#define SCHED_PRI_NICE(nice) (((nice) - PRIO_MIN) * 5 / 4) +#define SCHED_PRI_NRESV SCHED_PRI_NICE(PRIO_MAX) /* * Runqueue indices for the implemented scheduling policies' priority bounds. @@ -180,19 +175,26 @@ _Static_assert(RQ_TS_POL_MAX != RQ_ID_POL_MIN, /* * Cpu percentage computation macros and defines. * - * SCHED_TICK_SECS: Number of seconds to average the cpu usage across. - * SCHED_TICK_TARG: Number of hz ticks to average the cpu usage across. - * SCHED_TICK_MAX: Maximum number of ticks before scaling back. + * SCHED_TICK_SECS: Max number of seconds to average the cpu usage across. + * Must be at most 20 to avoid overflow in sched_pctcpu()'s current formula. + * SCHED_TICK_MAX: Max number of hz ticks matching SCHED_TICK_SECS. * SCHED_TICK_SHIFT: Shift factor to avoid rounding away results. - * SCHED_TICK_HZ: Compute the number of hz ticks for a given ticks count. - * SCHED_TICK_TOTAL: Gives the amount of time we've been recording ticks. - */ -#define SCHED_TICK_SECS 10 -#define SCHED_TICK_TARG (hz * SCHED_TICK_SECS) -#define SCHED_TICK_MAX (SCHED_TICK_TARG + hz) -#define SCHED_TICK_SHIFT 10 -#define SCHED_TICK_HZ(ts) ((ts)->ts_ticks >> SCHED_TICK_SHIFT) -#define SCHED_TICK_TOTAL(ts) (max((ts)->ts_ltick - (ts)->ts_ftick, hz)) + * SCHED_TICK_RUN_SHIFTED: Number of shifted ticks running in last window. + * SCHED_TICK_LENGTH: Length of last window in shifted ticks or 1 if empty. + * SCHED_CPU_DECAY_NUMER: Numerator of %CPU decay factor. + * SCHED_CPU_DECAY_DENOM: Denominator of %CPU decay factor. + */ +#define SCHED_TICK_SECS 11 +#define SCHED_TICK_MAX(hz) ((hz) * SCHED_TICK_SECS) +#define SCHED_TICK_SHIFT 10 +#define SCHED_TICK_RUN_SHIFTED(ts) ((ts)->ts_ticks) +#define SCHED_TICK_LENGTH(ts) (max((ts)->ts_ltick - (ts)->ts_ftick, 1)) +#define SCHED_CPU_DECAY_NUMER 10 +#define SCHED_CPU_DECAY_DENOM 11 +_Static_assert(SCHED_CPU_DECAY_NUMER >= 0 && SCHED_CPU_DECAY_DENOM > 0 && + SCHED_CPU_DECAY_NUMER <= SCHED_CPU_DECAY_DENOM, + "Inconsistent values for SCHED_CPU_DECAY_NUMER and/or " + "SCHED_CPU_DECAY_DENOM"); /* * These determine the interactivity of a process. Interactivity differs from @@ -308,7 +310,11 @@ struct tdq { struct cpu_group __read_mostly *cpu_top; /* CPU topology */ #define SCHED_AFFINITY_DEFAULT (max(1, hz / 1000)) -#define SCHED_AFFINITY(ts, t) ((ts)->ts_rltick > ticks - ((t) * affinity)) +/* + * This inequality has to be written with a positive difference of ticks to + * correctly handle wraparound. + */ +#define SCHED_AFFINITY(ts, t) ((u_int)ticks - (ts)->ts_rltick < (t) * affinity) /* * Run-time tunables. @@ -665,7 +671,7 @@ tdq_load_rem(struct tdq *tdq, struct thread *td) * aside from curthread and target no more than sched_slice latency but * no less than sched_slice_min runtime. */ -static inline int +static inline u_int tdq_slice(struct tdq *tdq) { int load; @@ -1757,9 +1763,12 @@ static void sched_priority(struct thread *td) { u_int pri, score; + int nice; if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) return; + + nice = td->td_proc->p_nice; /* * If the score is interactive we place the thread in the realtime * queue with a priority that is less than kernel and interrupt @@ -1773,7 +1782,7 @@ sched_priority(struct thread *td) * score. Negative nice values make it easier for a thread to be * considered interactive. */ - score = imax(0, sched_interact_score(td) + td->td_proc->p_nice); + score = imax(0, sched_interact_score(td) + nice); if (score < sched_interact) { pri = PRI_MIN_INTERACT; pri += (PRI_MAX_INTERACT - PRI_MIN_INTERACT + 1) * score / @@ -1782,17 +1791,26 @@ sched_priority(struct thread *td) ("sched_priority: invalid interactive priority %u score %u", pri, score)); } else { - pri = SCHED_PRI_MIN; - if (td_get_sched(td)->ts_ticks) - pri += min(SCHED_PRI_TICKS(td_get_sched(td)), - SCHED_PRI_RANGE - 1); - pri += SCHED_PRI_NICE(td->td_proc->p_nice); + const struct td_sched *const ts = td_get_sched(td); + const u_int run = SCHED_TICK_RUN_SHIFTED(ts); + const u_int run_unshifted __unused = (run + + (1 << SCHED_TICK_SHIFT) / 2) >> SCHED_TICK_SHIFT; + const u_int len = SCHED_TICK_LENGTH(ts); + const u_int nice_pri_off = SCHED_PRI_NICE(nice); + const u_int cpu_pri_off = (((SCHED_PRI_CPU_RANGE - 1) * + run + len / 2) / len + (1 << SCHED_TICK_SHIFT) / 2) >> + SCHED_TICK_SHIFT; + + MPASS(cpu_pri_off < SCHED_PRI_CPU_RANGE); + pri = PRI_MIN_BATCH + cpu_pri_off + nice_pri_off; KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, - ("sched_priority: invalid priority %u: nice %d, " - "ticks %d ftick %d ltick %d tick pri %d", - pri, td->td_proc->p_nice, td_get_sched(td)->ts_ticks, - td_get_sched(td)->ts_ftick, td_get_sched(td)->ts_ltick, - SCHED_PRI_TICKS(td_get_sched(td)))); + ("sched_priority: Invalid computed priority %u: " + "Should be between %u and %u (PRI_MIN_BATCH: %u; " + "Window size (ticks): %u, runtime (shifted ticks): %u," + "(unshifted ticks): %u => CPU pri off: %u; " + "Nice: %d => nice pri off: %u)", + pri, PRI_MIN_BATCH, PRI_MAX_BATCH, PRI_MIN_BATCH, + len, run, run_unshifted, cpu_pri_off, nice, nice_pri_off)); } sched_user_prio(td, pri); @@ -1877,8 +1895,8 @@ schedinit(void) * Set up the scheduler specific parts of thread0. */ ts0 = td_get_sched(&thread0); - ts0->ts_ltick = ticks; - ts0->ts_ftick = ticks; + ts0->ts_ftick = (u_int)ticks; + ts0->ts_ltick = ts0->ts_ftick; ts0->ts_slice = 0; ts0->ts_cpu = curcpu; /* set valid CPU number */ } @@ -1917,30 +1935,56 @@ sched_rr_interval(void) } /* - * Update the percent cpu tracking information when it is requested or - * the total history exceeds the maximum. We keep a sliding history of - * tick counts that slowly decays. This is less precise than the 4BSD - * mechanism since it happens with less regular and frequent events. + * Update the percent cpu tracking information when it is requested or the total + * history exceeds the maximum. We keep a sliding history of tick counts that + * slowly decays, for running threads (see comments below for more details). + * This is less precise than the 4BSD mechanism since it happens with less + * regular and frequent events. */ static void sched_pctcpu_update(struct td_sched *ts, int run) { - int t = ticks; + const u_int t = (u_int)ticks; + u_int t_max = SCHED_TICK_MAX((u_int)hz); + u_int t_tgt = ((t_max << SCHED_TICK_SHIFT) * SCHED_CPU_DECAY_NUMER / + SCHED_CPU_DECAY_DENOM) >> SCHED_TICK_SHIFT; + const u_int lu_span = t - ts->ts_ltick; - /* - * The signed difference may be negative if the thread hasn't run for - * over half of the ticks rollover period. - */ - if ((u_int)(t - ts->ts_ltick) >= SCHED_TICK_TARG) { - ts->ts_ticks = 0; - ts->ts_ftick = t - SCHED_TICK_TARG; - } else if (t - ts->ts_ftick >= SCHED_TICK_MAX) { - ts->ts_ticks = (ts->ts_ticks / (ts->ts_ltick - ts->ts_ftick)) * - (ts->ts_ltick - (t - SCHED_TICK_TARG)); - ts->ts_ftick = t - SCHED_TICK_TARG; + if (lu_span >= t_tgt) { + /* + * Forget all previous ticks if we are more than t_tgt + * (currently, 10s) apart from the last update. Don't account + * for more than 't_tgt' ticks when running. + */ + ts->ts_ticks = run ? (t_tgt << SCHED_TICK_SHIFT) : 0; + ts->ts_ftick = t - t_tgt; + ts->ts_ltick = t; + return; + } + + if (t - ts->ts_ftick >= t_max) { + /* + * First reduce the existing ticks to proportionally occupy only + * what's left of the target window given 'lu_span' will occupy + * the rest. Since sched_clock() is called frequently on + * running threads, these threads have a small 'lu_span', and + * the next formula basically becomes an exponential decay with + * ratio r = SCHED_CPU_DECAY_NUMER / SCHED_CPU_DECAY_DENOM + * (currently, 10/11) and period 1s. However, a sleeping thread + * will see its accounted ticks drop linearly with a high slope + * with respect to 'lu_span', approaching 0 as 'lu_span' + * approaches 't_tgt' (so, continuously with respect to the + * previous case). This rescaling is completely dependent on + * the frequency of calls and the span since last update passed + * at each call. + */ + ts->ts_ticks = SCHED_TICK_RUN_SHIFTED(ts) / + SCHED_TICK_LENGTH(ts) * (t_tgt - lu_span); + ts->ts_ftick = t - t_tgt; } + if (run) - ts->ts_ticks += (t - ts->ts_ltick) << SCHED_TICK_SHIFT; + ts->ts_ticks += lu_span << SCHED_TICK_SHIFT; ts->ts_ltick = t; } @@ -2300,9 +2344,9 @@ sched_switch(struct thread *td, int flags) #ifdef SMP pickcpu = (td->td_flags & TDF_PICKCPU) != 0; if (pickcpu) - ts->ts_rltick = ticks - affinity * MAX_CACHE_LEVELS; + ts->ts_rltick = (u_int)ticks - affinity * MAX_CACHE_LEVELS; else - ts->ts_rltick = ticks; + ts->ts_rltick = (u_int)ticks; #endif td->td_lastcpu = td->td_oncpu; preempted = (td->td_flags & TDF_SLICEEND) == 0 && @@ -2658,7 +2702,7 @@ SCHED_STAT_DEFINE(ithread_preemptions, * Return time slice for a given thread. For ithreads this is * sched_slice. For other threads it is tdq_slice(tdq). */ -static inline int +static inline u_int td_slice(struct thread *td, struct tdq *tdq) { if (PRI_BASE(td->td_pri_class) == PRI_ITHD) @@ -2943,22 +2987,18 @@ sched_rem(struct thread *td) fixpt_t sched_pctcpu(struct thread *td) { - fixpt_t pctcpu; struct td_sched *ts; - - pctcpu = 0; - ts = td_get_sched(td); + u_int len; + fixpt_t pctcpu; THREAD_LOCK_ASSERT(td, MA_OWNED); + ts = td_get_sched(td); sched_pctcpu_update(ts, TD_IS_RUNNING(td)); - if (ts->ts_ticks) { - int rtick; - - /* How many rtick per second ? */ - rtick = min(SCHED_TICK_HZ(ts) / SCHED_TICK_SECS, hz); - pctcpu = (FSCALE * ((FSCALE * rtick)/hz)) >> FSHIFT; - } - + len = SCHED_TICK_LENGTH(ts); + pctcpu = ((FSHIFT >= SCHED_TICK_SHIFT ? /* Resolved at compile-time. */ + (SCHED_TICK_RUN_SHIFTED(ts) << (FSHIFT - SCHED_TICK_SHIFT)) : + (SCHED_TICK_RUN_SHIFTED(ts) >> (SCHED_TICK_SHIFT - FSHIFT))) + + len / 2) / len; return (pctcpu); } From nobody Mon Jul 28 13:31:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBf6McDz63541; Mon, 28 Jul 2025 13:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBf3cZVz3v75; Mon, 28 Jul 2025 13:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6BkqmxBofOA+kEOA4TF5UwQhMQFV2W+WCGDSo9aNPuQ=; b=uaVM4t7HQIVgC9UQIQTThvuwY59jokwqfODkfapKjPkCVU9NIh8DoR2EUedD6EduJbMHpz hOa9x9C5tbRKdyiqzOywNA6wdBk2LB/L28rcfhjViBmjOJR0y5PWCbNZaDnGn6Y+GJULci 0FUGNWlICjYMHvFMwckar5hqL9ykm/CEkvP/CW9VtsuVH+z2qLgQ9U17BC2IkMoXtdLON8 NfjZGZjXxst5SSQx7tuBM+AkuoS76BPRcsHr3PDjaO75k8oVUtvQalsmZeu9p+SHZWNutG J1h99ECsQdO4+3fumwDjonvV+E3m9suBGCu3MnfllHmc58Nhf/LMX2M/XeZDtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6BkqmxBofOA+kEOA4TF5UwQhMQFV2W+WCGDSo9aNPuQ=; b=J8qbVLrVQk8CWaJ2tu1JIZfMpDT/ocJnddIMaGGxrfcJWGaLf5hByqQY+HQXngo3VP6fvT BaoLk4vKOo6azhHuvobOSSGOCXbMhVTrCxQCwzlgWbymKPmRD+7ajnie/vuAdD257qvdtR ku81mG7SsLRjdm60n0pXCRZfebG1fh67GRxkfRYge+yCLxepSaOVOm7mqi7kqyeZTFiKec oNYfZ51t2OFPSTMbL//o0DBequYXz8osawFOAeq3FCIAa6auQEFaWQhTMd7kcPq62+FApU 5nA9HB8DPyKTvJl3PIWp7qecX9dzOLVWpcdpE3C657piFUmPA7LC6evpX7DeFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709498; a=rsa-sha256; cv=none; b=wBqWhE2OyNnxrpNMpJUT0yOC3y6Cw2MrPPASDUA5qhegA5caWu7S0nSsctsAWQIUyp2L8+ 2u9xIXqMZotoRF5tuRc6xxlLMNAyR63TAnmcva1jSMXLcVQpOvsnGMKEZifKd64xyE/MAV A3GE++KpP0IEvAY0wKMYzbfZ8fgQHyiV22hocvYXI4zNwb1KgQSWtivicgdoJKWz7s5dzX Oahlq3bFX5aZIpuwRW4craTW49nrCFBG6haDL/+Cidl5S7e3xqCO1OFl3TT+yuMlHX0mR4 pNMNzgBCq26L5LOVpGI+VHDXBJUEg0RjwVH1TmXTLmYoaKJhpG5Y7zulg96ySw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBf303Rzng3; Mon, 28 Jul 2025 13:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVcGI082118; Mon, 28 Jul 2025 13:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVcLj082115; Mon, 28 Jul 2025 13:31:38 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:38 GMT Message-Id: <202507281331.56SDVcLj082115@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: 00c1b4fac2ab - stable/14 - sched_4bsd: Remove RQ_PPQ from ESTCPULIM()'s formula List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 00c1b4fac2ab709b0e0c77007d47c85e0bf36095 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=00c1b4fac2ab709b0e0c77007d47c85e0bf36095 commit 00c1b4fac2ab709b0e0c77007d47c85e0bf36095 Author: Olivier Certner AuthorDate: 2024-05-21 12:26:25 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:42 +0000 sched_4bsd: Remove RQ_PPQ from ESTCPULIM()'s formula Substracting RQ_PPQ to the maximum number of allowed priority values (the factor to INVERSE_ESTCPU_WEIGHT) has the effect of pessimizing the number of processes assigned to the last priority bucket. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45392 (cherry picked from commit 51a4ae05abe6e170de0ff82641d8fce19043eea9) --- sys/kern/sched_4bsd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 4cf5ec054d1c..e9d180fde303 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -79,9 +79,9 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; #define INVERSE_ESTCPU_WEIGHT 8 /* 1 / (priorities per estcpu level). */ #endif #define NICE_WEIGHT 1 /* Priorities per nice level. */ -#define ESTCPULIM(e) \ - min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) - \ - RQ_PPQ) + INVERSE_ESTCPU_WEIGHT - 1) +#define ESTCPULIM(e) \ + min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN)) \ + + INVERSE_ESTCPU_WEIGHT - 1) #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) From nobody Mon Jul 28 13:31:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBh12Ksz634YN; Mon, 28 Jul 2025 13:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBg4SJtz3v9C; Mon, 28 Jul 2025 13:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+pCPf7vwCdUicqC9sqp1uNqpNNgWKMuVCYo89bHZHtk=; b=L5eKWi/DPhAeFnp3aPPM6FIDcVoB1jjtmi7s5bHvGJX9KaaB0j3r9Xy8yTe85QOqTU/dga JSzwhahiuTyndYheHKQue9M9kSpVMe+tnASpX0eDBKLAJnCuJYVG2rhoG9tfXJtlD05uSg 30WR9+goP5bPYAtp6bmpVP84JdOkglzGJeJ2ZQWJj9qC8o/f5Qa0NQTGaUtnbG542cxQU1 FcCVZMH7rj7Z1yd1JrhuhlUbZa5Pg4jd9+m+osGuxyWQ1QzOym/d6/7F9mNZlaqdwf6X/H lVVZ2M2qjuH/eP2oefiyWffhESHWoBnA8zcpW12x3841WsbALHhGupgxPV+Cow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+pCPf7vwCdUicqC9sqp1uNqpNNgWKMuVCYo89bHZHtk=; b=oELLIFOE1SVr8GJc3JPROvkVRneNygI2ja/MUezdCXLlYtZT4mJl5i1g2dkM+gyDXisGIr b4cIbHJXjOHp6KLYgfZT1qTemG4T7RGRanZqHsX+NO+0Lowq81YpTqUBFh0QPf5zJn0wHP LZgSr7NcBe+u8N+hp7tNXN+5SUkPVF2DbSqa7wtTHWUW2hmeClw3fgf69mlKqm5iG9vcuU ShkICoA6QsGyUqj/IVyzO1oGckgrQx7hHn3c5ERX0++u+3QcOZgoAZyoNHPUazFdDRZvMF w2lGsEh32ROeL0pqWm0kUSM2oNLby9EU6SxO3D1OB0xMBklEvbFx9Jc1r+D6gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709499; a=rsa-sha256; cv=none; b=CaGu2QdMFetXTfWVgz7yt95iXWUdzXQlqISXsiGUdqSaa9Lf6waFt+crJi0ZGODHRGudnC ExkAvJTSrc1jdCoNNFr4CAucEdnQ0KncUhljyuCJwKOT14SPmsvd+A5SQDxtis8gphPqE8 0/FndzrmCg+u1B1ozGsKKxLvWokObLno9YrVIgCkzhwKnSOIBFBf+DRCFmIbgSKzdMj6mJ 471VzGe6YPVR9xXKbzyjqe0ZK9YR8IXEVkMObYak5ON+klV0HSJ570N+goIdC4agewbpL7 HmZNHQLiaZ5xMKHvNyuE85U/1azJq4DQ8UI3adXAPxvxdR+TszOLYQDaK3RhKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBg3xkBznCZ; Mon, 28 Jul 2025 13:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVdjY082155; Mon, 28 Jul 2025 13:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVdpS082151; Mon, 28 Jul 2025 13:31:39 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:39 GMT Message-Id: <202507281331.56SDVdpS082151@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: cc604213b597 - stable/14 - sched_4bsd: ESTCPULIM(): Allow any value in the timeshare range List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cc604213b59777b33c413e2d2c70f63d4c3665bf Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cc604213b59777b33c413e2d2c70f63d4c3665bf commit cc604213b59777b33c413e2d2c70f63d4c3665bf Author: Olivier Certner AuthorDate: 2024-05-21 12:55:43 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:42 +0000 sched_4bsd: ESTCPULIM(): Allow any value in the timeshare range The current formula wastes queues and degrades usage estimation precision, since any increase of ticks that goes over 40 priorities (so, 8 * 40) is clamped to the last of these 40 levels (the nice value is subsequently added to that number to get the final priority level). Allow 'ts_estcpu' to grow up to a value corresponding to the greatest (i.e., lowest) priority of the timeshare range. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45392 (cherry picked from commit eebc148f25c3012b943083b48fbfc13494e9c77f) --- sys/kern/sched_4bsd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index e9d180fde303..0e7ac9feb686 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -80,7 +80,9 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; #endif #define NICE_WEIGHT 1 /* Priorities per nice level. */ #define ESTCPULIM(e) \ - min((e), INVERSE_ESTCPU_WEIGHT * (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN)) \ + min((e), INVERSE_ESTCPU_WEIGHT * \ + (NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) + \ + PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) \ + INVERSE_ESTCPU_WEIGHT - 1) #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) From nobody Mon Jul 28 13:31:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBj3NvHz634tc; Mon, 28 Jul 2025 13:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBh54MXz3vZ5; Mon, 28 Jul 2025 13:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/VB/DyxRJyRjSObxtuLseKFPwC7waoVmj27Z7IsTqFY=; b=ltdwZ3CCnlVWFrl8WUdRXOtm/UrkwPxoPfUU/4W1S4D1QqVB/PGKOK2uT4sV6jzouf942x aYVXjVp+i0dxNmigWLZIFo7daDJBK6nvkADZnVmCGzlSkBDhgAOoXdmfjNQ52omT5UJmCr vYB4yqWDjWdqZBeznSWOQX1Hm+UWCfem8fKyfJjR1JPO+Y0PdIvWowkZh3YF1nXF7WKJxW qnTxZ+yFhP0uBw+7a8OpYk0ix8WrTQJ+O9989MciJa7Cj36sea9BBf1DqQrkMu/Yrgxrwh X5HIZXijoD8hRset5pSW1LStGPAkVcyF2NmWi29EcV3+WAYqrVEME/zjaVLLIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/VB/DyxRJyRjSObxtuLseKFPwC7waoVmj27Z7IsTqFY=; b=JzrjU8q3itpZszZMe+dASbacrxa1ZFDSTO2DWI9qeBKhVMnCt9f+eB80ZnyQYc8S+3VRnH i4/DCmF0dXY+ZqZYjc50lBQx3raJLGpqonRQuHflcZazBOCumDko5BVguKqni33KjoujeS RfDLLz6n/uESq2QVervOWhK2PyeJXZfEIEHbjOSYI9JrczGhIs7rtBGw1VXx9rvsz0fyR8 GYgwO1pHBjOh30Bz0C53XZUT9tFngvldPOGWCR5RxeOZotzvfznk41PZr3yZDDDbZeuly2 SwDeBpaLQJXE5o4/L6uDh1adN2843NxgmxdLXRfqnzdT3R02wACzdKHOfAmWXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709500; a=rsa-sha256; cv=none; b=f64LSdDleeBCIndYk8WMxNT9VFp8Hx0N4VarMLL0pFQhU+6SqIR1Pa/AtRlTtDGJ1Du6nU CNAIDd75LXRS5o8JCUB5Zpk/6+CXcUTkipyoc4/p/c/yYccSLIN8bl7/NypHp4/u/TYrHO DbNGSjBXr8FVME0AUel/xCqVLKE8e1ITbdtD6MsjzsVYxHfI4TboM8cmHOeBuFMSU3Cva1 au/6cNcByTsva8e1ANd+kgzSNqiuPfU4jFPaFyD6AqXaFgDF+A2ekSEznV1+fc0sjrpJgl LzBskCcqRpWhhQwW7/AGypfZ+08eJWvnnf+RuHIRRR6jk+CyQtao6pRh2aMoxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBh4b62znfZ; Mon, 28 Jul 2025 13:31:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVe1w082192; Mon, 28 Jul 2025 13:31:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVeVc082189; Mon, 28 Jul 2025 13:31:40 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:40 GMT Message-Id: <202507281331.56SDVeVc082189@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: 193c695d7b07 - stable/14 - ps(1), top(1): Priority: Let 0 be the first timesharing level List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 193c695d7b071f901a60c971736b22c96565bd70 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=193c695d7b071f901a60c971736b22c96565bd70 commit 193c695d7b071f901a60c971736b22c96565bd70 Author: Olivier Certner AuthorDate: 2024-09-09 19:35:16 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:43 +0000 ps(1), top(1): Priority: Let 0 be the first timesharing level Change the origin from PZERO to PUSER. Doing so allows users to immediately detect if some thread is running under a high priority (kernel or realtime) or under a low one (timesharing or idle). MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit 1d8f8f3e36fafdb50613d042f5fa75d8cbcf2b8f) --- bin/ps/print.c | 2 +- usr.bin/top/machine.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ps/print.c b/bin/ps/print.c index c12a8dd8fbe1..5f5f7b23eaec 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -286,7 +286,7 @@ state(KINFO *k, VARENT *ve __unused) return (buf); } -#define scalepri(x) ((x) - PZERO) +#define scalepri(x) ((x) - PUSER) char * pri(KINFO *k, VARENT *ve __unused) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 07a7119ad0c2..8c035b5df383 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1134,7 +1134,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags sbuf_printf(procbuf, " "); } - sbuf_printf(procbuf, "%3d ", pp->ki_pri.pri_level - PZERO); + sbuf_printf(procbuf, "%3d ", pp->ki_pri.pri_level - PUSER); sbuf_printf(procbuf, "%4s", format_nice(pp)); sbuf_printf(procbuf, "%7s ", format_k(PROCSIZE(pp))); sbuf_printf(procbuf, "%6s ", format_k(pagetok(pp->ki_rssize))); From nobody Mon Jul 28 13:31:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBk6KPpz634r8; Mon, 28 Jul 2025 13:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBj6fvxz3vg3; Mon, 28 Jul 2025 13:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9n12SPK85hdxLnZXNdRTLsM9bltvG2YJKx171AARQec=; b=LcUtZZ0fX02B5i9XwgyLVRaI5zHLfiS34EhvprlpNiWux+FwLspjqg5l+18c3uu4s5p0dK 1+C4ohO2ocPTzfP1p5O+CF6/+Us4Ri836tKc32D8Ri+PSzPfo16QaBrFrXfpri4FROcstG 6E+Tt1Zm11LDmbCxiZYC9ByDgnKDSYAGWXpAN7n3Jq3/L15R0qXJI8PS7dIcB5orT+PDCa gFScunns4WeoGsQn3jVTne5f+152rgcubFW2/TqgQheRrn2SABujK5J97QnMOtNYKNDzan M9+oKsx2oLzoM8dr106o36Ultj75Ho36rbSEiaBZ6j8gh2LV3tteJGQoZbYmIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9n12SPK85hdxLnZXNdRTLsM9bltvG2YJKx171AARQec=; b=GIIec1ZFUG/V8PARPjQHVemXEhIZHxeGNWezRr2sRz+u812Ec83KjB644kGDserRaljbvg reTegdyDDhvI8OqjHPYjUnYN0YqzYjuZa11ufFhTZ2AjsWLFI0uVvzsrRU1MkcqSwkREP1 jArKLnBB6dvOsVICv9xgjfar+8sLN2eWSGEVunoCQBDjRZumPZlNEegP+SQv3JJPzxF8ti bUjzY6pulIg09HBxWZqLEsxGeTB7LGslCzJPaJ+gkei/sT1Rrl4Q2Xdg71AjxQ4uq1qi4D r2cKCU69g5qjdmYNS8JDlhxn1PTNhM9oUawdgbJwDg0uXOuvAYunDON9V3MGqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709501; a=rsa-sha256; cv=none; b=X3WaQuOhZyfbQAoS1nXd1BlDPUHR92T2EPBebEi2pLkRubReXrH0o/CztiZvhTXGunivwC O13TGXNl493PQ9GLs/11S8z8vrCg/XbQyITa3x5yO4VUbp5aoMyvc4GwU1JDam9VtcjlzY /6CZ9DHqFjvBYt74PmrVRJbqyVmkgoIVsZd2R0jC4c5JU05Q8bJKdpZb5napZetZILSx3d uiT/XyQue3poKUHRspZEgjzvuaFPDBuaihDkB/bs9C/N46D7lAUpuh3WPZ11xyqlSFYwNJ /7AjCMTtxcPV0p/ITndqd28MGb1WYpw4bzOE7cPu3bvmlbErOMwo5BO05Pyu5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBj5Nn9zng5; Mon, 28 Jul 2025 13:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVf1t082227; Mon, 28 Jul 2025 13:31:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVfSW082223; Mon, 28 Jul 2025 13:31:41 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:41 GMT Message-Id: <202507281331.56SDVfSW082223@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: 2b76d028605b - stable/14 - arm64: lib32: Don't try to install removed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b76d028605bf1f08ab9630f775fa29368737715 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2b76d028605bf1f08ab9630f775fa29368737715 commit 2b76d028605bf1f08ab9630f775fa29368737715 Author: Olivier Certner AuthorDate: 2025-06-18 14:31:59 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:44 +0000 arm64: lib32: Don't try to install removed Reported by: Herbert J. Skuhra (herbert gojira.at) Fixes: 79d8a99ee583 ("runq: Deduce most parameters, remove machine headers") MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit 63c9b018069b58bacb2875c83c676cc8c4f40d69) --- include/arm/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/include/arm/Makefile b/include/arm/Makefile index 1f596763df77..27fa8dfb9de3 100644 --- a/include/arm/Makefile +++ b/include/arm/Makefile @@ -32,7 +32,6 @@ INCS= _align.h \ reg.h \ reloc.h \ resource.h \ - runq.h \ setjmp.h \ signal.h \ sysarch.h \ From nobody Mon Jul 28 13:31:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBm1nq1z63545; Mon, 28 Jul 2025 13:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBk6mDQz3vgD; Mon, 28 Jul 2025 13: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=1753709502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/8brrLhrjlEyCwsigEwrTiLBUlYOiqnHq2LPsz1+OtQ=; b=TTSVX8ZZMY9mHsUQmmvusaBKcuZMPesMotTKeUEP1HMkl2B9PR6rSHwwYbt1tzVha2ppex Z7PKD5JfSrRP0r5vsIglrZ0z+VA9/gwSsO9gGwmZZnITbX4XAliXsOlwUiESzu26345jnJ hMm4IpTEHrlcwIp7L0X3p8vaS9Lc844N0AvYg+Qd89j4ykYb/qOdUcdwUEtNaQwBz5TqIK rQdCNEb0JObqb0cmxNqj2eY3g9wYM2jlYX6NkPAZt02vqwXiFcX6JHKY27Md1Oom+6eQPM zRgsDLT/Zx5uAE21foGok4xbDnWCYjMLJXU2V32U+kg0SfJWTMq1v+eUPJRJfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/8brrLhrjlEyCwsigEwrTiLBUlYOiqnHq2LPsz1+OtQ=; b=aoPlj2qvCN3Xqa+giTK4a5naxyfyDhSMwcFXfFhvFVangjZW58VOFfzdWl7KltStjvQuoD R2m60XumbLlTbQABFcHHnxl3usgVwYaculctNyw2WtjtQ/x8Q1wBSWc88pEqAJZUtZidhR f6ZzJ7HRTUFiCfgy7dAyRYh8+ynryPAwHhuyfADMeQtcxaPd/TXZmOJQLs2BjveOUt7UZP 75y5H8xOgo5l2fxcEzs95VzRbXAj5vL9qzpbyNH/MigyNANGIp3ivGjs1ePARE102clIwV 5y9JMe9vEAhJYmT9LY4In1R7b4b5UdwZzHkWYULOBmv6Aahn4bdCzNDEsnmtrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709502; a=rsa-sha256; cv=none; b=MSMRsRXHxWqVpLntPSIhud7ONpL7YB89xC6O8qAXpcIzpTHhi/9aE44U4wVWwYFejJZSBd ypV1vTd5mg10z/wcOu44pg2v9yK/xWcmyVd6qylF3Jf+kkWwVNB7Ie55cLvsYDdgWLYBoI RleNKEXeHBocVniv8umQwsb9zgoMBZF8WtnUEH63lPdvfDMsLqxh/4IevS8bRY/u/YY+Qb 1BQG5eQQoXVcNtaxgokfZLev9LPOHP9LKDLTdpvegq3AzZakAFfJpiHZDzCtrXt7IJLgc7 w3HXFFWrGfGCIDtRZR/DQnCKx65dvsdDt61XjDDKzsNLvk86n1r6l3KVfhMTQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBk69zZznRY; Mon, 28 Jul 2025 13:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVgAt082263; Mon, 28 Jul 2025 13:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVgXX082260; Mon, 28 Jul 2025 13:31:42 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:42 GMT Message-Id: <202507281331.56SDVgXX082260@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: 8a59ea47d92c - stable/14 - sched_ule: 32-bit platforms: Fix runq_print() after runq changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8a59ea47d92c3c4b6dca61a3c21346ae34b30b61 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8a59ea47d92c3c4b6dca61a3c21346ae34b30b61 commit 8a59ea47d92c3c4b6dca61a3c21346ae34b30b61 Author: Olivier Certner AuthorDate: 2025-06-18 15:15:18 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:44 +0000 sched_ule: 32-bit platforms: Fix runq_print() after runq changes The compiler would report a mismatch between the format and the actual type of the runqueue status word because the latter is now unconditionally defined as an 'unsigned long' (which has the "natural" platform size) and the format expects a 'size_t', which expands to an 'unsigned int' on 32-bit platforms (although they are both of the same actual size). This worked before as the C type used depended on the architecture and was set to 'uint32_t' aka 'unsigned int' on these 32-bit platforms. Just fix the format (use 'l'). While here, remove outputting '0x' by hand, instead relying on '#' (only difference is for 0, and is fine). runq_print() should be moved out of 'sched_ule.c' in a subsequent commit. Reported by: Jenkins Fixes: 79d8a99ee583 ("runq: Deduce most parameters, remove machine headers") MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit 013c58ced6aef26bad7ca5c6eb829b9d586f6edb) --- sys/kern/sched_ule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index b09d6dfc0f54..f59b7195f754 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -444,7 +444,7 @@ runq_print(struct runq *rq) int i; for (i = 0; i < RQSW_NB; i++) { - printf("\t\trunq bits %d 0x%zx\n", + printf("\t\trunq bits %d %#lx\n", i, rq->rq_status.rq_sw[i]); for (j = 0; j < RQSW_BPW; j++) if (rq->rq_status.rq_sw[i] & (1ul << j)) { From nobody Mon Jul 28 13:31:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBn49hFz634r9; Mon, 28 Jul 2025 13:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBm0XTKz3v2G; Mon, 28 Jul 2025 13:31:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GyeObK8ROMRbm4cF7YBX45jFqguqqE9z3RYCEV2rwtU=; b=VEyHv7UFOA+JKbReiz5wX4q8b5Bm9H2z5qaxtgNux4xsHOtqzreHzywS0Z+IQ/6RukHVFw Ox+gDdkHxe3CwR5qXYQ4j+guj6XnoLZWy1EsILIg0rHsHJCcGDMnW7fsgATOuF+4FrcJYj 3k0karZCEeBtJ/Y3PDJNKK7e6uUjhFwiuZLaCUAYse+ykUnOC7GLBxFFDXMf1um7uXXGHo Fd6z7ec9R0B6J+JyCts8twOAH7Up5xz/9ZpRb5OZE2jUKHPPZ543JvkRXW2uM8v/U73mNp kalupfJpkHiuPwuQWSSYGB2cL+RZcAQ6NHbZYunbd0eEz7mh6Rwsa3SBDocDVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GyeObK8ROMRbm4cF7YBX45jFqguqqE9z3RYCEV2rwtU=; b=HRptAn7WqQplfUhq/B0UlMlIwsppiV8AcJnikZ7YdLhiTlp88z91gr6w5av81rjFgeachZ o0p1EfH1E8yLHZgxUs3kHjH+C1/e/obke8TN8nPB6lgJ/OWvRNnNlR5lIVHikljr0ducNG HSM8f6ZkE8WXpVH7rWZvCE4JYOIZ0rAi7XsIHza8x/r/2yY4kRB75p9Q2wflUkBVyI3nAS vaGO11lf9sw1tmyVxIdF/Aji29oqAfV3KCEURTE+5K8xGWIIqKrU6150rO3nfQb6/x27JZ uCwFg6MPAcu/vvMEnFseuoqaDwU6dd9Y/J8/oVarwdR/O+sfmDiHvNXTguaezg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709504; a=rsa-sha256; cv=none; b=EjHLkW6lZ2FFeg35rUeAEjzlvy48yuJAPpm/RsB7tEbEXUHFtlOSZ+DUuetfiEySkaleWe ET7G38VDQvi3iUcP47vzCIWexLqjgJXJ+ob30KEoROtJu81p+NxMYNWpDoUKBQDR6Dqy2L XmOGucMRubb3wTAfVuXuBL8edLBayhLN0rsQNFOKi5h72p/v9MlGwySBf/+wwMrk0oD3l4 WUD/JGgo0OenGaIbf1z4KV6X6F6cwiKrmFpoes4MdLH3eTJ+HF8pW6bPkgL1DRWMceDYIr snsn5x8lRIlAy4LqMBiSRZ7J4/iAwyZhBO0a0IamdmRdk8IpNy9doAlUhhFo1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBl6hRkznRb; Mon, 28 Jul 2025 13:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVhiJ082296; Mon, 28 Jul 2025 13:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVhDL082293; Mon, 28 Jul 2025 13:31:43 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:43 GMT Message-Id: <202507281331.56SDVhDL082293@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: c7bb3ca85e5a - stable/14 - runq: Fix printing status word bits List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7bb3ca85e5a8d7916fc2828aa2a47aebddb0294 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c7bb3ca85e5a8d7916fc2828aa2a47aebddb0294 commit c7bb3ca85e5a8d7916fc2828aa2a47aebddb0294 Author: Olivier Certner AuthorDate: 2025-06-20 02:26:28 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:46 +0000 runq: Fix printing status word bits 'rqsw_t' is 'unsigned long', strictly longer than integers on 64-bit platforms. While here, factor out the print format for a status word. Fixes: d2ac231616f0 ("Make the run queue parameters machine dependent...") MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit 3e5aeb20645fa0a67ce50d96c5136de14067a944) --- sys/kern/kern_switch.c | 11 ++++++++--- sys/sys/runq.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index bd0d987594ea..917f73682564 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -326,7 +326,9 @@ runq_sw_set_not_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp) rqsw_t old_sw __unused = *swp; *swp |= sw_bit; - CTR4(KTR_RUNQ, "runq_sw_set_not_empty: idx=%d sw_idx=%d bits=%#x->%#x", + CTR4(KTR_RUNQ, + "runq_sw_set_not_empty: idx=%d sw_idx=%d " + "bits=" RQSW_PRI "->" RQSW_PRI, idx, sw_idx, old_sw, *swp); return (0); } @@ -349,7 +351,9 @@ runq_sw_set_empty_op(int idx, int sw_idx, rqsw_t sw_bit, rqsw_t *swp) rqsw_t old_sw __unused = *swp; *swp &= ~sw_bit; - CTR4(KTR_RUNQ, "runq_sw_set_empty: idx=%d sw_idx=%d bits=%#x->%#x", + CTR4(KTR_RUNQ, + "runq_sw_set_empty: idx=%d sw_idx=%d " + "bits=" RQSW_PRI "->" RQSW_PRI, idx, sw_idx, old_sw, *swp); return (0); } @@ -525,7 +529,8 @@ last_mask: goto return_idx; return (-1); return_idx: - CTR4(KTR_RUNQ, "runq_findq: bits=%#x->%#x i=%d idx=%d", + CTR4(KTR_RUNQ, + "runq_findq: bits=" RQSW_PRI "->" RQSW_PRI " i=%d idx=%d", (*rqsw)[i], w, i, idx); return (idx); } diff --git a/sys/sys/runq.h b/sys/sys/runq.h index fb9b9908fe57..997c131b24b1 100644 --- a/sys/sys/runq.h +++ b/sys/sys/runq.h @@ -60,6 +60,7 @@ struct thread; typedef unsigned long rqsw_t; /* runq's status words type. */ #define RQSW_BPW (sizeof(rqsw_t) * NBBY) /* Bits per runq word. */ +#define RQSW_PRI "%#lx" /* printf() directive. */ /* Number of status words to cover RQ_NQS queues. */ #define RQSW_NB (howmany(RQ_NQS, RQSW_BPW)) From nobody Mon Jul 28 13:31:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBn74NMz63547; Mon, 28 Jul 2025 13:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBn1YVMz3vV9; Mon, 28 Jul 2025 13:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EY9Md8ZW/1aantgWMIe62+L+p1Do3u44r0neqYwedQU=; b=MLPBYBOntNtktAhW0pa3q0TxTPLIb/hNP9wdSJ9Ob+iL+JB6Cb+7wQKQyUpErxqy4FkMqi 3fT6uleLqCwXMc5X52OPjGOH78aaqpxQvNSv+Zwpls+1TCqJ7uJNrdTaV5AFZh3wLEphyC SCp+B7ZjVWMIddOr/YZlwpq132gGWm9gCR0ojC3G5ibdT6HZCJn6zZ39PGtmcjfiKFzjS9 F3Fl5B8I+WgV4r2v+aLoPp2PAUHYrRWeIFC/QAeJi8KImmUOcVX4rLMLGguDY0xDeixX28 hK8Hw6ry/jqNEpcqi+lRFE0eQ+jHOD/HoFuU7k57WRZLOdBbVc5jNj9aSC27ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EY9Md8ZW/1aantgWMIe62+L+p1Do3u44r0neqYwedQU=; b=XDQt/pDhnAqOqckFkkhesJvK6D7cYU5f9IHhRFa6mOf4Vo/RytT0BHNQjCV1BmvvjdY7dT wr4PkzuhkurS8Oq3HwEvAoFxuNXlKEdjxhEjgKylPAT1SxCLlMYUT9yB/Q9+P/VAP050Xv LUQCaSOeP6F/JR5biGVPKDbUmrhkPqTevUh+S9/pss9xDPr0RPQ1ObT1vRUKTD+ilpFAc4 AzCybYShyWpF939hLTvhGMZ4QYRL+s/9x4oELuXWnGmMzUIJKd/RqUs8KWTLPRTkNbyuJ8 nedIRBef6VZvfdVv1Uox4iK4UpNO5AxzW9DF+yvfEOKssxNZX5H7gpoJvw/fzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709505; a=rsa-sha256; cv=none; b=Mh/uAEvJT257VpNllWmQ+bqND3UxF2mdkdUQQ+0bPwMpZvo5uunuSekaLQ0Gi77EAifsvp Zpz+7wERF1LvluqYfORK2IHdP8HeJELOl8JlWgisttvl+UuqqX6i8s7UVE/iHUo0qV7ZHm 5h1vb7My3Lj1Cp9q98eywRljDIgjWWJx7ixmUDQiQBrVZicucESEumcpUkl2Zh4vdJX+GI 2F3ASxQ/2eBcvulFmyYmLrOVDWvgui5Bnf9ZyDGOq2OAmg6NNQAmbKTpeIuylqykPfR1Nc zEhLNY9EYbTy4GBA0+6ClFG0oDdlHng6fx7gVUd9NopK4IKEUQp9lNGTVRtp2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBn0XGfznvN; Mon, 28 Jul 2025 13:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVjfl082330; Mon, 28 Jul 2025 13:31:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVj5j082327; Mon, 28 Jul 2025 13:31:45 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:45 GMT Message-Id: <202507281331.56SDVj5j082327@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: 2d2e8ea9f286 - stable/14 - runq: runq_not_empty() to support racy lookups again List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2d2e8ea9f2866182ad1524b5b99564a46f92649f Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2d2e8ea9f2866182ad1524b5b99564a46f92649f commit 2d2e8ea9f2866182ad1524b5b99564a46f92649f Author: Olivier Certner AuthorDate: 2025-06-20 02:36:09 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:47 +0000 runq: runq_not_empty() to support racy lookups again The 4BSD assumes that its sched_runnable(), which then calls runq_not_empty(), can be called racily (another CPU may be grabbing a thread from the global queue at the same time). This makes runq_not_empty() trip on an assertion in runq_find() detecting a mismatch between some bit in the status word and the state of the corresponding queue (empty/not empty). Re-implement runq_not_empty() in an independent and simpler way as an alternative to removing the assertion, which remains useful to detect races when removing or adding a thread in some runqueue. Fixes: 79f68322c892 ("runq: runq_check(): Re-implement on top of runq_findq()") MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit be8e84c2e9240110ce99bb8d14259073340e4ef6) --- sys/kern/kern_switch.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 917f73682564..42fee61a99a0 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -493,7 +493,7 @@ int runq_findq(struct runq *const rq, const int lvl_min, const int lvl_max, runq_pred_t *const pred, void *const pred_data) { - rqsw_t const (*const rqsw)[RQSW_NB] = &rq->rq_status.rq_sw; + const rqsw_t (*const rqsw)[RQSW_NB] = &rq->rq_status.rq_sw; rqsw_t w; int i, last, idx; @@ -568,20 +568,27 @@ runq_first_thread(struct runq *const rq) /* * Return true if there are some processes of any priority on the run queue, - * false otherwise. Has no side effects. + * false otherwise. Has no side effects. Supports racy lookups (required by + * 4BSD). */ bool runq_not_empty(struct runq *rq) { - struct thread *const td = runq_first_thread(rq); + const rqsw_t (*const rqsw)[RQSW_NB] = &rq->rq_status.rq_sw; + int sw_idx; - if (td != NULL) { - CTR2(KTR_RUNQ, "runq_not_empty: idx=%d, td=%p", - td->td_rqindex, td); - return (true); + for (sw_idx = 0; sw_idx < RQSW_NB; ++sw_idx) { + const rqsw_t w = (*rqsw)[sw_idx]; + + if (w != 0) { + CTR3(KTR_RUNQ, "runq_not_empty: not empty; " + "rq=%p, sw_idx=%d, bits=" RQSW_PRI, + rq, sw_idx, w); + return (true); + } } - CTR0(KTR_RUNQ, "runq_not_empty: empty"); + CTR1(KTR_RUNQ, "runq_not_empty: empty; rq=%p", rq); return (false); } From nobody Mon Jul 28 13:31:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBq2gVQz63549; Mon, 28 Jul 2025 13:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBp2Wsxz3vjk; Mon, 28 Jul 2025 13:31:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TrNLGMECsF5AuIgsBYAYy1YKndNpLbkyvnmpsBulIqE=; b=EsYHNWlRLdnFmgg2W8A0bV0OuYdAUdxz0dmK1aKnqmue2HoSar+ZJ9oRC4h5sRvgtZpueK Mt3TGkz3BpeZWvYl1l++NW3MAj4GrRugENv/EiEHNOmZG1oSxb2JT4f1AM0T+n5PcbVe9r K+8V7sBdv2L9Ks7KBFGOYKVwL6Bk4dHAQcg56xUapUSMd2BBtHQSIgtj+BoqrHcwdOat75 ioFnVr/8QPocjiEZOLnF+DzEG04ewjk6xMasAaVkFEDAcaBYh4VCNUxaLLYxnikjyjhK63 iMSMr30z5JMI+UAd7EIuJLplyehSObgH6lhcCZt+kprZJvcjTi3Gofw2za5ZPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TrNLGMECsF5AuIgsBYAYy1YKndNpLbkyvnmpsBulIqE=; b=QJ1qSKeU2czARPoPDoNAiEVfDIGPixxv2yuOuzG1WeR65lGZTVxuFYHggsC1D8lnae0clK 7V1fXOTOFAxHEgRrsEGXVn4YDmlj85B6BdVaeoEIE/lzdIm1QMqaPb9fq9ulDUD9K9TX7S GuHAXfoHaiZmmpzcJYteeZ2D8WRM8VM1cmHxpc5Jj/+6sfOiJ1PS/FQWuJC8ckqiZSlZeR EGo//ym0rsbl0ljAjnVaEYuUwkjCtQqjgkTT1dk6fWG0+A7D2lcAnGYNY+lw5NoOCRNZ7P mTClBn0P9qoSSuygOiyxj9bryDGkugLP1wOwYz6xh14tnCEPFOMWL2B7A96cNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709506; a=rsa-sha256; cv=none; b=K/JdtBWEI5lsNJPvVFyRrdy7fhZX4CQ2F1POGugsyXWy3D5sNnGCkwqvZiAPgVwAHIY+84 61B/nBgsuYON8fWCYcJMo2CJ9gTjv4vigF33sFsbSR3d2IWtAJVMQlsCBlp9BuOQ0thOW5 taN/l+DElasqOvlvYQ7frc6WtlCjnC9D5prpUbFU3Q99TFYsGhYwYjYyYEfaCb9b+wRdE+ nSvA9w1A1ygYDzYfFe7EKVVKp/lfHzl/hyUe3TarUsDmLQhf8rpMMqZHK6DVixUAgYcMj0 WWYVZ30PXtrkwclBRnX7QPdNYUYCNRNtAJda1WsMftHRNdzcFtIcyRvHa8vf5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBp1sLrzngC; Mon, 28 Jul 2025 13:31:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVk7V082369; Mon, 28 Jul 2025 13:31:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVkbe082366; Mon, 28 Jul 2025 13:31:46 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:46 GMT Message-Id: <202507281331.56SDVkbe082366@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: 38cf4580a449 - stable/14 - Obsoletefiles.inc: Add architecture-specific 'runq.h' headers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38cf4580a449a81805f2d45cc5b5f3a08685a36c Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=38cf4580a449a81805f2d45cc5b5f3a08685a36c commit 38cf4580a449a81805f2d45cc5b5f3a08685a36c Author: Olivier Certner AuthorDate: 2025-07-28 03:10:26 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:48 +0000 Obsoletefiles.inc: Add architecture-specific 'runq.h' headers These were removed in commit 2fefe2c88b31 ("runq: Deduce most parameters, remove machine headers"). MFC with: 2fefe2c88b31 ("runq: Deduce most parameters, remove machine headers") Sponsored by: The FreeBSD Foundation (cherry picked from commit 8a69eb88fa00bb0ce85439d91cfdbd71426ffd0e) --- ObsoleteFiles.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index cecfc8c47a75..8edc2a281ae9 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250728: Machine versions of 'runq.h' do not exist anymore +OLD_FILES+=usr/include/machine/runq.h + # 20250708: replace yaml.lua with lyaml OLD_FILES+=usr/share/flua/yaml.lua From nobody Mon Jul 28 13:31:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBt3vWDz6354h; Mon, 28 Jul 2025 13:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBr4bz7z3vbY; Mon, 28 Jul 2025 13:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eylbEbibNj3kW0gbdm4uxcdzgSQredJPEOqSllJdyA8=; b=S6jgzQKKNCfSnBZ178EYyoTk4Oegz+7gV63VxuLrGTmEOxlPNoDY6nr/X+TVTn7Nas8jIH 3uF5dlfsdw0jJyvaRcfc+UVSI3+EpfzmwhMc7N/+cDFpygPQcCxZE3CxigZpGtxB0C5Ifw rERA3Q5/Cfiw81uFdGS3rDYkU1J5XRCgatqCzymYM4crhSAl11go2a1U3ch3WRSPeH6Wbu qGAMKV7rkE1UxzOV8Vw2rvHpp80Vp62P/Q1s+e/uTmKoWnZ09oNoL+DMiJnSOAF6DzKx3H CPnqwIVS0iGfOkdc/EBd8ciOmapSUaQaewj5mlnqBt0OzTjvIHqUw4d1utHE6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eylbEbibNj3kW0gbdm4uxcdzgSQredJPEOqSllJdyA8=; b=guJE6lr3Rkcz6YbVphiTqJyLLPsdkb4yRFnYuoiWuxabikl3VW6SSbY+XJZzxOIksRAx+f 7ubTxWP2Ra2B/PWthSRVS32yxn9YaNI8hL6qj25s4EIK9+/A++21qLyRL7dOKNFepcWVfG Gl2siuprvtOChhpsjUQW4sYtTCekfG2lDLyEH6f2qpF3krzNsacwbPqg8DxSzG9KSsXh7Z HRrY2iU/ZlJUd7EpA1ggunQ9MaZ3JxhxRec0ZjWaSfaAr4s3B5y2L/c5UobgGTaxbz4Q/b HyJfbdIxz20XfxzVZdTOZJtvjdB3IWmYozlfEtEXfURPoq/bU5bgy53h8Si6eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709508; a=rsa-sha256; cv=none; b=KOpOEw/bLIagh/Af5xxAAA83spQIBpkCgaUlQ4nvdPY5NGMBd7xPRcNIvYCmloRp+KTdHA o+mH86AJaKtkML+feFJEgi6Tze4Bqn/7Gdygyat525S2ieu99NqUeB15zHl4Bpn0bh1OKz rfAOxniapAtK+VBnF2ZeQUvjFZGY3JkeA125672BxHHagDHh4BvEjXb8VNH/bnCgE6abeZ IYCSs1BVXhv9Y+xTmzhUugYxlQLDJaLEd/SVanKzWku5TkRforzqh6qu3lbZK6dnWxVuE0 6QXbY8AIzbWe7ZWUSEYHrQmN/IO1y76dOE6Bb0ERkR9F1O0tzYq/eL4MK49nPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBr3l9QznsF; Mon, 28 Jul 2025 13:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVmbG082435; Mon, 28 Jul 2025 13:31:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVmBA082432; Mon, 28 Jul 2025 13:31:48 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:48 GMT Message-Id: <202507281331.56SDVmBA082432@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: 8e1b8ae7298f - stable/14 - LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e1b8ae7298fc8ec91f6d7dc040341343c894e57 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8e1b8ae7298fc8ec91f6d7dc040341343c894e57 commit 8e1b8ae7298fc8ec91f6d7dc040341343c894e57 Author: Olivier Certner AuthorDate: 2025-07-07 13:28:21 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:50 +0000 LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc() Since commit 19df0c5abcb9d4e9 ("LinuxKPI: make __kmalloc() play by the rules"), kmalloc() systematically allocates contiguous physical memory, as it should. However, kvzalloc() was left defined in terms of kmalloc(), which makes it allocate contiguous physical memory too. This is a too stringent restriction, as kvzalloc() is supposed to be a simple page-zeroing wrapper around kvmalloc(). According to Linux's documentation ("memory-allocation.rst"), kvmalloc() first tries to allocate contiguous memory, falling back to non-contiguous one if that fails. Thus, callers are already supposed to deal with the possibility of non-contiguous memory being returned. Reviewed by: bz Fixes: 19df0c5abcb9 ("LinuxKPI: make __kmalloc() play by the rules") MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51247 (cherry picked from commit 986edb19a49c7d7d3050c759d9b0826283492ebf) Forgotten on commit to main/-CURRENT: PR: 277476 --- sys/compat/linuxkpi/common/include/linux/slab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index f3a840d9bf4b..efa5c8cb67b3 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -45,7 +45,7 @@ MALLOC_DECLARE(M_KMALLOC); -#define kvzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) +#define kvzalloc(size, flags) kvmalloc(size, (flags) | __GFP_ZERO) #define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO) #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kzalloc_node(size, flags, node) kmalloc_node(size, (flags) | __GFP_ZERO, node) From nobody Mon Jul 28 13:31:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBs1vqxz635Km; Mon, 28 Jul 2025 13:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBq354Kz3vk0; Mon, 28 Jul 2025 13:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PTQymAJJdBI7PyNBp2RyCEhTDl4NMdBeCr6fiC3tXt4=; b=BsgA1dENkfh1ZT4O2PnZNp8+riNBgTBRQk4yirqKJOeCbXWulCIzi3EJH+nJB8iEucOxPw LKK61pgqkfgW/qn89p7u/OofywhFhSpzS2AqSLNIBrN4RqPAaUuTH10oJvGp9KnZ7bUK2D /QEGWkPXfREe7aM0uLyqYgqDxwkli1zOky5ENyHRWIe2HFWw6CXsHSy4Mwyj8vNZRu+f8g dQAr4p3pYjca6TqqffnfRLEunOXyVljL2giXnu3py0iPspOS7xjQE2+SrbaC9Ql0MXiBg6 /g9IQTRdVqMUlID47C4BYg5u0cCrFgK0p1bqn9gikhj6/LkFnS31X7W/YPLD4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PTQymAJJdBI7PyNBp2RyCEhTDl4NMdBeCr6fiC3tXt4=; b=pmF4RtsjM15xP1Aqfjhqs64yrEUMT7Z5XILHFNdEkHqUw1uIOUPmeSNA8af8q4qV/Lhmcg j2luPbXg3qeC/CYkc6l47v/UJWXEK2avMLFG3/BkPkaJ04dnIixRtJjiAV0Cb3cbOX4JoI FTf7vqbxN/gduyG7QvrEjMrpQzjlOIJguZMmEvPX8+wrsG80Onh7so5heYFuobD3kSAwaY 1Uyn+iHCtinSoo23pcCFm3EXWbumPPXq6Iq3dIC5eVApp6LlBrfytf/faNkr1QiI6jeMhI 55j1vWDbXVC2p/OGsbwalD6IRhSbBb0gWQLKvNX0kQgsQuZftDZzwlLWKuoRYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709507; a=rsa-sha256; cv=none; b=rJXW23KtQ5hbk5jnPX3rVX81jGwS+BW5iWAnCGJ1cg0AwFnYqK6yugga+DSorGbx5j/Lgd 6LvOcNZF+p9zYSzt/7doRggZx8eEDBzuuxayY7cEug3Ktedy+cutSUGv/LlvLp+vcTd1Ds mr+DW3D+AJlDDqGtge1xBgHxSytocoJfuNGYPxL6s/gR9SLUT8AMEXGOY6Ll74lSg9QgDO G4lyKXK/na3JL32s9Lbg5gMrWCkFfQwfz4d8mq+G3tAtsZnFhMgA9PgQANOCgeES3p6Rqt wRROi3Vl69wAscnVeXX75fJuojXueuCo8Nz3pKTLoHoJVfX17mDwcUQwE+hwWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBq2TRzzngD; Mon, 28 Jul 2025 13:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVlcS082402; Mon, 28 Jul 2025 13:31:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVlXn082399; Mon, 28 Jul 2025 13:31:47 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:47 GMT Message-Id: <202507281331.56SDVlXn082399@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: d738ed04dbff - stable/14 - LinuxKPI: alloc_pages(): Don't reclaim on __GFP_NORETRY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d738ed04dbff78243617ac341486b86486e9c8be Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d738ed04dbff78243617ac341486b86486e9c8be commit d738ed04dbff78243617ac341486b86486e9c8be Author: Olivier Certner AuthorDate: 2025-07-07 12:27:48 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:49 +0000 LinuxKPI: alloc_pages(): Don't reclaim on __GFP_NORETRY Pass VM_ALLOC_NORECLAIM to vm_page_alloc_noobj_contig() so that it avoids reclaiming (currently, calling vm_reserv_reclaim_contig()). According to Linux's documentation, __GFP_NORETRY should not cause any "disruptive reclaim". alloc_pages() is called a lot from the amdgpu DRM driver via ttm_pool_alloc(), which tries to allocate pages of the highest order first and fallback to lower order pages (as allocating contiguous physical pages is in fact not a requirement). This process relies on failing fast, as requested by __GFP_NORETRY. See also related commit 718d1928f874 ("LinuxKPI: make linux_alloc_pages() honor __GFP_NORETRY"). Reviewed by: jeffpc_josefsipek.net, bz MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51246 (cherry picked from commit 4ca9190251bbd00c928a3cba54712c3ec25e9e26) Forgotten on commit to main/-CURRENT: PR: 277476 --- sys/compat/linuxkpi/common/src/linux_page.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index 99b63e8d5680..bb5a1411eeec 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -107,6 +107,7 @@ linux_alloc_pages(gfp_t flags, unsigned int order) if ((flags & M_ZERO) != 0) req |= VM_ALLOC_ZERO; + if (order == 0 && (flags & GFP_DMA32) == 0) { page = vm_page_alloc_noobj(req); if (page == NULL) @@ -114,6 +115,10 @@ linux_alloc_pages(gfp_t flags, unsigned int order) } else { vm_paddr_t pmax = (flags & GFP_DMA32) ? BUS_SPACE_MAXADDR_32BIT : BUS_SPACE_MAXADDR; + + if ((flags & __GFP_NORETRY) != 0) + req |= VM_ALLOC_NORECLAIM; + retry: page = vm_page_alloc_noobj_contig(req, npages, 0, pmax, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); From nobody Mon Jul 28 13:31:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBv0yc1z6354k; Mon, 28 Jul 2025 13:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBs54X4z3vbk; Mon, 28 Jul 2025 13:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Syy5H0plAKdAjjDxabUOCZ9WQ8SuRxhsC8gN4LPSHJo=; b=NKhrOyQhb5AhgP8akVIzl7E/ctU8C/lz+pza7pTVVfgMg3SSMGimHhEtIz5ALcoZCuiXVN 44MBW8UFSdAYOCPCX+tlC/dfvsx+8zqPX1GxpO7wbBoxW42T1wK/FhjCbP2M07YdMyieae N39sp2g9sa43lUjDEqTKGBmbAw6/Gztp6pl/jf2CP6eS8m4irl0As6pdvN37I4tCJtr1u9 gX4jI5b7JSOt7JZ2D34qRwMBHTXEq/OVgnigw5R9UPXkvvH0nMfbe2tvYZ6rCirnZ0hWtd Mpmye3EaPnGE6xx2/g6A/RA8u+2AMFLhLRWT5v69LumiWa7E5UtHpMA4cv/NfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Syy5H0plAKdAjjDxabUOCZ9WQ8SuRxhsC8gN4LPSHJo=; b=M/P4ZzJhMM/t54JpsuvhVNuB3VvZ6/uMJnBsO745Bu+r8qCrSA4zk7TYz9ycJVHTMzkAn1 ygk0rY8hISAMGPb4KB6HNaVUCwxPywGRFWhIkrvRfUOgQ3cdGp25OCseDqahzGwc190cld Apv+w76jt4cb7VhUbLxn1ZgEg/9wq9BUxF0Eq34avA9J+SeQt7S3xEgAkekP0vOKAYyo0G 4T3deIhK1IZ/Z25eaQS9Q8OG+WKHJ0lboB4isVedgLFtkHVCn9QbcXKNVVZEsA0lQAikmd s7bDvU+G+s8cNOPaBZFZclPoqLPdyroVULnBREqUFKdU9sOJDxiyRwXq0vAOVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709509; a=rsa-sha256; cv=none; b=CIbt+bnZ8iw4lrUnWaXHei7Sd8E+znbfxy35a7+jozxsvwCLahLR2C/rnAqU/EJIkdVrGu FYSOqc3d0moEA63aFHfdlRoIOKwQ2NtxE9M8KJiHEgUYXTm0+MLOqIzXt15DHVTzbmE1UC YO0yBifgs7YK70uCgMUvpoMymoFgvmrxjdcqv8IR7C7Pcg8SMDuiczU3H5iVjKYLiidx8+ ozt3Sfva1+RSRr3riul/9Phmqj06yDcoPLmJw0fTmoKTRZ9TVFqeCvchx+pez3fmRuIO3j 7altol9+RDYax6G2GiWp0VT+GmMNa9sKhDD+U27EJGLWup7vsMTRo7HBb6MUVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBs4ZyNzngF; Mon, 28 Jul 2025 13:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVn1r082472; Mon, 28 Jul 2025 13:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVnKZ082469; Mon, 28 Jul 2025 13:31:49 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:49 GMT Message-Id: <202507281331.56SDVnKZ082469@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: 0e9a3bdeb737 - stable/14 - pmap: Degrade pmap_page_set_attr*() into a no-op on same attribute List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e9a3bdeb7376bf04cf21830c4e33aa7efe13961 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0e9a3bdeb7376bf04cf21830c4e33aa7efe13961 commit 0e9a3bdeb7376bf04cf21830c4e33aa7efe13961 Author: Olivier Certner AuthorDate: 2025-07-08 16:17:30 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:51 +0000 pmap: Degrade pmap_page_set_attr*() into a no-op on same attribute For 32-bit arm, move the no-op test that was already in place at start of the function so that it stays first even if the '#if 0' block around the call to sf_buf_invalidate_cache() is uncommented at some point (if ever). Reviewed by: jeffpc_josefsipek.net, kib MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51253 (cherry picked from commit 9d1f3ce79d85855399663e3977766ec46f28cadd) Forgotten on commit to main/-CURRENT: PR: 277476 --- sys/amd64/amd64/pmap.c | 5 +++++ sys/arm/arm/pmap-v6.c | 32 +++++++++++++++----------------- sys/arm64/arm64/pmap.c | 2 ++ sys/i386/i386/pmap.c | 2 ++ sys/powerpc/aim/mmu_oea.c | 3 +++ sys/powerpc/aim/mmu_oea64.c | 3 +++ sys/powerpc/aim/mmu_radix.c | 4 ++++ sys/riscv/riscv/pmap.c | 2 ++ 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 34c7c1c94737..b9681da13d3a 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -9620,6 +9620,8 @@ pmap_demote_pdpe(pmap_t pmap, pdp_entry_t *pdpe, vm_offset_t va, vm_page_t m) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pat_mode == ma) + return; m->md.pat_mode = ma; @@ -9639,6 +9641,9 @@ pmap_page_set_memattr_noflush(vm_page_t m, vm_memattr_t ma) { int error; + if (m->md.pat_mode == ma) + return; + m->md.pat_mode = ma; if ((m->flags & PG_FICTITIOUS) != 0) diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 95aeba201e4a..737e215b44b6 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -5749,7 +5749,7 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) CTR5(KTR_PMAP, "%s: page %p - 0x%08X oma: %d, ma: %d", __func__, m, VM_PAGE_TO_PHYS(m), oma, ma); - if ((m->flags & PG_FICTITIOUS) != 0) + if (ma == oma || (m->flags & PG_FICTITIOUS) != 0) return; #if 0 /* @@ -5766,22 +5766,20 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) * If page is not mapped by sf buffer, map the page * transient and do invalidation. */ - if (ma != oma) { - pa = VM_PAGE_TO_PHYS(m); - sched_pin(); - pc = get_pcpu(); - cmap2_pte2p = pc->pc_cmap2_pte2p; - mtx_lock(&pc->pc_cmap_lock); - if (pte2_load(cmap2_pte2p) != 0) - panic("%s: CMAP2 busy", __func__); - pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW, - vm_memattr_to_pte2(ma))); - dcache_wbinv_poc((vm_offset_t)pc->pc_cmap2_addr, pa, PAGE_SIZE); - pte2_clear(cmap2_pte2p); - tlb_flush((vm_offset_t)pc->pc_cmap2_addr); - sched_unpin(); - mtx_unlock(&pc->pc_cmap_lock); - } + pa = VM_PAGE_TO_PHYS(m); + sched_pin(); + pc = get_pcpu(); + cmap2_pte2p = pc->pc_cmap2_pte2p; + mtx_lock(&pc->pc_cmap_lock); + if (pte2_load(cmap2_pte2p) != 0) + panic("%s: CMAP2 busy", __func__); + pte2_store(cmap2_pte2p, PTE2_KERN_NG(pa, PTE2_AP_KRW, + vm_memattr_to_pte2(ma))); + dcache_wbinv_poc((vm_offset_t)pc->pc_cmap2_addr, pa, PAGE_SIZE); + pte2_clear(cmap2_pte2p); + tlb_flush((vm_offset_t)pc->pc_cmap2_addr); + sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index ef33a7339b9e..8e3161736467 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -6678,6 +6678,8 @@ pmap_unmapbios(void *p, vm_size_t size) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pv_memattr == ma) + return; m->md.pv_memattr = ma; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 90ea6e3459cf..d9eeeed69bd5 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -5516,6 +5516,8 @@ __CONCAT(PMTYPE, unmapdev)(void *p, vm_size_t size) static void __CONCAT(PMTYPE, page_set_memattr)(vm_page_t m, vm_memattr_t ma) { + if (m->md.pat_mode == ma) + return; m->md.pat_mode = ma; if ((m->flags & PG_FICTITIOUS) != 0) diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 363eb0c4c9a7..662204ec8b33 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1465,6 +1465,9 @@ moea_page_set_memattr(vm_page_t m, vm_memattr_t ma) pmap_t pmap; u_int lo; + if (m->md.mdpg_cache_attrs == ma) + return; + if ((m->oflags & VPO_UNMANAGED) != 0) { m->md.mdpg_cache_attrs = ma; return; diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 4266047ee3e2..2ded3b6b5195 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -2121,6 +2121,9 @@ moea64_page_set_memattr(vm_page_t m, vm_memattr_t ma) CTR3(KTR_PMAP, "%s: pa=%#jx, ma=%#x", __func__, (uintmax_t)VM_PAGE_TO_PHYS(m), ma); + if (m->md.mdpg_cache_attrs == ma) + return; + if ((m->oflags & VPO_UNMANAGED) != 0) { m->md.mdpg_cache_attrs = ma; return; diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index a15f686d88fe..78c57badee55 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -5888,6 +5888,10 @@ mmu_radix_page_set_memattr(vm_page_t m, vm_memattr_t ma) { CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, m, ma); + + if (m->md.mdpg_cache_attrs == ma) + return; + m->md.mdpg_cache_attrs = ma; /* diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 4812f3274e69..74bbddd7b065 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -4589,6 +4589,8 @@ pmap_unmapbios(void *p, vm_size_t size) void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { + if (m->md.pv_memattr == ma) + return; m->md.pv_memattr = ma; From nobody Mon Jul 28 13:31:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKBv4zHrz635DX; Mon, 28 Jul 2025 13:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKBt6X7Mz3vsM; Mon, 28 Jul 2025 13:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=COCplM74Kjva2FG320guNp4IGin5ZzHQ0vsTSyj8xYY=; b=N0zuGUppkQ7aAYh9cWmoKim1myyUQor2LmtnDl4H1N7b+7LIRRgzi4sWjuIlAULpkSPvD/ paNbpmGIsNEV0HdhnKLU0J5FtMSOmeBjM7d68hO6apX8c65tSZEY5Fjg/VUYWdy7jRmmQG lDZlYvUHvsFtzJspnqCUYgC+cLHUDJITK/RQUdKX2VIVZDfM2cUSQ6IaOgsOnjRXl3VNZc /AlBvk7UPko7jBnqP52nEnMgkw20NGBruomQfVLxCMQcpfxBa6jBkRNQZNg2t5vZ4Zzwpk JmjLEWP9TdrKtuiqO7SajCgel0O+a0I0UKc8D7SsmHUciMMEc6q301Aa5WsJnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753709510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=COCplM74Kjva2FG320guNp4IGin5ZzHQ0vsTSyj8xYY=; b=pSzuweJYIhavWtbep9JLzWqjnjxXWM4/gGiUqKoh10/NFSCkfqYnePE9U79AedfSpzHj5Q 49MyEV4z/jwuNs9aUoMApDQVWbemxMPOMUMpidm+TIQPboLPyKH3iOYGuPqPn0xJYaqZUR /Uqrg09yHmBhl1PcoMICMalZS8oujlcfj8iamlF7VGff/yPH5lx9vEd1VndSuvRBiv4+5K gYvUwHhNG1vG2L8h59MfMSXhgWigs1OdjyMJCT9hAm6xsko345DBM1qnC7VOFSUiqm+WB/ hTspFhih2HJw8G5aOhLkiJL0r0ft895x9qdg/h0nx3Tqxm1k9ujI0pmVx5I6Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753709510; a=rsa-sha256; cv=none; b=LQZPeuBJGA4+0TzZ4i+6BPFBRm8gYjB7HVH+aXla5M9cqH9fmf6fEP0z4zk+K6fYEcL/Kc 4np6QKoJE+eWtWYYw6CjqmjJ6WLl1MvJRaH8a5GEkOXFd750s6uMc3gC0ll8Li85VG6ql/ 6LQDD/+eeiBLj3569Q06JmEh0oa3btxEInD91RI41SQJx1M9vnc39nR3/1ZfwY5HTMItcA T/qszrL3F22WMjAwF6yF0aCD0gc70GkkQ+r8Klm7f9jBf1uopcgtzNOFRPHXLkrAo0R5Hb xI45+5n/RY1eT84AvlDhfHJQCe38rOU3KqVkkpFDb/DJ3y9ANQ/UFrtcwgxryg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brKBt5YjGzngG; Mon, 28 Jul 2025 13:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SDVosg082506; Mon, 28 Jul 2025 13:31:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SDVopN082503; Mon, 28 Jul 2025 13:31:50 GMT (envelope-from git) Date: Mon, 28 Jul 2025 13:31:50 GMT Message-Id: <202507281331.56SDVopN082503@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: 880e131d9d31 - stable/14 - vm_domainset: Print correct function in KASSERT()/panic() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 880e131d9d310c98f3b3c035d2daecb757198a77 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=880e131d9d310c98f3b3c035d2daecb757198a77 commit 880e131d9d310c98f3b3c035d2daecb757198a77 Author: Olivier Certner AuthorDate: 2025-07-07 14:14:16 +0000 Commit: Olivier Certner CommitDate: 2025-07-28 13:28:52 +0000 vm_domainset: Print correct function in KASSERT()/panic() Some messages in vm_domainset_iter_next() would wrongly refer to vm_domainset_iter_first(). While here, ensure that all assertion/panic messages use '__func__' to avoid this discrepancy in the future if code is moved/copy-pasted again. Reviewed by: markj, alc, kib MFC after: 10 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51248 (cherry picked from commit 1e78a6a6d85702b84f679712aac71f91e481e8f9) --- sys/vm/vm_domainset.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/vm/vm_domainset.c b/sys/vm/vm_domainset.c index 9bc0df865154..b666324db494 100644 --- a/sys/vm/vm_domainset.c +++ b/sys/vm/vm_domainset.c @@ -126,8 +126,7 @@ static void vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain) { - KASSERT(di->di_n > 0, - ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + KASSERT(di->di_n > 0, ("%s: Invalid n %d", __func__, di->di_n)); switch (di->di_policy) { case DOMAINSET_POLICY_FIRSTTOUCH: /* @@ -144,11 +143,10 @@ vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain) vm_domainset_iter_prefer(di, domain); break; default: - panic("vm_domainset_iter_first: Unknown policy %d", - di->di_policy); + panic("%s: Unknown policy %d", __func__, di->di_policy); } KASSERT(*domain < vm_ndomains, - ("vm_domainset_iter_next: Invalid domain %d", *domain)); + ("%s: Invalid domain %d", __func__, *domain)); } static void @@ -184,13 +182,11 @@ vm_domainset_iter_first(struct vm_domainset_iter *di, int *domain) di->di_n = di->di_domain->ds_cnt; break; default: - panic("vm_domainset_iter_first: Unknown policy %d", - di->di_policy); + panic("%s: Unknown policy %d", __func__, di->di_policy); } - KASSERT(di->di_n > 0, - ("vm_domainset_iter_first: Invalid n %d", di->di_n)); + KASSERT(di->di_n > 0, ("%s: Invalid n %d", __func__, di->di_n)); KASSERT(*domain < vm_ndomains, - ("vm_domainset_iter_first: Invalid domain %d", *domain)); + ("%s: Invalid domain %d", __func__, *domain)); } void From nobody Mon Jul 28 13:54:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKhy1Bklz6361t; Mon, 28 Jul 2025 13:54:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKhx3SrXz48td; Mon, 28 Jul 2025 13:54:25 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-615378b42ecso2138521a12.0; Mon, 28 Jul 2025 06:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753710859; x=1754315659; 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=qoFlqgSykRMGRrmLEoJQ86N/14i5MM+UMEMMsRaowoA=; b=fvXeTZ87mADi1tqBtLdhSCPjVue+LvPimqvG9UQrCeA2CXuPX81DyB/JQwz7vx/s8+ gjSlGJGUwUMdonrRDiH3fA3vLyad4/NTMnZL7sTRgHYhQSIsD6pPMiPpDLEsT/YcA+VA A4ED4lCz7yVNJEbCrxGByCkhQP8BbUOHVkrZBnAw5zSst6cT0mzT/sYuvL07MChGapyj Kvj7zHr8UaCs3WLsWdfCweaYbz2ie4zsqOwibKFqSv77gesnUMEsFqgMhmprGOtFVMoY dmMLZxYHRg87wxZhYWZhk6HZ4PMpiHGd9IFLJo8ttzMq2e+lMzF846zBxxzsMaeZoni6 5kZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753710859; x=1754315659; 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=qoFlqgSykRMGRrmLEoJQ86N/14i5MM+UMEMMsRaowoA=; b=gUg/JAo+8qdc6tH8tXmrDGWFlnipxN/fLy5zdGmRPqRnNy2DiGpNT/96eg+Mj/Ax8f GBWJs9alZe+dAbbqqlrtbUu/sPuJiBLla0TU2PpiWuCbXqPiezoRbDxjD+64MVdUW4LI SVJCMvwjZdvROV6THgnFBZ5QrgWJBZc7X5845TElp7APFwVL1eZcXwgEIdQ1kHC5w39B PIPyA25crhPoUdsk/M88zaESCo9/dljJShSauHeHom6mWbTxiFlCh/4yGmcdJHasw+/Y ApHy6fd5gBax4w3sPbNWRa1Ur7ZG64SvY0zYDFaUIQwofUF4AG+iddSETCBhuFX/pfP6 ovDw== X-Forwarded-Encrypted: i=1; AJvYcCV5x5fsFHprgISFqPaBvlNh9/7GdpqQtdO5JRZ2sbx6rCBgXSSm49y8bsHMXWMnwahTTUNPK+/9@freebsd.org, AJvYcCVDVECkUSO2b0pDJCrU2GOaFP1RwTJac/XXLmOzr2XZ8ynp0RB4VRF/abXKvGBCDHY2q3t7bBsgaarWdEeorJQgzYMfEGE=@freebsd.org, AJvYcCVJWNMEB+Pgf98UBEywdonJWIAJY7m7wto+iOXt2y9KJhkm2GEdwHMsI/6NgwY5Z5DKLw==@freebsd.org, AJvYcCWOyopeGoWF5bqm97JJuSL1GUtk5NLkq0D5+niA+iG0SSrPSmz+ygXk17DfHKIHsxVnMeIfzYWNRZ0/khm13rY=@freebsd.org, AJvYcCXsCFk1fWgSRU+sBZdPkqQRyprmR5h4/93RUpVQhdWbDJQi31mhSSUA1eTOQ0n171WsBkmKlRqzc+mNKkBjMLRgrn6Jgg==@freebsd.org X-Gm-Message-State: AOJu0YwWKT1dcdJRAbz/C9MLMSWLdQq+JCfLyRlIFZaa7EtGZNcfLOw/ aKqHPYcebMwiww/IA9Fx5efgWaOJ69cz1rc870ieBQ5ddget1q2M9QYCGZ8OdQXAGi2WVV9tkdj RJTMC36I2P0X7JidVN3Jok/vK02GIRoeg X-Gm-Gg: ASbGnctos1DFMXeWzVyhPEzMhNC6pI4uYdQcJbT8hK9xprxKYMkS7YbxNdXW1Ulj4ze V02JZkV1sdXvkbbiFUQgQJBgHL3IEDUZp8pv059Sr8nTmdt83LQWpcaC7m+0THnxYA1AwWiGisG pBR/G5sY9fPgRcuSKmFSb9nwBXhWRrz3yL//NpAcNZGiofYGhfFAdsRUBrr2hTbc6VY7/jwKJAj mku8+CKxhxIuqGFFWkKIzGaXvSa6RH/9Nk4MZU= X-Google-Smtp-Source: AGHT+IE7+tnprcerW+wq+Og2VHBONydUaEtevb3KLCtl2QlKCfXqubTV00dgp/cDHgrq3tEchhK3JgO1XjpRrkt4kK4= X-Received: by 2002:aa7:d158:0:b0:615:44c5:b5fc with SMTP id 4fb4d7f45d1cf-61544c5f515mr2693306a12.28.1753710858664; Mon, 28 Jul 2025 06:54:18 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Mon, 28 Jul 2025 06:54:05 -0700 X-Gm-Features: Ac12FXxMEI-ScCZeZvzRhZ5UUnFCOhLYYhWoidrWNv5nR0cOpfGO5DSEPbaijaQ Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Konstantin Belousov Cc: Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4brKhx3SrXz48td X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Mon, Jul 28, 2025 at 1:20=E2=80=AFAM Konstantin Belousov 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. > > On Sun, Jul 27, 2025 at 08:26:03PM -0700, Rick Macklem wrote: > > On Tue, Jul 22, 2025 at 9:00=E2=80=AFAM Cy Schubert wrote: > > > > > > CAUTION: This email originated from outside of the University of Guel= ph. 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 ITh= elp@uoguelph.ca. > > > > > > In message , Konstantin Belousov writes= : > > > > On Mon, Jul 21, 2025 at 07:46:45AM -0700, Cy Schubert wrote: > > > > > In message <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org>, Je= ssica > > > > > Clarke w > > > > > rites: > > > > > > On 21 Jul 2025, at 15:10, Cy Schubert wrote: > > > > > > >=3D20 > > > > > > > The branch main has been updated by cy: > > > > > > >=3D20 > > > > > > > URL: =3D > > > > > > https://cgit.FreeBSD.org/src/commit/?id=3D3Dc7da9fb90b0b6385e99= bb7747476359 > > > > b=3D > > > > > > 712993fa > > > > > > >=3D20 > > > > > > > commit c7da9fb90b0b6385e99bb7747476359b712993fa > > > > > > > Author: Cy Schubert > > > > > > > AuthorDate: 2025-07-19 14:11:18 +0000 > > > > > > > Commit: Cy Schubert > > > > > > > CommitDate: 2025-07-21 14:07:22 +0000 > > > > > > >=3D20 > > > > > > > KRB5: Enable MIT KRB5 by default > > > > > > >=3D20 > > > > > > > Set WITH_MITKRB5=3D3Dyes as the default. > > > > > > >=3D20 > > > > > > > Rebuild all USES=3D3Dgssapi ports is recommended. > > > > > > >=3D20 > > > > > > > A clean buildworld is required. > > > > > > > > > > > > That=3DE2=3D80=3D99s going to be quite annoying and cause a lot= of issues =3D > > > > > > given > > > > > > WITH_CLEAN is now the default. Can we do something in depend-cl= eanup.sh > > > > > > to delete everything from the obj tree that needs to be rebuilt= if we > > > > > > detect the wrong kerberos implementation was previously built? > > > > > > > > > > All binaries that depend on any kerberos libraries must be rebuil= t. > > > > > WITHOUT_CLEAN will fail at various spots. Meta mode should take c= are of > > > > > this for us. > > > > Does the statement mean that ABI for the base libraries was broken? > > > > If yes, and the new libs have the same name as the old, we must bum= p > > > > dso versions. > > > > > > Three new libs have the same names. Most don't. The three with the sa= me > > > names are libkrb5, libgssapi_krb5 and libcom_err. > > > > > > libgssapi_krb5 is a merge of the Heimdal libgssapi_* files. For examp= le, > > > there is no libgssapi_spnego in MIT. > > > > > > The libcom_err contains the same but updated MIT functions. > > > > > > libkrb5 removes Heimdal-only functions. > > > > > > There is no libasn1 nor libroken in MIT. > > > > > > The differences are outlined at https://k5wiki.kerberos.org/wiki/Samb= a%27s_u > > > se_of_Heimdal_symbols,_with_MIT_differences. > > I know diddly about how libraries are handled, but is it possible to pu= t the > > old Heimdal 1.5.2 libraries somewhere (semi-private) under different na= mes? > > > > I ask because it is going to be very difficult to port the gssd to the > > new libraries. > > > > The problem is that the KGSSAPI code assumes some stuff very specific > > to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you'll see > > what I mean. (There's code that parses the keys etc out of the internal= ly > > generated tokens. I have no idea where to even find the information on > > how/where the MIT code hides this stuff and it a large part of krb5_mec= h.c > > looks like it will have to be re-written to work with the MIT libraries= .) > > It might be better to extract the required bits and keep just them. > Perhaps even moving that bits from vendor to FreeBSD-owned code area. > > I do not think that keeping large pieces of code in vendor without update= s > is a good plan. I will work on it. I just cannot guarantee timing. The next step to getting the gssd to work with MIT is finding the MIT structure that gss_ctx_id_t refers to. If that structure isn't a lot different than the Heimdal one, the conversion shouldn't be too bad. (I'll start on that to-day.) I understand that this does need to be upgraded. It is unfortunate that the KGSSAPI code is wired specifically for Heimdal. (Another approach would be to add a new upcall to the gssd daemon to extract the keys and then, hopefully, a kerberos library call could be used instead of having a "home rolled" chunk of code in the kernel that has to be updated whenever the structure returned by the library call changes.) I didn't realize this existed until yesterday when I bumped into it while debugging the kerberized NFS mount. If you glance at krb5_import() in sys/kgssapi/krb5/krb5_mech.c, you'll see how messy this could get. rick From nobody Mon Jul 28 14:03:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brKw95g6pz6373D; Mon, 28 Jul 2025 14:04:09 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brKw91j3Nz3CTB; Mon, 28 Jul 2025 14:04:09 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-60789b450ceso8222402a12.2; Mon, 28 Jul 2025 07:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753711443; x=1754316243; 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=ew1ho6yWwi5tSm1D8JIsW4uuZgIa3HzZAquj0BZg+b0=; b=JVRjtDm+26vMXHoQm5xG/GAV6aOMSEgn3adKSRKEWE7EfETI/gFqHin5pa0ocROvxp GdpAKbPGIGrdgoWlF0v4IOpG/r9hgGPUH2ro06ly7BbbBAKewpHm8J+80YPKDwnhwqhy wr7Zoa0IMJamN+myraTFz9t6x+GwZ7YYb/FH+p4Kjtxo/WTK+b1jZzd9pvf7RAVRJNiF d6rz3rM7U98jWjk+KLiMLebDJgx1tmT0XrKn1slVZ0JtlexwZ6j9x5kKeFiZh62HsgGW DvMp2jJCLce0iHB/5/Ff/0uBhcxwX4wKz/II5LAM5n5xPupgnjHKe/2F/V6FNehuPncd k6iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753711443; x=1754316243; 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=ew1ho6yWwi5tSm1D8JIsW4uuZgIa3HzZAquj0BZg+b0=; b=K1MXS9kFkJKm28XNQtVjsM9GgQ3PLQxgMa2cuYHVfTmZlPsOyBlH1BxlrZdJR1nBQt d3sF5mb3EDmZulRb1tqrnEPNhHnQOKwM/I8a6u7JH4Gs73SlQ2ihF+WfGXsRm2t/l0ss ychHzRUr3ccfGoDFBT7tE7IPOXXwqChk66LwQhHMKe/Hk2CW8xcyPPogRYklkqhsXMOE e2QJOWuSLSPX/M7gUxlC2Mnc1qmZbRLSzr9lk/kSVZiACa8TZm+pXth/7IsEIHq8H0Ve lMrHQC/RQRHPj87qRzmh51B+0PYTGcI6F+GCEf7feK65/q8onrBhSfAUiQWJRF1Bu2ar ZAGw== X-Forwarded-Encrypted: i=1; AJvYcCUNj+/zjuDzwfTbIZJyQUNrPasXgvz8GXSHpkdNvPhgrfVntibIFYgxoiI0RnUxC9ufXw==@freebsd.org, AJvYcCVsOIWw6uXvgPqDbLNAZpYg3fQC5jttoEOCT7MgQ2LR1jaKQm5klhOuXXjQhOEyfIoibhs0B3izHKOSw9IB4iQ=@freebsd.org, AJvYcCWc8J47zUGC5Wyie/hqr5snf6awRQTkinjQ1c/jphAr+W0A1dtz+ilmXCH7JWXuIHdmXS+8TUvA@freebsd.org, AJvYcCX+HuSCpjVzFD3HdWobwfW4eO1NRpyRYptY42qhQgoqPUwt/U+1C+06leThVZCdof7eGMCa3Yovq/MazG+VZAyK3saArg==@freebsd.org, AJvYcCX7j87yCwZeSAHf64qH4hhGsoQExSjtkGjFHg/AWOG9/4Z5WEmiUgInEFPTZLnK1akk8di9a7SiAqp+p77C44IINMO6PC8=@freebsd.org X-Gm-Message-State: AOJu0Yzv91sVQHiRX/A9RGsYBGYJXqDHgliHBGPTBhhjITSAp/d1T8fY YPuwBarblL54UQN+2JsBeXBXFXH3/H9jbtmycBDvLC+38L0MYc0OOVkwwop50yEJQ5YPNYRnVAR 7W53wMLEbw8IZiKGsVtZ2iY8TN7HajQ== X-Gm-Gg: ASbGncsTvfvzFAdeO9muZ00tbdvW9zdAdZFQOSgL+vSH7qGy6IyBOEpe9uRmOW/T9Gd r98YWh/BBB2xGdmFUfP1Q7tnkHLG7Wad0uqRHuHETMxkB/927Wg1nMjrdrJLy5K24l0y1wlz6gu NYgOpQd3wcgkdw3/pcHK+6kdwkvfIq94CEhqXMBhOrPQc1cM0GHoxnUX3Rf7TEZopej3A3KfOoq hgsK3dY4KNoAAqO4S31+c4igMHvwhFMtaEA3iU= X-Google-Smtp-Source: AGHT+IHakBJr2tOpZMUhlBwI6XegXZFnQSJUJF9PRr/c+NPdK+8uY8YQ9utVjB4mi4Vj+3uxkdURXcCelqnEa5GA/MI= X-Received: by 2002:a05:6402:40c2:b0:615:5bec:1d5 with SMTP id 4fb4d7f45d1cf-6155bec52eamr1171726a12.7.1753711442027; Mon, 28 Jul 2025 07:04:02 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Mon, 28 Jul 2025 07:03:49 -0700 X-Gm-Features: Ac12FXznyARnWc8CBGhARlv45lH2XaDDKu2BxryfaEMSMnunoJYSh4Eg3yVIol8 Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Konstantin Belousov Cc: Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4brKw91j3Nz3CTB X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Mon, Jul 28, 2025 at 1:20=E2=80=AFAM Konstantin Belousov 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. > > On Sun, Jul 27, 2025 at 08:26:03PM -0700, Rick Macklem wrote: > > On Tue, Jul 22, 2025 at 9:00=E2=80=AFAM Cy Schubert wrote: > > > > > > CAUTION: This email originated from outside of the University of Guel= ph. 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 ITh= elp@uoguelph.ca. > > > > > > In message , Konstantin Belousov writes= : > > > > On Mon, Jul 21, 2025 at 07:46:45AM -0700, Cy Schubert wrote: > > > > > In message <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org>, Je= ssica > > > > > Clarke w > > > > > rites: > > > > > > On 21 Jul 2025, at 15:10, Cy Schubert wrote: > > > > > > >=3D20 > > > > > > > The branch main has been updated by cy: > > > > > > >=3D20 > > > > > > > URL: =3D > > > > > > https://cgit.FreeBSD.org/src/commit/?id=3D3Dc7da9fb90b0b6385e99= bb7747476359 > > > > b=3D > > > > > > 712993fa > > > > > > >=3D20 > > > > > > > commit c7da9fb90b0b6385e99bb7747476359b712993fa > > > > > > > Author: Cy Schubert > > > > > > > AuthorDate: 2025-07-19 14:11:18 +0000 > > > > > > > Commit: Cy Schubert > > > > > > > CommitDate: 2025-07-21 14:07:22 +0000 > > > > > > >=3D20 > > > > > > > KRB5: Enable MIT KRB5 by default > > > > > > >=3D20 > > > > > > > Set WITH_MITKRB5=3D3Dyes as the default. > > > > > > >=3D20 > > > > > > > Rebuild all USES=3D3Dgssapi ports is recommended. > > > > > > >=3D20 > > > > > > > A clean buildworld is required. > > > > > > > > > > > > That=3DE2=3D80=3D99s going to be quite annoying and cause a lot= of issues =3D > > > > > > given > > > > > > WITH_CLEAN is now the default. Can we do something in depend-cl= eanup.sh > > > > > > to delete everything from the obj tree that needs to be rebuilt= if we > > > > > > detect the wrong kerberos implementation was previously built? > > > > > > > > > > All binaries that depend on any kerberos libraries must be rebuil= t. > > > > > WITHOUT_CLEAN will fail at various spots. Meta mode should take c= are of > > > > > this for us. > > > > Does the statement mean that ABI for the base libraries was broken? > > > > If yes, and the new libs have the same name as the old, we must bum= p > > > > dso versions. > > > > > > Three new libs have the same names. Most don't. The three with the sa= me > > > names are libkrb5, libgssapi_krb5 and libcom_err. > > > > > > libgssapi_krb5 is a merge of the Heimdal libgssapi_* files. For examp= le, > > > there is no libgssapi_spnego in MIT. > > > > > > The libcom_err contains the same but updated MIT functions. > > > > > > libkrb5 removes Heimdal-only functions. > > > > > > There is no libasn1 nor libroken in MIT. > > > > > > The differences are outlined at https://k5wiki.kerberos.org/wiki/Samb= a%27s_u > > > se_of_Heimdal_symbols,_with_MIT_differences. > > I know diddly about how libraries are handled, but is it possible to pu= t the > > old Heimdal 1.5.2 libraries somewhere (semi-private) under different na= mes? > > > > I ask because it is going to be very difficult to port the gssd to the > > new libraries. > > > > The problem is that the KGSSAPI code assumes some stuff very specific > > to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you'll see > > what I mean. (There's code that parses the keys etc out of the internal= ly > > generated tokens. I have no idea where to even find the information on > > how/where the MIT code hides this stuff and it a large part of krb5_mec= h.c > > looks like it will have to be re-written to work with the MIT libraries= .) > > It might be better to extract the required bits and keep just them. > Perhaps even moving that bits from vendor to FreeBSD-owned code area. The problem is that the code in sys/kgssapi/krb5/krb5_mech.c does contain bits extracted from the Heimdal code. Basically, a detailed knowledge of an internal structure that the keys are extracted from. --> I am now thinking that adding an upcall to the gssd and letting it extr= act the keys might be a better plan. (At least it moves the maintenance t= o userland and, hopefully, library calls can replace the detailed knowl= edge about the internals of the implementation.) > > I do not think that keeping large pieces of code in vendor without update= s > is a good plan. Agreed. I'll work on it. (But no guarantees w.r.t. timeline.) Maybe doing a transition to Heimdal 7.8 (or 8.n) would be less painful? (It looks like Heimdal is getting maintenance these days. I think Debian is using it, which suggests it will get at least some TLC?) rick From nobody Mon Jul 28 14:09:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brL2h0Y2pz637TM; Mon, 28 Jul 2025 14:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brL2h048rz3DvM; Mon, 28 Jul 2025 14:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753711788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gIOXKUQjl9TZE28iX0KWc+MuS006iAJHk5DOwYS8/Js=; b=SfonImtAcDEWptkuCRLqMSwhDsven5odvSS2WMSttCzszp0keQBow+Tgy6O0d8Fvi3WcvL ipClFZlxbrqb0p4iPSEpD7RDwNfe45o6YWzciiug8LZlL8OHJEHWYsEAEnXYQ5H30XGFJW 07zJFan1m7GbGikYpgmItKA3y+cJZwUaOjGkOANUlJhQfTqmMHq3xQCMUWiTWdeRBIjPPQ tv7oEL3xK/qOb+m91mSKjAOUHmCHVFzPw2eBdu9jZIuSJrj7wIhsWduaF7DmYr04h99tU3 F6gps9nviCNhbQ//cN8qOqPE3R/Is5W0GAm/U2u2So7C9v/g1ghEgrcCqcFCMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753711788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gIOXKUQjl9TZE28iX0KWc+MuS006iAJHk5DOwYS8/Js=; b=ONpUykrmf34P1b3i6zPKNzLmEcIExck5kaf70u5VhF4ou5qMyPcBR3mfk7WHl0eBxpixoS L1pL8zPWX/ACxOFNNkoUWPVJU/+pXA/jcmN2ua6+jVVwXPvzUOwIrWqCNDkOrlm6S5lu30 or7I01Raan9pUJX9Rg1Pg8KXpkCHiGd7KVJQCHyjHNU9w99pnPA6sbfLiuzYbCg8Worpwl zI/44FW8oUpjyGBby+izh5Qf5/R8wnTGHhD9dNktX+Kdpf093xFlYogH7iBgrlp369/TpZ A7eQdUIRR1w1losh7qMrR6kpJeT8j/N0FT8h8Mez4PWh7WTQnm8GYLmLF1HvQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753711788; a=rsa-sha256; cv=none; b=nRns1eGPMVF2f5vG3M2soqQAmYc2RLr/neaXGyMvwzxLq9wPecYA4tPtZtid3He7zhEt6x TyrQhs9Oh2cVhwxSIeeai/5OskYnj2GGEFpa0jLo520eqUoh0kLd6TPRbqStmTUZa1ZnMH JGDi1O5SgfiJhHGKIbmTM+WLtsjGl/SxLMOed2ypgBZTFUXqorSWpyWIS0JFFHCWNQoT4y 472iPlVrKpeCTZKYBRJsY09K3CEYLshoDUsa8jqCF6lWyyJ56GyXpaCIFXC0KLlyIG8ITm EFwIf8fN+MDY2u7O27NHSpFyGoN3is+SzmaJr8ePFqWy8xBPGUkWMlZaC5Jqqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brL2g6mW9zpfx; Mon, 28 Jul 2025 14:09:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SE9lBT046724; Mon, 28 Jul 2025 14:09:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SE9lpS046722; Mon, 28 Jul 2025 14:09:47 GMT (envelope-from git) Date: Mon, 28 Jul 2025 14:09:47 GMT Message-Id: <202507281409.56SE9lpS046722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 287a5fdcd3c9 - main - ifconfig/ifbridge.c: add get_vlan_id() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 287a5fdcd3c941ce73705c664b5df4932ba3bad4 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=287a5fdcd3c941ce73705c664b5df4932ba3bad4 commit 287a5fdcd3c941ce73705c664b5df4932ba3bad4 Author: Lexi Winter AuthorDate: 2025-07-28 14:09:29 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 14:09:29 +0000 ifconfig/ifbridge.c: add get_vlan_id() This is like get_val() but takes an ether_vlanid_t* and ensures the value is a valid VLAN ID. This avoids redundant comparisons and casting when parsing VLAN IDs. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D51548 --- sbin/ifconfig/ifbridge.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 3465dc223ada..9b46cc70c409 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -79,6 +79,20 @@ get_val(const char *cp, u_long *valp) return (0); } +static int +get_vlan_id(const char *cp, ether_vlanid_t *valp) +{ + u_long val; + + if (get_val(cp, &val) == -1) + return (-1); + if (val < DOT1Q_VID_MIN || val > DOT1Q_VID_MAX) + return (-1); + + *valp = (ether_vlanid_t)val; + return (0); +} + static int do_cmd(if_ctx *ctx, u_long op, void *arg, size_t argsize, int set) { @@ -614,23 +628,13 @@ static void setbridge_untagged(if_ctx *ctx, const char *ifn, const char *vlanid) { struct ifbreq req; - u_long val; memset(&req, 0, sizeof(req)); + strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname)); - if (get_val(vlanid, &val) < 0) + if (get_vlan_id(vlanid, &req.ifbr_untagged) < 0) errx(1, "invalid VLAN identifier: %s", vlanid); - /* - * Reject vlan 0, since it's not a valid vlan identifier and has a - * special meaning in the kernel interface. - */ - if (val == 0) - errx(1, "invalid VLAN identifier: %lu", val); - - strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname)); - req.ifbr_untagged = val; - if (do_cmd(ctx, BRDGSIFUNTAGGED, &req, sizeof(req), 1) < 0) err(1, "BRDGSIFUNTAGGED %s", vlanid); } From nobody Mon Jul 28 14:34:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brLbq1WCTz638bS; Mon, 28 Jul 2025 14:35:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brLbp1s9Xz3GdH; Mon, 28 Jul 2025 14:35:02 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id gMJduyzpi5MqygOwPuETtl; Mon, 28 Jul 2025 14:35:01 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id gOwNuCWQSl5eGgOwOuhCzH; Mon, 28 Jul 2025 14:35:01 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=EO6l0EZC c=1 sm=1 tr=0 ts=68878a95 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=6gsJtrw7AAAA:8 a=EkcXrb_YAAAA:8 a=zdPUvaFGAAAA:8 a=hF2rLc1pAAAA:8 a=wdBCWTejAAAA:8 a=YxBL1-UpAAAA:8 a=Ej7iOXXI3qwOJxRcbfkA:9 a=CjuIK1q_8ugA:10 a=pJONDuH_yeJkak6KR8-4:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=fvD0gfNcX4AKPV7IvcuC:22 a=O9OM7dhJW_8Hj9EqqvKN:22 a=E6RPhFkzuBHyj9NHzc04:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 50485518; Mon, 28 Jul 2025 07:34:59 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 48E7D481; Mon, 28 Jul 2025 07:34:59 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Rick Macklem cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default In-reply-to: References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> Comments: In-reply-to Rick Macklem message dated "Mon, 28 Jul 2025 06:54:05 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 28 Jul 2025 07:34:59 -0700 Message-Id: <20250728143459.48E7D481@slippy.cwsent.com> X-CMAE-Envelope: MS4xfMWd+c5fBbAqIvz6G6gNDAgHw82fohOwz58ZO/4jrrofIG0hScS+16wU9JvAk0AcSoXH8UNY7YZ/DPpSZvELyCLMMtVRmRassRwE1y2dyi2VAG/s/drQ +uz8BmlLkU9XJzFzUDUF50rbtJw0m8VEYdHs/bT7kTBM1LIZvGg/mhDaimhurLZsPxYugTudOeyIFmCArRA2KzKc2v/dMTpByEZvVGbKPCDaurWCEBWHQJR3 mi+pF78cQXezZn9GAyJWsBgoUCY4SUjADBpCKkrjnoVAPEX/RXyhQ+103jaEnrH/NPqj7eEL//AaXsmBWNhe6VB7NMtCtPVX0eR1n+4Qe8frgFq0UpeHcqxA zVv4CcDK2mrTMAg8zI4l3FveI1IhI10IF35GIMDRK789pGNmu3vfFZoU2NDwLJ8Zic+KzAy+ X-Spamd-Result: default: False [-1.55 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_LONG(-0.75)[-0.754]; MV_CASE(0.50)[]; RWL_MAILSPIKE_EXCELLENT(-0.40)[3.97.99.33:from]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[8]; R_DKIM_NA(0.00)[]; TAGGED_RCPT(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4brLbp1s9Xz3GdH X-Spamd-Bar: - In message , Rick Macklem writes: > On Mon, Jul 28, 2025 at 1:20=E2=80=AFAM Konstantin Belousov l.com> 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. > > > > On Sun, Jul 27, 2025 at 08:26:03PM -0700, Rick Macklem wrote: > > > On Tue, Jul 22, 2025 at 9:00=E2=80=AFAM Cy Schubert ert.com> wrote: > > > > > > > > CAUTION: This email originated from outside of the University of Guel= > ph. 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 ITh= > elp@uoguelph.ca. > > > > > > > > In message , Konstantin Belousov writes= > : > > > > > On Mon, Jul 21, 2025 at 07:46:45AM -0700, Cy Schubert wrote: > > > > > > In message <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org>, Je= > ssica > > > > > > Clarke w > > > > > > rites: > > > > > > > On 21 Jul 2025, at 15:10, Cy Schubert wrote: > > > > > > > >=3D20 > > > > > > > > The branch main has been updated by cy: > > > > > > > >=3D20 > > > > > > > > URL: =3D > > > > > > > https://cgit.FreeBSD.org/src/commit/?id=3D3Dc7da9fb90b0b6385e99= > bb7747476359 > > > > > b=3D > > > > > > > 712993fa > > > > > > > >=3D20 > > > > > > > > commit c7da9fb90b0b6385e99bb7747476359b712993fa > > > > > > > > Author: Cy Schubert > > > > > > > > AuthorDate: 2025-07-19 14:11:18 +0000 > > > > > > > > Commit: Cy Schubert > > > > > > > > CommitDate: 2025-07-21 14:07:22 +0000 > > > > > > > >=3D20 > > > > > > > > KRB5: Enable MIT KRB5 by default > > > > > > > >=3D20 > > > > > > > > Set WITH_MITKRB5=3D3Dyes as the default. > > > > > > > >=3D20 > > > > > > > > Rebuild all USES=3D3Dgssapi ports is recommended. > > > > > > > >=3D20 > > > > > > > > A clean buildworld is required. > > > > > > > > > > > > > > That=3DE2=3D80=3D99s going to be quite annoying and cause a lot= > of issues =3D > > > > > > > given > > > > > > > WITH_CLEAN is now the default. Can we do something in depend-cl= > eanup.sh > > > > > > > to delete everything from the obj tree that needs to be rebuilt= > if we > > > > > > > detect the wrong kerberos implementation was previously built? > > > > > > > > > > > > All binaries that depend on any kerberos libraries must be rebuil= > t. > > > > > > WITHOUT_CLEAN will fail at various spots. Meta mode should take c= > are of > > > > > > this for us. > > > > > Does the statement mean that ABI for the base libraries was broken? > > > > > If yes, and the new libs have the same name as the old, we must bum= > p > > > > > dso versions. > > > > > > > > Three new libs have the same names. Most don't. The three with the sa= > me > > > > names are libkrb5, libgssapi_krb5 and libcom_err. > > > > > > > > libgssapi_krb5 is a merge of the Heimdal libgssapi_* files. For examp= > le, > > > > there is no libgssapi_spnego in MIT. > > > > > > > > The libcom_err contains the same but updated MIT functions. > > > > > > > > libkrb5 removes Heimdal-only functions. > > > > > > > > There is no libasn1 nor libroken in MIT. > > > > > > > > The differences are outlined at https://k5wiki.kerberos.org/wiki/Samb= > a%27s_u > > > > se_of_Heimdal_symbols,_with_MIT_differences. > > > I know diddly about how libraries are handled, but is it possible to pu= > t the > > > old Heimdal 1.5.2 libraries somewhere (semi-private) under different na= > mes? > > > > > > I ask because it is going to be very difficult to port the gssd to the > > > new libraries. > > > > > > The problem is that the KGSSAPI code assumes some stuff very specific > > > to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you'll see > > > what I mean. (There's code that parses the keys etc out of the internal= > ly > > > generated tokens. I have no idea where to even find the information on > > > how/where the MIT code hides this stuff and it a large part of krb5_mec= > h.c > > > looks like it will have to be re-written to work with the MIT libraries= > .) > > > > It might be better to extract the required bits and keep just them. > > Perhaps even moving that bits from vendor to FreeBSD-owned code area. > > > > I do not think that keeping large pieces of code in vendor without update= > s > > is a good plan. > I will work on it. I just cannot guarantee timing. > > The next step to getting the gssd to work with MIT is finding the MIT > structure that gss_ctx_id_t refers to. If that structure isn't a lot > different than the Heimdal one, the conversion shouldn't be too bad. > (I'll start on that to-day.) > > I understand that this does need to be upgraded. > It is unfortunate that the KGSSAPI code is wired specifically for > Heimdal. (Another approach would be to add a new upcall to the > gssd daemon to extract the keys and then, hopefully, a kerberos > library call could be used instead of having a "home rolled" > chunk of code in the kernel that has to be updated whenever > the structure returned by the library call changes.) I agree. We should isolate the kerberos data structures from the kernel as much as possible to allow us to quickly pivot to a new Kerberos, whether it be MIT, Heimdal or something else. I notice Linux uses the GSSAPI proxy. I'll bring that into ports. I don't know whether we need that here or not -- probably not. And adding an additional daemon between the KDC and the kernel isn't my preference ATM. > > I didn't realize this existed until yesterday when I bumped > into it while debugging the kerberized NFS mount. I didn't think the the contexts were that different. > > If you glance at krb5_import() in sys/kgssapi/krb5/krb5_mech.c, > you'll see how messy this could get. gssd should share its own data structure with the kernel rather. This externalizes any mapping or conversion of the context into one that provides the kernel a static interface (as much as possible). -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 > > rick From nobody Mon Jul 28 14:37:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brLfB31skz638lP; Mon, 28 Jul 2025 14:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brLfB2Nmpz3HRH; Mon, 28 Jul 2025 14:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753713426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=drFonV+36YPBdy4kM1J9BRxwcTxIipVI3LKq2oqDDzs=; b=xiD18DHfiRRC0kZ64QWx4swe3ESu4Z3AF1dZbrOgfqJk9CnZsQdOZbBw9Ga7I+MwNeX9C3 Ej/QJR63hY+2MprPhkL3/ubRXrQDod2qrKcvQkRKSmn2FXCEtciJPfhxOqVaA29YReLBc0 BBolY4CVDkxBQHU5RAWPhtTxomlUevCLI1eoxGA3ZNHtXKWqrss1KkY9r2shXW1NJ4zpjk c9uxerrpQZm7TKTUcgPAySMvZlVt9Rv++Pc5BKVdPqLyxXKkWsdR7b1CJZPSxBHtKL4oY9 JZtUE8AzeX1071KzVQllqe6mnHb6U3H4aDT7LDDeiIK2neqbS0ZzRtp1GKkP+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753713426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=drFonV+36YPBdy4kM1J9BRxwcTxIipVI3LKq2oqDDzs=; b=DZBL4z881eJzInrD6SsWgc8fSjWxJYAtTq1vjMoI5ALScmVLDyiReepBqxchKW5xYjlFa2 nhysN86A2fHAIVE3E9Cq0PKrTzJAdiV3vMmgE34BFve6J3jgdf01mKIzZgP8c6yQNap5UC 7CFyyhsxxy4MOCROq3DwN+nVVvqUNZmwSIeJQ66C9rdgkgtZIAVC8WGqfmTfL0+Q8Hm4LG JNX7NfgRhPHi12KUhCMhJPrn1GLG3zmiZePsmGQ5v56w8NbWsigvjH52TOFwTlnNPsq3Ay GC66IpMGFSOIIMg/KVoXaxoEZ9SbSoFWCIPVySGzDH9ppcJee/o/WLLBPE1sxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753713426; a=rsa-sha256; cv=none; b=LwMzMil70Z+gs0+yDNFbIXl30Umhb3XMQtf5WRpr7UtOfEG8EALyA1KOuwCySUt6a0KEmk fSg9cWDKqetj45Ek+zQQzgjVSGhMwVMfJVNsxhCclMiMnlZI2HCeyEu2q9qt5PM8eEG9YE rhUilRESPYm7f62FqoUW9TOiVaJZ59CDkwE4Ln7oJ1HioPDmnJcO1aMfZXP6C+b8ZhIzIo PbMk8nKFbGYDcWGnpFKDR/PeY5zv3R1zlGpvhwkQyff50QTAN/8xD60xEQnVbZs8SOrZoD GLPMKNdnOg90gR9eZtk09GNN1eoq3Py78WgG7nApetbftWyK60NwcO/6ur0myw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brLfB1t8Mzq6f; Mon, 28 Jul 2025 14:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SEb6qO001309; Mon, 28 Jul 2025 14:37:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SEb6WE001306; Mon, 28 Jul 2025 14:37:06 GMT (envelope-from git) Date: Mon, 28 Jul 2025 14:37:06 GMT Message-Id: <202507281437.56SEb6WE001306@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: 9c52600a5a15 - main - if_ovpn: support floating clients List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 9c52600a5a150117b4396df3b868cf2516e1674c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9c52600a5a150117b4396df3b868cf2516e1674c commit 9c52600a5a150117b4396df3b868cf2516e1674c Author: Kristof Provost AuthorDate: 2025-07-22 12:50:52 +0000 Commit: Kristof Provost CommitDate: 2025-07-28 14:36:54 +0000 if_ovpn: support floating clients If a client changes its IP address notify userspace of this. The UDP filtering function supplies the remote IP address, so we check if the address changed there. If so, we tag the packet with the new address. Once the packet is decrypted (and as part of that, has had its signature checked) we can commit to the address change. Take the write lock and notify userspace of the change. Reviewed by: markj MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D51468 --- sys/net/if_ovpn.c | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++- sys/net/if_ovpn.h | 1 + sys/sys/mbuf.h | 1 + 3 files changed, 194 insertions(+), 1 deletion(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 853a0556a080..fdbf70465338 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -131,6 +131,9 @@ struct ovpn_notification { /* Delete notification */ enum ovpn_del_reason del_reason; struct ovpn_peer_counters counters; + + /* Float notification */ + struct sockaddr_storage address; }; struct ovpn_softc; @@ -195,6 +198,10 @@ struct ovpn_softc { struct epoch_context epoch_ctx; }; +struct ovpn_mtag { + struct sockaddr_storage addr; +}; + static struct ovpn_kpeer *ovpn_find_peer(struct ovpn_softc *, uint32_t); static bool ovpn_udp_input(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); @@ -206,6 +213,8 @@ static void ovpn_free_kkey_dir(struct ovpn_kkey_dir *); static bool ovpn_check_replay(struct ovpn_kkey_dir *, uint32_t); static int ovpn_peer_compare(const struct ovpn_kpeer *, const struct ovpn_kpeer *); +static bool ovpn_sockaddr_compare(const struct sockaddr *, + const struct sockaddr *); static RB_PROTOTYPE(ovpn_kpeers, ovpn_kpeer, tree, ovpn_peer_compare); static RB_GENERATE(ovpn_kpeers, ovpn_kpeer, tree, ovpn_peer_compare); @@ -283,6 +292,43 @@ ovpn_peer_compare(const struct ovpn_kpeer *a, const struct ovpn_kpeer *b) return (a->peerid - b->peerid); } +static bool +ovpn_sockaddr_compare(const struct sockaddr *a, + const struct sockaddr *b) +{ + if (a->sa_family != b->sa_family) + return (false); + MPASS(a->sa_len == b->sa_len); + + switch (a->sa_family) { + case AF_INET: { + const struct sockaddr_in *a4, *b4; + + a4 = (const struct sockaddr_in *)a; + b4 = (const struct sockaddr_in *)b; + + if (a4->sin_port != b4->sin_port) + return (false); + + return (a4->sin_addr.s_addr == b4->sin_addr.s_addr); + } + case AF_INET6: { + const struct sockaddr_in6 *a6, *b6; + + a6 = (const struct sockaddr_in6 *)a; + b6 = (const struct sockaddr_in6 *)b; + + if (a6->sin6_port != b6->sin6_port) + return (false); + + return (memcmp(&a6->sin6_addr, &b6->sin6_addr, + sizeof(a6->sin6_addr)) == 0); + } + default: + panic("Unknown address family %d", a->sa_family); + } +} + static struct ovpn_kpeer * ovpn_find_peer(struct ovpn_softc *sc, uint32_t peerid) { @@ -394,6 +440,44 @@ ovpn_nvlist_to_sockaddr(const nvlist_t *nvl, struct sockaddr_storage *sa) return (0); } +static int +ovpn_add_sockaddr(nvlist_t *parent, const char *name, const struct sockaddr *s) +{ + nvlist_t *nvl; + + nvl = nvlist_create(0); + if (nvl == NULL) + return (ENOMEM); + + nvlist_add_number(nvl, "af", s->sa_family); + + switch (s->sa_family) { + case AF_INET: { + const struct sockaddr_in *s4 = (const struct sockaddr_in *)s; + + nvlist_add_number(nvl, "port", s4->sin_port); + nvlist_add_binary(nvl, "address", &s4->sin_addr, + sizeof(s4->sin_addr)); + break; + } + case AF_INET6: { + const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *)s; + + nvlist_add_number(nvl, "port", s6->sin6_port); + nvlist_add_binary(nvl, "address", &s6->sin6_addr, + sizeof(s6->sin6_addr)); + break; + } + default: + nvlist_destroy(nvl); + return (EINVAL); + } + + nvlist_move_nvlist(parent, name, nvl); + + return (0); +} + static void ovpn_notify_del_peer(struct ovpn_softc *sc, struct ovpn_kpeer *peer) { @@ -446,6 +530,33 @@ ovpn_notify_key_rotation(struct ovpn_softc *sc, struct ovpn_kpeer *peer) } } +static int +ovpn_notify_float(struct ovpn_softc *sc, uint32_t peerid, + const struct sockaddr_storage *remote) +{ + struct ovpn_notification *n; + + n = malloc(sizeof(*n), M_OVPN, M_NOWAIT | M_ZERO); + if (n == NULL) + return (ENOMEM); + + n->peerid = peerid; + n->type = OVPN_NOTIF_FLOAT; + memcpy(&n->address, remote, sizeof(n->address)); + + if (buf_ring_enqueue(sc->notifring, n) != 0) { + free(n, M_OVPN); + return (ENOMEM); + } else if (sc->so != NULL) { + /* Wake up userspace */ + sc->so->so_error = EAGAIN; + sorwakeup(sc->so); + sowwakeup(sc->so); + } + + return (0); +} + static void ovpn_peer_release_ref(struct ovpn_kpeer *peer, bool locked) { @@ -1377,12 +1488,36 @@ opvn_get_pkt(struct ovpn_softc *sc, nvlist_t **onvl) } nvlist_add_number(nvl, "peerid", n->peerid); nvlist_add_number(nvl, "notification", n->type); - if (n->type == OVPN_NOTIF_DEL_PEER) { + switch (n->type) { + case OVPN_NOTIF_DEL_PEER: { nvlist_add_number(nvl, "del_reason", n->del_reason); /* No error handling, because we want to send the notification * even if we can't attach the counters. */ ovpn_notif_add_counters(nvl, n); + break; + } + case OVPN_NOTIF_FLOAT: { + int ret; + + ret = ovpn_add_sockaddr(nvl, "address", + (struct sockaddr *)&n->address); + + if (ret) { + /* + * Try to re-enqueue the notification. Maybe we'll + * have better luck next time. No error handling, + * because if we fail to re-enqueue there's nothing we can do. + */ + (void)ovpn_notify_float(sc, n->peerid, &n->address); + nvlist_destroy(nvl); + free(n, M_OVPN); + return (ret); + } + break; + } + default: + break; } free(n, M_OVPN); @@ -1538,6 +1673,7 @@ ovpn_finish_rx(struct ovpn_softc *sc, struct mbuf *m, struct rm_priotracker *_ovpn_lock_trackerp) { uint32_t af; + struct m_tag *mtag; OVPN_RASSERT(sc); NET_EPOCH_ASSERT(); @@ -1556,6 +1692,38 @@ ovpn_finish_rx(struct ovpn_softc *sc, struct mbuf *m, OVPN_RUNLOCK(sc); + /* Check if the peer changed to a new source address. */ + mtag = m_tag_find(m, PACKET_TAG_OVPN, NULL); + if (mtag != NULL) { + struct ovpn_mtag *ot = (struct ovpn_mtag *)(mtag + 1); + + OVPN_WLOCK(sc); + + /* + * Check the address against the peer's remote again, because we may race + * against ourselves (i.e. we may have tagged multiple packets to indicate we + * floated). + */ + if (ovpn_sockaddr_compare((struct sockaddr *)&ot->addr, + (struct sockaddr *)&peer->remote)) { + OVPN_WUNLOCK(sc); + goto skip_float; + } + + /* And notify userspace. */ + if (ovpn_notify_float(sc, peer->peerid, &ot->addr) == 0) { + /* + * Update the 'remote' for this peer, but only if + * we've actually enqueued the notification. + * Otherwise we can try again later. + */ + memcpy(&peer->remote, &ot->addr, sizeof(peer->remote)); + } + + OVPN_WUNLOCK(sc); + } + +skip_float: OVPN_COUNTER_ADD(sc, received_data_pkts, 1); OVPN_COUNTER_ADD(sc, tunnel_bytes_received, m->m_pkthdr.len); OVPN_PEER_COUNTER_ADD(peer, pkt_in, 1); @@ -2318,6 +2486,29 @@ ovpn_udp_input(struct mbuf *m, int off, struct inpcb *inp, return (true); } + /* + * If we got this from a different address than we expected tag the packet. + * We'll deal with notifiying userspace later, after we've decrypted and + * verified. + */ + if (! ovpn_sockaddr_compare((struct sockaddr *)&peer->remote, sa)) { + struct m_tag *mt; + struct ovpn_mtag *ot; + + MPASS(sa->sa_len <= sizeof(ot->addr)); + mt = m_tag_get(PACKET_TAG_OVPN, sizeof(*ot), M_NOWAIT); + /* + * If we fail to allocate here we'll just try again on the next + * packet. + */ + if (mt != NULL) { + ot = (struct ovpn_mtag *)(mt + 1); + memcpy(&ot->addr, sa, sa->sa_len); + + m_tag_prepend(m, mt); + } + } + if (key->decrypt->cipher == OVPN_CIPHER_ALG_NONE) { /* Now remove the outer headers */ m_adj_decap(m, sizeof(struct udphdr) + ohdrlen); diff --git a/sys/net/if_ovpn.h b/sys/net/if_ovpn.h index 2d6b8c1e7eff..2a24c35788a9 100644 --- a/sys/net/if_ovpn.h +++ b/sys/net/if_ovpn.h @@ -37,6 +37,7 @@ enum ovpn_notif_type { OVPN_NOTIF_DEL_PEER, OVPN_NOTIF_ROTATE_KEY, + OVPN_NOTIF_FLOAT, }; enum ovpn_del_reason { diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index c75094aea450..304bd019c9fc 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1391,6 +1391,7 @@ extern bool mb_use_ext_pgs; /* Use ext_pgs for sendfile */ #define PACKET_TAG_PF_REASSEMBLED 31 #define PACKET_TAG_IPSEC_ACCEL_OUT 32 /* IPSEC accel out */ #define PACKET_TAG_IPSEC_ACCEL_IN 33 /* IPSEC accel in */ +#define PACKET_TAG_OVPN 34 /* if_ovpn */ /* Specific cookies and tags. */ From nobody Mon Jul 28 14:37:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brLfC3rtHz638T0; Mon, 28 Jul 2025 14:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brLfC2v2nz3HFd; Mon, 28 Jul 2025 14:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753713427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=plrsGxFNnaCnGr2ZaasGzfgXRcYq7Bi6IfR6G0E5bjQ=; b=DalZSf+X4uQQQhM8X56Fb+TJ6+ZV6pTcAamM6y6sEUrAWKaf8qwYXgGjVRODZbeIIomqSG 3lxRTKgB1oF/75K4jzerQjNYmlU56Uk4pB7UD1xA0IVEGHIePDcXroHRn7GUZo4C+zXLlI c/NaCDz6xVtzRGHWV3OdyKNX1ALOBBKiU/IyNR+KNFG/NWi49g9MCqpWhLl61gRBCa1rGH lesw+p8pcf40CmqqPsSThKiH5q+o7rIH6p5v81zzqwzPtn66KEPkRjTOL/N/R9S8YCsxFk wWDXKcEAM/PlsUSfMlTryIFuFigKW4nakzPyU8u8nhyDhcRgg90LFsZDc9/K/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753713427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=plrsGxFNnaCnGr2ZaasGzfgXRcYq7Bi6IfR6G0E5bjQ=; b=YUF1LiajVz+J5oavJT0ctk9vS4nWAUK7VCWjJFgoQuR+rZ/VsSLnT8impAHAenK9GV35F6 NBoBv+sbsnZjF6vPxo+5t4hGRhLxIXqoS5lT7xkp0Wvg5+WUMmDRCf7yYKuFmrMoJ8wuig 4f6/ypguav0x5ikAxl+H6X8HWBcfhdZyrqSvZkaPwiS/gCseM9OIfQzSGWmXyEQ0iWHXad KD4QsBTIQ6duS+2pNByEQ35rWVz4DUlzvowZhTeVxPi8JtCm9cCu+6BKgtdCDqnHD0hv+X eEAn2mS/qyjCIv4c88guw/RwjydwJrL6HYMOobf8S4bje+HQDHJPq5CyDQxoGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753713427; a=rsa-sha256; cv=none; b=ag1VJ2qloGaYiDoXa0FbVV1y8EktKbQr3X25L+F5DY71alK2YYL1xq+E0/qQbkU7FFMN27 Sicdo47hYDcvct8xWLD7hxUhxf40y3GvhT+NezLfMwwhdS3faQffCgb6C72BVHcP6z0xSd ZsPNLl4B0yQdOM30ct4OEmZ9YYwb73d0roJqhOg01JEaON1jPfOfsZwyNdI81kzkBZrUBw r9o9Q0rOnWd0VtllZxvtMVW75hsCw8WfBgCeYsT6wPhOBFhyjSj/aYWCvcbugNks2pOp4p NafXgmMww9IINXRv2YfYTklxF2fgW0QHrEVvXmGfGh6FfK4hu/JjIsSqNqqdcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brLfC2TgNzq6g; Mon, 28 Jul 2025 14:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SEb7PT001344; Mon, 28 Jul 2025 14:37:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SEb7p3001341; Mon, 28 Jul 2025 14:37:07 GMT (envelope-from git) Date: Mon, 28 Jul 2025 14:37:07 GMT Message-Id: <202507281437.56SEb7p3001341@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: ad1b5df8884c - main - if_ovpn tests: basic float test case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad1b5df8884c0fd7d265526a4980c1fd9c67fb90 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ad1b5df8884c0fd7d265526a4980c1fd9c67fb90 commit ad1b5df8884c0fd7d265526a4980c1fd9c67fb90 Author: Kristof Provost AuthorDate: 2025-07-22 16:20:56 +0000 Commit: Kristof Provost CommitDate: 2025-07-28 14:36:54 +0000 if_ovpn tests: basic float test case Reviewed by: markj MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D51469 --- tests/sys/net/if_ovpn/if_ovpn.sh | 91 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index 26807a095455..c42344da1a3b 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -1314,6 +1314,96 @@ multihome6_cleanup() ovpn_cleanup } +atf_test_case "float" "cleanup" +float_head() +{ + atf_set descr 'Test peer float notification' + atf_set require.user root +} + +float_body() +{ + ovpn_init + + l=$(vnet_mkepair) + + vnet_mkjail a ${l}a + jexec a ifconfig ${l}a 192.0.2.1/24 up + jexec a ifconfig lo0 127.0.0.1/8 up + vnet_mkjail b ${l}b + jexec b ifconfig ${l}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore jexec a ping -c 1 192.0.2.2 + + ovpn_start a " + dev ovpn0 + dev-type tun + proto udp4 + + cipher AES-256-GCM + auth SHA256 + + local 192.0.2.1 + server 198.51.100.0 255.255.255.0 + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/server.crt + key $(atf_get_srcdir)/server.key + dh $(atf_get_srcdir)/dh.pem + + mode server + script-security 2 + auth-user-pass-verify /usr/bin/true via-env + topology subnet + + keepalive 2 10 + + management 192.0.2.1 1234 + " + ovpn_start b " + dev tun0 + dev-type tun + + client + + remote 192.0.2.1 + auth-user-pass $(atf_get_srcdir)/user.pass + + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/client.crt + key $(atf_get_srcdir)/client.key + dh $(atf_get_srcdir)/dh.pem + + keepalive 2 10 + " + + # Give the tunnel time to come up + sleep 10 + + atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1 + + # We expect the client on 192.0.2.2 + if ! echo "status" | jexec a nc -N 192.0.2.1 1234 | grep 192.0.2.2; then + atf_fail "Client not found in status list!" + fi + + # Now change the client IP + jexec b ifconfig ${l}b 192.0.2.3/24 up + + # And wait for keepalives to trigger the float notification + sleep 5 + + # So the client now has the new address in userspace + if ! echo "status" | jexec a nc -N 192.0.2.1 1234 | grep 192.0.2.3; then + atf_fail "Client not found in status list!" + fi +} + +float_cleanup() +{ + ovpn_cleanup +} + atf_init_test_cases() { atf_add_test_case "4in4" @@ -1332,4 +1422,5 @@ atf_init_test_cases() atf_add_test_case "destroy_unused" atf_add_test_case "multihome4" atf_add_test_case "multihome6" + atf_add_test_case "float" } From nobody Mon Jul 28 14:56:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brM461vX1z639RB; Mon, 28 Jul 2025 14:56:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brM460H7Kz3M26; Mon, 28 Jul 2025 14:56:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L/5t6vNgju7JulKWRoCVDUdlJi48RT0RbTAezHVRR/w=; b=Op64JIQ76EspHKPTYtnaz0yqej/87gyvDeDEtVD0/2bXZCceI4S7uFE1Byfo+RWevldBda wZX3xM7glcE41Iz67QgST02VVTB8bK1WrgBZrxxu1JtjPQ1Y+Kw7Wc+eEySHERO9JCQsZ4 jCeFT3flk/egYGOgoxNcfc3bMomrVNpfU0QS3XoCGR4HRyMyNYskW2jtS3rgevpqXtmA9V Fa6dsmGW8kT2w8mz7vRs7hErHuU4JzI4pFTtFNpSBN6+j1FMsq/UHbnU3ATLNKQZBZR/6k 332vrQqbnUhysBhghQo44tpAOv1ZvMin7d5Ikqrq7Xn/LNpNuDuq0LVPUK3dJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L/5t6vNgju7JulKWRoCVDUdlJi48RT0RbTAezHVRR/w=; b=OmYwePNqXea90F9XZ0Ms/tXGt6o/fica59w0KcKYeO5rGQ0b9vdi2aQZ4X4sNNrr6jF/IL SN71S0iRAaTt88edfOm9jK0Q4mAvGNbydDMH9mWJXdythlpk2S888NiAmUPiCDM8xyIqlW XLEVmuZi4ceu8RDsCbd8lmucn8pi3eE663BdZCRXdOxg+zePdIeKpZUxsRkCMO4Tk9OwWr CpZKSYMqm4oHXw7PLyH3TSPqxrynOXqrQnRXj/4r4U24lGR8zRJ3Xua3FN+J+JXe14Z41O 2r4oh+r4Ga3Tm/vyXmZc2DjbEOg8EJmvyv3oCReH5i/KHFmfZx/mJYsZlo/O+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753714566; a=rsa-sha256; cv=none; b=DlPTk2Z5Oh1Aw23W6xEVmcj1s3zhN5dDRgCm1jhD9cKR2ngaxUchJEna50+FjukPHiOAkM ujXc7XouEnFi0y7IVJ5zTqpM5wwDtC/XNqsfKXa+CB6e3IbflRPjZzFzSEijfwDPyX7Set zIlZ2mHC5ZEGsUSbeIkqcc5TLdyorhZEYoyT7/Yv/dqO+2Iy9BEfmTpztlrG0Gz60mejcd hQ2CVA+soKuufRzBbGy7e5mXohxMQpcxE0JClL8Rj6h/x6SF+0/cy6HW6TKe1Cq6gE8W8r 9lsf4SoZM+71eZx0hzBgaXo/ulnrKb0FapktdiztWaMkjAgIBeWBCbAvpKF3iA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brM456MS9zqsh; Mon, 28 Jul 2025 14:56:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SEu5Fi039126; Mon, 28 Jul 2025 14:56:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SEu5LK039123; Mon, 28 Jul 2025 14:56:05 GMT (envelope-from git) Date: Mon, 28 Jul 2025 14:56:05 GMT Message-Id: <202507281456.56SEu5LK039123@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: 45c3fa9897f1 - main - ice: Fix aarch64 LINT 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 45c3fa9897f1fa9babe5b43bc4bf73eaf583e45a Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=45c3fa9897f1fa9babe5b43bc4bf73eaf583e45a commit 45c3fa9897f1fa9babe5b43bc4bf73eaf583e45a Author: Dag-Erling Smørgrav AuthorDate: 2025-07-28 14:54:20 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-28 14:55:39 +0000 ice: Fix aarch64 LINT kernel Fixes: bc761988b724 (cherry picked from commit 3630e74d8d1c8a068478a4457f825e4efc2b77f0) --- sys/conf/files.arm64 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 901da27e63f2..641001efab5e 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -368,6 +368,10 @@ dev/ice/irdma_di_if.m optional ice pci \ compile-with "${NORMAL_M} -I$S/dev/ice" dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iov.c optional ice pci pci_iov \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_vf_mbx.c optional ice pci pci_iov \ + compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032900 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ From nobody Mon Jul 28 14:58:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brM6Z57bgz639SY; Mon, 28 Jul 2025 14:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brM6Z4Fg8z3MDC; Mon, 28 Jul 2025 14:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xsVMih6fwQzbiP6krjr7RTlLb8IPELboVvwjvwu3FYA=; b=QAR4UzOZFqy40ZTrBA6MGVu6YAR/CDqvpLepDHXTrpHYTl6NoLkHu6k5vvWzTittqErhmK N4cK/I417lqYHl2rH1g13tyVRyC6CSRVKDEmqBKWrw++jKPmkqYsW9ev/eEZxlHZccUaz0 PRE7L3WHm6HNjcDkB/NpAb+7s2TDBmVnIc69XmeZXbd+JKLXrVK6/GRkDtStH2XSj6YEdX OdrQF3AyAt2sJD53xj3L8dFpNsD3SS29r7xD37UTPZLYy38JuU2Sm0aTxtOguoJCkQYHyS tUb4QMzz8xgySET0foFpKleri1ih4jH5+qRvnqiV/BMzbAaHieg0kiT1cA9NFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xsVMih6fwQzbiP6krjr7RTlLb8IPELboVvwjvwu3FYA=; b=FctEvuSbsaP+MOWdY/yxAPndGozpWSsUjOnefkYmWYjn7oknFy228cJUcVFkgDpGNEEgsh oDZzReqI8if4WGDJrMnPBPelqwzIyk94T0acIIhE06ySPG7K6TcQCOt4wtAwz7DDP/kJtz Vs0tq55lNIhNCw8aohfSTKYFjZ2GEcKxYy+vkolG+KyLuCR3Mdylqow9yJHxh3vVZsdJwi keUsi13wi4ECaLe5FYz1jorjByIOf+YW/1tJ06Bgnu8laFhl07SJZdVPNzXtN2vNTl3oun fqogjWWTNspESvJZcG4dvn01nEDmhpCHmkXODPdvr1n8ElFYHcdddIZvu20Scg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753714694; a=rsa-sha256; cv=none; b=gkRtXtxPGVBn3+17CvJwZoflZk6BhQ06+y77uxTeKIiioZdfvpf4FWt6l9dta9uImCjh1i ljrKvTH+P9ZU9p1ZBZt4kahPZWBO4V+q2pPoc8bYG3slnySg29ujtfeJ0tT1H/M4xvU5YH 3MevyPSOBbkkzViWHdHj7FdVqFNW8b9/IVpH1tOBrcdGQHENseLBVrGaapLkM0kO0m3vRS hrm1yWNbncYLOXOVVUo4lfwMdN9tumS0b3Dg7fECcDACivJjstZzb5do0H7/55qoraBSe8 Os+NLRjSqfeXP/FnEvq1tHOz6BQSvwVvMubV/vrdXuUDjYkFXBUMKasznFByPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brM6Z39FFzqF0; Mon, 28 Jul 2025 14:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SEwE8q039880; Mon, 28 Jul 2025 14:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SEwEv1039877; Mon, 28 Jul 2025 14:58:14 GMT (envelope-from git) Date: Mon, 28 Jul 2025 14:58:14 GMT Message-Id: <202507281458.56SEwEv1039877@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: e958bc1c1337 - main - tools/boot/rootgen: Remove stray zfsboot1 from ZFS + MBR + UEFI function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e958bc1c13377767d9b2cf87d072d923aa3d482a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e958bc1c13377767d9b2cf87d072d923aa3d482a commit e958bc1c13377767d9b2cf87d072d923aa3d482a Author: John Baldwin AuthorDate: 2025-07-28 14:55:07 +0000 Commit: John Baldwin CommitDate: 2025-07-28 14:58:02 +0000 tools/boot/rootgen: Remove stray zfsboot1 from ZFS + MBR + UEFI function This was copy-pasted from the ZFS + MBF + BIOS function, but without the corresponding code to extract zfsboot1 from /boot/zfsboot via dd(1). It's also not necessary since UEFI booting doesn't make use of BSD label boot blocks (note the lack of any -b option to mkimg when generating the BSD partition in mk_nogeli_mbr_ufs_uefi()). Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D51544 --- tools/boot/rootgen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/boot/rootgen.sh b/tools/boot/rootgen.sh index d87eb481e2c1..32007a46802e 100755 --- a/tools/boot/rootgen.sh +++ b/tools/boot/rootgen.sh @@ -244,7 +244,7 @@ mk_nogeli_mbr_zfs_uefi() { makefs -t zfs -s 200m \ -o poolname=${pool} -o bootfs=${pool} -o rootpath=/ \ ${img}.s2a ${src} ${dst} - mkimg -s bsd -b ${dst}zfsboot1 -p freebsd-zfs:=${img}.s2a -o ${img}.s2 + mkimg -s bsd -p freebsd-zfs:=${img}.s2a -o ${img}.s2 mkimg -a 1 -s mbr -b ${src}/boot/mbr -p efi:=${img}.s1 -p freebsd:=${img}.s2 -o ${img} rm -rf ${dst} } From nobody Mon Jul 28 14:58:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brM6b5hx6z6397w; Mon, 28 Jul 2025 14:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brM6b50TDz3MGY; Mon, 28 Jul 2025 14:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K70NAyu+glGj8+occt1FrFuFRNmJnZm7BInxBGlYm1g=; b=pifrISHW2Cnhx6gL2la8PqjrIn6/9VEGjYIUdzYJcQmY3qLmQCwizDT/ST6MlTAdPnDl/3 ICisGJ/MG5wgNRo36rzF1WWoFwGXp8GcutiXTcHWHttGISOn/xD/5gV/T9iITNTyCUtvCr a6nZ9uE9cMoSdQzoOyGtj+FpXkdCflg9stDUHLfvP0jypC7XeO3Msfy+SdEZ9oAQh8arnx PP2OLCOuIGPQ0gfxFVXOMsubQfcFGEEtMJ6gcfXP7hsvrLsBB3tVwFQPqPegq04D0chE2D QqB3WVCE6/bgLF3f2Ke0RcWb+Xr2spRJRs+6XLRwv1eTUdtDUFIOxCc3NHK7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K70NAyu+glGj8+occt1FrFuFRNmJnZm7BInxBGlYm1g=; b=KFd49YtblNeS3YnDR0m4bQ42aGLBsXgMM3Hb2r/oO7u7/N6ZHUhbNHJMeArJ8yeZvA5JJG NdsYFbsPzd7AZDlvlj/Q87+0W5WrO6YaJe5/tfZJdK/wKUwlTER6ZymkVBPjVoHHVO80pi rYg68q6Nq5WrN9E6Hr9hAVw/l5KSmgg9cGz376LIrReltlxy3Eoh2c9BqOVcVsHBQeZttf D29tkAYuYUYXarYu7t9NrGZO0mtnH636/ocRqLi+7vz+l2y6r6wDBzViADm4ZS89ULpbZs 1wfsCtMZzde/dW+vbujI1beDcA5CTHfKep1bIbb3iq4quLNHLr71nG+ANZF/8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753714695; a=rsa-sha256; cv=none; b=FDFDj9foXGB6f6jHHBU6oUwokKRMJ1zMX6k9/H6pXU0nqltLbGVOTiw9Oz2YOYRCmAa3Gf YtOn8B4mLb3fW2oL2iyt86mfgfkXEp2JTx1yfGZPWHp6QdL7/Oev3wGE7DxoVqRjI+X046 4BSN32ql4cF1hZJZ8EOfIQ26StMO7HkMun8Y91VRRA/WZ3wqAwb9pgpgCz9E4tpZnTDzCo FnniTqX+6/8K9BTwX0zUptAL5WYPJKL5fQUHk4VzsVpNmbA6nzE5b4PdjwW6rzOInk6sxD b3o82SqyoeKdf6piq2oBenMCli0qNzEJLUfuiQCYWj1h0qTfJ/SBgYskKlVYWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brM6b3VkszqT3; Mon, 28 Jul 2025 14:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SEwFhg039912; Mon, 28 Jul 2025 14:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SEwFWC039909; Mon, 28 Jul 2025 14:58:15 GMT (envelope-from git) Date: Mon, 28 Jul 2025 14:58:15 GMT Message-Id: <202507281458.56SEwFWC039909@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: a3b72d89c702 - main - zfsboot: Remove zfsboot(8) program used to boot ZFS from MBR + BIOS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: a3b72d89c7028a2254381e4d2b126416dee3fbb5 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a3b72d89c7028a2254381e4d2b126416dee3fbb5 commit a3b72d89c7028a2254381e4d2b126416dee3fbb5 Author: John Baldwin AuthorDate: 2025-07-28 14:57:16 +0000 Commit: John Baldwin CommitDate: 2025-07-28 14:58:02 +0000 zfsboot: Remove zfsboot(8) program used to boot ZFS from MBR + BIOS This has not worked since the import of OpenZFS in FreeBSD 13.0. Trying to fix it at this point would probably entail rearchitecting how it works (e.g. using a dedicated freebsd-boot slice to hold zfsboot). However, it's not really worth doing that at this point. PR: 271262 Reported by: Henryk Paluch Reviewed by: imp, emaste Relnotes: yes Differential Revision: https://reviews.freebsd.org/D51545 --- ObsoleteFiles.inc | 4 + sbin/zfsbootcfg/zfsbootcfg.8 | 8 +- stand/i386/Makefile | 2 +- stand/i386/common/bootargs.h | 2 +- stand/i386/loader/main.c | 2 +- stand/i386/zfsboot/Makefile | 92 --------- stand/i386/zfsboot/Makefile.depend | 17 -- stand/i386/zfsboot/zfsboot.8 | 130 ------------- stand/i386/zfsboot/zfsldr.S | 281 --------------------------- targets/pseudo/userland/misc/Makefile.depend | 1 - tools/boot/install-boot.sh | 23 +-- tools/boot/rootgen.sh | 63 +----- tools/build/mk/OptionalObsoleteFiles.inc | 4 - 13 files changed, 20 insertions(+), 609 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 2aa914ab089f..83fb2d3f3a2c 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20250728: zfsboot (MBR) removed +OLD_FILES+=boot/zfsboot +OLD_FILES+=usr/share/man/man8/zfsboot.8.gz + # 20250728: Machine versions of 'runq.h' do not exist anymore OLD_FILES+=usr/include/machine/runq.h diff --git a/sbin/zfsbootcfg/zfsbootcfg.8 b/sbin/zfsbootcfg/zfsbootcfg.8 index 5e7f02b2578c..3831adfc81bd 100644 --- a/sbin/zfsbootcfg/zfsbootcfg.8 +++ b/sbin/zfsbootcfg/zfsbootcfg.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 22, 2020 +.Dd July 28, 2025 .Dt ZFSBOOTCFG 8 .Os .Sh NAME @@ -44,14 +44,11 @@ is used to set .Xr boot.config 5 Ns -style options to be used by -.Xr zfsboot 8 , .Xr gptzfsboot 8 or .Xr loader 8 the next time the machine is booted. Once -.Xr zfsboot 8 -or .Xr gptzfsboot 8 or .Xr loader 8 @@ -130,8 +127,7 @@ To clear the boot options: .Xr boot.config 5 , .Xr bectl 8 , .Xr gptzfsboot 8 , -.Xr loader 8 , -.Xr zfsboot 8 +.Xr loader 8 .Sh HISTORY .Nm appeared in diff --git a/stand/i386/Makefile b/stand/i386/Makefile index 768496598575..299e070d8cd5 100644 --- a/stand/i386/Makefile +++ b/stand/i386/Makefile @@ -18,7 +18,7 @@ SUBDIR.yes+= loader_simp # special boot programs, 'self-extracting boot2+loader' SUBDIR.${MK_LOADER_PXEBOOT}+= pxeldr -SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot +SUBDIR.${MK_LOADER_ZFS}+= gptzfsboot .if defined(PXEBOOT_DEFAULT_INTERP) L=${PXEBOOT_DEFAULT_INTERP} diff --git a/stand/i386/common/bootargs.h b/stand/i386/common/bootargs.h index dafcf6a55554..072f7ee505fd 100644 --- a/stand/i386/common/bootargs.h +++ b/stand/i386/common/bootargs.h @@ -88,7 +88,7 @@ struct bootargs /* * geli_boot_data is embedded in geli_boot_args (passed from gptboot to loader) - * and in zfs_boot_args (passed from zfsboot and gptzfsboot to loader). + * and in zfs_boot_args (passed from gptzfsboot to loader). */ struct geli_boot_data { diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index fd95cf5243cf..a70b3a253b90 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -198,7 +198,7 @@ main(void) #ifdef LOADER_ZFS_SUPPORT /* - * zfsboot and gptzfsboot have always passed KARGS_FLAGS_ZFS, + * gptzfsboot has always passed KARGS_FLAGS_ZFS, * so if that is set along with KARGS_FLAGS_EXTARG we know we * can interpret the extarg data as a struct zfs_boot_args. */ diff --git a/stand/i386/zfsboot/Makefile b/stand/i386/zfsboot/Makefile deleted file mode 100644 index b619b84c368e..000000000000 --- a/stand/i386/zfsboot/Makefile +++ /dev/null @@ -1,92 +0,0 @@ -.include - -.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${BOOTSRC}/common - -FILES= zfsboot -MAN= zfsboot.8 - -BOOT_COMCONSOLE_PORT?= 0x3f8 -BOOT_COMCONSOLE_SPEED?= 115200 -B2SIOFMT?= 0x3 - -REL1= 0x700 -ORG1= 0x7c00 -ORG2= 0x2000 - -CFLAGS+=-DBOOTPROG=\"zfsboot\" \ - -O1 \ - -DBOOT2 \ - -DLOADER_GPT_SUPPORT \ - -DLOADER_MBR_SUPPORT \ - -DLOADER_ZFS_SUPPORT \ - -DLOADER_UFS_SUPPORT \ - -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ - -DSIOFMT=${B2SIOFMT} \ - -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${LDRSRC} \ - -I${BOOTSRC}/i386/common \ - -I${BOOTSRC}/i386/libi386 \ - -I${ZFSSRC} \ - -I${SYSDIR}/crypto/skein \ - -I${SYSDIR}/cddl/boot/zfs \ - -I${SYSDIR}/contrib/openzfs/include \ - -I${SYSDIR}/contrib/openzfs/include/os/freebsd/spl \ - -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs \ - -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 \ - -I${BOOTSRC}/i386/boot2 \ - -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ - -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ - -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings - -CFLAGS.part.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib - -CFLAGS.gcc+= --param max-inline-insns-single=100 - -LD_FLAGS+=${LD_FLAGS_BIN} - -CLEANFILES+= zfsboot - -zfsboot: zfsboot1 zfsboot2 - cat zfsboot1 zfsboot2 > zfsboot - -CLEANFILES+= zfsboot1 zfsldr.out zfsldr.o - -zfsboot1: zfsldr.out - ${OBJCOPY} -S -O binary zfsldr.out ${.TARGET} - -zfsldr.out: zfsldr.o - ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} zfsldr.o - -OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o misc.o -CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - ${OBJS} - -# We currently allow 256k bytes for zfsboot - in practice it could be -# any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. -# -BOOT2SIZE= 262144 - -# i386 standalone support library -LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a - -zfsboot2: zfsboot.ld - @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ - echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} bs=${BOOT2SIZE} conv=sync - -zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} - btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ - -o ${.TARGET} -P 1 zfsboot.bin - -zfsboot.ldr: - :> ${.TARGET} - -zfsboot.bin: zfsboot.out - ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} - -zfsboot.out: ${BTXCRT} ${OBJS} - ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBI386} ${LIBSA32} - -SRCS= zfsboot.c - -.include diff --git a/stand/i386/zfsboot/Makefile.depend b/stand/i386/zfsboot/Makefile.depend deleted file mode 100644 index 92ab022283fd..000000000000 --- a/stand/i386/zfsboot/Makefile.depend +++ /dev/null @@ -1,17 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/xlocale \ - lib/libmd \ - stand/i386/btx/btx \ - stand/i386/btx/lib \ - stand/libsa32 \ - stand/zfs32 \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/stand/i386/zfsboot/zfsboot.8 b/stand/i386/zfsboot/zfsboot.8 deleted file mode 100644 index a8411bc065d0..000000000000 --- a/stand/i386/zfsboot/zfsboot.8 +++ /dev/null @@ -1,130 +0,0 @@ -.\" Copyright (c) 2014 Andriy Gapon -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd March 27, 2018 -.Dt ZFSBOOT 8 -.Os -.Sh NAME -.Nm zfsboot -.Nd bootcode for ZFS on BIOS-based computers -.Sh DESCRIPTION -.Nm -is used on BIOS-based computers to boot from a filesystem in -a ZFS pool. -.Nm -is installed in two parts on a disk or a partition used by a ZFS pool. -The first part, a single-sector starter boot block, is installed -at the beginning of the disk or partition. -The second part, a main boot block, is installed at a special offset -within the disk or partition. -Both areas are reserved by the ZFS on-disk specification for boot use. -If -.Nm -is installed in a partition, then that partition should be made -bootable using appropriate configuration and boot blocks described in -.Xr boot 8 . -.Sh BOOTING -The -.Nm -boot process is very similar to that of -.Xr gptzfsboot 8 . -One significant difference is that -.Nm -does not currently support the GPT partitioning scheme. -Thus only whole disks and MBR partitions, traditionally referred to as -slices, are probed for ZFS disk labels. -See the BUGS section in -.Xr gptzfsboot 8 -for some limitations of the MBR scheme support. -.Sh USAGE -.Nm -supports all the same prompt and configuration file arguments as -.Xr gptzfsboot 8 . -.Sh FILES -.Bl -tag -width /boot/zfsboot -compact -.It Pa /boot/zfsboot -boot code binary -.It Pa /boot.config -parameters for the boot block -.Pq optional -.It Pa /boot/config -alternative parameters for the boot block -.Pq optional -.El -.Sh EXAMPLES -.Nm -is typically installed using -.Xr dd 1 . -To install -.Nm -on the -.Pa ada0 -drive: -.Bd -literal -offset indent -dd if=/boot/zfsboot of=/dev/ada0 count=1 -dd if=/boot/zfsboot of=/dev/ada0 iseek=1 oseek=1024 -.Ed -.Pp -If the drive is currently in use, the GEOM safety will prevent writes -and must be disabled before running the above commands: -.Bd -literal -offset indent -sysctl kern.geom.debugflags=0x10 -.Ed -.Pp -.Nm -can also be installed in an MBR slice: -.Bd -literal -offset indent -gpart create -s mbr ada0 -gpart add -t freebsd ada0 -gpart bootcode -b /boot/boot0 ada0 -gpart set -a active -i 1 ada0 -dd if=/dev/zero of=/dev/ada0s1 count=2 -dd if=/boot/zfsboot of=/dev/ada0s1 count=1 -dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024 -.Ed -.Pp -Note that commands to create and populate a pool are not shown -in the example above. -.Sh SEE ALSO -.Xr dd 1 , -.Xr boot.config 5 , -.Xr boot 8 , -.Xr gptzfsboot 8 , -.Xr loader 8 , -.Xr zpool 8 -.Sh HISTORY -.Nm -appeared in FreeBSD 7.3. -.Sh AUTHORS -This manual page was written by -.An Andriy Gapon Aq avg@FreeBSD.org . -.Sh BUGS -Installing -.Nm -with -.Xr dd 1 -is a hack. -ZFS needs a command to properly install -.Nm -onto a ZFS-controlled disk or partition. diff --git a/stand/i386/zfsboot/zfsldr.S b/stand/i386/zfsboot/zfsldr.S deleted file mode 100644 index cd8289f952fd..000000000000 --- a/stand/i386/zfsboot/zfsldr.S +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 1998 Robert Nordier - * All rights reserved. - * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. - * - * This software is provided "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. - */ - -/* Memory Locations */ - .set MEM_ARG,0x900 # Arguments - .set MEM_ORG,0x7c00 # Origin - .set MEM_BUF,0x8000 # Load area - .set MEM_BTX,0x9000 # BTX start - .set MEM_JMP,0x9010 # BTX entry point - .set MEM_USR,0xa000 # Client start - .set BDA_BOOT,0x472 # Boot howto flag - -/* Partition Constants */ - .set PRT_OFF,0x1be # Partition offset - .set PRT_NUM,0x4 # Partitions - .set PRT_BSD,0xa5 # Partition type - -/* Misc. Constants */ - .set SIZ_PAG,0x1000 # Page size - .set SIZ_SEC,0x200 # Sector size - .set COPY_BLKS,0x8 # Number of blocks - # to copy for boot2 (<= 15) - .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be - # a multiple of 16 bytes - .set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS) - .globl start - .code16 - -/* - * Load the rest of zfsboot2 and BTX up, copy the parts to the right locations, - * and start it all up. - */ - -/* - * Setup the segment registers to flat addressing (segment 0) and setup the - * stack to end just below the start of our code. - */ -start: cld # String ops inc - xor %cx,%cx # Zero - mov %cx,%es # Address - mov %cx,%ds # data - mov %cx,%ss # Set up - mov $start,%sp # stack -/* - * Load the MBR and look for the first FreeBSD slice. We use the fake - * partition entry below that points to the MBR when we call read. - * The first pass looks for the first active FreeBSD slice. The - * second pass looks for the first non-active FreeBSD slice if the - * first one fails. - */ - call check_edd # Make sure EDD works - mov $part4,%si # Dummy partition - xor %eax,%eax # Read MBR - movl $MEM_BUF,%ebx # from first - call read # sector - mov $0x1,%cx # Two passes -main.1: mov $MEM_BUF+PRT_OFF,%si # Partition table - movb $0x1,%dh # Partition -main.2: cmpb $PRT_BSD,0x4(%si) # Our partition type? - jne main.3 # No - jcxz main.5 # If second pass - testb $0x80,(%si) # Active? - jnz main.5 # Yes -main.3: add $0x10,%si # Next entry - incb %dh # Partition - cmpb $0x1+PRT_NUM,%dh # In table? - jb main.2 # Yes - dec %cx # Do two - jcxz main.1 # passes -/* - * If we get here, we didn't find any FreeBSD slices at all, so print an - * error message and die. - */ - mov $msg_part,%si # Message - jmp error # Error - -/* - * Ok, we have a slice and drive in %dx now, so use that to locate and - * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the COPY_BLKS*COPY_BLK_SZ/SIZ_SEC sectors - * starting at sector 1024 (i.e. after the two vdev labels). We don't - * have do anything fancy here to allow for an extra copy of boot1 and - * a partition table (compare to this section of the UFS bootstrap) so we - * just load it all at 0x9000. The first part of boot2 is BTX, which wants - * to run at 0x9000. The boot2.bin binary starts right after the end of BTX, - * so we have to figure out where the start of it is and then move the - * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, - * but when we use btxld to create zfsboot2, we use an entry point of - * 0x2000. That entry point is relative to MEM_USR; thus boot2.bin - * starts at 0xc000. - * - * The load area and the target area for the client overlap so we have - * to use a decrementing string move. We also play segment register - * games with the destination address for the move so that the client - * can be larger than 16k (which would overflow the zero segment since - * the client starts at 0xc000). - */ -main.5: mov %dx,MEM_ARG # Save args - mov $NSECT,%cx # Sector count - movl $1024,%eax # Offset to boot2 - mov $MEM_BTX,%ebx # Destination buffer -main.6: pushal # Save params - call read # Read disk - popal # Restore - incl %eax # Advance to - add $SIZ_SEC,%ebx # next sector - loop main.6 # If not last, read another - - mov $MEM_BTX,%bx # BTX - mov 0xa(%bx),%si # Get BTX length and set - add %bx,%si # %si to start of boot2 - dec %si # Set %ds:%si to point at the - mov %si,%ax # last byte we want to copy - shr $4,%ax # from boot2, with %si made as - add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # small as possible. - and $0xf,%si # - mov %ax,%ds # - mov $(MEM_USR+2*SIZ_PAG)/16,%ax # Set %es:(-1) to point at - add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # the last byte we - mov %ax,%es # want to copy boot2 into. - mov $COPY_BLKS,%bx # Copy COPY_BLKS 32k blocks -copyloop: - add $COPY_BLK_SZ,%si # Adjust %ds:%si to point at - mov %ds,%ax # the end of the next 32k to - sub $COPY_BLK_SZ/16,%ax # copy from boot2 - mov %ax,%ds - mov $COPY_BLK_SZ-1,%di # Adjust %es:%di to point at - mov %es,%ax # the end of the next 32k into - sub $COPY_BLK_SZ/16,%ax # which we want boot2 copied - mov %ax,%es - mov $COPY_BLK_SZ,%cx # Copy 32k - std - rep movsb - dec %bx - jnz copyloop - mov %cx,%ds # Reset %ds and %es - mov %cx,%es - cld # Back to increment - -/* - * Enable A20 so we can access memory above 1 meg. - * Use the zero-valued %cx as a timeout for embedded hardware which do not - * have a keyboard controller. - */ -seta20: cli # Disable interrupts -seta20.1: dec %cx # Timeout? - jz seta20.3 # Yes - inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.1 # Yes - movb $0xd1,%al # Command: Write - outb %al,$0x64 # output port -seta20.2: inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.2 # Yes - movb $0xdf,%al # Enable - outb %al,$0x60 # A20 -seta20.3: sti # Enable interrupts - - jmp start+MEM_JMP-MEM_ORG # Start BTX - - -/* - * Read a sector from the disk. Sets up an EDD packet on the stack - * and passes it to read. We assume that the destination address is - * always segment-aligned. - * - * %eax - int - LBA to read in relative to partition start - * %ebx - ptr - destination address - * %dl - byte - drive to read from - * %si - ptr - MBR partition entry - */ -read: xor %ecx,%ecx # Get - addl 0x8(%si),%eax # LBA - adc $0,%ecx - pushl %ecx # Starting absolute block - pushl %eax # block number - shr $4,%ebx # Convert to segment - push %bx # Address of - push $0 # transfer buffer - push $0x1 # Read 1 sector - push $0x10 # Size of packet - mov %sp,%si # Packet pointer - mov $0x42,%ah # BIOS: Extended - int $0x13 # read - jc read.1 # If error, fail - lea 0x10(%si),%sp # Clear stack - ret # If success, return -read.1: mov %ah,%al # Format - mov $read_err,%di # error - call hex8 # code - mov $msg_read,%si # Set the error message and - # fall through to the error - # routine -/* - * Print out the error message pointed to by %ds:(%si) followed - * by a prompt, wait for a keypress, and then reboot the machine. - */ -error: callw putstr # Display message - mov $prompt,%si # Display - callw putstr # prompt - xorb %ah,%ah # BIOS: Get - int $0x16 # keypress - movw $0x1234, BDA_BOOT # Do a warm boot - ljmp $0xffff,$0x0 # reboot the machine -/* - * Display a null-terminated string using the BIOS output. - */ -putstr.0: mov $0x7,%bx # Page:attribute - movb $0xe,%ah # BIOS: Display - int $0x10 # character -putstr: lodsb # Get char - testb %al,%al # End of string? - jne putstr.0 # No - ret # To caller -/* - * Check to see if the disk supports EDD. zfsboot requires EDD and does not - * support older C/H/S disk I/O. - */ -check_edd: cmpb $0x80,%dl # Hard drive? - jb check_edd.1 # No, fail to boot - mov $0x55aa,%bx # Magic - push %dx # Save - movb $0x41,%ah # BIOS: Check - int $0x13 # extensions present - pop %dx # Restore - jc check_edd.1 # If error, fail - cmp $0xaa55,%bx # Magic? - jne check_edd.1 # No, so fail - testb $0x1,%cl # Packet interface? - jz check_edd.1 # No, so fail - ret # EDD ok, keep booting -check_edd.1: mov $msg_chs,%si # Warn that CHS is - jmp error # unsupported and fail -/* - * AL to hex, saving the result to [EDI]. - */ -hex8: push %ax # Save - shrb $0x4,%al # Do upper - call hex8.1 # 4 - pop %ax # Restore -hex8.1: andb $0xf,%al # Get lower 4 - cmpb $0xa,%al # Convert - sbbb $0x69,%al # to hex - das # digit - orb $0x20,%al # To lower case - stosb # Save char - ret # (Recursive) - -/* Messages */ - -msg_chs: .asciz "CHS not supported" -msg_read: .ascii "Read error: " -read_err: .asciz "XX" -msg_part: .asciz "Boot error" - -prompt: .asciz "\r\n" - - .org PRT_OFF,0x90 - -/* Partition table */ - - .fill 0x30,0x1,0x0 -part4: .byte 0x80, 0x00, 0x01, 0x00 - .byte 0xa5, 0xfe, 0xff, 0xff - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x50, 0xc3, 0x00, 0x00 # 50000 sectors long, bleh - - .word 0xaa55 # Magic number diff --git a/targets/pseudo/userland/misc/Makefile.depend b/targets/pseudo/userland/misc/Makefile.depend index d3c97fc56b40..546800004d11 100644 --- a/targets/pseudo/userland/misc/Makefile.depend +++ b/targets/pseudo/userland/misc/Makefile.depend @@ -54,7 +54,6 @@ DIRDEPS.x86sys= \ .if ${MK_ZFS} != "no" DIRDEPS.x86sys+= \ stand/i386/gptzfsboot \ - stand/i386/zfsboot \ stand/i386/zfsloader \ DIRDEPS+= \ diff --git a/tools/boot/install-boot.sh b/tools/boot/install-boot.sh index 217bf0ff1457..10e62dd32ba8 100755 --- a/tools/boot/install-boot.sh +++ b/tools/boot/install-boot.sh @@ -294,27 +294,9 @@ boot_nogeli_mbr_ufs_both() { boot_nogeli_mbr_ufs_uefi $1 $2 $3 } +# ZFS+MBR+BIOS is not a supported configuration boot_nogeli_mbr_zfs_legacy() { - dev=$1 - dst=$2 - - # search to find the BSD slice - s=$(find_part $dev "freebsd") - if [ -z "$s" ] ; then - die "No BSD slice found" - fi - idx=$(find_part ${dev}s${s} "freebsd-zfs") - if [ -z "$idx" ] ; then - die "No freebsd-zfs slice found" - fi - # search to find the freebsd-zfs partition within the slice - # Or just assume it is 'a' because it has to be since it fails otherwise - doit gpart bootcode -b ${dst}/boot/mbr ${dev} - dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1 - doit gpart bootcode -b /tmp/zfsboot1 ${dev}s${s} # Put boot1 into the start of part - sysctl kern.geom.debugflags=0x10 # Put boot2 into ZFS boot slot - doit dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s}a skip=1 seek=1024 - sysctl kern.geom.debugflags=0x0 + exit 1 } boot_nogeli_mbr_zfs_uefi() { @@ -322,7 +304,6 @@ boot_nogeli_mbr_zfs_uefi() { } boot_nogeli_mbr_zfs_both() { - boot_nogeli_mbr_zfs_legacy $1 $2 $3 boot_nogeli_mbr_zfs_uefi $1 $2 $3 } diff --git a/tools/boot/rootgen.sh b/tools/boot/rootgen.sh index 32007a46802e..2cd65bdd180d 100755 --- a/tools/boot/rootgen.sh +++ b/tools/boot/rootgen.sh @@ -202,33 +202,6 @@ mk_nogeli_mbr_ufs_both() { rm -f ${src}/etc/fstab } -mk_nogeli_mbr_zfs_legacy() { - src=$1 - img=$2 - mntpt=$3 - geli=$4 - scheme=$5 - fs=$6 - bios=$7 - pool=nogeli-mbr-zfs-legacy - - zfs_extra $src $dst - makefs -t zfs -s 200m \ - -o poolname=${pool} -o bootfs=${pool} -o rootpath=/ \ - ${img}.s1a ${src} ${dst} - # The old boot1/boot2 boot split is also used by zfs. We need to extract zfsboot1 - # from this image. Since there's no room in the mbr format for the rest of the loader, - # it will load the zfsboot loader from the reserved for bootloader area of the ZFS volume - # being booted, hence the need to dd it into the raw img later. - # Please note: zfsboot only works with partition 'a' which must be the root - # partition / zfs volume - dd if=${src}/boot/zfsboot of=${dst}/zfsboot1 count=1 - mkimg -s bsd -b ${dst}zfsboot1 -p freebsd-zfs:=${img}.s1a -o ${img}.s1 - dd if=${src}/boot/zfsboot of=${img}.s1a skip=1 seek=1024 - mkimg -a 1 -s mbr -b ${src}/boot/mbr -p freebsd:=${img}.s1 -o ${img} - rm -rf ${dst} -} - mk_nogeli_mbr_zfs_uefi() { src=$1 img=$2 @@ -249,33 +222,6 @@ mk_nogeli_mbr_zfs_uefi() { rm -rf ${dst} } -mk_nogeli_mbr_zfs_both() { - src=$1 - img=$2 - mntpt=$3 - geli=$4 - scheme=$5 - fs=$6 - bios=$7 - pool=nogeli-mbr-zfs-both - - zfs_extra $src $dst - make_esp_file ${img}.s1 ${espsize} ${src}/boot/loader.efi - makefs -t zfs -s 200m \ - -o poolname=${pool} -o bootfs=${pool} -o rootpath=/ \ - ${img}.s2a ${src} ${dst} - # The old boot1/boot2 boot split is also used by zfs. We need to extract zfsboot1 - # from this image. Since there's no room in the mbr format for the rest of the loader, - # it will load the zfsboot loader from the reserved for bootloader area of the ZFS volume - # being booted, hence the need to dd it into the raw img later. - # Please note: zfsboot only works with partition 'a' which must be the root - # partition / zfs volume - dd if=${src}/boot/zfsboot of=${dst}/zfsboot1 count=1 - mkimg -s bsd -b ${dst}zfsboot1 -p freebsd-zfs:=${img}.s2a -o ${img}.s2 - dd if=${src}/boot/zfsboot of=${img}.s1a skip=1 seek=1024 - mkimg -a 1 -s mbr -b ${src}/boot/mbr -p efi:=${img}.s1 -p freebsd:=${img}.s2 -o ${img} -} - mk_geli_gpt_ufs_legacy() { src=$1 img=$2 @@ -728,6 +674,10 @@ for arch in amd64; do for scheme in gpt mbr; do for fs in ufs zfs; do for bios in legacy uefi both; do + # ZFS+MBR+BIOS is not supported + if [ "$scheme" = "mbr" -a "$fs" = "zfs" -a "$bios" != "uefi" ]; then + continue + fi make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done @@ -750,6 +700,11 @@ for arch in i386; do for bios in legacy; do # The legacy boot is shared with amd64 so those routines could # likely be used here. + + # ZFS+MBR+BIOS is not supported + if [ "$scheme" = "mbr" -a "$fs" = "zfs" -a "$bios" != "uefi" ]; then + continue + fi make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index da7f57eec2d5..580be4362a18 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -357,7 +357,6 @@ OLD_FILES+=boot/shortcuts.4th OLD_FILES+=boot/support.4th OLD_FILES+=boot/userboot.so OLD_FILES+=boot/version.4th -OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader OLD_FILES+=usr/lib/kgzldr.o OLD_FILES+=usr/share/man/man5/loader.conf.5.gz @@ -374,7 +373,6 @@ OLD_FILES+=usr/share/man/man8/menu.4th.8.gz OLD_FILES+=usr/share/man/man8/menusets.4th.8.gz OLD_FILES+=usr/share/man/man8/pxeboot.8.gz OLD_FILES+=usr/share/man/man8/version.4th.8.gz -OLD_FILES+=usr/share/man/man8/zfsboot.8.gz OLD_FILES+=usr/share/man/man8/zfsloader.8.gz .endif @@ -12277,7 +12275,6 @@ OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-WIRELESS-MIB.txt .if ${MK_ZFS} == no OLD_FILES+=boot/gptzfsboot -OLD_FILES+=boot/zfsboot OLD_FILES+=boot/zfsloader OLD_FILES+=etc/rc.d/zfs OLD_FILES+=etc/rc.d/zfsbe @@ -12380,7 +12377,6 @@ OLD_FILES+=usr/share/man/man8/gptzfsboot.8.gz OLD_FILES+=usr/share/man/man8/zdb.8.gz OLD_FILES+=usr/share/man/man8/zfs-program.8.gz OLD_FILES+=usr/share/man/man8/zfs.8.gz -OLD_FILES+=usr/share/man/man8/zfsboot.8.gz OLD_FILES+=usr/share/man/man8/zfsbootcfg.8.gz OLD_FILES+=usr/share/man/man8/zfsd.8.gz OLD_FILES+=usr/share/man/man8/zfsloader.8.gz From nobody Mon Jul 28 14:59:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brM8S2Hp8z639b7; Mon, 28 Jul 2025 14:59:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brM8S1LCCz3N3Z; Mon, 28 Jul 2025 14:59:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714792; h=from:from:reply-to:subject: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=VCRvdlu7nKkXRE7gFq8yRVKNFtYdnJW5jdwcKvFPSEQ=; b=dKLxBtqArzcowOYiGFlLcu6IV9b32NfWHbsqf1WTYrJSgfCuKpNpURvhEdrTJbHRgMXJC9 rrspORgojzhTxWd0g126j7MzD4s5d6DFa8pIY/bRfGRX3f3lKbNIF8z20ye6J138Vh+BmX Os4HX73nTthfFj/M2ctj6W315f3VKQ3uS3I8D99r8CUUYxr9JyqXWRMGVaKXnDPwXXC06P xexCu17TvNrhGsipEVjlbINY9J94gef7ijL1y+amm0l3KT21NL1N9C+2nJAMXmMgG2+rNT zkvLdgwT0jTQpxYJRPpG6KR1DF/n1fI2je3iiRPIIQGXxXN10nYTjKuN0VoTqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753714792; h=from:from:reply-to:subject: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=VCRvdlu7nKkXRE7gFq8yRVKNFtYdnJW5jdwcKvFPSEQ=; b=AobGGCf8VvbxTeaGnWSqLn1x4STzajbkaHNZEqtCJH3F6uTIpdzH1Y/L+yf6Fwzhj+59Fz G/XsnzpFOYxJ0R36993q3e+QqgkLf75c3NFfHag4Czf+rDe++3aFv1nJx3pnx0Ps3W2uWS wEDXJ87GXW6XCM84fpv+isr58bN6D3qS193eErjA3O3HYnq4Pbcx8amzvtUoBFuv/nUCkY /4N3X+sSf+bImo2ejbnb0XmKtbjrSyVVVRa0uH/iqUBj/Rp0j8V9x2na6aBEaIXoCdL+SU e261SjwlyqiEgc0WS00Vc6p3wBkXZVX+0Qffxp2Ur/pWxoa5mVdhO2BeQH7+ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753714792; a=rsa-sha256; cv=none; b=keaQNjmC49zPjgJzTHAZBfStzPvBdQTByUwvhwvNOEaAq68E5DmxN6KGvmtNs9CNUKOQqR BNa6cQALibhlLCE/+KQmVqIQ99E+YFsgC7Ou9sdOD5mLiEGD1ipjjbC6e7Wa9kWCSqRsBK IQeTG0dcbooegQCDYnVYWAbsSQQzTt6i6mEKEcZNYLmp15tS0Nk3xDmCAUdyoXbEEiIGDe ITiWnea+T20pd58b1+lmhag77n1JdsBsaA2PmiD/G9yEov1kdWVaZ0BClEqKcgxafj6GeN HMBm7mP7fixcKOAqfPM42zq5k0yorV2L7O3AxVkIit9pi5stXWZlGzk9krb03Q== Received: from [IPV6:2601:5c0:4202:5670:3864:84:6216:1369] (unknown [IPv6:2601:5c0:4202:5670:3864:84:6216:1369]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4brM8R6MWvzxdD; Mon, 28 Jul 2025 14:59:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <305c3ba9-32e7-43df-b969-729ed68819a5@FreeBSD.org> Date: Mon, 28 Jul 2025 10:59:50 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 45c3fa9897f1 - main - ice: Fix aarch64 LINT kernel Content-Language: en-US To: =?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507281456.56SEu5LK039123@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202507281456.56SEu5LK039123@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/28/25 10:56, Dag-Erling Smørgrav wrote: > The branch main has been updated by des: > > URL: https://cgit.FreeBSD.org/src/commit/?id=45c3fa9897f1fa9babe5b43bc4bf73eaf583e45a > > commit 45c3fa9897f1fa9babe5b43bc4bf73eaf583e45a > Author: Dag-Erling Smørgrav > AuthorDate: 2025-07-28 14:54:20 +0000 > Commit: Dag-Erling Smørgrav > CommitDate: 2025-07-28 14:55:39 +0000 > > ice: Fix aarch64 LINT kernel > > Fixes: bc761988b724 > (cherry picked from commit 3630e74d8d1c8a068478a4457f825e4efc2b77f0) Hmm, did you mean to include this annotation? That commit doesn't seem to exist in the FreeBSD repository which may confuse scripts that parse cherry picked from lines. % git show 3630e74d8d1c8a068478a4457f825e4efc2b77f0 fatal: bad object 3630e74d8d1c8a068478a4457f825e4efc2b77f0 -- John Baldwin From nobody Mon Jul 28 15:30:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brMqX2lxzz63C9P; Mon, 28 Jul 2025 15:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brMqW1dRdz3RYg; Mon, 28 Jul 2025 15:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753716616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55H0+9HvDvKVVe3U7Rh9hh4tIwReUrODWC+2KrtWcvA=; b=t+Vm/SAFddT7jJsZdSyAOoBSvnsLg2wrfykgOp2l6wFusoTDC48562yG1lku7ina87OpFI ceo7GomjxRfsEXNMwh2DogBI90XcbTbGO52CuDYtQtkKGpF1jgyJd3kox76CYYqwinPBJ3 FkYdFRx7ACt4v84y5UqKMRTOPWfq+IxDCssHjvFJBIHHPdKfLdSHYP/duKx9kXx5NbXyyu K7LkGIA/nSaCCiEvl3GxW+43G+Up/+fyK78KxDHjt5T6x7HqUCY7KmZjJID6PkTCJiTWVe 0LtNUugDcn5/qJZffXGL+qVdNInDPAs2ng94YZReddZVyVxxVL25WZqGuVM1gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753716615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55H0+9HvDvKVVe3U7Rh9hh4tIwReUrODWC+2KrtWcvA=; b=hJLDu2CrJgvlkpvjWEnapzeM/a6zqceIRRh1LCXDiGNY1HNAmweGb7Z3sunUkeLk2tCEa8 lAPkiLZ1S8pwfX2gt9N2q+C381qpeXW4Ly16f6ELrG9KN2HBopO38Mh192686kBiQw7wfz 7w3YztogXSlE1o25mLDMdhJgDPv1UIbIp9lNzgqKI50x8uFp/iGC5SK0u/ZM2OGdpZLJrb 1gkv1n4+eMyQoxxdNybfA9AFLbtsWgiRP0tXi/pFcz8Li2NzBMnGMqusNazsFYZnQy2W+x r3BccWW4JzRCa0oLVHJq4A8asTjPw5dgutY8hcH24Dj+c1xYUxkxd8tDz3D2ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753716615; a=rsa-sha256; cv=none; b=EzjRi4+zHfMnhBtpDoAzxxyK4Ewqd8uv2545V8ntiWSGYqOadrPueRG2PWr+xsEacF6nrg Eabhao61ROBVNysZHuv2wS3+vZJ1lnaQKYLLe74Z2hazzy2ubWOIyV1ZjQXtPGE96pD6u+ KUYx1oxjYb0dbmekmAr4Fie52oKp0mX6RmRv4tQG0tg9MCYlrQFJjCvya+ipDepR924rpl 9ljyc6ZLbvPExDugztQuVaKVdH1fNKeTfVJkzIAL3GMqE2F6IJ8g9jHbJAyF5W2J/69nzj HeWxUBC0C9T+Z9jER399h6OnlCJeJndCpnS/gJ0XWqeqWyvvR2e0WhgITzDVFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brMqW159hzr1d; Mon, 28 Jul 2025 15:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SFUFmc004763; Mon, 28 Jul 2025 15:30:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SFUFYC004755; Mon, 28 Jul 2025 15:30:15 GMT (envelope-from git) Date: Mon, 28 Jul 2025 15:30:15 GMT Message-Id: <202507281530.56SFUFYC004755@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: 4a4338d94401 - main - comsat: Don't read arbitrary files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a4338d94401f0012380d4f1a4d332bd6d44fa8e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4a4338d94401f0012380d4f1a4d332bd6d44fa8e commit 4a4338d94401f0012380d4f1a4d332bd6d44fa8e Author: Dag-Erling Smørgrav AuthorDate: 2025-07-28 15:28:26 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-28 15:28:59 +0000 comsat: Don't read arbitrary files When processing a notification, instead of accepting any file name that doesn't begin with a slash, accept only file names that don't contain any slashes at all. This makes it possible to notify a user about a mailbox that doesn't bear their name, as long as they are permitted to read it, but prevents comsat from reading files outside the mail spool. PR: 270404 MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51580 --- libexec/comsat/comsat.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index d5d1eedeb5f3..60d4f65519d0 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -113,29 +113,24 @@ mailfor(char *name) char *file; off_t offset; int folder; - char buf[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; - char buf2[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; + char buf[MAXPATHLEN]; - if (!(cp = strchr(name, '@'))) + if ((cp = strchr(name, '@')) == NULL) return; *cp = '\0'; offset = strtoll(cp + 1, NULL, 10); - if (!(cp = strchr(cp + 1, ':'))) - file = name; - else - file = cp + 1; - sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utp->ut_user), - name); - if (*file != '/') { - sprintf(buf2, "%s/%.*s", _PATH_MAILDIR, - (int)sizeof(utp->ut_user), file); - file = buf2; + if ((cp = strchr(cp + 1, ':')) != NULL && + strchr((file = cp + 1), '/') == NULL) { + snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, file); + folder = 1; + } else { + snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, name); + folder = 0; } - folder = strcmp(buf, file); setutxent(); while ((utp = getutxent()) != NULL) if (utp->ut_type == USER_PROCESS && !strcmp(utp->ut_user, name)) - notify(utp, file, offset, folder); + notify(utp, buf, offset, folder); endutxent(); } @@ -159,8 +154,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) utp->ut_line); return; } - (void)snprintf(tty, sizeof(tty), "%s%.*s", - _PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line); + (void)snprintf(tty, sizeof(tty), "%s%s", _PATH_DEV, utp->ut_line); if (stat(tty, &stb) == -1 || !(stb.st_mode & (S_IXUSR | S_IXGRP))) { dsyslog(LOG_DEBUG, "%s: wrong mode on %s", utp->ut_user, tty); return; @@ -189,24 +183,18 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) setuid(p->pw_uid) == -1) return; - switch (stb.st_mode & (S_IXUSR | S_IXGRP)) { - case S_IXUSR: - case (S_IXUSR | S_IXGRP): + if (stb.st_mode & S_IXUSR) { (void)fprintf(tp, "%s\007New mail for %s@%.*s\007 has arrived%s%s%s:%s----%s", cr, utp->ut_user, (int)sizeof(hostname), hostname, folder ? cr : "", folder ? "to " : "", folder ? file : "", cr, cr); jkfprintf(tp, file, offset); - break; - case S_IXGRP: + } else if (stb.st_mode & S_IXGRP) { (void)fprintf(tp, "\007"); (void)fflush(tp); (void)sleep(1); (void)fprintf(tp, "\007"); - break; - default: - break; } (void)fclose(tp); _exit(0); From nobody Mon Jul 28 15:30:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brMqX3hFcz63Byr; Mon, 28 Jul 2025 15:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brMqX2cMmz3RlK; Mon, 28 Jul 2025 15:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753716616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oVfh0cIUuFuOBlxJ6jl8FLjHyszXJRKUeUtwAWkEyD4=; b=Mm7rxD6UzmfS8uHcrdGjskn9I0IRl3mhJFjU3eockjNU2bpHZMEAOe5e4yGhadWjXoXsnd Z8kbYYHl2ZqujrDPeHOb1wFgfdTCP53LoynB3jRqmDnYd8e0/AbqoeeCvJEttcbtXSG0w5 b5UCnkMU/glJwUXuqZSMFmoddo2jbCnA2jIix6y15xWEJMc7JUkAGBZb7AItVTQ6A+qRdu cL4RCj9SLlNxwn7lclutI3q3JClA2OEEjNjJV+QAW4H3SdZMzrL+xUH93SC0Ey/Fo2fPq8 yEdE/d3N+3ON88MildIq4Z/ZAt/WhFbzj0p6iYk1Tz/oEac3ztKQkS3h4aaeUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753716616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oVfh0cIUuFuOBlxJ6jl8FLjHyszXJRKUeUtwAWkEyD4=; b=qaC0y0O8TSlM2j4ioJZBU7gmoKIQjbUsi62jWTtJFTEfuhX3GO20+tp3mv3MRdwFtZBGEX xLzlukXbje2izMB4oPFjmgIFBYNKUu7ppBFDRmLqlb7mgA5u8JDkFLJKTnjER5DC0xeB4i KHiGjMGD+RJT4FdMSAcmEW0aVq+29D1BIxIotNhEStnu2mo9TuV5IF7zF9kFuCeCIFz5LB YUscPwyAYGFvMBn6x7iCwd8CxbOQS5HV1iFQy+wjj2Me/qm4F0ht4cPTfzcQ+WAt67K5qw NhmYq4YYTyc7df1ll71u1qTBfFRNVywXp8YT/zHievgPcvXJw0bZVF6wfieA9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753716616; a=rsa-sha256; cv=none; b=m4JOS2xH6pFI2ajKW2HTGRn5WCOya6+/qXpmP3+qbiOLf8HKvBktiuH03YVddLNLTh9DmY 1gCqTEaOLSwTDZXIs6vBzH7jHpuK1qWNAL/IAJePk9lj5w+DRRCdqMpDnmWifxxYPmwKAY 9EFKMYbqjITjDZvQKibmvqLQIHCTSgtdLqznEefvcpRU9Mltv/iUeFePm332HUlcfRHe0J qCE7diVCNa+8CYyLx8x90Gm8pqJcKrVUSWk9WG1Ihcho72LY+flB0aUs9oC7HmM9Y5hZTM CZaXff6l/VRSPbxWflW02NLE7r8zDkdCeNGBkjJKMTAM3colUvkEQTMxDPVV3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brMqX1ccXzqw6; Mon, 28 Jul 2025 15:30:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SFUG7l005413; Mon, 28 Jul 2025 15:30:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SFUGaM005409; Mon, 28 Jul 2025 15:30:16 GMT (envelope-from git) Date: Mon, 28 Jul 2025 15:30:16 GMT Message-Id: <202507281530.56SFUGaM005409@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: e40a2c4927a8 - main - comsat: Don't return from the child List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: e40a2c4927a8068d7b6adee69c90ae3be8efc4df Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e40a2c4927a8068d7b6adee69c90ae3be8efc4df commit e40a2c4927a8068d7b6adee69c90ae3be8efc4df Author: Dag-Erling Smørgrav AuthorDate: 2025-07-28 15:28:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-28 15:28:59 +0000 comsat: Don't return from the child Fixes: 91629228e3df MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51581 --- libexec/comsat/comsat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c index 60d4f65519d0..cb00ee4a9392 100644 --- a/libexec/comsat/comsat.c +++ b/libexec/comsat/comsat.c @@ -181,7 +181,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder) initgroups(p->pw_name, p->pw_gid) == -1 || setgid(p->pw_gid) == -1 || setuid(p->pw_uid) == -1) - return; + _exit(1); if (stb.st_mode & S_IXUSR) { (void)fprintf(tp, From nobody Mon Jul 28 15:36:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brMzF6dYZz63CWs; Mon, 28 Jul 2025 15:36:57 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brMzF5m3wz3SNS; Mon, 28 Jul 2025 15:36:57 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZHEh2ywP9q2i5j0/Hs2tGIAdkLsLrcU/+63So7y2m+A=; b=UIZ/ePbiSp/rdR+a80z3sFmbX5IUhZaglGJNEMWsxagFIq50m3P3apk52CwvY0tb/xJe+z 4eMHqijgA9BIJJBl0W6i9WBIFW+KyQGACIKKbRA+soZ4o+15h4g5JPlnwLja3Tq4WyzjYt Kvsb3kEBKFmUxYduXJjgXuSfdGceOzo7IouaY1FxXslFQGGtA29OaZdj/r8G0x6MGu6laT cOaGTj+MMYGLdvgpqVrjHkJdqKMz1Jy/4Qp39QE0e1XZKQ1Vc98A471juRGtZ4pVVd4f1B fPwgvkfwwzGGEZpHGF4tXcubSGLhnKXYMkm0OyTUjAl7akha1oUZyuKEjcJn4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZHEh2ywP9q2i5j0/Hs2tGIAdkLsLrcU/+63So7y2m+A=; b=VkKtVrXCrDETahJ9/4rDSEHepGYz6nyPssmBwDxzQrO09HTrgREmaJfHjY1LoOqRrUYQsm HoXLOUs+rdAubk+XiqA4Vw6nR5yWb45WsAiEO+B2WxOpcDhWXd2o1Em7DIjiEfVMvPhdHc JLURH9+A6+ger242fPe+xmnHU2jqE0tCV69KiWyfDkSXosPPgH0kGYRcFJ4CkkoebQv07Y SiTvZYUg6wslzUZ0RdUEBZ8Lcu+s3q4qWT0SXEL4RUMScyrQA4lQWMzSXgz1XovfASjXcO /BE27j2ie1pUKNzEZrltpCJhTKgsTx0tK0GQ86SCesyFO5gN/nBv0Ei5ydDZcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753717017; a=rsa-sha256; cv=none; b=fgQCx7IWzBOPvJp8MJ8W+8C4d7H3/xg7Hqmyx7O2Xj0cyuREVj+j2f9v/Jj38tD830fBfF aDY7tQLlrJjXJkCzQLOmKHOErXwpqF/oDtGdDZxLSo2g3P4JjfTG+r0kxBpJhV4xsnba/w GyJMM8odPyEnfF/Ejpbt4t9KGM0TspJeycHUOIiP7utHh3RN27kcdg1a3MmcoaW2Yt0jas uDOV9pOq0UYd4C2wzFVugaWlDX1XXl3y+MjBeB5pIo+Twzx5EGZ09pYWc2ZsggvNuPC1MA 9C1GMsuswpviv26hW79OS+apT95BthKNOHfwXki2LE0O7suD2aTeVZA8FlBwqQ== Received: from ltc.des.dev (unknown [IPv6:2a01:e0a:c54:bed0:922e:16ff:fef1:acef]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4brMzF4NKCzwXJ; Mon, 28 Jul 2025 15:36:57 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id D82D2128A9; Mon, 28 Jul 2025 17:36:55 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 45c3fa9897f1 - main - ice: Fix aarch64 LINT kernel In-Reply-To: <305c3ba9-32e7-43df-b969-729ed68819a5@FreeBSD.org> (John Baldwin's message of "Mon, 28 Jul 2025 10:59:50 -0400") References: <202507281456.56SEu5LK039123@gitrepo.freebsd.org> <305c3ba9-32e7-43df-b969-729ed68819a5@FreeBSD.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Mon, 28 Jul 2025 17:36:55 +0200 Message-ID: <861pq08gyw.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable John Baldwin writes: > Dag-Erling Sm=C3=B8rgrav writes: > > (cherry picked from commit 3630e74d8d1c8a068478a4457f825e4efc2b77f= 0) > Hmm, did you mean to include this annotation? No, that was unintentional. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Mon Jul 28 15:43:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brN6F2fvJz63CG9; Mon, 28 Jul 2025 15:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brN6F1x81z3TSb; Mon, 28 Jul 2025 15:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rj4ydEljvx6BWHBC4esn9qIGT9g0K6xgyUKzsDjd42w=; b=Cbs2/bk00fqUPrjrg67jP75+Vc05I1nus/AHphUuZ3ku8VDJ14K2MWcW959qVlZWiYBUMG 8Wrd4QG6zip5y9Hr0FNxYvFxjlJr96t3kE6IcC80mzBZsstYz+4Kn9C+ZJwwR+bYSOJhl+ sTYx2sgMoc4JkePK53OBtdTf0PrwlnrHIrpWvAsoKEUmNyEQ6eaY8XXBGjnXpLZV/UobCD gh+O61iikM3GP+1F3qUm4tjgSHNOizK3mY/+NJKICT2qAt/ryvo2rsYVw7gVCTWG9rLqEc 4zuzGI+ZofbfXIN5r6PaACiX6n37MdXuDZhBA/UoFSmezRIAUZSh1s1fiaVupw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rj4ydEljvx6BWHBC4esn9qIGT9g0K6xgyUKzsDjd42w=; b=uGO8IUC9gecrvYkTc3yZjGEvXhP24Fol9Rk+JbEzsrYti8JCo54aZJa3QsPkgx6Pi3ufYN o9/mmoRLck0AQE6HV38wvWqdIhpsqO7hKNd3xNbJz7KyPdSmRYomBJwMUxIAK3p+0DAI1m XMjVGU+qrAzLXKicdIE8mguWmyaBOtklleNKhBFDVkqAecFeKKWMlIXH3ZOpgpO6HzEekD aScuhbaCoMlWLbo2oUy5ql6zZFWOaYfs6BWyS8AdrFn74hqcb7NhpNtUjelXL9un8LJtFI 47cpKH2itNeMpD5HnJVEKqj52R88KwW25M8nHJ/4FKnqky/yaAyXd9wNQjrO7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753717381; a=rsa-sha256; cv=none; b=MXBheLy2UFYDP1TiG+ZD4JqmCjjKUfiESa928bmAsdEP5hJoagtb68o2IpnzXaOwCxQEEk hNTOpe+YvRaX1AJ9j+gtXUhOLUGBmwxcT/no30lfRf2iFFzDgRMX9OLa310bBONQH5QSTs qyTiO2pfh63kdU1iNmkQBCrhPT3RIPsYNmHF5dvfHVStsVk3KRaVYlEIpEFM/llFCdQGEA sqL1F2UeGjBUibJpuXEwT/+uQAp/fmVs1rdXrJKRDtBxvS6MZEmZaA3a5QJu2sibPndQ6M zIDqOZcniW7w8Ctb4E4zISSteEHjWLhfuHu2Q89+Mkn+0U5X54opv23LwUcS/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 4brN6F1P6Qzs49; Mon, 28 Jul 2025 15:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SFh1et032194; Mon, 28 Jul 2025 15:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SFh1NX032191; Mon, 28 Jul 2025 15:43:01 GMT (envelope-from git) Date: Mon, 28 Jul 2025 15:43:01 GMT Message-Id: <202507281543.56SFh1NX032191@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: 6efe8e6be413 - main - pf: Fix a lock leak in pf_ioctl_addrule() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 6efe8e6be4135643d8283fcb6773da641326f427 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6efe8e6be4135643d8283fcb6773da641326f427 commit 6efe8e6be4135643d8283fcb6773da641326f427 Author: Mark Johnston AuthorDate: 2025-07-27 13:23:22 +0000 Commit: Mark Johnston CommitDate: 2025-07-28 15:40:20 +0000 pf: Fix a lock leak in pf_ioctl_addrule() The ERROUT macro assumes that the rules lock is held, but some error paths arise before that lock is acquired. Introduce ERROUT_UNLOCKED for that case. Reviewed by: kp Reported by: syzkaller Fixes: cc68decda316 ("pf: Reject rules with invalid port ranges") Differential Revision: https://reviews.freebsd.org/D51571 --- sys/amd64/conf/SYZKALLER | 5 +++++ sys/netpfil/pf/pf_ioctl.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER new file mode 100644 index 000000000000..49059302793b --- /dev/null +++ b/sys/amd64/conf/SYZKALLER @@ -0,0 +1,5 @@ +include GENERIC +ident SYZKALLER + +options COVERAGE +options KCOV diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index ea9f7fe441c6..9abc07c36788 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2092,19 +2092,18 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, int rs_num; int error = 0; - if ((rule->return_icmp >> 8) > ICMP_MAXTYPE) { - error = EINVAL; - goto errout_unlocked; - } +#define ERROUT(x) ERROUT_FUNCTION(errout, x) +#define ERROUT_UNLOCKED(x) ERROUT_FUNCTION(errout_unlocked, x) -#define ERROUT(x) ERROUT_FUNCTION(errout, x) + if ((rule->return_icmp >> 8) > ICMP_MAXTYPE) + ERROUT_UNLOCKED(EINVAL); if ((error = pf_rule_checkaf(rule))) - ERROUT(error); + ERROUT_UNLOCKED(error); if (pf_validate_range(rule->src.port_op, rule->src.port)) - ERROUT(EINVAL); + ERROUT_UNLOCKED(EINVAL); if (pf_validate_range(rule->dst.port_op, rule->dst.port)) - ERROUT(EINVAL); + ERROUT_UNLOCKED(EINVAL); if (rule->ifname[0]) kif = pf_kkif_create(M_WAITOK); @@ -2294,6 +2293,7 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, return (0); #undef ERROUT +#undef ERROUT_UNLOCKED errout: PF_RULES_WUNLOCK(); PF_CONFIG_UNLOCK(); From nobody Mon Jul 28 15:45:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brN9P5GWxz63CpK; Mon, 28 Jul 2025 15:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brN9P4T4Sz3TWD; Mon, 28 Jul 2025 15:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8PvX1KsaVNwQdn/EoVGmMReKtTTa+pCgD21CPxxNY0=; b=WKnBYB++XVIzcIUsStQ7L8FTAL8Or5DCRJR1vN9J+JZhhcYuchrrpqLMXLHDEL4n99OEys jO1BUBtBf3+WN/X3dAxZ5FmjhwrHoF428jFQ+d2ZiPrcBNlct1kFv7bX3rCli6kMqDtqda VO3MsluMXZotv17KBbvmq0symlkx3FMb0fJ2OkBsD12hyb3Y6lE9zk4wk8swLY232eoXYy 3y2ZKQbwAXYTbwh3SOfiHuJfn+G9SSmt8SlXyaxIEGA9wnK/sC1rmSxBqLhMc2u8s9i1zP zhlpIlKrYrjDzA7ZvEDmFO3Sp8uXTRj18ZeW5EJyq2gzOj3MqUPGAsA+mFXO6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8PvX1KsaVNwQdn/EoVGmMReKtTTa+pCgD21CPxxNY0=; b=o8TKs2i+alKlTbkMkN+EhLHGZDp8Kl/NQECJWmajbjurbNr8RIW/ZlIVRuy31trqjdtgNi aZezBuNFeLxSTBE5PW/XSF8tbgc4ISxgbbT9E3EpxNrVJWI/9mE7NW83UH1wJE9kIn9GVo JdApu9Plz0v2f/s5Ehkoi5Ht25ZrVuvvrZCH5gGM0oo5yVIfiglPsCdrMVsd4uofD9TJOt gLY23S1HmAGMW3bTGzIyhQg+mj7XAhITl6a154RdJ6JnsETqk5hJ/O6eMvuh0M5JHG4/sx +Aj9M9lDlTtK0RY42uYyVfbuw1N7Vha5K8wXsZ4t5sangioAo74Sx4A3TkMS8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753717545; a=rsa-sha256; cv=none; b=troGdXIiw3BLogBRCdqYG/GFfMRAxZE53CU5BgT7brvoQ0RFW/S1wXriRPcb41Q9gboVtm cc6r6HhiwCyOgcZXcAginZ+9EyM8qKncYS8WEelpnRQavGWroG+daXSwGXLYjvFXgELMyK 7ysmui2jg15Nc7sYdAoUh/V+pMrJuU1/FNoJDBK5RiUqaJRZ/kKld9sRYxObO0/cuzoKio LP8AF+beoy/TwfT1t4HkFWAp9gGKvk4OHWH6+gi/9j2Pz02rXbKPqG5+9SDc4E43eWwKLz jPb0xxJshGGmAf7QXfjXwB+KECqAbKJQZ/J5HZkwX1jfodNZOTTF56zWIYjaAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brN9P3wGTzryp; Mon, 28 Jul 2025 15:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SFjjHf033101; Mon, 28 Jul 2025 15:45:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SFjjaQ033097; Mon, 28 Jul 2025 15:45:45 GMT (envelope-from git) Date: Mon, 28 Jul 2025 15:45:45 GMT Message-Id: <202507281545.56SFjjaQ033097@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: a007340abe83 - main - amd64: Remove a stray syzkaller config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: a007340abe835722f0ca947cee16a00f1f93fbe6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a007340abe835722f0ca947cee16a00f1f93fbe6 commit a007340abe835722f0ca947cee16a00f1f93fbe6 Author: Mark Johnston AuthorDate: 2025-07-28 15:44:54 +0000 Commit: Mark Johnston CommitDate: 2025-07-28 15:44:54 +0000 amd64: Remove a stray syzkaller config Reported by: mjg Fixes: 6efe8e6be413 ("pf: Fix a lock leak in pf_ioctl_addrule()") --- sys/amd64/conf/SYZKALLER | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER deleted file mode 100644 index 49059302793b..000000000000 --- a/sys/amd64/conf/SYZKALLER +++ /dev/null @@ -1,5 +0,0 @@ -include GENERIC -ident SYZKALLER - -options COVERAGE -options KCOV From nobody Mon Jul 28 15:46:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brNBb6Vl9z63Cyl; Mon, 28 Jul 2025 15:46:47 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brNBb5kBxz3V5L; Mon, 28 Jul 2025 15:46:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717607; 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=UNy97HOg0KhOAe+VT57niJ3xfvHdGh9RESQ9oN1sgxs=; b=lbZ7x3lsc2bgy+usavn04xkbAge9S9Sl395SSi/Z4b18yY8dDiMQat62gdbF24Z/sLaOil krmXxaBV+nt79HwRBpdooSWnPav50lld2g968qk5suJAVNSnVFeX/ISD9xYd+05GFUvohY ydBHv3uehvQltwAtX1TCaBhUq+s/v7GEj9A40skCpSlnPzU+322//GbFIlT6LIKUrrEf9H OekGs1mIPYYlWvMx1PrzL+2yarD7Ol+jJBagkDf9oofO6NynnEEwOXBHApTEaOAa3xUNzT Z5QXMKbLCDiE4xn5uc2hUDGXEzNFcT9x7gBeWCjRbh2izrpsMhQ0yIAz4XiiQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753717607; 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=UNy97HOg0KhOAe+VT57niJ3xfvHdGh9RESQ9oN1sgxs=; b=YoCoIErl1XjNXrChQDSAQ30Gpk4GyMiswLBZBbQsXUOYp3M4na1XoyYp9Eda5JG7+KXcSc AWKIJFwwmQeyOjPVWYTBfhYnBB28ljT/0Qgok4GJR1ujLgq57MIbPRNeeDagbh+ddA9gl4 QQBH/TKm9ibknOCHAn7WnC277PG2mtYJ1DSzIw5Gsem8qEkxHh3Oqs78t/d0P+D2dramRt q0plfcBcaHszQ5DA/qOLPUyBCTIo6swLcIe0sGH+y73RLZbMQx9EknHwI7NV3ptf5HVkW1 CF5LBIzEvZZGqQAeOKyv9TGoJyiFnKbHFsbVjBRBmPKF5EN6C/CXz6NzVW8zsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753717607; a=rsa-sha256; cv=none; b=r9lb3DTM1yFo9gmS8swyI7GlDPPzbrAl3R2AOJ71EE7F+s1B9WsYLSe/+E3mR5OOsAEbDT pMWSlyrgQ7rOz3/orpX2GTa5LN9B6huxtx9WLI2mbxwBZXb/FgiKYAerjI0dMKfcmgDCye 7VAvdFAIzim9UIfvOAkR0g2bkSb3MLh+yePSDW8hRWMAS3EFNJhXJfYCuV24dHsVRKNu5e eqRMUFKpJhLoIJEVXXxir78pFvOvpXQZKbVqyE5Ib9imhmU8b0kFCU8WTjmW4+P7qns7rC cPRSkgQcuRzq3DpiNR6KkVj+OjDJk80/od44y9y2rsPj0shsnhOLuWCQIMoYBw== 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 "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4brNBb4PqWzy0P; Mon, 28 Jul 2025 15:46:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id A8A614447D; Mon, 28 Jul 2025 17:46:45 +0200 (CEST) From: Kristof Provost To: Mark Johnston Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 6efe8e6be413 - main - pf: Fix a lock leak in pf_ioctl_addrule() Date: Mon, 28 Jul 2025 17:46:44 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: <6358D349-40F0-4C8C-9760-10CECC2D763D@FreeBSD.org> In-Reply-To: <202507281543.56SFh1NX032191@gitrepo.freebsd.org> References: <202507281543.56SFh1NX032191@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_F2A29105-5BD4-400E-B451-9F79A25EBDEF_=" --=_MailMate_F2A29105-5BD4-400E-B451-9F79A25EBDEF_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 28 Jul 2025, at 17:43, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D6efe8e6be4135643d8283fcb6773d= a641326f427 > > commit 6efe8e6be4135643d8283fcb6773da641326f427 > Author: Mark Johnston > AuthorDate: 2025-07-27 13:23:22 +0000 > Commit: Mark Johnston > CommitDate: 2025-07-28 15:40:20 +0000 > > pf: Fix a lock leak in pf_ioctl_addrule() > > The ERROUT macro assumes that the rules lock is held, but some = > error > paths arise before that lock is acquired. Introduce = > ERROUT_UNLOCKED for > that case. > > Reviewed by: kp > Reported by: syzkaller > Fixes: cc68decda316 ("pf: Reject rules with invalid port = > ranges") > Differential Revision: https://reviews.freebsd.org/D51571 > --- > sys/amd64/conf/SYZKALLER | 5 +++++ > sys/netpfil/pf/pf_ioctl.c | 16 ++++++++-------- > 2 files changed, 13 insertions(+), 8 deletions(-) > > diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER > new file mode 100644 > index 000000000000..49059302793b > --- /dev/null > +++ b/sys/amd64/conf/SYZKALLER > @@ -0,0 +1,5 @@ > +include GENERIC > +ident SYZKALLER > + > +options COVERAGE > +options KCOV ^=E2=80=94 This hunk might not have been intended to be part of this. =E2=80=94 Kristof --=_MailMate_F2A29105-5BD4-400E-B451-9F79A25EBDEF_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 28 Jul 2025, at 17:43, Mark Johnston wrote:

The branch main has been updated by markj:

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

commit 6efe8e6be4135643d8283fcb6773da641326f427
Author: Mark Johnston markj@Free= BSD.org
AuthorDate: 2025-07-27 13:23:22 +0000
Commit: Mark Johnston markj@Free= BSD.org
CommitDate: 2025-07-28 15:40:20 +0000

pf=
: Fix a lock leak in pf_ioctl_addrule()

The ERROUT macro assumes that the rules lock is held, but some error
paths arise before that lock is acquired.  Introduce ERROUT_UNLOCKED for
that case.

Reviewed by:    kp
Reported by:    syzkaller
Fixes:          cc68decda316 ("pf: Reject rules with invalid port ra=
nges")
Differential Revision:  https://reviews.freebsd.org/D51571

sys/amd64/conf/SYZKALLER | 5 +++++
sys/netpfil/pf/pf_ioctl.c | 16 ++++++++--------
2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SY= ZKALLER
new file mode 100644
index 000000000000..49059302793b
--- /dev/null
+++ b/sys/amd64/conf/SYZKALLER
@@ -0,0 +1,5 @@
+include GENERIC
+ident SYZKALLER
+
+options COVERAGE
+options KCOV

^=E2=80=94 This hunk might not have been intended to be p= art of this.

=E2=80=94
Kristof

--=_MailMate_F2A29105-5BD4-400E-B451-9F79A25EBDEF_=-- From nobody Mon Jul 28 15:52:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brNKS1rgCz63CwQ; Mon, 28 Jul 2025 15:52:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4brNKR6mMpz3WjH; Mon, 28 Jul 2025 15:52:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56SFqU8m025287; Mon, 28 Jul 2025 18:52:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56SFqU8m025287 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56SFqUZX025286; Mon, 28 Jul 2025 18:52:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 28 Jul 2025 18:52:30 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c0fae431fd6a - main - krb5: Chase dd0ec030f8fd updating to current DSO Message-ID: References: <202507280358.56S3wRDV096604@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507280358.56S3wRDV096604@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4brNKR6mMpz3WjH X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Mon, Jul 28, 2025 at 03:58:27AM +0000, Cy Schubert wrote: > The branch main has been updated by cy: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c0fae431fd6ae9092d5f04da108b024f750834f1 > > commit c0fae431fd6ae9092d5f04da108b024f750834f1 > Author: Cy Schubert > AuthorDate: 2025-07-28 03:57:30 +0000 > Commit: Cy Schubert > CommitDate: 2025-07-28 03:58:20 +0000 > > krb5: Chase dd0ec030f8fd updating to current DSO > > Fixes: dd0ec030f8fd > --- > etc/gss-krb5/mech | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/etc/gss-krb5/mech b/etc/gss-krb5/mech > index 94fed68a24eb..b13f665705c5 100644 > --- a/etc/gss-krb5/mech > +++ b/etc/gss-krb5/mech > @@ -1,10 +1,10 @@ > # > # Name OID Library name Kernel module > -kerberosv5 1.2.840.113554.1.2.2 /usr/lib/libgssapi_krb5.so.121 kgssapi_krb5 Then would it be useful to generate the final installed mech file from a template, with a step that substitutes SHLIB_MAJOR into it? From nobody Mon Jul 28 16:07:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brNf33jh3z63Drn; Mon, 28 Jul 2025 16:07:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brNf31NNZz3XhD; Mon, 28 Jul 2025 16:07:07 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id gN7QuPEZa9JM2gQNWuYZWZ; Mon, 28 Jul 2025 16:07:06 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id gQNUu8zTWWX70gQNVu5hj9; Mon, 28 Jul 2025 16:07:06 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=d71WygjE c=1 sm=1 tr=0 ts=6887a02a a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=AFiWGAVX_hWdF8_zJ8cA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 339EF61B; Mon, 28 Jul 2025 09:07:04 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id F3DA1307; Mon, 28 Jul 2025 09:07:03 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c0fae431fd6a - main - krb5: Chase dd0ec030f8fd updating to current DSO In-reply-to: References: <202507280358.56S3wRDV096604@gitrepo.freebsd.org> Comments: In-reply-to Konstantin Belousov message dated "Mon, 28 Jul 2025 18:52:30 +0300." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 28 Jul 2025 09:07:03 -0700 Message-Id: <20250728160703.F3DA1307@slippy.cwsent.com> X-CMAE-Envelope: MS4xfK+AGKwEZcnzn57ubX5bRdMDvU2JYoV1TLjBTM0xWhXiFuDD9qC5NDwPvKv5Ger6OwVpRd5HNMiLo1GJm83Dahllv7Lh8vfgfbNJudg0ETyFMbICLurc O8Ujzdpvd6NUyz/E33d1HCoD9FVh68MS3dDDRiKN9c6RkbFXuX3oUSz0tMfVCwi1+La92ZCoH8xwDR4bbY19khAbN79U+wDmKPXAYRDD/yxRk4M7sHF2XCwZ x2Km2cw+7QhJj1gLTWhm+KvPbjMSAIFMdNLDexLuqBbYPAIdQ3U8ljzhbsApTI5C1OoxiYDI/fb0kvaPmh+7DFIHQCM5M9juzqRZcESNCOvH9kxbYQmxdzHE HiphK25n X-Rspamd-Queue-Id: 4brNf31NNZz3XhD X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message , Konstantin Belousov writes: > On Mon, Jul 28, 2025 at 03:58:27AM +0000, Cy Schubert wrote: > > The branch main has been updated by cy: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c0fae431fd6ae9092d5f04da108b02 > 4f750834f1 > > > > commit c0fae431fd6ae9092d5f04da108b024f750834f1 > > Author: Cy Schubert > > AuthorDate: 2025-07-28 03:57:30 +0000 > > Commit: Cy Schubert > > CommitDate: 2025-07-28 03:58:20 +0000 > > > > krb5: Chase dd0ec030f8fd updating to current DSO > > > > Fixes: dd0ec030f8fd > > --- > > etc/gss-krb5/mech | 16 ++++++++-------- > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/etc/gss-krb5/mech b/etc/gss-krb5/mech > > index 94fed68a24eb..b13f665705c5 100644 > > --- a/etc/gss-krb5/mech > > +++ b/etc/gss-krb5/mech > > @@ -1,10 +1,10 @@ > > # > > # Name OID Library name > Kernel module > > -kerberosv5 1.2.840.113554.1.2.2 /usr/lib/libgssapi_krb5.so.121 kgssapi > _krb5 > > Then would it be useful to generate the final installed mech file from a > template, with a step that substitutes SHLIB_MAJOR into it? That would be reasonable. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Mon Jul 28 16:19:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brNwg3tN6z63FR3; Mon, 28 Jul 2025 16:19:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brNwg39MPz3YYJ; Mon, 28 Jul 2025 16:19:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753719587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rv3vhg77mhOL5ZI7F+nKcllk1FUu88bRy8kNx6ToJPw=; b=DLKAgIELM50LBQ0kzrnEoy31EHJYgTT8mVddqOhxB7tLtSdFwuuLXmeDmn8PFvXK/XAE6n U90brFeTadfX/AoJYZwoQTKuGumK1GV17upLQI/uTd1oLmHvZEgBvAgZMWZ9/3Jt/0SLiy 4yB7yPi8/aWuKlQFYVNQ7q0bED5wiYvpEttyjfAqxkjAEMLP1ThWO4DDmlvb2/jmQTMFyC eyJ8RGoJDJClnjFO40JoB/35RqP3c0c0hX8ZGcVL8ICrOAfAlJJq3fpWXBh5NGiOuDdZ/x sUDCp899nKjNDrR5SjLLIavMaxjALBZKKKkQmDkbalmS9KTRknLcnJfz5hoRJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753719587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rv3vhg77mhOL5ZI7F+nKcllk1FUu88bRy8kNx6ToJPw=; b=Bz7sFr/FHszdxT+89wBVuR4Rs3MnXgzI6q9r+UNtLs1XerOSQKOakt6Nhy9gB6ZzkHUD2z gzKfKDtusIOE4UGowGswhNJIes9hSUutLHmhoFTJ1RT1spu2F7U/tQNWVdVxEqF+K0ec3Z d86GbgQu7h28T1ONQ50lShfmFez3CPJkk+ecY4od4l1EhKritpLH8+8gnq2vM2SxExP6Ss OGKX+FtWxw/MBxcgJBsIvRki5YyheDJ+8ujeaoXSgJAWd7VMLFEwgczRZMvbMVS5+ZoWkI Vqsk80Yc4edC6wwv8o0jVwUqN5Bk9Hty64Q9aD2TTUgczAz3O3LdDvl7Fap25A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753719587; a=rsa-sha256; cv=none; b=MRm5UKM+UoLijke1OV+/vlc4bbs3qyH7fE1sGEKWWA3SeUJ5CJOCdgcXsz1Hdcd+N9XTrF Cj0MOl569N7PZTF+LwehN/oJixG21UT+qFNkvPsiIMw/3OmmkX2zHZh6yOaTQNxQl/Ujbb cqjX9HPP1we/VgNo8q5pzwPRH1AtMzrE4cmbXZeSUzuOSYobbj8zPiN29oDkpeL/W1flau 1v9OxnHiCj3K9nTE4s5iW9S2XNFhELRKYq4HTia5VC8muSDr5WnY8Xxp59x5frN/vvyRcS irSgqsEI0IQazybBkLZejDg+1gPHMAvDWBGkFzOJovNPjDnwoNYp8cC1bjMNPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brNwg2ZJKzsHh; Mon, 28 Jul 2025 16:19:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SGJlug091621; Mon, 28 Jul 2025 16:19:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SGJllr091618; Mon, 28 Jul 2025 16:19:47 GMT (envelope-from git) Date: Mon, 28 Jul 2025 16:19:47 GMT Message-Id: <202507281619.56SGJllr091618@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: 748a4ea1caff - main - jail: Make prison_owns_vnet() operate on a prison instead of a ucred List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 748a4ea1caffca48c4949d5a7b964853c44fbdae Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=748a4ea1caffca48c4949d5a7b964853c44fbdae commit 748a4ea1caffca48c4949d5a7b964853c44fbdae Author: Mark Johnston AuthorDate: 2025-07-28 15:46:26 +0000 Commit: Mark Johnston CommitDate: 2025-07-28 16:19:38 +0000 jail: Make prison_owns_vnet() operate on a prison instead of a ucred This will be useful in an upcoming change. No functional change intended. Reviewed by: jamie MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51524 --- sys/kern/kern_jail.c | 17 +++++++---------- sys/kern/kern_sysctl.c | 2 +- sys/sys/jail.h | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index d4529e096929..7ef1d19f0ea8 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3466,7 +3466,7 @@ prison_check_af(struct ucred *cred, int af) pr = cred->cr_prison; #ifdef VIMAGE /* Prisons with their own network stack are not limited. */ - if (prison_owns_vnet(cred)) + if (prison_owns_vnet(pr)) return (0); #endif @@ -3531,7 +3531,7 @@ prison_if(struct ucred *cred, const struct sockaddr *sa) KASSERT(sa != NULL, ("%s: sa is NULL", __func__)); #ifdef VIMAGE - if (prison_owns_vnet(cred)) + if (prison_owns_vnet(cred->cr_prison)) return (0); #endif @@ -3648,7 +3648,7 @@ jailed_without_vnet(struct ucred *cred) if (!jailed(cred)) return (false); #ifdef VIMAGE - if (prison_owns_vnet(cred)) + if (prison_owns_vnet(cred->cr_prison)) return (false); #endif @@ -3711,20 +3711,17 @@ getjailname(struct ucred *cred, char *name, size_t len) #ifdef VIMAGE /* - * Determine whether the prison represented by cred owns - * its vnet rather than having it inherited. - * - * Returns true in case the prison owns the vnet, false otherwise. + * Determine whether the prison owns its VNET. */ bool -prison_owns_vnet(struct ucred *cred) +prison_owns_vnet(struct prison *pr) { /* * vnets cannot be added/removed after jail creation, * so no need to lock here. */ - return ((cred->cr_prison->pr_flags & PR_VNET) != 0); + return ((pr->pr_flags & PR_VNET) != 0); } #endif @@ -4425,7 +4422,7 @@ sysctl_jail_vnet(SYSCTL_HANDLER_ARGS) #ifdef VIMAGE struct ucred *cred = req->td->td_ucred; - havevnet = jailed(cred) && prison_owns_vnet(cred); + havevnet = jailed(cred) && prison_owns_vnet(cred->cr_prison); #else havevnet = 0; #endif diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 46226cc31980..25da134661e9 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -2368,7 +2368,7 @@ sysctl_root(SYSCTL_HANDLER_ARGS) priv = PRIV_SYSCTL_WRITEJAIL; #ifdef VIMAGE else if ((oid->oid_kind & CTLFLAG_VNET) && - prison_owns_vnet(req->td->td_ucred)) + prison_owns_vnet(req->td->td_ucred->cr_prison)) priv = PRIV_SYSCTL_WRITEJAIL; #endif else diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 08caa9f49270..24c420e2c976 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -435,7 +435,7 @@ void prison0_init(void); bool prison_allow(struct ucred *, unsigned); int prison_check(struct ucred *cred1, struct ucred *cred2); bool prison_check_nfsd(struct ucred *cred); -bool prison_owns_vnet(struct ucred *); +bool prison_owns_vnet(struct prison *pr); int prison_canseemount(struct ucred *cred, struct mount *mp); void prison_enforce_statfs(struct ucred *cred, struct mount *mp, struct statfs *sp); From nobody Mon Jul 28 16:19:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brNwj0Ggkz63FP3; Mon, 28 Jul 2025 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brNwh57klz3YxV; Mon, 28 Jul 2025 16: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=1753719588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sUucQDaXFfdgvFpFXNf0PnTXkpcnYlbHa3wdSxYEv+4=; b=A9hDd/jQaGo2lHSh0TTuUWQKQ1PB/rBc9DROoQTwSFW3hsvGw3dif9MlQfbYKk+MwSbHdC XN+2qO+eKTOQxkdevHaRC9B/TxXYxCaOgwmTlbEKrCchXTRn2js0XCcVqOld+ozza8omZE IVu6DCjt5msau7gcOp7gBVDHWHK0QzpNgqtIu0d452I7ObubPfVia81j9sgq5zlSYnzpd0 QOIJ7DyH/AsbyumbcmZQ53eQiFOOyOWBul0N0Y8YuAEGUhU9fEqAwAy7flXKDF8Fc9flkj CceyabmCngjmoGJjMNKBprqsKca7mHwEZzSWoyRmyOcU1aQaD3f4aUSlCtUGZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753719588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sUucQDaXFfdgvFpFXNf0PnTXkpcnYlbHa3wdSxYEv+4=; b=lnEPxlvOpCbnZEYru4q5sPOUVhWOlmNp/U7Pqqz0f3H1weGqeHdyZg5ICS+0OriOFef79M fH93w7xllQJPYN7Pey0idEBBmqRvQn0tUZtt4Vefcu4mllKELyq1pky8NKGdNnvxDHGYeo uVyAbOfZv9Q1i9J5nYwrGX9/dO+BiBAN1/LKh6ek94eceaqZHtIIWCaqIf+QpFdLSjFaZK g7e99MLwjuL1nqBOYS7CNBsehLZh4sIuWotNb99q2jOb/LJ1V40Ar5nLQzCBYZcYfzO7Z4 qkd0VDe41xD6Uu/Pk7+rjsxMNTWycpkfBEENs20Yh7TDU1MOVw2zDEVNgqNaVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753719588; a=rsa-sha256; cv=none; b=MVBRT1Tb9Xqn06b8q/0Fx+U/IC+TLnm/t092Oxbk28OB1D8hg6aMms5+WnzDUjg43gkvz1 CjV5vF6beD2qtZwnQ/witr7MrviCeLk6TzuvoiX84/xLY5f5jX1wY1z1X538YlIrZR1bBj UxoGSIhi/tPEbVk2/KTjPuchgmDNaWIl7sMRe2K5W3rBiJIsRxJv6H79NGg+hKwky1soM5 FmtDQn35teO5BrzsnYYS2wn8J8V5xnnA2pkNqR9YpmiLltXsKHO/7O9rvgIQmRthhtAnIw rqNh1ymiayA5z6DmXE7sspd/pw6REfPBKTb6PXuyTjgMHfxSEHWhR5Fg6cCZeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brNwh3KLVzsf0; Mon, 28 Jul 2025 16:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SGJm6U091663; Mon, 28 Jul 2025 16:19:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SGJm34091660; Mon, 28 Jul 2025 16:19:48 GMT (envelope-from git) Date: Mon, 28 Jul 2025 16:19:48 GMT Message-Id: <202507281619.56SGJm34091660@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: 96b29c7f0cff - main - if_ovpn: Destroy cloned interfaces via a prison removal callback List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 96b29c7f0cffd377a757ad8ccc0cdd8fcb96d0dd Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=96b29c7f0cffd377a757ad8ccc0cdd8fcb96d0dd commit 96b29c7f0cffd377a757ad8ccc0cdd8fcb96d0dd Author: Mark Johnston AuthorDate: 2025-07-28 15:46:37 +0000 Commit: Mark Johnston CommitDate: 2025-07-28 16:19:38 +0000 if_ovpn: Destroy cloned interfaces via a prison removal callback A if_ovpn interface carries a reference to a socket, which has a credential reference, which holds a reference on the containing prison and prevents SYSUNINITs from being invoked. So, register a PR_METHOD_REMOVE callback and destroy the cloner from there instead, since that mechanism doesn't require the prison refcount to drop to zero first. This fixes a bug where jails get left stuck in the DYING state after running if_ovpn regression tests. Reviewed by: kp MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51526 --- sys/net/if_ovpn.c | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index fdbf70465338..fe3e7bbd7fff 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -34,11 +34,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -2784,23 +2786,53 @@ vnet_ovpn_init(const void *unused __unused) VNET_SYSINIT(vnet_ovpn_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_ovpn_init, NULL); -static void -vnet_ovpn_uninit(const void *unused __unused) +static int +ovpn_prison_remove(void *obj, void *data __unused) { - if_clone_detach(V_ovpn_cloner); +#ifdef VIMAGE + struct prison *pr; + + pr = obj; + if (prison_owns_vnet(pr)) { + CURVNET_SET(pr->pr_vnet); + if (V_ovpn_cloner != NULL) { + ifc_detach_cloner(V_ovpn_cloner); + V_ovpn_cloner = NULL; + } + CURVNET_RESTORE(); + } +#endif + return (0); } -VNET_SYSUNINIT(vnet_ovpn_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, - vnet_ovpn_uninit, NULL); static int ovpnmodevent(module_t mod, int type, void *data) { + static int ovpn_osd_jail_slot; + switch (type) { - case MOD_LOAD: - /* Done in vnet_ovpn_init() */ + case MOD_LOAD: { + /* + * Registration is handled in vnet_ovpn_init(), but cloned + * interfaces must be destroyed via PR_METHOD_REMOVE since they + * hold a reference to the prison via the UDP socket, which + * prevents the prison from being destroyed. + */ + osd_method_t methods[PR_MAXMETHOD] = { + [PR_METHOD_REMOVE] = ovpn_prison_remove, + }; + ovpn_osd_jail_slot = osd_jail_register(NULL, methods); break; + } case MOD_UNLOAD: - /* Done in vnet_ovpn_uninit() */ + if (ovpn_osd_jail_slot != 0) + osd_jail_deregister(ovpn_osd_jail_slot); + CURVNET_SET(vnet0); + if (V_ovpn_cloner != NULL) { + ifc_detach_cloner(V_ovpn_cloner); + V_ovpn_cloner = NULL; + } + CURVNET_RESTORE(); break; default: return (EOPNOTSUPP); From nobody Mon Jul 28 16:19:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brNwk0LsXz63FR5; Mon, 28 Jul 2025 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brNwj5nGqz3Ymy; Mon, 28 Jul 2025 16: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=1753719589; h=from:from:reply-to:subject:subject: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/SE4fImxn58L1N944U4VcVZIwbGtJX/V+trbBRsSuU=; b=Tv5hWJbNEudPyOWaLTM+MEgtk5tHjpLWEA5ik+fuDjOG2BEaK7QLT1f2IbVpybjygLRsCX pzJZU9ozX0Y3ibvyWbqfv2twJy/jZL/symXbkmV3yzGE2imqtyXJ87unymCy1cCuZv05Q7 yk9YPRhZHVNRyqVj3p6eZSEIGgEN4TyaBxokpxP0UJBSh0iVWEw2rPxUBLc+7Ookh4q5Hh RrAm5V8VUSQ9uYFfm2XrbG7J5W0E9v4kgf10A+TXVW/GJMf5R3yZ/bkXsXAW7g4wAhOB1i tH+b9n9Lqx8T3AUVSiuXOs4tYbZup/Br2/PbT1rg4Bs59397pJZPotHZ1R+D/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753719589; h=from:from:reply-to:subject:subject: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/SE4fImxn58L1N944U4VcVZIwbGtJX/V+trbBRsSuU=; b=iU+VYN67YZDqErXXrnveS6sImbQYBWDaf2TWGUKBCCl9RakQc1N9nmrZurZqwfVhF8BvG5 KpMxzOdn+uoF5InynS9SUPz8yotGNT1IfFA/dEOxIiaL+YRXSPCVSPgMpObRMAHnU1xj4I biJENFr6VkCDMtD3ed2SPJLKH1LSYwaZnIz+UzzhMCFKgbUviD3F9lQYHMbdj9kIwr5T38 rMu5d/E8Ohc91BBdPhp3wJ+UNIIOO2UbpVMfTPD5mZfuQdzXQ3UCh532QQLNtBJ5fRSVQO 5S5G5vfb0DGfKpWZrb4VfhL2PPL2Y6Rf3X865lOMpc2dg/h09UEwHFZo2Oi96g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753719589; a=rsa-sha256; cv=none; b=cZdpRCaIcaZlPyJPIUzm1uXug3CGMhqdn52o0meUA+6OkYXoazFmEOBr+1cUsyBxl2gzKZ ZCW8XNc+CSHydC5JL0DzD6kJ35hKipVINQpjJWkvCYqVcjCfXScoS3f7ahz2YQ6PQlEb0m KfjO93uMSDtuuV2fnJCTWMg9BdLqCyeGG4R9P93CV+FdzMLyW9xM9Kks1ZV7T3sb+8CteE Olxn9gLdvHOxhMdkdOV3TwXXmQDmDeFlcwXKa5gToryK22YVxS8GfV1OxiyZyT7KgbABYN wTi6i8MJzL2Jgv75WQPlxMkUMyMRVckH5f2KRPzWOH+3lPJsdjHfJizs/hxgLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brNwj4xkXzsFy; Mon, 28 Jul 2025 16:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SGJni7091697; Mon, 28 Jul 2025 16:19:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SGJnXb091694; Mon, 28 Jul 2025 16:19:49 GMT (envelope-from git) Date: Mon, 28 Jul 2025 16:19:49 GMT Message-Id: <202507281619.56SGJnXb091694@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: 3b263fa76c08 - main - if_tuntap: Try to fix device refcount bugs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 3b263fa76c08993f37ce94cb7cd4605f67dd5965 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b263fa76c08993f37ce94cb7cd4605f67dd5965 commit 3b263fa76c08993f37ce94cb7cd4605f67dd5965 Author: Mark Johnston AuthorDate: 2025-07-28 16:03:20 +0000 Commit: Mark Johnston CommitDate: 2025-07-28 16:19:38 +0000 if_tuntap: Try to fix device refcount bugs There are two ways to create a tun device, via devfs cloning or with ifconfig. The latter is implemented by tun_clone_create() and the former by tunclone(), which invokes tun_clone_create() via if_clone_create(). Both of these functions were invoking dev_ref() after creating the devfs_node(), but this was extraneous. tunclone() does need to acquire an extra reference since this is required by the dev_clone EVENTHANDLER interface contract, but it was already doing so by specifying MAKEDEV_REF. Fix this by removing unnecessary refcount acquisitions. A second problem is with teardown in a VNET jail. A tun interface created by device cloning will hold a credential reference for the jail, which prevents it from being destroyed and in particular prevents VNET SYSUNINITs from running. To fix this, we need to register a PR_METHOD_REMOVE callback for jail teardown which, in a VNET jail, destroys cloned interfaces. This way, jail teardown can proceed. These bugs are noticeable with something like # jail -c name=test vnet command=ls /dev/tun # jls -vd While here, add some comments and be sure to destroy a nascent mutex and condition variable in an error path. Reviewed by: kib MFC after: 1 month Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51525 --- sys/net/if_tuntap.c | 76 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 3bab04aa4d38..5e6f65c04b2f 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -74,6 +74,7 @@ #include #include #include +#include #include #include @@ -178,6 +179,7 @@ struct tuntap_softc { static struct mtx tunmtx; static eventhandler_tag arrival_tag; static eventhandler_tag clone_tag; +static int tuntap_osd_jail_slot; static const char tunname[] = "tun"; static const char tapname[] = "tap"; static const char vmnetname[] = "vmnet"; @@ -497,6 +499,10 @@ vmnet_clone_match(struct if_clone *ifc, const char *name) return (0); } +/* + * Create a clone via the ifnet cloning mechanism. Note that this is invoked + * indirectly by tunclone() below. + */ static int tun_clone_create(struct if_clone *ifc, char *name, size_t len, struct ifc_data *ifd, struct ifnet **ifpp) @@ -532,15 +538,19 @@ tun_clone_create(struct if_clone *ifc, char *name, size_t len, if (i != 0) i = tun_create_device(drv, unit, NULL, &dev, name); if (i == 0) { - dev_ref(dev); + struct tuntap_softc *tp; + tuncreate(dev); - struct tuntap_softc *tp = dev->si_drv1; + tp = dev->si_drv1; *ifpp = tp->tun_ifp; } return (i); } +/* + * Create a clone via devfs access. + */ static void tunclone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev) @@ -595,11 +605,12 @@ tunclone(void *arg, struct ucred *cred, char *name, int namelen, } i = tun_create_device(drv, u, cred, dev, name); - } - if (i == 0) { + } else { + /* Consumed by the dev_clone invoker. */ dev_ref(*dev); - if_clone_create(name, namelen, NULL); } + if (i == 0) + if_clone_create(name, namelen, NULL); out: CURVNET_RESTORE(); } @@ -669,16 +680,6 @@ vnet_tun_init(const void *unused __unused) VNET_SYSINIT(vnet_tun_init, SI_SUB_PROTO_IF, SI_ORDER_ANY, vnet_tun_init, NULL); -static void -vnet_tun_uninit(const void *unused __unused) -{ - - for (u_int i = 0; i < NDRV; ++i) - if_clone_detach(V_tuntap_driver_cloners[i]); -} -VNET_SYSUNINIT(vnet_tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, - vnet_tun_uninit, NULL); - static void tun_uninit(const void *unused __unused) { @@ -689,6 +690,16 @@ tun_uninit(const void *unused __unused) EVENTHANDLER_DEREGISTER(ifnet_arrival_event, arrival_tag); EVENTHANDLER_DEREGISTER(dev_clone, clone_tag); + CURVNET_SET(vnet0); + for (u_int i = 0; i < NDRV; i++) { + if_clone_detach(V_tuntap_driver_cloners[i]); + V_tuntap_driver_cloners[i] = NULL; + } + CURVNET_RESTORE(); + + if (tuntap_osd_jail_slot != 0) + osd_jail_deregister(tuntap_osd_jail_slot); + mtx_lock(&tunmtx); while ((tp = TAILQ_FIRST(&tunhead)) != NULL) { TAILQ_REMOVE(&tunhead, tp, tun_list); @@ -724,6 +735,30 @@ tuntap_driver_from_ifnet(const struct ifnet *ifp) return (NULL); } +/* + * Remove devices that were created by devfs cloning, as they hold references + * which prevent the prison from collapsing, in which state VNET sysuninits will + * not be invoked. + */ +static int +tuntap_prison_remove(void *obj, void *data __unused) +{ +#ifdef VIMAGE + struct prison *pr; + + pr = obj; + if (prison_owns_vnet(pr)) { + CURVNET_SET(pr->pr_vnet); + for (u_int i = 0; i < NDRV; i++) { + if_clone_detach(V_tuntap_driver_cloners[i]); + V_tuntap_driver_cloners[i] = NULL; + } + CURVNET_RESTORE(); + } +#endif + return (0); +} + static int tuntapmodevent(module_t mod, int type, void *data) { @@ -738,8 +773,12 @@ tuntapmodevent(module_t mod, int type, void *data) clone_setup(&drv->clones); drv->unrhdr = new_unrhdr(0, IF_MAXUNIT, &tunmtx); } + osd_method_t methods[PR_MAXMETHOD] = { + [PR_METHOD_REMOVE] = tuntap_prison_remove, + }; + tuntap_osd_jail_slot = osd_jail_register(NULL, methods); arrival_tag = EVENTHANDLER_REGISTER(ifnet_arrival_event, - tunrename, 0, 1000); + tunrename, 0, 1000); if (arrival_tag == NULL) return (ENOMEM); clone_tag = EVENTHANDLER_REGISTER(dev_clone, tunclone, 0, 1000); @@ -747,7 +786,7 @@ tuntapmodevent(module_t mod, int type, void *data) return (ENOMEM); break; case MOD_UNLOAD: - /* See tun_uninit, so it's done after the vnet_sysuninit() */ + /* See tun_uninit(). */ break; default: return EOPNOTSUPP; @@ -798,6 +837,8 @@ tun_create_device(struct tuntap_driver *drv, int unit, struct ucred *cr, args.mda_si_drv1 = tp; error = make_dev_s(&args, dev, "%s", name); if (error != 0) { + mtx_destroy(&tp->tun_mtx); + cv_destroy(&tp->tun_cv); free(tp, M_TUN); return (error); } @@ -914,7 +955,6 @@ tap_transmit(struct ifnet *ifp, struct mbuf *m) return (error); } -/* XXX: should return an error code so it can fail. */ static void tuncreate(struct cdev *dev) { From nobody Mon Jul 28 16:22:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brP0D5DvLz63Fbr; Mon, 28 Jul 2025 16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brP0D4XDDz3b8s; Mon, 28 Jul 2025 16: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=1753719772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9SLpE9yTXAQT5OgWMkhg0EmQh58UcL/tc3F1LE0LR4=; b=I3KRb3T6QlShi4WK9oo3gwxYajuoiOi9pdYNjEsTmEyK1WUAisE8gxJ8tl6IsMOFq6hbnt Inm5v0zrdweFHKvcYaL4MoNoZ8/bKY6u9dwX0boKbZmfpXO/HYjRPFKOpf3BLdxTmfmRyN /eUYsq6Y78DxRrFQoJ7bEB/tQiihLsNUGJSsN2l/pprcGyFvYN5gFvOCOdZxZhUokM6w2k 9DTsXp2BW8ZdeVkVVjUKiCp6ajc+kYa5bhLfx7SJEstE2t906V+yQ2pR3n6gCpdkGRIXkN +1/uTQxCnJZwBTsZ1/pQl54Vaeem2KCCvbe1pfi6qdEineRlwox/wAsqdMJOaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753719772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9SLpE9yTXAQT5OgWMkhg0EmQh58UcL/tc3F1LE0LR4=; b=q2KRLmq9YOWdVzrKJiyxi0JjUDPRtgcKpv5qFki/hnDf0YKJgYK7e96qnoLw+J75PTnKIC xhGYsiKC6RW1/3jFPeAz/YbGH03t6orF9+d8WtSF44ec9Urpqgma+mGqoHpOmbjqBKRfr5 a4dJgyLIEvR6C87fWsLFMuab1ramnMUZbzsEY8E9X2VVDjqVp6UN7Pe6fDI5B/7K/EMoQn xUQrAnJ7skEWVpzGyzv13KI7qKMAQyj9lIMZPLectCmi7njakipX76PtZzC1o49dwdDp9y 4a4PbOiZZxHpu4fCHbUItzn2MHPW4CNIg2cI78X90HZjEfUNS6kQe2xzuwMh0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753719772; a=rsa-sha256; cv=none; b=RxQXhk8NjRad5BFAtKZPSd2FyTtYlcqm/x7IKgxSInAtKUvS0pnGuJnsH972/0Aa2SXEmf h8v0PwVYmCu3/YI4/Ho3uHEmfc/52hEqmaeDzNyBSvKq/aZMxL8759qmrtG3QJRE1oNbpk KJeZvk2EYmyXDMp/eUKGPkX/i4aVtS+PoQOQX539nknTCmHpgMn8AtIT+Wg21meLtMhU2z jvYnfxWSpWBkjvpz0i4rLsbzWQuQGT/OUYIjTyh6CFrIf47M+GoEs45C+kiuhVQBsB2f0F Q1qO+AdYVM0ADU6FLe/G5ynuWvJMgCZJl0jyrynkUCTi/0lu7smf3rPzLXrNKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brP0D3xSXztBv; Mon, 28 Jul 2025 16:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SGMqaV008099; Mon, 28 Jul 2025 16:22:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SGMqfk008096; Mon, 28 Jul 2025 16:22:52 GMT (envelope-from git) Date: Mon, 28 Jul 2025 16:22:52 GMT Message-Id: <202507281622.56SGMqfk008096@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: 73e3f094faef - main - exterr: enqueue ktrace event on syscall exit instead of at EXTERROR() call List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 73e3f094faefea012ce978986c2c5d9e4d417acb Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=73e3f094faefea012ce978986c2c5d9e4d417acb commit 73e3f094faefea012ce978986c2c5d9e4d417acb Author: Konstantin Belousov AuthorDate: 2025-07-28 15:04:53 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-28 16:22:33 +0000 exterr: enqueue ktrace event on syscall exit instead of at EXTERROR() call This restores the feature of EXTERROR() being allowed at any context except the interrupt handlers. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51595 --- sys/kern/sys_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index b472aaea89e6..5606b36f772f 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2269,6 +2269,7 @@ exterr_copyout(struct thread *td) ue.error = 0; sz = sizeof(ue.error); } else { + ktrexterr(td); sz = sizeof(ue) - __offsetof(struct uexterror, error); } error = copyout(&ue.error, uloc, sz); @@ -2335,7 +2336,6 @@ exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, td->td_kexterr.p1 = pp1; td->td_kexterr.p2 = pp2; td->td_kexterr.src_line = line; - ktrexterr(td); } return (eerror); } From nobody Mon Jul 28 16:29:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brP7y4JfNz63G2M; Mon, 28 Jul 2025 16:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brP7y3XPcz3c43; Mon, 28 Jul 2025 16:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753720174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7AMCG/tPT1KZTkcSkPPaYfViR0/M5HG8ATehAKe5cE=; b=k8j2xzpGngRAo0Y/5vwOvDYsdVSfofKzt74WoeJLVgQ808ZC2HbwMtAVt4uvD68Hc39yxF cB6h+4+Z6yxD+eGNHs0q/SrFO1pYSh/KJ9P0+xXM8cfGpJ/pO7tbEPASIQXmqalIEWkP3e 1AORGYzaMdA4wFJFIV9DQORiNMZVn7ChrYt4M5EneQz4tSjCEK8C72lEOi1Imf4nGw/WE4 WsUyosK9fWAL1zXGMd0yup9KIKhF0qCeW1wLu/sKyFI8PCYW9k8tJv6vThCFnWj2cUZKn0 xeD4y/p+DYWwvrJaA/EwsP8th00fB0fHg/bClodIwlAU9+BaZAMr+IE7ODgjpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753720174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7AMCG/tPT1KZTkcSkPPaYfViR0/M5HG8ATehAKe5cE=; b=pDMsMzCGNubXlaLsc91gYjl+lGcfGPGBOvaV2xBnGkkuSwrwc4sXgMeNf8q6kJbWVVqebh FsvES110S+KGUGHLhk3u9zQxlyx3wzDf7PCiSxa8KpidSndG+EQKczgNkFsaHm0npVWOqV c9+1fxfp9++ICJlzE2jbduGc5bmMduAmHbB8UBlZIyy97h8U8ZIxy4WIKzgbkvgigRHj/H Ize2Tu82Z/bzAiUF2mm7wAUAhCfhZojZNqW4rIAWz3dOofdBHa1qC6EUP8EGmv7SsSYiGD pEzbjSbxNEqXvilToxROZ3rMpGbAgcaQmy6oGARxY7o5gdNhI0Kw0HoY2ApnrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753720174; a=rsa-sha256; cv=none; b=vVNw5+JbLy2++GIAeYuEbJaVctgOcTy8L3+V/M0iPoG9gAgTcs2OTiw+4GL30+rq+M3J5w QeWdK0rdZ3+QUEf4P4Lrm4l0AlH9IBOcsu9dpuMsqO5iF5h5sqlHAWpe1OenthPQEInU/l nf1BfrGVVTgCVyZb/EksvACFUYVAijdgsXzrnL0sVVWKFOgEFQpcWG6MWkAIBysPj6+JXr rKPaMjNTOIa6DU6hkf7XvQ40i63F9eK1K1qrn6EXQFaZQNTVd8RN8ZZGzjdNxctkQL0Twg EcWNdpEppcok1U1MA0PM1DpYio3n+uXXvZ+gWu3g4+oPXjH//qFnvG+QTcHKeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brP7y2vwszsq9; Mon, 28 Jul 2025 16:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SGTYcA010363; Mon, 28 Jul 2025 16:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SGTYvj010360; Mon, 28 Jul 2025 16:29:34 GMT (envelope-from git) Date: Mon, 28 Jul 2025 16:29:34 GMT Message-Id: <202507281629.56SGTYvj010360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 328110da2661 - main - Move toolchain utils to -toolchain package List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 328110da2661a8841f12000b99fea27ceacdd5b2 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=328110da2661a8841f12000b99fea27ceacdd5b2 commit 328110da2661a8841f12000b99fea27ceacdd5b2 Author: Lexi Winter AuthorDate: 2025-07-28 16:29:09 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 16:29:29 +0000 Move toolchain utils to -toolchain package Move LLVM ar, nm, and size. Also move elftoolchain strings, which should have already been there. The remaining LLVM utilities (including strings) stay in -clang for now since they're links to other executables. Reviewed by: des, dim Differential Revision: https://reviews.freebsd.org/D51583 --- usr.bin/clang/clang.prog.mk | 2 +- usr.bin/clang/llvm-ar/Makefile | 1 + usr.bin/clang/llvm-nm/Makefile | 1 + usr.bin/clang/llvm-size/Makefile | 1 + usr.bin/clang/llvm.prog.mk | 2 +- usr.bin/strings/Makefile | 2 ++ 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.bin/clang/clang.prog.mk b/usr.bin/clang/clang.prog.mk index 36c601bcbe36..3baf3d0baf0f 100644 --- a/usr.bin/clang/clang.prog.mk +++ b/usr.bin/clang/clang.prog.mk @@ -31,7 +31,7 @@ DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} .endfor -PACKAGE= clang +PACKAGE?= clang .if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) LIBADD+= execinfo diff --git a/usr.bin/clang/llvm-ar/Makefile b/usr.bin/clang/llvm-ar/Makefile index fd12b1ddef57..e019c89b3581 100644 --- a/usr.bin/clang/llvm-ar/Makefile +++ b/usr.bin/clang/llvm-ar/Makefile @@ -1,5 +1,6 @@ .include +PACKAGE= toolchain PROG_CXX= llvm-ar MAN= llvm-ar.1 llvm-ranlib.1 diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile index 825faf74719b..7e089d1b408d 100644 --- a/usr.bin/clang/llvm-nm/Makefile +++ b/usr.bin/clang/llvm-nm/Makefile @@ -1,5 +1,6 @@ .include +PACKAGE= toolchain PROG_CXX= llvm-nm SRCDIR= llvm/tools/llvm-nm diff --git a/usr.bin/clang/llvm-size/Makefile b/usr.bin/clang/llvm-size/Makefile index 2860a0069538..9d3505cdd319 100644 --- a/usr.bin/clang/llvm-size/Makefile +++ b/usr.bin/clang/llvm-size/Makefile @@ -1,5 +1,6 @@ .include +PACKAGE= toolchain PROG_CXX= llvm-size SRCDIR= llvm/tools/llvm-size diff --git a/usr.bin/clang/llvm.prog.mk b/usr.bin/clang/llvm.prog.mk index f702082e31bd..c369fe8d5944 100644 --- a/usr.bin/clang/llvm.prog.mk +++ b/usr.bin/clang/llvm.prog.mk @@ -25,7 +25,7 @@ DPADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${LIBPRIV}${lib}.${LIBEXT} .endfor -PACKAGE= clang +PACKAGE?= clang .if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) LIBADD+= execinfo diff --git a/usr.bin/strings/Makefile b/usr.bin/strings/Makefile index 8e2572810947..c01e775b0b89 100644 --- a/usr.bin/strings/Makefile +++ b/usr.bin/strings/Makefile @@ -1,5 +1,7 @@ .include +PACKAGE= toolchain + ELFTCDIR= ${SRCTOP}/contrib/elftoolchain .PATH: ${ELFTCDIR}/strings From nobody Mon Jul 28 17:27:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brQQX1mcWz63JbS; Mon, 28 Jul 2025 17:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brQQX0qvjz3hGX; Mon, 28 Jul 2025 17:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753723636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QNldI+g678nTcmzX20Po/K3qd5T8/NwgQLtojaTlckI=; b=qdf7nIcd4rUoyNfnXabhl7tGd9E4x8TaZCCEMJdxRNGVkHGZzQ8+gGHy3z/K50jlziepPl 0XHAcFCn0D0ncEyjsaguUFjy0GNJtnAzryThXhky0k8WC8GBa75AHRD7iIKsebaw9Z89cX IowHVgYqbBvADxE2QYe9Lrcs4o2gSTH0Kfem0U1db2XMN76HD9zjH8ED+74JbmdL52X2VL S3NXPOgT4J+1Ja7ccH/rgg2C3EHuMQazCfn6X9x4HuZgUcI61Do2GenDS7KG81K90bCBXv T661jxcEheRcszKe2PYhh1wmbVAn/IJvv6y8fQ32vB41gxJ4aYV4Oe0aT/4aMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753723636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QNldI+g678nTcmzX20Po/K3qd5T8/NwgQLtojaTlckI=; b=dkuajcTUHQn85K0C9h15lyG+aFM6ESx0kNxwenTtjchGZwpZmn8+IdVkLLj9NEm4/z6fcL IMKgORFR37KUE+9j4WmS2Gn+b7gx0RADR4lLsCT92MNuG2YMPPPkfVFAL/QC+TZK7iZkZf yTnrN1CaAdreUZgvE4ZUkrFJs0QcOLywFZELj9fX+QZmuk6azv1apxq065RGtDC4jX0iR7 +cZodawOQVW5he+liWj2V/3uxmdAqAVhjQEX7xDMrxQ9ZEu1h7uXKV4KHXmi/nYAenddJ3 hSqutHbyfmEYSch2yTvTKRu3hYAKQmyuRmXvRXPnH3MXoDHqnUzWRZ4sxayCBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753723636; a=rsa-sha256; cv=none; b=lJtZcddWHEs2Gal94nhaxAS1RFf8xuO9MoJxcpP2ZbcV+OwnYmI3OI4WZ7ABVt9vcxRq3E vfX/zZGF9CwTWREFSe3dgWXmJuuJZUbUh6lKlsckLi8AfwBPtFD3adL9jtJZzYmhOYEBqp MZq97lL080kCmPrF6g0KSIoon2CLNkEzwI9X+eUrRLhfcK5qUF+xusAtjKuXNKC2afVnNC T9aRuYAxdHSbWCP3jB1oO982HNqVw7J7DNXHHB30k0vB+Uf9udXsZX4kogI+kmWa2Har3V FqPiMh6+DUFPJ87wMYSKMQS24BhXCW7SUKzHFWFscDXcga1DirfcDERP61pDeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brQQX0748zvRC; Mon, 28 Jul 2025 17:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SHRFm0023314; Mon, 28 Jul 2025 17:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SHRFkc023311; Mon, 28 Jul 2025 17:27:15 GMT (envelope-from git) Date: Mon, 28 Jul 2025 17:27:15 GMT Message-Id: <202507281727.56SHRFkc023311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 4d281507f5f1 - main - bridge: be consistent about PVID terminology List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d281507f5f159e0717ae9f4a46cf6fbca67e23d Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=4d281507f5f159e0717ae9f4a46cf6fbca67e23d commit 4d281507f5f159e0717ae9f4a46cf6fbca67e23d Author: Lexi Winter AuthorDate: 2025-07-28 17:26:22 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 17:26:22 +0000 bridge: be consistent about PVID terminology The PVID option is exposed to the user as 'untagged', but the API was inconsistent on whether it's called 'untagged' or 'PVID'. Standardise on calling it PVID everywhere in the code, since this is the 802.1Q terminology. Keep 'untagged' as the user-facing term since sysadmins are not network admins and are often not familiar with the term PVID. Approved by: des Differential Revision: https://reviews.freebsd.org/D51182 --- sbin/ifconfig/ifbridge.c | 16 ++++++++-------- sys/net/if_bridge.c | 28 ++++++++++++++-------------- sys/net/if_bridgevar.h | 4 ++-- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 9b46cc70c409..a75c37e640a2 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -256,8 +256,8 @@ bridge_status(if_ctx *ctx) else printf(" ", state); } - if (member->ifbr_untagged != 0) - printf(" untagged %u", (unsigned)member->ifbr_untagged); + if (member->ifbr_pvid != 0) + printf(" untagged %u", (unsigned)member->ifbr_pvid); print_vlans(&bridge->member_vlans[i]); printf("\n"); } @@ -632,11 +632,11 @@ setbridge_untagged(if_ctx *ctx, const char *ifn, const char *vlanid) memset(&req, 0, sizeof(req)); strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname)); - if (get_vlan_id(vlanid, &req.ifbr_untagged) < 0) + if (get_vlan_id(vlanid, &req.ifbr_pvid) < 0) errx(1, "invalid VLAN identifier: %s", vlanid); - if (do_cmd(ctx, BRDGSIFUNTAGGED, &req, sizeof(req), 1) < 0) - err(1, "BRDGSIFUNTAGGED %s", vlanid); + if (do_cmd(ctx, BRDGSIFPVID, &req, sizeof(req), 1) < 0) + err(1, "BRDGSIFPVID %s", vlanid); } static void @@ -647,10 +647,10 @@ unsetbridge_untagged(if_ctx *ctx, const char *ifn, int dummy __unused) memset(&req, 0, sizeof(req)); strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname)); - req.ifbr_untagged = 0; + req.ifbr_pvid = 0; - if (do_cmd(ctx, BRDGSIFUNTAGGED, &req, sizeof(req), 1) < 0) - err(1, "BRDGSIFUNTAGGED"); + if (do_cmd(ctx, BRDGSIFPVID, &req, sizeof(req), 1) < 0) + err(1, "BRDGSIFPVID"); } static void diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 3327c863468f..64aaecf6f029 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -257,8 +257,8 @@ struct bridge_iflist { uint32_t bif_addrcnt; /* cur. # of addresses */ uint32_t bif_addrexceeded;/* # of address violations */ struct epoch_context bif_epoch_ctx; - ether_vlanid_t bif_untagged; /* untagged vlan id */ - ifbvlan_set_t bif_vlan_set; /* allowed tagged vlans */ + ether_vlanid_t bif_pvid; /* port vlan id */ + ifbvlan_set_t bif_vlan_set; /* if allowed tagged vlans */ }; /* @@ -407,7 +407,7 @@ static int bridge_ioctl_sma(struct bridge_softc *, void *); static int bridge_ioctl_sifprio(struct bridge_softc *, void *); static int bridge_ioctl_sifcost(struct bridge_softc *, void *); static int bridge_ioctl_sifmaxaddr(struct bridge_softc *, void *); -static int bridge_ioctl_sifuntagged(struct bridge_softc *, void *); +static int bridge_ioctl_sifpvid(struct bridge_softc *, void *); static int bridge_ioctl_sifvlanset(struct bridge_softc *, void *); static int bridge_ioctl_gifvlanset(struct bridge_softc *, void *); static int bridge_ioctl_addspan(struct bridge_softc *, void *); @@ -628,7 +628,7 @@ static const struct bridge_control bridge_control_table[] = { { bridge_ioctl_sifmaxaddr, sizeof(struct ifbreq), BC_F_COPYIN|BC_F_SUSER }, - { bridge_ioctl_sifuntagged, sizeof(struct ifbreq), + { bridge_ioctl_sifpvid, sizeof(struct ifbreq), BC_F_COPYIN|BC_F_SUSER }, { bridge_ioctl_sifvlanset, sizeof(struct ifbif_vlan_req), @@ -1533,7 +1533,7 @@ bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg) req->ifbr_addrcnt = bif->bif_addrcnt; req->ifbr_addrmax = bif->bif_addrmax; req->ifbr_addrexceeded = bif->bif_addrexceeded; - req->ifbr_untagged = bif->bif_untagged; + req->ifbr_pvid = bif->bif_pvid; /* Copy STP state options as flags */ if (bp->bp_operedge) @@ -1913,7 +1913,7 @@ bridge_ioctl_sifmaxaddr(struct bridge_softc *sc, void *arg) } static int -bridge_ioctl_sifuntagged(struct bridge_softc *sc, void *arg) +bridge_ioctl_sifpvid(struct bridge_softc *sc, void *arg) { struct ifbreq *req = arg; struct bridge_iflist *bif; @@ -1922,12 +1922,12 @@ bridge_ioctl_sifuntagged(struct bridge_softc *sc, void *arg) if (bif == NULL) return (EXTERROR(ENOENT, "Interface is not a bridge member")); - if (req->ifbr_untagged > DOT1Q_VID_MAX) + if (req->ifbr_pvid > DOT1Q_VID_MAX) return (EXTERROR(EINVAL, "Invalid VLAN ID")); - if (req->ifbr_untagged != DOT1Q_VID_NULL) + if (req->ifbr_pvid != DOT1Q_VID_NULL) bif->bif_flags |= IFBIF_VLANFILTER; - bif->bif_untagged = req->ifbr_untagged; + bif->bif_pvid = req->ifbr_pvid; return (0); } @@ -2303,8 +2303,8 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m, * the VLAN header. */ if ((bif->bif_flags & IFBIF_VLANFILTER) && - bif->bif_untagged != DOT1Q_VID_NULL && - VLANTAGOF(m) == bif->bif_untagged) { + bif->bif_pvid != DOT1Q_VID_NULL && + VLANTAGOF(m) == bif->bif_pvid) { m->m_flags &= ~M_VLANTAG; m->m_pkthdr.ether_vtag = 0; } @@ -3170,14 +3170,14 @@ bridge_vfilter_in(const struct bridge_iflist *sbif, struct mbuf *m) * The frame doesn't have a tag. If the interface does not * have an untagged vlan configured, drop the frame. */ - if (sbif->bif_untagged == DOT1Q_VID_NULL) + if (sbif->bif_pvid == DOT1Q_VID_NULL) return (false); /* * Otherwise, insert a new tag based on the interface's * untagged vlan id. */ - m->m_pkthdr.ether_vtag = sbif->bif_untagged; + m->m_pkthdr.ether_vtag = sbif->bif_pvid; m->m_flags |= M_VLANTAG; } else { /* @@ -3238,7 +3238,7 @@ bridge_vfilter_out(const struct bridge_iflist *dbif, const struct mbuf *m) * If the frame's vlan matches the interfaces's untagged vlan, * allow it. */ - if (vlan == dbif->bif_untagged) + if (vlan == dbif->bif_pvid) return (true); /* diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index 97b63e3d4416..c458dcc152a0 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -124,7 +124,7 @@ #define BRDGSPROTO 28 /* set protocol (ifbrparam) */ #define BRDGSTXHC 29 /* set tx hold count (ifbrparam) */ #define BRDGSIFAMAX 30 /* set max interface addrs (ifbreq) */ -#define BRDGSIFUNTAGGED 31 /* set if untagged vlan */ +#define BRDGSIFPVID 31 /* set if PVID */ #define BRDGSIFVLANSET 32 /* set if vlan set */ #define BRDGGIFVLANSET 33 /* get if vlan set */ @@ -144,7 +144,7 @@ struct ifbreq { uint32_t ifbr_addrcnt; /* member if addr number */ uint32_t ifbr_addrmax; /* member if addr max */ uint32_t ifbr_addrexceeded; /* member if addr violations */ - ether_vlanid_t ifbr_untagged; /* member if untagged vlan */ + ether_vlanid_t ifbr_pvid; /* member if PVID */ uint8_t pad[32]; }; From nobody Mon Jul 28 17:38:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brQgD3K23z63JfV; Mon, 28 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brQgD2WwTz3k9p; Mon, 28 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753724296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=091g7KKAaEoR6fbymXRMwq09SMxzMk4HTk6iggGoIcM=; b=i5M+OH64h2tNl31GILosUYB6UPcuEE+ob+OAolQhKcTRmbQ9egsnK668MtF0GPZelq1IIz yGVDOMD97EoS8s/911eH/XB7NEV2tjZt/Kxz26N5Peq14IphDXUizcUQ2EIafXw4fql/Nu x1wTqB/HjUnjZE2hB0OpmvHfS1sH00tP46Wj3ioTMdAbcJCDruwR0P4eJ958JP+HUhGwy1 V5/v1kHmpJpIUvL/NrQhlPABcI8X0/iGSUr5G1xdJFQ5q4yMFfNAl5UV/JXgUQOE8APWI3 toM7ND0vJhmPYcOjU6qR1nbJ4+tYuSMuTwKrdBBaLFGNubMVbn3XZFFE/et7cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753724296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=091g7KKAaEoR6fbymXRMwq09SMxzMk4HTk6iggGoIcM=; b=X3RP/UYFZqIEwahUjnuJKyA3RDcFpnU/XTpce9rnBffFnrHD05dxfrImsNTEZFXb7lP3pr /EoModSsd5xHP1GErJ8wZuBk6oA7mcy1u6nidR3D3BDlyFKNqhW40/xU4K+fZScE0TCofx ZJkw4L0I7hYbXxGp3KHYJ2OoZyG1NtPJQmE5+Td/ZoBprlU9g2A7khvSXXitv2VgBjrp1p yiCSxyEdROmtUDS8cMg9Q4R8A931XttXBzYpD1Xa/Vo5VDwAKHVf0V5sBI0jKo9hJdnH1d GUzGQq84pzVjPa2bIo1hXRIHVmK0d0pmlpOv+onhXsxWgdNY7tGCcMPKm2Ln4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753724296; a=rsa-sha256; cv=none; b=iH07oL2rRHguNLjke2qE0O3kTylfhGC9kLPW4rSxFinWF1DcWJevh7e2zkLsD/XK9xm8WO +WHcFrqeaw7/SkJ32ELeUq4opORO5wLINT/FVwC98uY3lB8G1eOTyk+shcOE8B0HHJBw6P Bi9tmu9Dw/yQ6Cu665BLSozOCzaupn8S9YP68avDR9LhR0WJ/+wwmkiE3Nt5WDdi70wz8/ soMzZeavLR04IMUbjxbfACBPGVdg9HS4W7jnKsE37gMxui7cobvO81anq4Ok1ilU6dEMzA es1ZU1hQ70TR4hqbmjfQ0TPuZbVeXOaSVy/y2XsVHfLxvWlSdF0GFlN9B+T3zQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brQgD25rmzvV5; Mon, 28 Jul 2025 17:38:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SHcGW7041771; Mon, 28 Jul 2025 17:38:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SHcGqJ041768; Mon, 28 Jul 2025 17:38:16 GMT (envelope-from git) Date: Mon, 28 Jul 2025 17:38:16 GMT Message-Id: <202507281738.56SHcGqJ041768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 64f493e664cc - main - bridge: do not allow a bridge SVI in a bridge List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64f493e664cc4bd52c67c6ba2c36a35f68c9fbe4 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=64f493e664cc4bd52c67c6ba2c36a35f68c9fbe4 commit 64f493e664cc4bd52c67c6ba2c36a35f68c9fbe4 Author: Lexi Winter AuthorDate: 2025-07-28 17:38:02 +0000 Commit: Lexi Winter CommitDate: 2025-07-28 17:38:02 +0000 bridge: do not allow a bridge SVI in a bridge Disallow this: ifconfig bridge0 create ifconfig bridge0.1 create ifconfig bridge0 addm bridge0.1 Also disallow this: ifconfig vlan1 create ifconfig bridge0 create ifconfig bridge0 addm vlan1 ifconfig vlan1 vlan 1 vlandev bridge0 Firstly, this panics due to trying to take BRIDGE_LOCK recursively. Secondly, even if it worked, it could cause packet forwarding loops. Reviewed by: des Differential Revision: https://reviews.freebsd.org/D51310 --- sys/net/if_bridge.c | 23 +++++++++++++++++++++++ sys/net/if_vlan.c | 12 ++++++++++++ tests/sys/net/if_bridge_test.sh | 24 ++++++++++++++++++++++++ tests/sys/net/if_vlan.sh | 27 +++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 64aaecf6f029..0a35fb4095fb 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1335,6 +1335,29 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) if (ifs->if_ioctl == NULL) /* must be supported */ return (EXTERROR(EINVAL, "Interface must support ioctl(2)")); + /* + * If the new interface is a vlan(4), it could be a bridge SVI. + * Don't allow such things to be added to bridges. + */ + if (ifs->if_type == IFT_L2VLAN) { + struct ifnet *parent; + struct epoch_tracker et; + bool is_bridge; + + /* + * Entering NET_EPOCH with BRIDGE_LOCK held, but this is okay + * since we don't sleep here. + */ + NET_EPOCH_ENTER(et); + parent = VLAN_TRUNKDEV(ifs); + is_bridge = (parent != NULL && parent->if_type == IFT_BRIDGE); + NET_EPOCH_EXIT(et); + + if (is_bridge) + return (EXTERROR(EINVAL, + "Bridge SVI cannot be added to a bridge")); + } + /* If it's in the span list, it can't be a member. */ CK_LIST_FOREACH(bif, &sc->sc_spanlist, bif_next) if (ifs == bif->bif_ifp) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 22fcb7bf7c64..61000018e5a4 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -2336,6 +2336,18 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ENOENT; break; } + + /* + * If the ifp is in a bridge, do not allow setting the device + * to a bridge; this prevents having a bridge SVI as a bridge + * member (which is not permitted). + */ + if (ifp->if_bridge != NULL && p->if_type == IFT_BRIDGE) { + if_rele(p); + error = EINVAL; + break; + } + if (vlr.vlr_proto == 0) vlr.vlr_proto = ETHERTYPE_VLAN; oldmtu = ifp->if_mtu; diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index cd38adea28ad..c0c085f22273 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -1221,6 +1221,29 @@ vlan_qinq_cleanup() vnet_cleanup } +# Adding a bridge SVI to a bridge should not be allowed. +atf_test_case "bridge_svi_in_bridge" "cleanup" +bridge_svi_in_bridge_head() +{ + atf_set descr 'adding a bridge SVI to a bridge is not allowed (1)' + atf_set require.user root +} + +bridge_svi_in_bridge_body() +{ + vnet_init + vnet_init_bridge + + bridge=$(vnet_mkbridge) + atf_check -s exit:0 ifconfig ${bridge}.1 create + atf_check -s exit:1 -e ignore ifconfig ${bridge} addm ${bridge}.1 +} + +bridge_svi_in_bridge_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -1247,4 +1270,5 @@ atf_init_test_cases() atf_add_test_case "vlan_ifconfig_tagged" atf_add_test_case "vlan_svi" atf_add_test_case "vlan_qinq" + atf_add_test_case "bridge_svi_in_bridge" } diff --git a/tests/sys/net/if_vlan.sh b/tests/sys/net/if_vlan.sh index 424eac705b94..8122203337e2 100755 --- a/tests/sys/net/if_vlan.sh +++ b/tests/sys/net/if_vlan.sh @@ -333,6 +333,32 @@ conflict_id_cleanup() } +# If a vlan interface is in a bridge, changing the vlandev to refer to +# a bridge should not be allowed. +atf_test_case "bridge_vlandev" "cleanup" +bridge_vlandev_head() +{ + atf_set descr 'transforming a bridge member vlan into an SVI is not allowed' + atf_set require.user root +} + +bridge_vlandev_body() +{ + vnet_init + vnet_init_bridge + + bridge=$(vnet_mkbridge) + vlan=$(vnet_mkvlan) + + atf_check -s exit:0 ifconfig ${bridge} addm ${vlan} + atf_check -s exit:1 -e ignore ifconfig ${vlan} vlan 1 vlandev ${bridge} +} + +bridge_vlandev_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" @@ -343,4 +369,5 @@ atf_init_test_cases() atf_add_test_case "qinq_setflags" atf_add_test_case "bpf_pcp" atf_add_test_case "conflict_id" + atf_add_test_case "bridge_vlandev" } From nobody Mon Jul 28 17:45:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brQrS6BsMz63KQJ for ; Mon, 28 Jul 2025 17:46:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brQrS2nSYz3lVL for ; Mon, 28 Jul 2025 17:46:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-31eb744f568so1562861a91.1 for ; Mon, 28 Jul 2025 10:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1753724770; x=1754329570; 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=OCrbIcMVJtlOLHh6d4uw/FMu6e5uTzPrDrBuXAyGadc=; b=ceuhJe03/XhsIuTaFHvl6B9F7SvL3W+mU4pWaOBbAouhphdkUvqtDxSbYrvx5InUI4 TYd/dzryhYTHc4QcE+6CQP0Ip3jZszO+fM0Tg1JHIglc2bR/GUhXnJI4AJI3NfdCO1Xn 2SCfzdZ2DHp7FvA0kTOQ83L7g6nr818yPLn9WDp3k8GqaPFWkgVLCNZ3+p5VxoxqT1IQ kvtniQ9UU9rOrwtck7e6ymng6qbajlhLTzU3lSnL0YY2f26YgvkTGGrWRFk0nBzGs52o H5GeSG/nPY1nd0NkR7jhOoJWV0c4ZNDl9+2eFb7k1spyYhI8wLV9PzhCyUy1g0pyHhDR vDkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753724770; x=1754329570; 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=OCrbIcMVJtlOLHh6d4uw/FMu6e5uTzPrDrBuXAyGadc=; b=pVrYc+1D8uXvO+XZ/Y/whvm6gp7QqjERb93dxYyjekhNGxscft8vsoFIA9P2QT88AN T+C6Lm/G3wpCs9d5p9Xei+NNzuOsvjcGOMGXkx8ehSEU5uMJkT/3lc+17lTKTrgxOPrZ 1LmHcFZBfWfU/vJo7aHJMYC9r86MbXfvMavLOYoBA/bqDb+pCmSfdroerHFJxzjAKnzd Rb0VHEgQTUJ2KHdyr+awedByL9trkbtRGENcKhSFWgRQ/3+u5MoZRo6+PvwOE8t2DJNL I8JfuCWAjl+pXKv2rD5vsE9LyPYaOVz/d8bWpx6P8YGyoxc3jJ1yfNzZej30+dvgeWhT NSfg== X-Forwarded-Encrypted: i=1; AJvYcCVqcNWoaW0ImSmXjF1qvXxjjtUn90G54iY834BWZQPaIh0Z2R6l+2PIhNt37eeCawLfCIF0Z4GiTklwuiRJkWPQFlHl@freebsd.org X-Gm-Message-State: AOJu0YzKbMOQpK7G0Pmhz0KnLPM2Pv4RmRZdZmku/d3mIEC6m6G6f9pu JonskBzI390FHTsziHZjNjpVo/EYk+Nww+hhyOC26P9IZobkstwgniazV9TgF7Ya2CgrVzFlhhC FV+IO0ML4TFGhgr248y2NbvPydEvk9BcFKYiVahcN5g== X-Gm-Gg: ASbGnct+qvARU8U8d9QSHeV3Ne7Qq9rmlK3Ev0NDoYG7aEtZpm2Tzm/EeNicgSMJyEp YICLRwtrSjazA3X7wubUqz6eNJzhMxyYdjwjgpAcOeRAuBoTv9w9P+H9Qk/dYzG68ZaF69XJvac PBuAF/QcScQIyRXjRFr6yb7+u1qbOdUD9dOviZh3o4fskHiqqeqknigYmrSeoLiEvSVMVLSwtys JyLcA== X-Google-Smtp-Source: AGHT+IFRmyH3RTfAHdCMtPGOTcnwuxXWW8HJtnLNLuqytQ+v4z0H10NLGcfMx3qUngJIhMszStoWRUdVoEzSlVcRjAw= X-Received: by 2002:a17:90b:1350:b0:311:c939:c851 with SMTP id 98e67ed59e1d1-31e77735cbbmr17637059a91.4.1753724770066; Mon, 28 Jul 2025 10:46:10 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 28 Jul 2025 07:45:57 -1000 X-Gm-Features: Ac12FXzbs1FXlRPNWeXw5eCTNsF0FI00duolX2brTjc1gpfuhDwS3UZYYMVhgqM Message-ID: Subject: Re: git: 430f1acc451c - main - ice(4): Add MAC filter and VLAN resource limits to VFs To: Kristof Provost Cc: Warner Losh , Eric Joyner , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4brQrS2nSYz3lVL X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] I think DES may have just fixed this. Can you confirm? Warner On Mon, Jul 28, 2025 at 3:23=E2=80=AFAM Kristof Provost wr= ote: > > I=E2=80=99m not sure if it=E2=80=99s this specific commit or another one = in the recent dev/ice updates, but the arm64 LINT-FDT, LINT-ACPI and LINT b= uilds all fail. > > This is from arm64-LINT: > > ld: error: undefined symbol: ice_iov_attach > >>> referenced by if_ice_iflib.c:859 (/usr/src/sys/dev/ice/if_ice= _iflib.c:859) > >>> if_ice_iflib.o:(ice_if_attach_post) > > ld: error: undefined symbol: ice_iov_detach > >>> referenced by if_ice_iflib.c:989 (/usr/src/sys/dev/ice/if_ice= _iflib.c:989) > >>> if_ice_iflib.o:(ice_if_detach) > >>> referenced by if_ice_iflib.c:2323 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:2323) > >>> if_ice_iflib.o:(ice_if_update_admin_status) > >>> referenced by if_ice_iflib.c:2376 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:2376) > >>> if_ice_iflib.o:(ice_transition_safe_mode) > > ld: error: undefined symbol: ice_iov_add_vf > >>> referenced by if_ice_iflib.c:3464 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3464) > >>> if_ice_iflib.o:(ice_if_iov_vf_add) > > ld: error: undefined symbol: ice_iov_init > >>> referenced by if_ice_iflib.c:3429 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3429) > >>> if_ice_iflib.o:(ice_if_iov_init) > > ld: error: undefined symbol: ice_iov_uninit > >>> referenced by if_ice_iflib.c:3445 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3445) > >>> if_ice_iflib.o:(ice_if_iov_uninit) > > ld: error: undefined symbol: ice_iov_handle_vflr > >>> referenced by if_ice_iflib.c:3480 (/usr/src/sys/dev/ice/if_ic= e_iflib.c:3480) > >>> if_ice_iflib.o:(ice_if_vflr_handle) > > ld: error: undefined symbol: ice_vc_notify_all_vfs_link_state > >>> referenced by if_ice_iflib.c:757 (/usr/src/sys/dev/ice/if_ice= _iflib.c:757) > >>> if_ice_iflib.o:(ice_update_link_status) > > ld: error: undefined symbol: ice_vc_handle_vf_msg > >>> referenced by ice_lib.c:2285 (/usr/src/sys/dev/ice/ice_lib.c:= 2285) > >>> ice_lib.o:(ice_process_ctrlq) > *** [kernel.full] Error code 1 > > =E2=80=94 > Kristof > > On 18 Jul 2025, at 21:16, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D430f1acc451c7084d1d5aa7d= f7e7ecccea1a8b51 > > > > commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 > > Author: Eric Joyner > > AuthorDate: 2024-10-17 22:19:09 +0000 > > Commit: Warner Losh > > CommitDate: 2025-07-18 19:16:17 +0000 > > > > ice(4): Add MAC filter and VLAN resource limits to VFs > > > > Adds two new parameters to iovctl config for VLAN filter limits and= MAC > > filter limits and gives them defaults of 64 and 16, respectively. > > > > These are intended to limit the number of resources that a VF can > > consume so that any one VF cannot starve an other VFs or the PF of > > filters. > > > > Signed-off-by: Eric Joyner > > Signed-off-by: Krzysztof Galazka > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 > > --- > > sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++++++++++++++-= -- > > sys/dev/ice/ice_iov.h | 8 ++++++++ > > 2 files changed, 50 insertions(+), 3 deletions(-) > > > > diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c > > index fc37a0e7679c..e06c7eb56f7a 100644 > > --- a/sys/dev/ice/ice_iov.c > > +++ b/sys/dev/ice/ice_iov.c > > @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc) > > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); > > pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", > > IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); > > + pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed", > > + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT); > > + pci_iov_schema_add_uint16(vf_schema, "max-mac-filters", > > + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT); > > > > error =3D pci_iov_attach(dev, pf_schema, vf_schema); > > if (error !=3D 0) { > > @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum= , const nvlist_t *params) > > > > vsi->mirror_src_vsi =3D nvlist_get_number(params, "mirror-src-vsi= "); > > > > + vf->vlan_limit =3D nvlist_get_number(params, "max-vlan-allowed"); > > + vf->mac_filter_limit =3D nvlist_get_number(params, "max-mac-filte= rs"); > > + > > vf->vf_flags |=3D VF_FLAG_VLAN_CAP; > > > > /* Create and setup VSI in HW */ > > @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > > struct virtchnl_ether_addr_list *addr_list; > > struct ice_hw *hw =3D &sc->hw; > > + u16 added_addr_cnt =3D 0; > > int error =3D 0; > > > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > > > + if (addr_list->num_elements > > > + (vf->mac_filter_limit - vf->mac_filter_cnt)) { > > + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > + goto done; > > + } > > + > > for (int i =3D 0; i < addr_list->num_elements; i++) { > > u8 *addr =3D addr_list->list[i].addr; > > > > @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > > "%s: VF-%d: Error adding MAC addr for VSI %d\= n", > > __func__, vf->vf_num, vf->vsi->idx); > > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > - goto done; > > + continue; > > } > > + /* Don't count VF's MAC against its MAC filter limit */ > > + if (memcmp(addr, vf->mac, ETHER_ADDR_LEN)) > > + added_addr_cnt++; > > } > > > > + vf->mac_filter_cnt +=3D added_addr_cnt; > > + > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR, > > v_status, NULL, 0, NULL); > > @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struc= t ice_vf *vf, u8 *msg_buf) > > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > > struct virtchnl_ether_addr_list *addr_list; > > struct ice_hw *hw =3D &sc->hw; > > + u16 deleted_addr_cnt =3D 0; > > int error =3D 0; > > > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, str= uct ice_vf *vf, u8 *msg_buf) > > "%s: VF-%d: Error removing MAC addr for VSI %= d\n", > > __func__, vf->vf_num, vf->vsi->idx); > > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > - goto done; > > + continue; > > } > > + /* Don't count VF's MAC against its MAC filter limit */ > > + if (memcmp(addr_list->list[i].addr, vf->mac, ETHER_ADDR_L= EN)) > > + deleted_addr_cnt++; > > } > > > > -done: > > + if (deleted_addr_cnt >=3D vf->mac_filter_cnt) > > + vf->mac_filter_cnt =3D 0; > > + else > > + vf->mac_filter_cnt -=3D deleted_addr_cnt; > > + > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR, > > v_status, NULL, 0, NULL); > > } > > @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct i= ce_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > + if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) { > > + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > + goto done; > > + } > > + > > status =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, > > vlan_list->num_elements); > > if (status) { > > @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ic= e_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > + vf->vlan_cnt +=3D vlan_list->num_elements; > > + > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, > > v_status, NULL, 0, NULL); > > @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct i= ce_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > + if (vlan_list->num_elements >=3D vf->vlan_cnt) > > + vf->vlan_cnt =3D 0; > > + else > > + vf->vlan_cnt -=3D vlan_list->num_elements; > > + > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, > > v_status, NULL, 0, NULL); > > diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h > > index c2ac5fcd5c94..c4fb3e932e3f 100644 > > --- a/sys/dev/ice/ice_iov.h > > +++ b/sys/dev/ice/ice_iov.h > > @@ -85,6 +85,11 @@ struct ice_vf { > > u16 vf_num; > > struct virtchnl_version_info version; > > > > + u16 mac_filter_limit; > > + u16 mac_filter_cnt; > > + u16 vlan_limit; > > + u16 vlan_cnt; > > + > > u16 num_irq_vectors; > > u16 *vf_imap; > > struct ice_irq_vector *tx_irqvs; > > @@ -101,6 +106,9 @@ struct ice_vf { > > #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC = | \ > > FLAG_VF_MULTICAST_PROMIS= C) > > > > +#define ICE_DEFAULT_VF_VLAN_LIMIT 64 > > +#define ICE_DEFAULT_VF_FILTER_LIMIT 16 > > + > > int ice_iov_attach(struct ice_softc *sc); > > int ice_iov_detach(struct ice_softc *sc); From nobody Mon Jul 28 18:31:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brRrz6C4fz63M85; Mon, 28 Jul 2025 18:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brRrz541rz3pw4; Mon, 28 Jul 2025 18:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Nw2/2Hd0nSNwWFa6RZDMipECuyi+b1f/lpUoL8ki5w=; b=kEtSUkStFYfchx3aX1gALahHflw/CPcG7nS5TPBhQ9abH0iMgzGXY2qw6thbWUrYgKd1SQ wxOaBMcYKWOmj8GCw9vFroS98fGvXBiEDSV3kdnjnuk3DTVTozLwmrvBo0IzD9bCqqUlT6 IrVulJhh5s+wCAs4+/sm204I9vYHg2PqjvuI/DhfYeQfNlza7BHtiUGO1vawpvy4GE0Zkk RXlfENSERI8jMz6/55BsqSX/jUwrQwQ3Q8RNoOK6MQ5ws4QeRhogIohci5S6gfZxWvkLI+ XjMGCw+wdVgaTuvQLXWFxNp8zMIUAxCypCNxSP30gAJ0sTn34PyTCcwR+5TKXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Nw2/2Hd0nSNwWFa6RZDMipECuyi+b1f/lpUoL8ki5w=; b=qrQz5mwoe8zmvJCQrDQymhTiigm8PccyBMFSnLd7UeDqq1fa+LZWvxVAjoVM5tLG3EWmdT BK8cjMxueoZ/j1tm5mZsycWCOOAw8R2Nluk125Hr6NS+ehdGbYv4/8KxqWpH+D4Cz6MkwR VFHyuh+jJ7yoRgbPoSHVcRSErT1Oft03+g0a1LFCdw+qPZ8ALjYOq/nT0Fh8Dn6WSZv+f6 xbOzeSyYl6n2J8A58kzrTb5mUFtVCJr3jI9BXFr1i03hntw+yJik/hD7C2yjCbOcvAxHZe zNr9pkOE0H8l1V9HuUwV6I0xA1e9sbFbOwaNyN9sqSuXWN/br/VoEl3+R/P83A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753727507; a=rsa-sha256; cv=none; b=iWtUEBu4SMrEBkd2d/zd1gVhYYgejTExwL1G1xFXsESpGIbbNdRlmpSr0csEvukOqi8WFu IL/ECrI3QSXN8215Z4JSzQ/ScBcIhUVeFDrm9ij/CwkSrIDshMFx4uVrW1G/jNPOrXmlOs IrgCSLC3oIRb9eNnHagmGq5usdiuk5qi5lCpOZGpHS6y66y9PNSwFfMvX6QgQv80gMB74u kr1IXQtJi2taMO/Gu2K6yTxwwQxjB39RgX8lmng/2rjTDV83hEG5aWiCkf0GKo7UEpFJOA IbB976PbNO28/TR6/8nZJkVr2DmRfwAc3UB9dybQToZYUCNRbhET8O0P6neAIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brRrz4f51zx4Q; Mon, 28 Jul 2025 18:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SIVli8051365; Mon, 28 Jul 2025 18:31:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SIVl39051362; Mon, 28 Jul 2025 18:31:47 GMT (envelope-from git) Date: Mon, 28 Jul 2025 18:31:47 GMT Message-Id: <202507281831.56SIVl39051362@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: 4b02ad9d5063 - main - style.9: Add a C++ section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4b02ad9d506342ae47f722b830e603f5adc86b48 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4b02ad9d506342ae47f722b830e603f5adc86b48 commit 4b02ad9d506342ae47f722b830e603f5adc86b48 Author: John Baldwin AuthorDate: 2025-07-28 18:29:32 +0000 Commit: John Baldwin CommitDate: 2025-07-28 18:31:26 +0000 style.9: Add a C++ section This section adds several style guidelines for C++ in FreeBSD's base system both enumerating some differences relative to the C KNF style and addressing some unique C++ idioms not addressed by the existing KNF style. This section is not exhaustive but does include an initial set of guidelines. Reviewed by: ivy, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D50983 --- share/man/man9/style.9 | 160 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 157 insertions(+), 3 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 484b4f144b2e..e9f17392ae0c 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 27, 2025 +.Dd July 28, 2025 .Dt STYLE 9 .Os .Sh NAME @@ -766,8 +766,7 @@ to any pointer type. .Pp Values in .Ic return -statements should be enclosed in parentheses where possible. -For example, parentheses cannot be used if the value is a C++ braced-init-list. +statements should be enclosed in parentheses. .Pp Use .Xr err 3 @@ -918,6 +917,161 @@ Only use the annotation for the entire if statement, rather than individual clauses. Do not add these annotations without empirical evidence of the likelihood of the branch. +.Ss C++ +KNF style was originally defined as a style for C. +C++ introduces several new idioms which do not have an existing corollary +in KNF C such as inline function definitions in classes. +C++ is also not always compatible with some KNF guidelines such as +enclosing return values in parentheses. +For C++ code, FreeBSD aims to follow broadly accepted C++ practices while +also following the general shape of KNF. +This section enumerates C++ specific guidelines that differ from KNF C. +.Pp +The preferred suffixes for C++ source files are +.Dq .cc +and +.Dq .hh . +Header files should always use a suffix, +unlike headers from the C++ standard library. +.Pp +Return values should not be enclosed in parantheses. +When converting existing C code to C++, +existing return values may remain in parantheses. +.Pp +The opening curly brace for namespace declarations should be on the first line +similar to structure and class definitions. +Nested namespaces should be declared using a single namespace declaration. +.Bd -literal +namespace foo::bar { +} +.Ed +.Pp +Member function declarations should follow the same style used for standalone +function protoypes except that a space should be used between a function's +return type and name. +.Pp +Function definitions at the top level should use a newline after the function +type similar to C function definitions. +.Pp +Nested member function definitions inside of a class, structure, or union +should not use a newline after the function type. +Instead, these should follow the style of member function declarations. +This is more common C++ style and is more compact for small methods such as +getters and setters. +.Pp +Inline functions whose body consists of a single statement may use a single +line for the function body. +Inline functions with an empty body should always use a single line. +.Bd -literal +struct widget { + int foo() { return 4; } + int bar(); +}; + +int +widget::bar() +{ + return 6; +} +.Ed +.Pp +Default and deleted methods should be declared as a single line. +.Bd -literal +class box { + ~box() = default; +}; +.Ed +.Pp +In template declarations, the +.Ic template +keyword and list of template parameters should be followed by a newline +before the templated declaration. +.Bd -literal +template +class box { + T data; +}; +.Ed +.Pp +The +.Ic & +for reference variables should be placed on the variable name rather +than the type similar to the style used with +.Ic * +for pointers. +.Bd -literal + int x; + int &xp = x; +.Ed +.Pp +Variables may be declared at any point within a function, +not just at the start of blocks. +.Pp +Standard library containers should be used in preference to +.Xr queue 3 +or +.Xr tree 3 +macros. +.Pp +.Ic nullptr +should be used instead of +.Dv NULL +or 0. +.Pp +Use standard library types for managing strings such as +.Vt std::string +and +.Vt std::string_view +rather than +.Vt "char *" +and +.Vt "const char *" . +C types may be used when interfacing with C code. +.Pp +The +.Ic auto +keyword can be used in various contexts which improve readability. +Examples include iterators, non-trivial types of ranged-for values, +and return values of obvious types, +such as +.Ic static_cast +or +.Fn std::make_unique . +Place any qualifiers before +.Ic auto , +for example: +.Ic const auto . +.Pp +Use the +.Vt std::unique_ptr +and +.Vt std::shared_ptr +smart pointers to manage the lifetime of dynamically allocated objects +instead of +.Ic new +and +.Ic delete . +Construct smart pointers with +.Fn std::make_unique +or +.Fn std::make_shared . +Do not use +.Xr malloc 3 +except when necessary to interface with C code. +.Pp +Do not import any namespaces with +.Ic using +at global scope in header files. +Namespaces other than the +.Ic std +namespace (for example, +.Ic std::literals ) +may be imported in source files and in function scope in header files. +.Pp +Define type aliases using +.Ic using +instead of +.Ic typedef . .Sh FILES .Bl -tag -width indent .It Pa /usr/src/tools/build/checkstyle9.pl From nobody Mon Jul 28 18:31:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brRs072kzz63MFk; Mon, 28 Jul 2025 18:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brRs06HwQz3q94; Mon, 28 Jul 2025 18:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ny381RH1bbjSgjb0SiYL95lRdycr5xEAfHZyAwCfuEE=; b=xYO49093bAHxpMhINCt9WlHO2n9S+IvFIqVfDQveymhvEr8RZdQ0/E17pw75EnS81sakSr ghJa5boCenzh8/9kvRN9PdxkUxI3YWDr8PJlVKmUV2o2q5rbiCyHk5S2c8A1Ce02sX9JrI bRp7tfeiTnIKCvBoXRj0pdWe9F19QaqfwvNLZ2f3sqL0hVVtgudgyF9PJQCUuwx1bmsfgA S9G5RyFZ8hYmfmZoZ3Gl3Y/qR8XFTQ1ZEmGN7j8QH/XXx59wL2NllNJdvq8l+icOursUvy DZcdTBIdmb+drDwA3m4J2DNjLssSIuZs7acSOb9PlBVWxCgovAEy/XyhAxJRbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ny381RH1bbjSgjb0SiYL95lRdycr5xEAfHZyAwCfuEE=; b=s+J3I0y2t4V3YxcvlELZzr/AjE4KY4Knj3sJbAuT0v9iyU8kl8HpPSJKZ3RzXo6fJwx8eI liOt6S63FFORrBPAH3lmlOxy3lGrpip56Dy96z44I6xQF/qCBDk+zc13rQj+rwt/iEKNtY fnodEpuv9xZM5d3DyRxRqWg69QxclqSztnbbRZ6BN5Nc5OTHqhMf27qJxDQkjIAjdt16UO kM0ukKsdx5ZTMuyLldBRABX2R+eFqrAICHP+B1S7rLQSO/dD7DjGxj7mr2RvC8Dgm2swzx o9Ul+LWFqhOR0QwAfZSfPn48tYJZHBAbgRFgpaAmw9VDwovdxXaCBEJHgalGVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753727508; a=rsa-sha256; cv=none; b=DRLGZ3Vi6PFsfRk5lHe22a3huUVQXY1m8mOQnQx1K5tg04rGX77BDzqQhIwpWFWVYzJmjZ YV5DfgTc16upmWeJXdrLXkYtZGe7hK20poEM8bYojEzZaTF2cIQCQ6GNtq39VRilmwagba gXK4HtKuGdVVwLH6ZZt/mvxcYRfPGme+lvuHCtpQlIC42ABJG/qr24eqPsi4DTDHPraf4i n9c+M9PDutO+664EZ0o01BnESqJf9/jBw9mGKnMAfjwxtXM9+1dbwM/p2XHZ9cpaCC+zjb nhPNOjYQ2E2yH6ozvb722EQDUEwyHO/SF/a/NHmc4VBlrHphjRDmMrccd4QukQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brRs05bDTzx6f; Mon, 28 Jul 2025 18:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SIVmPh051398; Mon, 28 Jul 2025 18:31:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SIVmL7051395; Mon, 28 Jul 2025 18:31:48 GMT (envelope-from git) Date: Mon, 28 Jul 2025 18:31:48 GMT Message-Id: <202507281831.56SIVmL7051395@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: a88cd55ba8ad - main - gptzfsboot: Move zfsboot.c source into its sole consumer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: a88cd55ba8adbfbd0fa1d218c9f2740746d1e0cd Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a88cd55ba8adbfbd0fa1d218c9f2740746d1e0cd commit a88cd55ba8adbfbd0fa1d218c9f2740746d1e0cd Author: John Baldwin AuthorDate: 2025-07-28 18:30:28 +0000 Commit: John Baldwin CommitDate: 2025-07-28 18:31:26 +0000 gptzfsboot: Move zfsboot.c source into its sole consumer Suggested by: imp Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51597 --- stand/i386/gptzfsboot/Makefile | 2 +- stand/i386/{zfsboot => gptzfsboot}/zfsboot.c | 0 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/i386/gptzfsboot/Makefile b/stand/i386/gptzfsboot/Makefile index 0d9fa8b043df..1e3b51249b44 100644 --- a/stand/i386/gptzfsboot/Makefile +++ b/stand/i386/gptzfsboot/Makefile @@ -1,7 +1,7 @@ .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ - ${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \ + ${BOOTSRC}/i386/common \ ${BOOTSRC}/common FILES= gptzfsboot diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/gptzfsboot/zfsboot.c similarity index 100% rename from stand/i386/zfsboot/zfsboot.c rename to stand/i386/gptzfsboot/zfsboot.c From nobody Mon Jul 28 18:31:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brRs24Ll2z63M50; Mon, 28 Jul 2025 18:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brRs20P5zz3qLG; Mon, 28 Jul 2025 18:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ub9Puxfq/Ndtje9iZ2UPZhEGhEZtJCAr+P6ETfpT9sM=; b=tleUUs8fNpTOQuhiNS7rEkb91y1Is1uQ9Fgbq87pxwqGdpYq13/nrAwXG0WLfcQNeCyVVG vE1Tf8cb+I8OzjU4zWqIBStHUnziViCBoLsaiPLSLwK6z//roqnGo3grAvZHUh6q37AXk1 No9zmH2/cZ84QvKkPIcvLN65YqyF4PmSNLKNt9wkRquogDqLlBSPPFkRBM8HQcgkgtB1zP bLqT3wMb/RdrC4LY367oVD5CI3CrsfjlQ5hXEnm3lIJRnLWituz906bksPuYGc573/Hu9a U6Ewo2ki0GW95hN+u0XdE7vp1iS7YJH/elr4a/yi/lHBDMEpWM358dR6pbBU6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ub9Puxfq/Ndtje9iZ2UPZhEGhEZtJCAr+P6ETfpT9sM=; b=JFq33miqA6MOlDggjTFKGSJytl2tN1gkYlkmICuEWnDeENY6exv6BPPRTKA5FDLKDkfjoC oS9Jz1GL57FMirbwUuxoTGCLOFrxrrd7eErmLb3/DnFA0R260m2acmXWn1J3gAfbhmW0FX NExy1uMgXwiBskvYo7vyTv9zQfWVpJskITS89cuBriwZMzC08jFCvH7XRR3lqCghrMAtpO JlqRH4Rtggmf/VJTPbs5FW5hxe+SmtbA+PomZdG06MluaH532HtzyB713L+vxjZeedYWVr m47JLCg2PuCqnBMAEcS+KRfXg8q/NubF8gavvkqJe0FWvaATnEWVrr3AHvDH6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753727510; a=rsa-sha256; cv=none; b=q3welHTBNr63pBV7wTpDh1mZs5n74p+/5eei4NXG6/q8Yedqx7aWEeL57I1y1Weg9viIjl rZS/zj2HlSn+35hWZft32iIa/YhjPMXU8PUHuv5hH9WYqPr/oqT6YLgDWrhvogKef7ZhRN JDnYtMvlqpz6l3xbyQh90iBlD9g52LxYbpo6WZcmRM2Kwwk4pJImOK8l1Upt597ACw1EUl 5gKGa2XjNC1Co+q9AbI5ehs0xAeb1qxhHZOYpxpQN9/c4FhBB1ULUzJjWg4BLHyV5hsJOj iuFmsU5sFmAr6/v+VEn+zEcmbWe6cG/GzmSOFqC8wkMZa+IqVgu4V+lj4vIfJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brRs16YmHzwgs; Mon, 28 Jul 2025 18:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SIVnct051435; Mon, 28 Jul 2025 18:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SIVnJv051431; Mon, 28 Jul 2025 18:31:49 GMT (envelope-from git) Date: Mon, 28 Jul 2025 18:31:49 GMT Message-Id: <202507281831.56SIVnJv051431@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: 4e2cbc4466d2 - main - stand/i386: Remove references to empty variable OPENCRYPTO_XTS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4e2cbc4466d29e8198b62c37991a390c2f35f5bb Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4e2cbc4466d29e8198b62c37991a390c2f35f5bb commit 4e2cbc4466d29e8198b62c37991a390c2f35f5bb Author: John Baldwin AuthorDate: 2025-07-28 18:30:41 +0000 Commit: John Baldwin CommitDate: 2025-07-28 18:31:26 +0000 stand/i386: Remove references to empty variable OPENCRYPTO_XTS Reviewed by: imp Fixes: 4728f534ff6d ("Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI") Differential Revision: https://reviews.freebsd.org/D51598 --- stand/i386/gptboot/Makefile | 4 ++-- stand/i386/gptzfsboot/Makefile | 5 ++--- stand/i386/isoboot/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/stand/i386/gptboot/Makefile b/stand/i386/gptboot/Makefile index b91875d242f5..0f8a64529f90 100644 --- a/stand/i386/gptboot/Makefile +++ b/stand/i386/gptboot/Makefile @@ -53,12 +53,12 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o drv.o \ - cons.o ${OPENCRYPTO_XTS} + cons.o gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} -gptboot.out: ${BTXCRT} gptboot.o sio.o drv.o cons.o ${OPENCRYPTO_XTS} +gptboot.out: ${BTXCRT} gptboot.o sio.o drv.o cons.o ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include diff --git a/stand/i386/gptzfsboot/Makefile b/stand/i386/gptzfsboot/Makefile index 1e3b51249b44..0b67ff8cdaf4 100644 --- a/stand/i386/gptzfsboot/Makefile +++ b/stand/i386/gptzfsboot/Makefile @@ -65,7 +65,7 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o OBJS= zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o misc.o -CLEANFILES+= gptzfsboot.bin gptzfsboot.out ${OBJS} ${OPENCRYPTO_XTS} +CLEANFILES+= gptzfsboot.bin gptzfsboot.out ${OBJS} # i386 standalone support library LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a @@ -73,8 +73,7 @@ LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} ${OBJS} \ - ${OPENCRYPTO_XTS} +gptzfsboot.out: ${BTXCRT} ${OBJS} ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBI386} ${LIBSA32} zfsboot.o: ${ZFSSRC}/zfsimpl.c diff --git a/stand/i386/isoboot/Makefile b/stand/i386/isoboot/Makefile index 7973f8029aa0..41c40a72935b 100644 --- a/stand/i386/isoboot/Makefile +++ b/stand/i386/isoboot/Makefile @@ -51,12 +51,12 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o CLEANFILES+= isoboot.bin isoboot.out isoboot.o sio.o drv.o \ - cons.o ${OPENCRYPTO_XTS} + cons.o isoboot.bin: isoboot.out ${OBJCOPY} -S -O binary isoboot.out ${.TARGET} -isoboot.out: ${BTXCRT} isoboot.o sio.o drv.o cons.o ${OPENCRYPTO_XTS} +isoboot.out: ${BTXCRT} isoboot.o sio.o drv.o cons.o ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include From nobody Mon Jul 28 18:31:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brRs36f5Wz63Ln1; Mon, 28 Jul 2025 18:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brRs30YQ0z3qFr; Mon, 28 Jul 2025 18:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FS7+HPUCmpbf77WfJ1V+NEc4VqQmZCIkvru6w+XavLk=; b=sDs9n4uqNR66/d3ahgUifz7AgQ5Ibc26I8dIPxVpyPG37kDdD6i3FXCf5+x//1AHskCDrg rlrQnP9l1nYx1WxmBdLL9xeBGn9EVkDNO/x5PbNhgNoDXaL5KTWkSE1t+csjb5YLFKX4vS EMq6uIVpMqJc+TgGFiapd4NgfgaVfgdeHw+cMOojgOjUbhWc3pBo29bSojPt+/sAng+Iqq 4HEUFyO+Y8rYzcHwqRz56/PbtwdOh2EldHrojmYXB6/BlJ84u3TaUOdxKxKCmoNLfvltio j4zWfbKdtkPFpZiJtmChyrhfMlerJXywl9OiQ5DC6FGv4ko4GLy0VT5URdFWBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FS7+HPUCmpbf77WfJ1V+NEc4VqQmZCIkvru6w+XavLk=; b=SyxupuFPjEkzMRObw62KALRuq3+2iCoOGTtzDAK4iM8uaNkd5a7c7b/IO2Xe+NIj2N/rEi beFhKp62+47NiCHt4TZycL2x9JtAf2d3KcIlJhZkt0fdPnoEDnTOcZ6EaysDtkwpQi+U4O BkV8xKnUxG8pgOMe4KiF3g/w9DdKUqbpgfqCWpf8WdeKXVHThoNGD6vB/wVW/3H1NcRy/l SWnYqHFbx4NPlWCzgwpj7Kgs+Ga8r/a5xjq3NGtBtyORr/UReqEpzcxzZDSrZts8ypf8oP gu3BITkGflsr7qg3FRTl43UwLYyuLkmXyFen+P1AyGt8TN6wxNNVSp4tONSpBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753727511; a=rsa-sha256; cv=none; b=mBIz0RBpI/4doTRkbb0zZIkTjL2ZLTJoJkYSn7ZB04O/sDZMfxT5oTQliNQrxC22CFt2ol qbuYfweA2kGB+GWhx66rEq6kJXcbtSdgvy6N2QDfsiNY2mXBPHz1bLY+WaI94DGMB74iRC iATsNLzgIwNiRzrX/fzK6S4kKIp4LdHdsd8GLjkFZKkkG53aPKNj0cG1ky3+jTDeXerTLn EdVBMPQs1VXlQZGMbxVipa2Uw4x4LdESmTDYFn1DOgGiIWlLywdBCg19rF9qo7Jpm7VcJM beQiYcKI4bSBV1xYb9WwiqU71u15f+l1IBxBZJWfxYodf7zmJ//KU7w4saqFcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brRs302rgzx6g; Mon, 28 Jul 2025 18:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SIVoKZ051469; Mon, 28 Jul 2025 18:31:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SIVo9i051466; Mon, 28 Jul 2025 18:31:50 GMT (envelope-from git) Date: Mon, 28 Jul 2025 18:31:50 GMT Message-Id: <202507281831.56SIVo9i051466@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: df607c941f88 - main - stand/i386: Don't include SASRC in .PATH of boot loaders List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: df607c941f8887b8e68af0e6d349dcf329e74f79 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df607c941f8887b8e68af0e6d349dcf329e74f79 commit df607c941f8887b8e68af0e6d349dcf329e74f79 Author: John Baldwin AuthorDate: 2025-07-28 18:30:59 +0000 Commit: John Baldwin CommitDate: 2025-07-28 18:31:26 +0000 stand/i386: Don't include SASRC in .PATH of boot loaders These link against libsa instead of pulling individual sources from the libsa source directory. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51599 --- stand/i386/gptboot/Makefile | 2 +- stand/i386/isoboot/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stand/i386/gptboot/Makefile b/stand/i386/gptboot/Makefile index 0f8a64529f90..a829be6c745d 100644 --- a/stand/i386/gptboot/Makefile +++ b/stand/i386/gptboot/Makefile @@ -1,6 +1,6 @@ .include -.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} +.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common FILES= gptboot MAN= gptboot.8 diff --git a/stand/i386/isoboot/Makefile b/stand/i386/isoboot/Makefile index 41c40a72935b..0049e7fd3e0a 100644 --- a/stand/i386/isoboot/Makefile +++ b/stand/i386/isoboot/Makefile @@ -1,7 +1,7 @@ .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ - ${BOOTSRC}/i386/common ${SASRC} + ${BOOTSRC}/i386/common FILES= isoboot MAN= isoboot.8 From nobody Mon Jul 28 18:33:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brRv75MM2z63M2D; Mon, 28 Jul 2025 18:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brRv74cYsz3rXg; Mon, 28 Jul 2025 18:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/mp/w1GTgFDaK/ckcg4Mt0lIhrf7AWb1BlBi2w4ZBnA=; b=OQgP6a019Rx8X3pgDgSkAnEF46ErH8pFbFj7Oz5srvwBv9PQMqoDnvmw9TE3W19MZurCKP YRnnEX+eTqS8Ugnpuk2dUEj01lR6I5SsX/sAHwAt6ITi3Vbj6argNfGRe1Y+R6RkuOoCF4 gLGYoqIbsInD2NeqDInlGkGglvuL11DeiXv8GTcnLpFLT9CGtakB+fcbSoLY1ym7w9OYcT WKqE+OJ6uxo4ZBImuCbFC2CdNizgbDEjiNK+kxIcphe1QG8wmodpqd5lE34T0cll+YPPJC oSK1FnuMFJxsuJb1wmyfR/k8dNURPyXxLWu30/KmjOYh4DpMQlKdLQRutwjCaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753727619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/mp/w1GTgFDaK/ckcg4Mt0lIhrf7AWb1BlBi2w4ZBnA=; b=DawW11zz2oWqDGvTry68DPK45nAYbBH8dA/3Y/U9ujVzJXn0Qwp+sMCQTRLoDlR0wEZQsz vscbtTo1UfJZHw7RBmVbwu6a7vzHX7dH6cEIvxzJHe4p9YVEq1xVl4EuXB9wxZ2VEjJfXY BvPpfGQbcQJz06sOQCg0MHTsNZadio3QBEnJGBbGV/5wbpz51ZBkbnSzD9iKOCSFsciONV OR51Z6u1x+sZBdYI4Bjvab5e+eH8345zeg8f3H3AQEfTJDZXbJtP14emcVIYYUcp4RCdr7 UE5QTyEt99iX5jtebLDldJfH/6ohwOIfoOc1HHzV2MZ4hDDUz31Y4TfyyI5X1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753727619; a=rsa-sha256; cv=none; b=Nuf18aUa0PN2rkGxF9h+XQ3UkFsCMDC889laQ1EYwg58e089YR4eVVtHwYuhg1Gbu1Hy6j 3ezMX7w3mBLFWdw+apvfXnruyYJ/KDA5lDOt4TRjc5W+PjPgJGrW6T22CCi83LKddF4GAH BHpOPujnK0+PGf5DhE/fH28xS0f25qYI0ri/kZ+Fd7GGw9yTzjh+9131bMiTt3I2oh3rM/ TjtnNjEm/RxY16P44vVCC+0ra752PnWUgtr9IywtAZ9+kLgieYeTM9DSkniT+Xx71hUhyK 8ue9v8Idquogr8THgAm0PujlK5bdxbU/FeJltLkDa0Ae27EFfYujidDt65kHNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brRv74BMrzxG1; Mon, 28 Jul 2025 18:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SIXdUJ054191; Mon, 28 Jul 2025 18:33:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SIXdVe054188; Mon, 28 Jul 2025 18:33:39 GMT (envelope-from git) Date: Mon, 28 Jul 2025 18:33:39 GMT Message-Id: <202507281833.56SIXdVe054188@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: 9f0f30bc1f5f - main - libnvmf: Add nvmf_nqn_valid_strict() function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f0f30bc1f5f08d25243952bad3fdc6e13a75c2a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9f0f30bc1f5f08d25243952bad3fdc6e13a75c2a commit 9f0f30bc1f5f08d25243952bad3fdc6e13a75c2a Author: John Baldwin AuthorDate: 2025-07-28 18:33:03 +0000 Commit: John Baldwin CommitDate: 2025-07-28 18:33:03 +0000 libnvmf: Add nvmf_nqn_valid_strict() function This moves the checks previously under #ifdef STRICT in nvmf_nqn_valid() into a separate helper for userland. This requires that the NQN starts with "nqn.YYYY-MM." followed by at least one additional character. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D48767 --- lib/libnvmf/libnvmf.h | 7 ++++- lib/libnvmf/nvmf_controller.c | 50 ++++++++++++++++++++++++++++++++++++ sys/dev/nvmf/controller/nvmft_subr.c | 40 ----------------------------- 3 files changed, 56 insertions(+), 41 deletions(-) diff --git a/lib/libnvmf/libnvmf.h b/lib/libnvmf/libnvmf.h index 7cdd7e433455..6b38fd286596 100644 --- a/lib/libnvmf/libnvmf.h +++ b/lib/libnvmf/libnvmf.h @@ -111,8 +111,13 @@ const void *nvmf_capsule_cqe(const struct nvmf_capsule *nc); /* Return a string name for a transport type. */ const char *nvmf_transport_type(uint8_t trtype); -/* Validate a NVMe Qualified Name. */ +/* + * Validate a NVMe Qualified Name. The second version enforces + * stricter checks inline with the specification. The first version + * enforces more minimal checks. + */ bool nvmf_nqn_valid(const char *nqn); +bool nvmf_nqn_valid_strict(const char *nqn); /* Controller-specific APIs. */ diff --git a/lib/libnvmf/nvmf_controller.c b/lib/libnvmf/nvmf_controller.c index 971dccbe039e..f26f11633e03 100644 --- a/lib/libnvmf/nvmf_controller.c +++ b/lib/libnvmf/nvmf_controller.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -15,6 +16,55 @@ #include "internal.h" #include "nvmft_subr.h" +bool +nvmf_nqn_valid_strict(const char *nqn) +{ + size_t len; + + if (!nvmf_nqn_valid(nqn)) + return (false); + + /* + * Stricter checks from the spec. Linux does not seem to + * require these. + */ + len = strlen(nqn); + + /* + * NVMF_NQN_MIN_LEN does not include '.' and require at least + * one character of a domain name. + */ + if (len < NVMF_NQN_MIN_LEN + 2) + return (false); + if (memcmp("nqn.", nqn, strlen("nqn.")) != 0) + return (false); + nqn += strlen("nqn."); + + /* Next 4 digits must be a year. */ + for (u_int i = 0; i < 4; i++) { + if (!isdigit(nqn[i])) + return (false); + } + nqn += 4; + + /* '-' between year and month. */ + if (nqn[0] != '-') + return (false); + nqn++; + + /* 2 digit month. */ + for (u_int i = 0; i < 2; i++) { + if (!isdigit(nqn[i])) + return (false); + } + nqn += 2; + + /* '.' between month and reverse domain name. */ + if (nqn[0] != '.') + return (false); + return (true); +} + void nvmf_init_cqe(void *cqe, const struct nvmf_capsule *nc, uint16_t status) { diff --git a/sys/dev/nvmf/controller/nvmft_subr.c b/sys/dev/nvmf/controller/nvmft_subr.c index bb2bc0988e81..245971813854 100644 --- a/sys/dev/nvmf/controller/nvmft_subr.c +++ b/sys/dev/nvmf/controller/nvmft_subr.c @@ -26,46 +26,6 @@ nvmf_nqn_valid(const char *nqn) len = strnlen(nqn, NVME_NQN_FIELD_SIZE); if (len == 0 || len > NVMF_NQN_MAX_LEN) return (false); - -#ifdef STRICT_CHECKS - /* - * Stricter checks from the spec. Linux does not seem to - * require these. - */ - - /* - * NVMF_NQN_MIN_LEN does not include '.', and require at least - * one character of a domain name. - */ - if (len < NVMF_NQN_MIN_LEN + 2) - return (false); - if (memcmp("nqn.", nqn, strlen("nqn.")) != 0) - return (false); - nqn += strlen("nqn."); - - /* Next 4 digits must be a year. */ - for (u_int i = 0; i < 4; i++) { - if (!isdigit(nqn[i])) - return (false); - } - nqn += 4; - - /* '-' between year and month. */ - if (nqn[0] != '-') - return (false); - nqn++; - - /* 2 digit month. */ - for (u_int i = 0; i < 2; i++) { - if (!isdigit(nqn[i])) - return (false); - } - nqn += 2; - - /* '.' between month and reverse domain name. */ - if (nqn[0] != '.') - return (false); -#endif return (true); } From nobody Mon Jul 28 19:01:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brSWW3wPCz63NHt; Mon, 28 Jul 2025 19:01:43 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brSWW38Gpz3t9y; Mon, 28 Jul 2025 19:01:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753729303; 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=IPRL4KPMMdzyW1KcgmQTpwd7sWlHi8J3b9iQv0syzmE=; b=XivW7sYZ6WevbZpFpf8ctUz96WlA9gIkqGqsip/T0PcAORVajNWhIQChrhspfvs+O8g755 cOkMPSdFvCdxnwYQR/Bk+UMDucWpOTcD7AI0HHXPG3b/rQc5ss1AcLJ1PdJjdfCnsuhSOm 95bpu6aoKRhG01x5GDAkem1XluWqv6imlBeXEm05OFUz/R7mYGBFc5NMmyc0fJIno3KQJ+ tAlGiQSAmK2LctgJs2VGglZnMGH0FoLwPocWxUa+zgg+5JADpN7nQZyDmAbsE4DfTf5Kr3 DdkKNvi1Go7LZ0v2995TaK6WiXeh9w5ZHIlhE+M8H3/myqUEgrV5uAIg9MxNgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753729303; 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=IPRL4KPMMdzyW1KcgmQTpwd7sWlHi8J3b9iQv0syzmE=; b=AB8jw/hBOzmn0oLd3BZKEW6doZzL6DZwQX7VdSnCGeorgP16IV3IID73ygWfw9YHh8mfzJ 2zCedTNkBTHAJk0W4jaXwu1Q9toHKLpR6pnduLBIQeW/5I26WYmekeFjOD7zMvRH0/pl3W keNEuDCn0/kebAl+Ds5aHIWnuwBYM8KCniwFyBHSlMRD6G5usLA0Vzi8KVJxelxQUVyxVO hM8Ne7hkwQyRSqDVvtieJzwcfY0IGITKbMupjvU/l66fE7O47GoTZEmQ15BgJbFMl6I4fl amRkZvVy/m1PNSPqNU6Yyzt7fmECbDhYvzgwV6sjXJxMeSwYWAV/4rJ86Pc2Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753729303; a=rsa-sha256; cv=none; b=R8xbrd4/1yP0nrV4njTzQM5YecBftuvKosLqNijMFReNx1PQLwdro98v1i80B9t0YdD2ox qBbrWwGvCMaxUC8yLcwnNs6V72VBM68bMaDTzKWQpHOf1XrndXINoDL7Yy3GYUSMs9DG5j 7ze+LTmjM6i/bi6qXj8AVnT/oYb3ux/ZdLFO9R9145tPZyeMG5x8RmsN98igkz9RQnu/PL KX3CjAdvQ2fd35ONhrZ61hNRTL+Og43ia+j8pRgf63XPNd7Bwq2h6DX0H+Q3r9VFjcgGzB 1VTRpvX7XqSw5CXHPxJTBWVOgiNx19XdhIeGSWKHGP/wNj5gjE0rvZyXEY0Abw== 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 "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4brSWW0fZYz12lt; Mon, 28 Jul 2025 19:01:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id B11CB44BA3; Mon, 28 Jul 2025 21:01:40 +0200 (CEST) From: Kristof Provost To: Warner Losh Cc: Warner Losh , Eric Joyner , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 430f1acc451c - main - ice(4): Add MAC filter and VLAN resource limits to VFs Date: Mon, 28 Jul 2025 21:01:39 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: References: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_9A18F802-6A99-4690-A7E7-6E332B7DEDC3_=" --=_MailMate_9A18F802-6A99-4690-A7E7-6E332B7DEDC3_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable That=E2=80=99s confirmed, that has indeed fixed the arm64 LINT build erro= rs. Thanks des. We=E2=80=99re still failing riscv and i386, but those are different error= s. The riscv one is new (or I haven=E2=80=99t seen it before, anyway): --- all_subdir_usr.bin --- ld: error: undefined symbol: llvm::DisableABIBreakingChecks >>> referenced by ClangScanDeps.cpp >>> = ClangScanDeps.pieo:(llvm::VerifyDisableABIBreakingChecks) c++: error: linker command failed with exit code 1 (use -v to see = invocation) i386 has been failing for a while: --- all_subdir_sbin/recoverdisk --- /usr/src/sbin/recoverdisk/recoverdisk.c:830:38: error: comparison of = integers of different signs: 'unsigned int' and 'time_t' (aka 'int') = [-Werror,-Wsign-compare] --- all_subdir_usr.bin --- --- uuencode.o --- cc -target i386-unknown-freebsd15.0 = --sysroot=3D/usr/obj/usr/src/i386.i386/tmp = -B/usr/obj/usr/src/i386.i386/tmp/usr/bin -O2 -pipe -fno-common -g = -gz=3Dzlib -MD -MF.depend.uuencode.o -MTuu encode.o -std=3Dgnu17 -Wno-format-zero-length -fstack-protector-strong = -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpoi nter-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow = -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs = -Wold-style-definition -Wno-pointer-sign -Wdate-t ime -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body = -Wno-string-plus-int -Wno-unused-const-variable = -Wno-error=3Dunused-but-set-parameter -Wno-error=3Dcast-function-type-mis= ma tch -Qunused-arguments -c /usr/src/usr.bin/bintrans/uuencode.c -o = uuencode.o --- all_subdir_sbin --- 830 | if (unsaved && (t_save + snapshot) < t_now) { | ~~~~~~~~~~~~~~~~~ ^ ~~~~~ 1 error generated. *** [recoverdisk.o] Error code 1 =E2=80=94 Kristof On 28 Jul 2025, at 19:45, Warner Losh wrote: > I think DES may have just fixed this. Can you confirm? > > Warner > > On Mon, Jul 28, 2025 at 3:23=E2=80=AFAM Kristof Provost = > wrote: >> >> I=E2=80=99m not sure if it=E2=80=99s this specific commit or another o= ne in the = >> recent dev/ice updates, but the arm64 LINT-FDT, LINT-ACPI and LINT = >> builds all fail. >> >> This is from arm64-LINT: >> >> ld: error: undefined symbol: ice_iov_attach >> >>> referenced by if_ice_iflib.c:859 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:859) >> >>> if_ice_iflib.o:(ice_if_attach_post) >> >> ld: error: undefined symbol: ice_iov_detach >> >>> referenced by if_ice_iflib.c:989 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:989) >> >>> if_ice_iflib.o:(ice_if_detach) >> >>> referenced by if_ice_iflib.c:2323 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:2323) >> >>> if_ice_iflib.o:(ice_if_update_admin_status) >> >>> referenced by if_ice_iflib.c:2376 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:2376) >> >>> if_ice_iflib.o:(ice_transition_safe_mode) >> >> ld: error: undefined symbol: ice_iov_add_vf >> >>> referenced by if_ice_iflib.c:3464 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:3464) >> >>> if_ice_iflib.o:(ice_if_iov_vf_add) >> >> ld: error: undefined symbol: ice_iov_init >> >>> referenced by if_ice_iflib.c:3429 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:3429) >> >>> if_ice_iflib.o:(ice_if_iov_init) >> >> ld: error: undefined symbol: ice_iov_uninit >> >>> referenced by if_ice_iflib.c:3445 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:3445) >> >>> if_ice_iflib.o:(ice_if_iov_uninit) >> >> ld: error: undefined symbol: ice_iov_handle_vflr >> >>> referenced by if_ice_iflib.c:3480 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:3480) >> >>> if_ice_iflib.o:(ice_if_vflr_handle) >> >> ld: error: undefined symbol: ice_vc_notify_all_vfs_link_state >> >>> referenced by if_ice_iflib.c:757 = >> (/usr/src/sys/dev/ice/if_ice_iflib.c:757) >> >>> if_ice_iflib.o:(ice_update_link_status) >> >> ld: error: undefined symbol: ice_vc_handle_vf_msg >> >>> referenced by ice_lib.c:2285 = >> (/usr/src/sys/dev/ice/ice_lib.c:2285) >> >>> ice_lib.o:(ice_process_ctrlq) >> *** [kernel.full] Error code 1 >> >> =E2=80=94 >> Kristof >> >> On 18 Jul 2025, at 21:16, Warner Losh wrote: >>> The branch main has been updated by imp: >>> >>> URL: = >>> https://cgit.FreeBSD.org/src/commit/?id=3D430f1acc451c7084d1d5aa7df7e= 7ecccea1a8b51 >>> >>> commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 >>> Author: Eric Joyner >>> AuthorDate: 2024-10-17 22:19:09 +0000 >>> Commit: Warner Losh >>> CommitDate: 2025-07-18 19:16:17 +0000 >>> >>> ice(4): Add MAC filter and VLAN resource limits to VFs >>> >>> Adds two new parameters to iovctl config for VLAN filter limits = >>> and MAC >>> filter limits and gives them defaults of 64 and 16, = >>> respectively. >>> >>> These are intended to limit the number of resources that a VF = >>> can >>> consume so that any one VF cannot starve an other VFs or the PF = >>> of >>> filters. >>> >>> Signed-off-by: Eric Joyner >>> Signed-off-by: Krzysztof Galazka >>> Reviewed by: imp >>> Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 >>> --- >>> sys/dev/ice/ice_iov.c | 45 = >>> ++++++++++++++++++++++++++++++++++++++++++--- >>> sys/dev/ice/ice_iov.h | 8 ++++++++ >>> 2 files changed, 50 insertions(+), 3 deletions(-) >>> >>> diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c >>> index fc37a0e7679c..e06c7eb56f7a 100644 >>> --- a/sys/dev/ice/ice_iov.c >>> +++ b/sys/dev/ice/ice_iov.c >>> @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc) >>> IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); >>> pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", >>> IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); >>> + pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed", >>> + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT); >>> + pci_iov_schema_add_uint16(vf_schema, "max-mac-filters", >>> + IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT); >>> >>> error =3D pci_iov_attach(dev, pf_schema, vf_schema); >>> if (error !=3D 0) { >>> @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t = >>> vfnum, const nvlist_t *params) >>> >>> vsi->mirror_src_vsi =3D nvlist_get_number(params, = >>> "mirror-src-vsi"); >>> >>> + vf->vlan_limit =3D nvlist_get_number(params, = >>> "max-vlan-allowed"); >>> + vf->mac_filter_limit =3D nvlist_get_number(params, = >>> "max-mac-filters"); >>> + >>> vf->vf_flags |=3D VF_FLAG_VLAN_CAP; >>> >>> /* Create and setup VSI in HW */ >>> @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, = >>> struct ice_vf *vf, u8 *msg_buf) >>> enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS;= >>> struct virtchnl_ether_addr_list *addr_list; >>> struct ice_hw *hw =3D &sc->hw; >>> + u16 added_addr_cnt =3D 0; >>> int error =3D 0; >>> >>> addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; >>> >>> + if (addr_list->num_elements > >>> + (vf->mac_filter_limit - vf->mac_filter_cnt)) { >>> + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; >>> + goto done; >>> + } >>> + >>> for (int i =3D 0; i < addr_list->num_elements; i++) { >>> u8 *addr =3D addr_list->list[i].addr; >>> >>> @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, = >>> struct ice_vf *vf, u8 *msg_buf) >>> "%s: VF-%d: Error adding MAC addr for VSI = >>> %d\n", >>> __func__, vf->vf_num, vf->vsi->idx); >>> v_status =3D VIRTCHNL_STATUS_ERR_PARAM; >>> - goto done; >>> + continue; >>> } >>> + /* Don't count VF's MAC against its MAC filter limit = >>> */ >>> + if (memcmp(addr, vf->mac, ETHER_ADDR_LEN)) >>> + added_addr_cnt++; >>> } >>> >>> + vf->mac_filter_cnt +=3D added_addr_cnt; >>> + >>> done: >>> ice_aq_send_msg_to_vf(hw, vf->vf_num, = >>> VIRTCHNL_OP_ADD_ETH_ADDR, >>> v_status, NULL, 0, NULL); >>> @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, = >>> struct ice_vf *vf, u8 *msg_buf) >>> enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS;= >>> struct virtchnl_ether_addr_list *addr_list; >>> struct ice_hw *hw =3D &sc->hw; >>> + u16 deleted_addr_cnt =3D 0; >>> int error =3D 0; >>> >>> addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; >>> @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, = >>> struct ice_vf *vf, u8 *msg_buf) >>> "%s: VF-%d: Error removing MAC addr for = >>> VSI %d\n", >>> __func__, vf->vf_num, vf->vsi->idx); >>> v_status =3D VIRTCHNL_STATUS_ERR_PARAM; >>> - goto done; >>> + continue; >>> } >>> + /* Don't count VF's MAC against its MAC filter limit = >>> */ >>> + if (memcmp(addr_list->list[i].addr, vf->mac, = >>> ETHER_ADDR_LEN)) >>> + deleted_addr_cnt++; >>> } >>> >>> -done: >>> + if (deleted_addr_cnt >=3D vf->mac_filter_cnt) >>> + vf->mac_filter_cnt =3D 0; >>> + else >>> + vf->mac_filter_cnt -=3D deleted_addr_cnt; >>> + >>> ice_aq_send_msg_to_vf(hw, vf->vf_num, = >>> VIRTCHNL_OP_DEL_ETH_ADDR, >>> v_status, NULL, 0, NULL); >>> } >>> @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, = >>> struct ice_vf *vf, u8 *msg_buf) >>> goto done; >>> } >>> >>> + if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) = >>> { >>> + v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; >>> + goto done; >>> + } >>> + >>> status =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, >>> vlan_list->num_elements); >>> if (status) { >>> @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct = >>> ice_vf *vf, u8 *msg_buf) >>> goto done; >>> } >>> >>> + vf->vlan_cnt +=3D vlan_list->num_elements; >>> + >>> done: >>> ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, >>> v_status, NULL, 0, NULL); >>> @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, = >>> struct ice_vf *vf, u8 *msg_buf) >>> goto done; >>> } >>> >>> + if (vlan_list->num_elements >=3D vf->vlan_cnt) >>> + vf->vlan_cnt =3D 0; >>> + else >>> + vf->vlan_cnt -=3D vlan_list->num_elements; >>> + >>> done: >>> ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, >>> v_status, NULL, 0, NULL); >>> diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h >>> index c2ac5fcd5c94..c4fb3e932e3f 100644 >>> --- a/sys/dev/ice/ice_iov.h >>> +++ b/sys/dev/ice/ice_iov.h >>> @@ -85,6 +85,11 @@ struct ice_vf { >>> u16 vf_num; >>> struct virtchnl_version_info version; >>> >>> + u16 mac_filter_limit; >>> + u16 mac_filter_cnt; >>> + u16 vlan_limit; >>> + u16 vlan_cnt; >>> + >>> u16 num_irq_vectors; >>> u16 *vf_imap; >>> struct ice_irq_vector *tx_irqvs; >>> @@ -101,6 +106,9 @@ struct ice_vf { >>> #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS = >>> (FLAG_VF_UNICAST_PROMISC | \ >>> FLAG_VF_MULTICAST_PROM= ISC) >>> >>> +#define ICE_DEFAULT_VF_VLAN_LIMIT 64 >>> +#define ICE_DEFAULT_VF_FILTER_LIMIT 16 >>> + >>> int ice_iov_attach(struct ice_softc *sc); >>> int ice_iov_detach(struct ice_softc *sc); --=_MailMate_9A18F802-6A99-4690-A7E7-6E332B7DEDC3_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

That=E2=80=99s confirmed, that has indeed fixed the arm64= LINT build errors.
Thanks des.

We=E2=80=99re still failing riscv and i386, but those are= different errors.

The riscv one is new (or I haven=E2=80=99t seen it before= , anyway):

--=
- all_subdir_usr.bin ---
ld: error: undefined symbol: llvm::DisableABIBreakingChecks
>>> referenced by ClangScanDeps.cpp
>>>               ClangScanDeps.pieo:(llvm::VerifyDisableABIBrea=
kingChecks)
c++: error: linker command failed with exit code 1 (use -v to see invocat=
ion)

i386 has been failing for a while:

--=
- all_subdir_sbin/recoverdisk ---
/usr/src/sbin/recoverdisk/recoverdisk.c:830:38: error: comparison of inte=
gers of different signs: 'unsigned int' and 'time_t' (aka 'int') [-Werror=
,-Wsign-compare]
--- all_subdir_usr.bin ---
--- uuencode.o ---
cc -target i386-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/i386.i38=
6/tmp -B/usr/obj/usr/src/i386.i386/tmp/usr/bin  -O2 -pipe -fno-common   -=
g -gz=3Dzlib -MD  -MF.depend.uuencode.o -MTuu
encode.o -std=3Dgnu17 -Wno-format-zero-length -fstack-protector-strong -W=
system-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Ws=
trict-prototypes -Wmissing-prototypes -Wpoi
nter-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -W=
unused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-st=
yle-definition -Wno-pointer-sign -Wdate-t
ime -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-=
string-plus-int -Wno-unused-const-variable -Wno-error=3Dunused-but-set-pa=
rameter -Wno-error=3Dcast-function-type-misma
tch  -Qunused-arguments     -c /usr/src/usr.bin/bintrans/uuencode.c -o uu=
encode.o
--- all_subdir_sbin ---
  830 |                 if (unsaved && (t_save + snapshot) < t=
_now) {
      |                                 ~~~~~~~~~~~~~~~~~  ^ ~~~~~
1 error generated.
*** [recoverdisk.o] Error code 1

=E2=80=94
Kristof

On 28 Jul 2025, at 19:45, Warner Losh wrote:

I think DES may have just fixed this. Can you confirm?

Warner

On Mon, Jul 28, 2025 at 3:23=E2=80=AFAM Kristof Provost <= a href=3D"mailto:kp@freebsd.org">kp@freebsd.org wrote:

I=E2=80=99m not sure if it=E2=80=99s this specific commit= or another one in the recent dev/ice updates, but the arm64 LINT-FDT, LI= NT-ACPI and LINT builds all fail.

This is from arm64-LINT:

  =
  ld: error: undefined symbol: ice_iov_attach
    >>> referenced by if_ice_iflib.c:859 (/usr/src/sys/dev/ice/i=
f_ice_iflib.c:859)
    >>>               if_ice_iflib.o:(ice_if_attach_post)

    ld: error: undefined symbol: ice_iov_detach
    >>> referenced by if_ice_iflib.c:989 (/usr/src/sys/dev/ice/i=
f_ice_iflib.c:989)
    >>>               if_ice_iflib.o:(ice_if_detach)
    >>> referenced by if_ice_iflib.c:2323 (/usr/src/sys/dev/ice/=
if_ice_iflib.c:2323)
    >>>               if_ice_iflib.o:(ice_if_update_admin_status=
)
    >>> referenced by if_ice_iflib.c:2376 (/usr/src/sys/dev/ice/=
if_ice_iflib.c:2376)
    >>>               if_ice_iflib.o:(ice_transition_safe_mode)

    ld: error: undefined symbol: ice_iov_add_vf
    >>> referenced by if_ice_iflib.c:3464 (/usr/src/sys/dev/ice/=
if_ice_iflib.c:3464)
    >>>               if_ice_iflib.o:(ice_if_iov_vf_add)

    ld: error: undefined symbol: ice_iov_init
    >>> referenced by if_ice_iflib.c:3429 (/usr/src/sys/dev/ice/=
if_ice_iflib.c:3429)
    >>>               if_ice_iflib.o:(ice_if_iov_init)

    ld: error: undefined symbol: ice_iov_uninit
    >>> referenced by if_ice_iflib.c:3445 (/usr/src/sys/dev/ice/=
if_ice_iflib.c:3445)
    >>>               if_ice_iflib.o:(ice_if_iov_uninit)

    ld: error: undefined symbol: ice_iov_handle_vflr
    >>> referenced by if_ice_iflib.c:3480 (/usr/src/sys/dev/ice/=
if_ice_iflib.c:3480)
    >>>               if_ice_iflib.o:(ice_if_vflr_handle)

    ld: error: undefined symbol: ice_vc_notify_all_vfs_link_state
    >>> referenced by if_ice_iflib.c:757 (/usr/src/sys/dev/ice/i=
f_ice_iflib.c:757)
    >>>               if_ice_iflib.o:(ice_update_link_status)

    ld: error: undefined symbol: ice_vc_handle_vf_msg
    >>> referenced by ice_lib.c:2285 (/usr/src/sys/dev/ice/ice_l=
ib.c:2285)
    >>>               ice_lib.o:(ice_process_ctrlq)
    *** [kernel.full] Error code 1

=E2=80=94
Kristof

On 18 Jul 2025, at 21:16, Warner Losh wrote:

The branch main has been updated by imp:

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

commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51
Author: Eric Joyner eric.joy= ner@intel.com
AuthorDate: 2024-10-17 22:19:09 +0000
Commit: Warner Losh imp@FreeBSD.or= g
CommitDate: 2025-07-18 19:16:17 +0000

ic=
e(4): Add MAC filter and VLAN resource limits to VFs

Adds two new parameters to iovctl config for VLAN filter limits and MAC
filter limits and gives them defaults of 64 and 16, respectively.

These are intended to limit the number of resources that a VF can
consume so that any one VF cannot starve an other VFs or the PF of
filters.

Signed-off-by: Eric Joyner <eric.joyner@intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1573

sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++= ++++++++++++---
sys/dev/ice/ice_iov.h | 8 ++++++++
2 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.= c
index fc37a0e7679c..e06c7eb56f7a 100644
--- a/sys/dev/ice/ice_iov.c
+++ b/sys/dev/ice/ice_iov.c
@@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc)
IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES);
pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi",
IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI);

  • pc=
    i_iov_schema_add_uint16(vf_schema, "max-vlan-allowed",
    
  •   =
      IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT);
    
  • pc=
    i_iov_schema_add_uint16(vf_schema, "max-mac-filters",
    
  •   =
      IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT);
    
    error =3D pci_iov_attach(dev, pf_schema, vf_schema);
    if (error !=3D 0) {
    

@@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, = uint16_t vfnum, const nvlist_t *params)

  =
vsi->mirror_src_vsi =3D nvlist_get_number(params, "mirror-src-vsi=
");
  • vf=
    ->vlan_limit =3D nvlist_get_number(params, "max-vlan-allowed"=
    ;);
    
  • vf=
    ->mac_filter_limit =3D nvlist_get_number(params, "max-mac-filters=
    ");
    
  • vf=
    ->vf_flags |=3D VF_FLAG_VLAN_CAP;
    
    /* Create and setup VSI in HW */
    

@@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_= softc *sc, struct ice_vf *vf, u8 *msg_buf)
enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS;
struct virtchnl_ether_addr_list *addr_list;
struct ice_hw *hw =3D &sc->hw;

  • u1=
    6 added_addr_cnt =3D 0;
    int error =3D 0;
    
    addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf;
    
  • if=
     (addr_list->num_elements >
    
  •   =
      (vf->mac_filter_limit - vf->mac_filter_cnt)) {
    
  •   =
          v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY;
    
  •   =
          goto done;
    
  • }
    
  • fo=
    r (int i =3D 0; i < addr_list->num_elements; i++) {
            u8 *addr =3D addr_list->list[i].addr;
    

@@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_= softc *sc, struct ice_vf *vf, u8 *msg_buf)
"%s: VF-%d: Error adding MAC addr for VSI %d\n",
func, vf->vf_num, vf->vsi->idx);
v_status =3D VIRTCHNL_STATUS_ERR_PARAM;

  •   =
                  goto done;
    
  •   =
                  continue;
            }
    
  •   =
          /* Don't count VF's MAC against its MAC filter limit */
    
  •   =
          if (memcmp(addr, vf->mac, ETHER_ADDR_LEN))
    
  •   =
                  added_addr_cnt++;
    }
    
  • vf=
    ->mac_filter_cnt +=3D added_addr_cnt;
    

done:
ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR,
v_status, NULL, 0, NULL);
@@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struct = ice_vf *vf, u8 *msg_buf)
enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS;
struct virtchnl_ether_addr_list *addr_list;
struct ice_hw *hw =3D &sc->hw;

  • u1=
    6 deleted_addr_cnt =3D 0;
    int error =3D 0;
    
    addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf;
    

@@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_= softc *sc, struct ice_vf *vf, u8 *msg_buf)
"%s: VF-%d: Error removing MAC addr for VSI %d\n",
func, vf->vf_num, vf->vsi->idx);
v_status =3D VIRTCHNL_STATUS_ERR_PARAM;

  •   =
                  goto done;
    
  •   =
                  continue;
            }
    
  •   =
          /* Don't count VF's MAC against its MAC filter limit */
    
  •   =
          if (memcmp(addr_list->list[i].addr, vf->mac, ETHER_ADDR_LEN))=
    
    
  •   =
                  deleted_addr_cnt++;
    }
    

-done:

  • if=
     (deleted_addr_cnt >=3D vf->mac_filter_cnt)
    
  •   =
          vf->mac_filter_cnt =3D 0;
    
  • el=
    se
    
  •   =
          vf->mac_filter_cnt -=3D deleted_addr_cnt;
    
  • ic=
    e_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR,
        v_status, NULL, 0, NULL);
    

}
@@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ice= _vf *vf, u8 *msg_buf)
goto done;
}

  • if=
     (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) =
    {
    
  •   =
          v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY;
    
  •   =
          goto done;
    
  • }
    
  • st=
    atus =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id,
                                    vlan_list->num_elements);
    if (status) {
    

@@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc = *sc, struct ice_vf *vf, u8 *msg_buf)
goto done;
}

  • vf=
    ->vlan_cnt +=3D vlan_list->num_elements;
    

done:
ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN,
v_status, NULL, 0, NULL);
@@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct ice= _vf *vf, u8 *msg_buf)
goto done;
}

  • if=
     (vlan_list->num_elements >=3D vf->vlan_cnt)
    
  •   =
          vf->vlan_cnt =3D 0;
    
  • el=
    se
    
  •   =
          vf->vlan_cnt -=3D vlan_list->num_elements;
    

done:
ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN,
v_status, NULL, 0, NULL);
diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h
index c2ac5fcd5c94..c4fb3e932e3f 100644
--- a/sys/dev/ice/ice_iov.h
+++ b/sys/dev/ice/ice_iov.h
@@ -85,6 +85,11 @@ struct ice_vf {
u16 vf_num;
struct virtchnl_version_info version;

  • u1=
    6 mac_filter_limit;
    
  • u1=
    6 mac_filter_cnt;
    
  • u1=
    6 vlan_limit;
    
  • u1=
    6 vlan_cnt;
    
  • u1=
    6 num_irq_vectors;
    u16 *vf_imap;
    struct ice_irq_vector *tx_irqvs;
    

@@ -101,6 +106,9 @@ struct ice_vf {
#define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC | <= br> FLAG_VF_MULTICAST_PROMISC)

+#define ICE_DEFAULT_VF_VLAN_LIMIT 64<= br> +#define ICE_DEFAULT_VF_FILTER_LIMIT 16
+
int ice_iov_attach(struct ice_softc *sc);
int ice_iov_detach(struct ice_softc *sc);

--=_MailMate_9A18F802-6A99-4690-A7E7-6E332B7DEDC3_=-- From nobody Mon Jul 28 19:42:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brTQR0VTPz63PXf for ; Mon, 28 Jul 2025 19:42:23 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brTQQ1RZyz3xHq for ; Mon, 28 Jul 2025 19:42:22 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-4ab814c4f2dso89253051cf.1 for ; Mon, 28 Jul 2025 12:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; t=1753731740; x=1754336540; 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=wuzgBDhZ9s3j9eAjTWVsYeskvkwVfrUa1jGQiQEvw3U=; b=EYklgqQX5wq8rui+OrLJcmu+nDJTMVe/Uce8puXxMvcrPKGVdMjSAeJkomkKtZ95Lx KBI1vpD0+buZ0B2o/L50P8plzrP5eZAX7wcpfvAl+e/eX5J6qc8l90/FLN3u1A98kOJ7 qS3nLkLPrCDRJmz3+TkulkAZKflget09QmuCw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753731740; x=1754336540; 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=wuzgBDhZ9s3j9eAjTWVsYeskvkwVfrUa1jGQiQEvw3U=; b=g1EM8UlHkLxJAlbmpMxwqJ87zM3f8144HlSQhmkUKYmBoajeqhNTpT6zm6jG6OO5wi iH7HsJbQRyiuHiACf4iXTWtnby8WIDJtFA9532c7T71hz8GLQ77rkk/T5CcLB9zkPo6l GEPzLGDPmMeSCdIvNS/zoFTkRpE5FD2cLlYbht+Ni+MkajCjuP9eOYkLCpM6YFn/P6wM tU5KydLE9nf9LSH04FPbEixEr4y7UauNVf/2wGZJBy+fxELip/gZaDpV0L+mN/U7ZJw8 5zmIYEwqWMrvvBU39rUNeVdZcEy6j0RlUG2YBfxzq9jeWQ/GYKhE8DiBH9YxDGWf9Q72 Qz7w== X-Forwarded-Encrypted: i=1; AJvYcCVINEugtEpl4F+/OFn3GfFLjpobJxlJCw4wB7HkdqNVxGGKvToty4VwtT21cerUat/HWgPfH3Iak64Xq3xILXyvtL4F@freebsd.org X-Gm-Message-State: AOJu0Yw57y+c+ZQgdeGI/+r6eZ4pwmyyICOt48NOkkwAEtISF/EPyGOW qUc9pj8Y9TKVew5dvxuQVvkJAGtakPAFZ/XtPyTVXP0zH0Z3sW8QA4wqfkLNm4fse5zIfWYQGOw 7wFSLqM7S3qIWNcloJn58NhHRtYSkwYtNR2lov1VR X-Gm-Gg: ASbGncsP8DbSuFeGqnSFozfZUzv5ePInEp2TYCqizlF3gxeLDBanWxFR8h8cLNyHYJa KOiQ3xOOynskH7mvXUaq3+mx6QDGNpywkE57ZwBwBgDl6icqjHv+wVaYoZg+viqxJ/elvmTlbSI xzfUGnJJOdTOxr6mnP41N3sX5yGbkgQhFhFEB3FqLq+chCGBKgEPBn4W50bAoNx0oQLA91OSd9C qI4NAcaupPDf0Lk8WE= X-Google-Smtp-Source: AGHT+IG5n1fdMmw42VpiozDwbTwZKz5GAkxolVMQ25dv+XG8xygAD80lQXQmgwP+Mm+3lzojjZbx6bvXwrBbduCS6XI= X-Received: by 2002:ac8:5a0a:0:b0:4ae:cc4b:11bc with SMTP id d75a77b69052e-4aecc4b126cmr14919051cf.58.1753731739949; Mon, 28 Jul 2025 12:42:19 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> In-Reply-To: From: Kevin Bowling Date: Mon, 28 Jul 2025 12:42:07 -0700 X-Gm-Features: Ac12FXxeGzFQ9Lk3YlYwqjVgoLI9nfYbXz8dUSnWqFTaG4Ce1LXhT0914ZMTa_w Message-ID: Subject: Re: git: 430f1acc451c - main - ice(4): Add MAC filter and VLAN resource limits to VFs To: Kristof Provost , Krzysztof Galazka Cc: Warner Losh , Warner Losh , Eric Joyner , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4brTQQ1RZyz3xHq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] One gentle reminder in all this, kgalazka@ is under mentorship and should be included in especially ixl and ice work and follow ups so we can release him to make all these mistakes and fixes :) Regards, Kevin On Mon, Jul 28, 2025 at 12:01=E2=80=AFPM Kristof Provost w= rote: > > That=E2=80=99s confirmed, that has indeed fixed the arm64 LINT build erro= rs. > Thanks des. > > We=E2=80=99re still failing riscv and i386, but those are different error= s. > > The riscv one is new (or I haven=E2=80=99t seen it before, anyway): > > --- all_subdir_usr.bin --- > ld: error: undefined symbol: llvm::DisableABIBreakingChecks > >>> referenced by ClangScanDeps.cpp > >>> ClangScanDeps.pieo:(llvm::VerifyDisableABIBreakingCheck= s) > c++: error: linker command failed with exit code 1 (use -v to see invocat= ion) > > i386 has been failing for a while: > > --- all_subdir_sbin/recoverdisk --- > /usr/src/sbin/recoverdisk/recoverdisk.c:830:38: error: comparison of inte= gers of different signs: 'unsigned int' and 'time_t' (aka 'int') [-Werror,-= Wsign-compare] > --- all_subdir_usr.bin --- > --- uuencode.o --- > cc -target i386-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/i386.i38= 6/tmp -B/usr/obj/usr/src/i386.i386/tmp/usr/bin -O2 -pipe -fno-common -g = -gz=3Dzlib -MD -MF.depend.uuencode.o -MTuu > encode.o -std=3Dgnu17 -Wno-format-zero-length -fstack-protector-strong -W= system-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstr= ict-prototypes -Wmissing-prototypes -Wpoi > nter-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -W= unused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-styl= e-definition -Wno-pointer-sign -Wdate-t > ime -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-= string-plus-int -Wno-unused-const-variable -Wno-error=3Dunused-but-set-para= meter -Wno-error=3Dcast-function-type-misma > tch -Qunused-arguments -c /usr/src/usr.bin/bintrans/uuencode.c -o uu= encode.o > --- all_subdir_sbin --- > 830 | if (unsaved && (t_save + snapshot) < t_now) { > | ~~~~~~~~~~~~~~~~~ ^ ~~~~~ > 1 error generated. > *** [recoverdisk.o] Error code 1 > > =E2=80=94 > Kristof > > On 28 Jul 2025, at 19:45, Warner Losh wrote: > > I think DES may have just fixed this. Can you confirm? > > Warner > > On Mon, Jul 28, 2025 at 3:23=E2=80=AFAM Kristof Provost kp@freebsd.org wr= ote: > > I=E2=80=99m not sure if it=E2=80=99s this specific commit or another one = in the recent dev/ice updates, but the arm64 LINT-FDT, LINT-ACPI and LINT b= uilds all fail. > > This is from arm64-LINT: > > ld: error: undefined symbol: ice_iov_attach > >>> referenced by if_ice_iflib.c:859 (/usr/src/sys/dev/ice/if_ice_ifl= ib.c:859) > >>> if_ice_iflib.o:(ice_if_attach_post) > > ld: error: undefined symbol: ice_iov_detach > >>> referenced by if_ice_iflib.c:989 (/usr/src/sys/dev/ice/if_ice_ifl= ib.c:989) > >>> if_ice_iflib.o:(ice_if_detach) > >>> referenced by if_ice_iflib.c:2323 (/usr/src/sys/dev/ice/if_ice_if= lib.c:2323) > >>> if_ice_iflib.o:(ice_if_update_admin_status) > >>> referenced by if_ice_iflib.c:2376 (/usr/src/sys/dev/ice/if_ice_if= lib.c:2376) > >>> if_ice_iflib.o:(ice_transition_safe_mode) > > ld: error: undefined symbol: ice_iov_add_vf > >>> referenced by if_ice_iflib.c:3464 (/usr/src/sys/dev/ice/if_ice_if= lib.c:3464) > >>> if_ice_iflib.o:(ice_if_iov_vf_add) > > ld: error: undefined symbol: ice_iov_init > >>> referenced by if_ice_iflib.c:3429 (/usr/src/sys/dev/ice/if_ice_if= lib.c:3429) > >>> if_ice_iflib.o:(ice_if_iov_init) > > ld: error: undefined symbol: ice_iov_uninit > >>> referenced by if_ice_iflib.c:3445 (/usr/src/sys/dev/ice/if_ice_if= lib.c:3445) > >>> if_ice_iflib.o:(ice_if_iov_uninit) > > ld: error: undefined symbol: ice_iov_handle_vflr > >>> referenced by if_ice_iflib.c:3480 (/usr/src/sys/dev/ice/if_ice_if= lib.c:3480) > >>> if_ice_iflib.o:(ice_if_vflr_handle) > > ld: error: undefined symbol: ice_vc_notify_all_vfs_link_state > >>> referenced by if_ice_iflib.c:757 (/usr/src/sys/dev/ice/if_ice_ifl= ib.c:757) > >>> if_ice_iflib.o:(ice_update_link_status) > > ld: error: undefined symbol: ice_vc_handle_vf_msg > >>> referenced by ice_lib.c:2285 (/usr/src/sys/dev/ice/ice_lib.c:2285= ) > >>> ice_lib.o:(ice_process_ctrlq) > *** [kernel.full] Error code 1 > > =E2=80=94 > Kristof > > On 18 Jul 2025, at 21:16, Warner Losh wrote: > > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D430f1acc451c7084d1d5aa7df7= e7ecccea1a8b51 > > commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 > Author: Eric Joyner eric.joyner@intel.com > AuthorDate: 2024-10-17 22:19:09 +0000 > Commit: Warner Losh imp@FreeBSD.org > CommitDate: 2025-07-18 19:16:17 +0000 > > ice(4): Add MAC filter and VLAN resource limits to VFs > > Adds two new parameters to iovctl config for VLAN filter limits and MAC > filter limits and gives them defaults of 64 and 16, respectively. > > These are intended to limit the number of resources that a VF can > consume so that any one VF cannot starve an other VFs or the PF of > filters. > > Signed-off-by: Eric Joyner > Signed-off-by: Krzysztof Galazka > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 > > ________________________________ > > sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- > sys/dev/ice/ice_iov.h | 8 ++++++++ > 2 files changed, 50 insertions(+), 3 deletions(-) > > diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c > index fc37a0e7679c..e06c7eb56f7a 100644 > --- a/sys/dev/ice/ice_iov.c > +++ b/sys/dev/ice/ice_iov.c > @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc) > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); > pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", > IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); > > pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed", > > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT); > > pci_iov_schema_add_uint16(vf_schema, "max-mac-filters", > > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT); > > error =3D pci_iov_attach(dev, pf_schema, vf_schema); > if (error !=3D 0) { > > @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, = const nvlist_t *params) > > vsi->mirror_src_vsi =3D nvlist_get_number(params, "mirror-src-vsi"); > > vf->vlan_limit =3D nvlist_get_number(params, "max-vlan-allowed"); > > vf->mac_filter_limit =3D nvlist_get_number(params, "max-mac-filters"); > > vf->vf_flags |=3D VF_FLAG_VLAN_CAP; > > /* Create and setup VSI in HW */ > > @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, struc= t ice_vf *vf, u8 *msg_buf) > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > struct virtchnl_ether_addr_list *addr_list; > struct ice_hw *hw =3D &sc->hw; > > u16 added_addr_cnt =3D 0; > int error =3D 0; > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > if (addr_list->num_elements > > > (vf->mac_filter_limit - vf->mac_filter_cnt)) { > > v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > goto done; > > } > > for (int i =3D 0; i < addr_list->num_elements; i++) { > u8 *addr =3D addr_list->list[i].addr; > > @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, struc= t ice_vf *vf, u8 *msg_buf) > "%s: VF-%d: Error adding MAC addr for VSI %d\n", > func, vf->vf_num, vf->vsi->idx); > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > goto done; > > continue; > } > > /* Don't count VF's MAC against its MAC filter limit */ > > if (memcmp(addr, vf->mac, ETHER_ADDR_LEN)) > > added_addr_cnt++; > } > > vf->mac_filter_cnt +=3D added_addr_cnt; > > done: > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR, > v_status, NULL, 0, NULL); > @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struct = ice_vf *vf, u8 *msg_buf) > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > struct virtchnl_ether_addr_list *addr_list; > struct ice_hw *hw =3D &sc->hw; > > u16 deleted_addr_cnt =3D 0; > int error =3D 0; > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struc= t ice_vf *vf, u8 *msg_buf) > "%s: VF-%d: Error removing MAC addr for VSI %d\n", > func, vf->vf_num, vf->vsi->idx); > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > goto done; > > continue; > } > > /* Don't count VF's MAC against its MAC filter limit */ > > if (memcmp(addr_list->list[i].addr, vf->mac, ETHER_ADDR_LEN)) > > deleted_addr_cnt++; > } > > -done: > > if (deleted_addr_cnt >=3D vf->mac_filter_cnt) > > vf->mac_filter_cnt =3D 0; > > else > > vf->mac_filter_cnt -=3D deleted_addr_cnt; > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR, > v_status, NULL, 0, NULL); > > } > @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ice= _vf *vf, u8 *msg_buf) > goto done; > } > > if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) { > > v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > goto done; > > } > > status =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, > vlan_list->num_elements); > if (status) { > > @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct ice_= vf *vf, u8 *msg_buf) > goto done; > } > > vf->vlan_cnt +=3D vlan_list->num_elements; > > done: > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, > v_status, NULL, 0, NULL); > @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct ice= _vf *vf, u8 *msg_buf) > goto done; > } > > if (vlan_list->num_elements >=3D vf->vlan_cnt) > > vf->vlan_cnt =3D 0; > > else > > vf->vlan_cnt -=3D vlan_list->num_elements; > > done: > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, > v_status, NULL, 0, NULL); > diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h > index c2ac5fcd5c94..c4fb3e932e3f 100644 > --- a/sys/dev/ice/ice_iov.h > +++ b/sys/dev/ice/ice_iov.h > @@ -85,6 +85,11 @@ struct ice_vf { > u16 vf_num; > struct virtchnl_version_info version; > > u16 mac_filter_limit; > > u16 mac_filter_cnt; > > u16 vlan_limit; > > u16 vlan_cnt; > > u16 num_irq_vectors; > u16 *vf_imap; > struct ice_irq_vector *tx_irqvs; > > @@ -101,6 +106,9 @@ struct ice_vf { > #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC | > FLAG_VF_MULTICAST_PROMISC) > > +#define ICE_DEFAULT_VF_VLAN_LIMIT 64 > +#define ICE_DEFAULT_VF_FILTER_LIMIT 16 > + > int ice_iov_attach(struct ice_softc *sc); > int ice_iov_detach(struct ice_softc *sc); From nobody Mon Jul 28 20:33:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brVXw2zL5z63SJQ; Mon, 28 Jul 2025 20:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brVXw1yQpz43P1; Mon, 28 Jul 2025 20:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753734784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYMKcHCh4QlsLtcI9H4AUOWfNaSyMaAslBhuh3OF9a0=; b=Ho4DXWqBl/WhiT9XohvRt4RVU/qIaLRaqhMSetoJhN6eFojbCUgeHzkdhCXSZgS4A7uBai z7A5aW85RT5J9fO+F5ziRc3bSthqD5MIj3kmpxR2poz+gXPU5QbulxeBov66R3j5A4G/T2 qn0/gva7x9fCj1sEC4cpC8DVPeQKKlhVll3u3xgJVkjcM6KKp2MuPwBVCFHX+5SbDp37EO u8WXZ2N24/8NbB9S1jSywO8r6kb9ssrQQUH9hR7sJD/J+zUpZlQ9eiiNOkYKIaJ9t8snNn jX/7qCI1qqz7q45vXuJwAAwIN/uXtvr9wOVpxV9MEvvEtq1gdCYJ/eqHudlp4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753734784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fYMKcHCh4QlsLtcI9H4AUOWfNaSyMaAslBhuh3OF9a0=; b=XrsIAlzhd+QlxesKJWzsHYg3oKchSObKRPngIB22NCvOoN04GTgKSY/9Hc9+fTObiBAXQF 8amSzWft+iBp2zJ2P4+DKKqq4kO1P/xgWRkWrloq7TWXlg6V+lt7custUyp5OEm/LMm4dl EGHAkbO7pfqGDiFsvd7/+vbjMAIlzUcrt26C/8jaPtgBwOTLLxHpCF27erzt2/D5xdpXTR nB9+jcpYBSdL+MaztZhKNFgeuXMQozThXEGuRGafCJUojqupwn/5y/dl80ht3P2uPQvkUS uwbpbbdcKgBXgfAwOC6KeHTb2kN8vrH1DDuvr5HWGcKHzbMuLT+1hRxN8Ax9yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753734784; a=rsa-sha256; cv=none; b=N0UPXnxtgfDTnpnkyWrAax6dWOVWxoz28CMQrQLWbGfQ6RzVxYvoWT2F0VhKgp8v3KEl9d 7hwRU3vkBxP8duHsNtGCYp8UcqHuz0wjmv+3WG48uZr2RPm0dK4enpo9eHSO9raPxsmQwz LTUS8Mp0CElYLgTiBxMC1pGnw7ATsaZzP5vkUPEuqj4UpM5iVcTH/sJCtId+h+vRKzG8eK wtWgmDOjcaYsQMuVBpMbtvg5gsRcNzffG7oQ5WXihd7XhpC4cl99hIO0zZ6DFC6ftA1ZKB 3hKMxl2EDuPBkGkje5JnaVzrq3hOUfNWRENpKatWw+44uvFYU/YlarXoB3Y5qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brVXw1W5Vz11Jp; Mon, 28 Jul 2025 20:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SKX4ub079552; Mon, 28 Jul 2025 20:33:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SKX49Y079549; Mon, 28 Jul 2025 20:33:04 GMT (envelope-from git) Date: Mon, 28 Jul 2025 20:33:04 GMT Message-Id: <202507282033.56SKX49Y079549@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: 9a6ba186e0ca - main - sdt: Initialize probes in two passes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 9a6ba186e0ca4269021d8843dbc8409ea78da4a6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9a6ba186e0ca4269021d8843dbc8409ea78da4a6 commit 9a6ba186e0ca4269021d8843dbc8409ea78da4a6 Author: Mark Johnston AuthorDate: 2025-07-28 19:30:37 +0000 Commit: Mark Johnston CommitDate: 2025-07-28 20:32:39 +0000 sdt: Initialize probes in two passes Suppose a kernel module A defines an SDT provider and probes, and kernel linker file B, dependant on A, contains tracepoints for those probes. When sdt.ko is loaded, it iterates over all loaded KLDs to initialize probe structures and register them with dtrace. In particular it uses linker_file_foreach(), which is not sorted; in the above scenario, B may be visited before A. Thus, it's possible for sdt_kld_load_probes() to try to add tracepoints to an uninitialized SDT probe. An example of the above arises when pfsync, pf, and sdt are loaded in that exact order after commit 4bb3b36577645. Fix this by initializing probe structures in the first pass over loaded KLDs. Then, the second pass can safely add tracepoints to any probe structure. Note that the scenario where B and A are loaded after sdt.ko is already handled properly, as there, the kld_load eventhandler is responsible for registering probes with dtrace, and that eventhandler fires for dependencies before it does for the dependent KLD. This presumes, however, that there are no cycles in the dependency graph. Reported by: jenkins MFC after: 2 weeks --- sys/cddl/dev/sdt/sdt.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/sdt/sdt.c b/sys/cddl/dev/sdt/sdt.c index a8da618204af..0a9059104671 100644 --- a/sys/cddl/dev/sdt/sdt.c +++ b/sys/cddl/dev/sdt/sdt.c @@ -72,6 +72,7 @@ static void sdt_load(void); static int sdt_unload(void); static void sdt_create_provider(struct sdt_provider *); static void sdt_create_probe(struct sdt_probe *); +static void sdt_init_probe(struct sdt_probe *, linker_file_t); static void sdt_kld_load(void *, struct linker_file *); static void sdt_kld_unload_try(void *, struct linker_file *, int *); @@ -204,6 +205,14 @@ sdt_create_probe(struct sdt_probe *probe) (void)dtrace_probe_create(prov->id, mod, func, name, aframes, probe); } +static void +sdt_init_probe(struct sdt_probe *probe, linker_file_t lf) +{ + probe->sdtp_lf = lf; + TAILQ_INIT(&probe->argtype_list); + STAILQ_INIT(&probe->tracepoint_list); +} + /* * Probes are created through the SDT module load/unload hook, so this function * has nothing to do. It only exists because the DTrace provider framework @@ -361,12 +370,19 @@ static void sdt_kld_load_providers(struct linker_file *lf) { struct sdt_provider **prov, **begin, **end; + struct sdt_probe **p_begin, **p_end; if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL) == 0) { for (prov = begin; prov < end; prov++) sdt_create_provider(*prov); } + + if (linker_file_lookup_set(lf, "sdt_probes_set", &p_begin, &p_end, + NULL) == 0) { + for (struct sdt_probe **probe = p_begin; probe < p_end; probe++) + sdt_init_probe(*probe, lf); + } } static void @@ -378,13 +394,8 @@ sdt_kld_load_probes(struct linker_file *lf) if (linker_file_lookup_set(lf, "sdt_probes_set", &p_begin, &p_end, NULL) == 0) { - for (struct sdt_probe **probe = p_begin; probe < p_end; - probe++) { - (*probe)->sdtp_lf = lf; + for (struct sdt_probe **probe = p_begin; probe < p_end; probe++) sdt_create_probe(*probe); - TAILQ_INIT(&(*probe)->argtype_list); - STAILQ_INIT(&(*probe)->tracepoint_list); - } } if (linker_file_lookup_set(lf, "sdt_argtypes_set", &a_begin, &a_end, From nobody Mon Jul 28 20:57:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brW4x02xxz63TL6; Mon, 28 Jul 2025 20:57:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brW4w6H85z44rf; Mon, 28 Jul 2025 20:57:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753736240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=trwfmtf8lVCC3P40OciiCQagkT/Nzys15Cn51CtHgec=; b=C+ZrLwvx83BZd8zh5NVi6eZE6T2ambYl7FQtZ1h/A94jCI710G/bjFF6TGuXQ5WM8jFxhx kvc75Eqzhk5K3CQ6R6NoSlQg1qRgs5395dO3/KpQNZS5XE1vUoNz6NgHDCCN7YkYnIThDc TkhSjJMwpqGyJvBgX5hqYeSxKVaEyRzo4nhM/fVf6jJIaoFeescebtvlea6OBwXBd+XBkk ncRtoKqMYgcicRD4hZw8X8Re6nbGvpSD2p7zXH40NMoxOQ5s4JyS5jFYqhgLbwf5F9lnb4 XTnZ4YPPiNHduzGODl8h1O2lkh5JkZdkr7Atw3qCzA3JmtQ1ykg143h59NsUTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753736240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=trwfmtf8lVCC3P40OciiCQagkT/Nzys15Cn51CtHgec=; b=kE5w0th4JyWUxGtDiVlhYvaGdREodBQmlRk2EZBC74P0c8xzWxU7VJKMeriM2K1yHYyzYp YBMTI8JGc1iUlkFzLk9HVC1iIM84Tplb6uoRaps4fFstVOFbCvoPAZNXCXpxj1lBkYTv62 lCaij2fWRFNZkriIGQXzdamv2WtGPCcGKac+fMEbW1EtjSjFSbANl0FJdcVzfm2WjyjO5v PiywCNNrg4gSlR7XWBvqp/tyvqhQfzlRICvxavAf6S/Q7lZ4yZGWpz/6QELT/1L+ytW/UE oWuNVcNaYEpg0mjgRrBnGh0+4mQvGS6PQ0U8N6M6jBHxkISO2r2AUAzIONKE+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753736240; a=rsa-sha256; cv=none; b=HMR4rLdblrOiqEDX4CB08Gp9E6XQrj2a9h+fiCFQ/Cof5/pcKr9M1MhoNM/lmg10M8ZiIs o8YT6Y/lhEnGp5jUYzNb477RxGrq4XsmJOVZdZjEWW8Mx10AR6Y+UeeGw3lT5WWGcIVPLh CKj5gktu5E+g34qWnRUzLo/yT5GCvJyX3tfB05kVWP8roAVTH8nBgSfNdsBd27Lzv1HzYB lWedzY3sFjH+fkYHB9cB4GCd70IEJqx0nBuTMqoA8A7xDmMSZLfRoVASkJUe0MvnEoh3nT jydv93HizD64YRqavKgDxNDm7GAmntYJeTR/wio9sIUCJQTbuJT6BdyJUprE3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brW4w4Vvkz122t; Mon, 28 Jul 2025 20:57:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SKvKev019366; Mon, 28 Jul 2025 20:57:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SKvKt2019363; Mon, 28 Jul 2025 20:57:20 GMT (envelope-from git) Date: Mon, 28 Jul 2025 20:57:20 GMT Message-Id: <202507282057.56SKvKt2019363@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: c069ca085bd1 - main - ufs_vnops.c: use unsigned type for newparent inode number in ufs_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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: c069ca085bd185eda4a90dc4bc2b76cceb74579d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c069ca085bd185eda4a90dc4bc2b76cceb74579d commit c069ca085bd185eda4a90dc4bc2b76cceb74579d Author: Konstantin Belousov AuthorDate: 2025-07-27 13:47:22 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-28 20:57:14 +0000 ufs_vnops.c: use unsigned type for newparent inode number in ufs_rename() Otherwise it is sign-extended into 64bit ino_t on the call to ufs_dirrewrite(). This causes invalid inode number recorded in the SU tracking structures (newdirem) and triggers corresponding panics. Reviewed by: mckusick, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51573 --- sys/ufs/ufs/ufs_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 17308706c3f4..406b8f943077 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1268,7 +1268,8 @@ ufs_rename( struct inode *fip, *tip, *tdp, *fdp; struct direct newdir; off_t endoff; - int doingdirectory, newparent; + int doingdirectory; + u_int newparent; int error = 0; struct mount *mp; ino_t ino; From nobody Mon Jul 28 20:57:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brW4y0Ygjz63T1P; Mon, 28 Jul 2025 20:57:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brW4x5rcpz44pL; Mon, 28 Jul 2025 20:57:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753736241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kit2dlZe3Er3jkV71A4C1hUI1WLsCBnizdLld/eZJfo=; b=L8c7lmdGk95nOxdhNJbVRxSNM6JhNKWm5S4HjIoSaXJSV0E3ws9gmeN57OrCc7o9phU57K i6f3NpQJN5kz/2MUVbgwWSQGdc8Mh14ZUVxbPpDOQA4nakb44V41/Mda6Y3VUudk0pu+kw mpK6IIe2AU8KC8Ptdb4tXKrOThGfnqELxn8INfzz7Es2Kx6cgn2zoEjWxidDR7Op96xaqE T30Fw7Unon50szytq/u4axusMUxUwzm0h+kmps7/KSNRhiQwjb2mCLui4IXjOxh0uVlmBG Mp7v17+0y99mgdvNvGAKwbYQhXUCPbCaVen1l53Jn8GX7XdHT+5otJN4G0t/3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753736241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kit2dlZe3Er3jkV71A4C1hUI1WLsCBnizdLld/eZJfo=; b=lI4PsD2sFAQscr4C4c/OC5MPZnC+S1qb2YkV90hcsgdaJEBN1Mko1OJ2f7Rffeb7Q6Jn4U cqoHorzPlCTHiOA0AEuZKwzL6VU0YCPruNWD5LWG/hvRP1HgAlVMp7dFoE1kPCUutQNkjM sCoDSciE080FA0p+jKvuLwDHfkj6qeoPo2BvyWx0M/SeB37/i93u97l1bQQQbdPJFwlEDo hFUxTS4ko5+fXXcaryUviJkn3YKcreieBWxbn9ysFz5sIszjpR8FBav9oSe5j8c2LYU2zx BSz6gU3l13BS+h4FS/urlR2BtBAylevmLR6wboM9l2lQUEEjvBQa9yYqTmj5Ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753736241; a=rsa-sha256; cv=none; b=TPnHoUiJTP9CdEn6E8edrBsbKDdhhpFydAH3kgKntT5rJmH+RILVObu14+NEIFyV7H+zLs jZLtvzC2vK6NW3wMMphFKmS3oTxFuyFeZ2zt656Ofp+TYwXKe67LdjN4FX/k7kgm5Pe4sY mlwxs+BwZaxo6bP2ECpxufcS+GAZIgOcT8bL5bA+6splOc6QBfiJdI251drTzG2dCic1AU BCF0rTzZRnjZ5Dais6t5gcIhTWEM+diGuDj5DPRrY85Tt5ZFH6+xf2yYU2oMgTyxj4mOPc lOsPhZGaiu0mcVnmaxf1qwSUIVnKV3pZIplYada7ZTCek934jtaP4I8xzIwavg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brW4x54W2z11p0; Mon, 28 Jul 2025 20:57:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SKvLLs019406; Mon, 28 Jul 2025 20:57:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SKvL6x019403; Mon, 28 Jul 2025 20:57:21 GMT (envelope-from git) Date: Mon, 28 Jul 2025 20:57:21 GMT Message-Id: <202507282057.56SKvL6x019403@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: 610319c766e9 - main - ufs_vnops.c: newparent is not bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 610319c766e941de96e52f2d28fea9f8cfc51aeb Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb commit 610319c766e941de96e52f2d28fea9f8cfc51aeb Author: Konstantin Belousov AuthorDate: 2025-07-27 13:50:57 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-28 20:57:14 +0000 ufs_vnops.c: newparent is not bool Use proper comparision operators when we need to see if newparent was set to not-zero value. Reviewed by: mckusick, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51573 --- sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 406b8f943077..2757fb066981 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1476,7 +1476,7 @@ relock: * the user must have write permission in the source so * as to be able to change "..". */ - if (doingdirectory && newparent) { + if (doingdirectory && newparent != 0) { error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); if (error) goto unlockout; @@ -1539,7 +1539,7 @@ relock: if (tip == NULL) { if (ITODEV(tdp) != ITODEV(fip)) panic("ufs_rename: EXDEV"); - if (doingdirectory && newparent) { + if (doingdirectory && newparent != 0) { /* * Account for ".." in new directory. * When source and destination have the same @@ -1632,7 +1632,7 @@ relock: goto bad; } if (doingdirectory) { - if (!newparent) { + if (newparent == 0) { tdp->i_effnlink--; if (DOINGSOFTDEP(tdvp)) softdep_change_linkcnt(tdp); @@ -1642,11 +1642,10 @@ relock: softdep_change_linkcnt(tip); } error = ufs_dirrewrite(tdp, tip, fip->i_number, - IFTODT(fip->i_mode), - (doingdirectory && newparent) ? newparent : doingdirectory); + IFTODT(fip->i_mode), doingdirectory); if (error) { if (doingdirectory) { - if (!newparent) { + if (newparent == 0) { tdp->i_effnlink++; if (DOINGSOFTDEP(tdvp)) softdep_change_linkcnt(tdp); @@ -1669,7 +1668,7 @@ relock: * disk, so when running with that code we avoid doing * them now. */ - if (!newparent) { + if (newparent == 0) { tdp->i_nlink--; DIP_SET_NLINK(tdp, tdp->i_nlink); UFS_INODE_SET_FLAG(tdp, IN_CHANGE); @@ -1698,7 +1697,7 @@ relock: * parent directory must be decremented * and ".." set to point to the new parent. */ - if (doingdirectory && newparent) { + if (doingdirectory && newparent != 0) { /* * Set the directory depth based on its new parent. */ From nobody Mon Jul 28 21:07:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brWJ61MxNz63Tkt; Mon, 28 Jul 2025 21:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brWJ60clgz45xH; Mon, 28 Jul 2025 21:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753736822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aOKWZfKJtWMts/2F5Y0Q9u3tVpqOZqI0Yqby5gzQ5UQ=; b=X37jslpmj2qRthm5Ly2pmWOYEHI/0bDkZ+hVrF0FWtoLOv2AKi2Z44IvLEBK/NP8qtZaA/ S7ARlR7+UcoWrtoSA08OgEFRjZpOQbBrPf5svslFIJoEHI1W1xk6c/lXERHafwQ67vg/NF YBBZaiVQDTpP9qFekb264vxs6tcGMLDIi7MBi0vIbky12N+y+Cvm2sAHmLuUUhzgEyBVYj UPYsFfVMasMDU0iUQlpNggJ7HMMvXpD2rRIVYjdyii9LLwuOsvo3TAuAPVIAFrwhK/Jt2J c+/4Pw5+ITTCbUuWS/ESVj3gH9bVd5ZV0LfAVvS1Mg14fh/g5PzmOdZAAt+6zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753736822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aOKWZfKJtWMts/2F5Y0Q9u3tVpqOZqI0Yqby5gzQ5UQ=; b=SAnBDTuQuNX5W0O610qfJ65+81bnwaHN2NITtkDNLHzcpp5NjHX5135QtpvgM0pZhbSfek uu4QSsVzdRW+Vla7IyHpF5KxDFHNPPPDI+olTLOALtvgmnvGeLpRN9TT6+eIA+2Ya70Ma+ 3fp0VsGOHUWSasg3JXvPA+unu2DDXTnVensH0UGHJ9xRqCGKLutrcQYXYAspR4deJVEerN 9MCDQlFzpOAqk3Ro/IOKxWn81rXxRxHonQLbrJeL3I1VpnrQhYFQoTRIy/4Ql+Md8ZzjdS poNjQ9EqVXpp1sYHS1wux0ycWGBO1n5D5LVgdQpOw6bNMKua5X2JFAI0eBYLoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753736822; a=rsa-sha256; cv=none; b=DSRH15FOqzepg6zk9sbkHwoefkj1Z99Cok6dQlHZQKJmircXy8tbrVFae2BXFw1XS0Hk53 TLqftFmd63nn27DRrwIWJMw90KBSxzp3qCZ6CACIxj3IDuLADL3WtvwFsjO8OD73bBriK2 wicVJSBslgiAqvKQA+yjqL3XxSsBdcQNJ6jOJN4G4Ty6k+Se7LfCcfBrGxal/SxLG2SH+n WZpQNnkpUNn8xjfa9NM9LnOrKOw4/XtDxX9vIl8ZxS1I2scq8zuLfPo2MonlyzxD8FKu6p AezMAuYjLoJ3ofAF4u3zkyd1bdimnFZR+odh8mOr6mchgQ0KhVT0kZvKIqCnKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brWJ56xqFz125g; Mon, 28 Jul 2025 21:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56SL710G038608; Mon, 28 Jul 2025 21:07:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56SL71Jj038604; Mon, 28 Jul 2025 21:07:01 GMT (envelope-from git) Date: Mon, 28 Jul 2025 21:07:01 GMT Message-Id: <202507282107.56SL71Jj038604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?=C3=84lven?= Subject: git: 659962f96a15 - main - =?utf-8?Q?New committer (ports): =C3=84lven (alven)?= List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alven X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 659962f96a15c9c140e627324a1b12c0ff833ab2 Auto-Submitted: auto-generated The branch main has been updated by alven: URL: https://cgit.FreeBSD.org/src/commit/?id=659962f96a15c9c140e627324a1b12c0ff833ab2 commit 659962f96a15c9c140e627324a1b12c0ff833ab2 Author: Älven AuthorDate: 2025-07-26 09:18:24 +0000 Commit: Älven CommitDate: 2025-07-28 21:04:53 +0000 New committer (ports): Älven (alven) PR: 287620 Approved by: db@ (Mentor, implicit) --- share/misc/committers-ports.dot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index 7bb3d936e5e5..fb6c168f1425 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -153,6 +153,7 @@ ak [label="Alex Kozlov\nak@FreeBSD.org\n2012/02/29"] ale [label="Alex Dupre\nale@FreeBSD.org\n2004/01/12"] alepulver [label="Alejandro Pulver\nalepulver@FreeBSD.org\n2006/04/01"] alexey [label="Alexey Degtyarev\nalexey@FreeBSD.org\n2013/11/09"] +alven [label="Älven\nalven@FreeBSD.org\n2025/07/28"] amdmi3 [label="Dmitry Marakasov\namdmi3@FreeBSD.org\n2008/06/19"] antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2013/04/03"] arrowd [label="Gleb Popov\narrowd@FreeBSD.org\n2018/05/18"] @@ -420,6 +421,7 @@ culot -> marino culot -> pi culot -> wg +db -> alven db -> tj db -> shurd @@ -865,6 +867,7 @@ wxs -> zi ygy -> yasu +yuri -> alven yuri -> rea zirias -> jbo From nobody Mon Jul 28 22:04:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brXb6492hz63Wx2; Mon, 28 Jul 2025 22:05:06 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brXb50vBBz49nq; Mon, 28 Jul 2025 22:05:05 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=doWMJz5K; spf=pass (mx1.freebsd.org: domain of bjkfbsd@gmail.com designates 2607:f8b0:4864:20::530 as permitted sender) smtp.mailfrom=bjkfbsd@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-b271f3ae786so4091097a12.3; Mon, 28 Jul 2025 15:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753740298; x=1754345098; 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=a2zQV2Xx0EpZewBwZWeCF42OPKIulu6/RAYQYIegvz4=; b=doWMJz5KG+NorZC8CLHMHu962hd9x2Uo/N0Awy32fqVd0pkDRxCZ7WiFY23ZE6FiCU 4oN1Lovf26w5W8P6rWlqUJ+Dzl0qv0t3Pk5m66ZspZSSlwiqbrXiH4CzIP+5QaJypHux exUW6NyHIaYAaMqJCXd60Qciqj+NBY3F6Y7XhPvabjUIWSR1edSnPlHXZWbWkQSkfsga pnsmEbaeDA4TbqKGnE6s+wCkrJ/EFmQnfj1S20NFAfdEoFCPnpkieF8S6LrRHNAwd98M R8DMQ/gmMHJrF64zA359RHl82kjkuxtyIbQh5pHi2ysLRTyk6O9RFTQv3uJ+gRffXV5m C4qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753740298; x=1754345098; 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=a2zQV2Xx0EpZewBwZWeCF42OPKIulu6/RAYQYIegvz4=; b=uCsNc6qOBsMAakomR/6HAd321bqwztLEfxGjcXAvCPw7NroNfD5ZhapaILIjCkqqM9 mZ2UsXcf6SW1tDcp4/77ieDTqjp7FOUFZ2N/sXbWKEEv7hVCzfUZQVu15g9cjuDoTSU1 k7TutPj2CKxGe8JLSrorjMP68iScQvQW3+3bm7Wx+lkQ7SYBhdOg2AvgPGtX1MFAxIlU GAbcxu+TsAHh1/w0Mv2K5uvQtUIJ5oZHZw5+Xq6pI5/2bc1BY5/SFEB6OLYtBB2c9beb /U2QfMnOL300wifhP4/tV7hdRQUSbOlO3xSLfCPRWXs5hjYbtS7mumr1ENxVh8EE52iB GT4A== X-Forwarded-Encrypted: i=1; AJvYcCUHnpWloKyNoUYGQzHj3CDRJiA8AcaVAtHKCpUVuK7qofnB5X2p8D2/d4eCM5cRu/YADaggQPeQ@freebsd.org, AJvYcCUltgmSLvdwnbDjVszStksDT0YA25I5hL+arzQoDZirwD6Ki7vtkv8lnMVlTnMb5FWD8RnK9sDMdfHYQHgdETGxoHD+zg==@freebsd.org, AJvYcCVyC1wAQ+Zm1x7bHnBF0AeQokVkoPOgaVSryTi3mxE1FWKRh4CpDBfw9dEnHRpfNCV/uSthKgtOPGoF6YyR61NVbdF5KxI=@freebsd.org, AJvYcCXIgRlIh2mhtqeL8H4Yi+Ac5lUJXAiT5OEPDu+PtOzjni7fq3Lzrm6kJQyUBFFan1b6bvY8XNFbsQfywM8Iqiw=@freebsd.org, AJvYcCXJLArQ4LylAqPj6Tra50fGRpyNxg/OPZKNFozMJbAmlEI0PoCv6xfcKD0DgCYe4FvqUQ==@freebsd.org X-Gm-Message-State: AOJu0YyXct85N1jSIOiPh6FDL2oaXCqVjPkc9Hg3CFXDLIOLJ1hk7rDv FzeCuQKS9Pj2WW42EOSi9MD9O+Ekgg2eHlDy76433BUzgtW3Tt8fAWWdO0Pl8zQqnbQ7GHVizAl 29LsQ829pVFXaMfTCPdEmrsnp32hll0A= X-Gm-Gg: ASbGnct4+TZXn1otacouBRoi7Cw6Z0DPwaCYBEf10DuhmCRNXPr+OTyZcEH6y8PtENH lAxzgoFlx6jckqd2dEjhQ75kDBgUaLF/zZYOZuzvH1IOLakx2XJpIoOk8nKV5oBLJSOrY7CrYGV zrcsJj22AkbX5CVFEmtGKwKKAg799KwylfcngpdsjZNw3+qmEwVc+zWJMhzZoir/y7+lGhcWkIO ysimBjGEAZzPi5v2Q== X-Google-Smtp-Source: AGHT+IEE+BAtmU/RO0RaAmyCeoFX9sefmTz70GC6aRbdHByvfB5PYK99jDfRAGeaaQHHj9/hR1mixuoBMTJPGEOwbpQ= X-Received: by 2002:a17:90b:2e51:b0:31e:cc6b:321f with SMTP id 98e67ed59e1d1-31ecc6b330bmr9681849a91.29.1753740298231; Mon, 28 Jul 2025 15:04:58 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Benjamin Kaduk Date: Mon, 28 Jul 2025 15:04:46 -0700 X-Gm-Features: Ac12FXxExj7WsYPOtitS39AmfCx0QuZb9eCzulmcCxGE1BaVvOt_whBZijkNEqU Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Rick Macklem Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000812483063b047b97" X-Spamd-Result: default: False [-2.25 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.75)[-0.754]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; TAGGED_RCPT(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::530:from] X-Rspamd-Queue-Id: 4brXb50vBBz49nq X-Spamd-Bar: -- --000000000000812483063b047b97 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 28, 2025 at 7:04=E2=80=AFAM Rick Macklem wrote: > On Mon, Jul 28, 2025 at 1:20=E2=80=AFAM Konstantin Belousov > wrote: > > > > CAUTION: This email originated from outside of the University of Guelph= . > Do not click links or open attachments unless you recognize the sender an= d > know the content is safe. If in doubt, forward suspicious emails to > IThelp@uoguelph.ca. > > > > On Sun, Jul 27, 2025 at 08:26:03PM -0700, Rick Macklem wrote: > > > On Tue, Jul 22, 2025 at 9:00=E2=80=AFAM Cy Schubert > 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 emai= ls > to IThelp@uoguelph.ca. > > > > > > > I know diddly about how libraries are handled, but is it possible to > put the > > > old Heimdal 1.5.2 libraries somewhere (semi-private) under different > names? > > > > > > I ask because it is going to be very difficult to port the gssd to th= e > > > new libraries. > > > > > > The problem is that the KGSSAPI code assumes some stuff very specific > > > to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you'll se= e > > > what I mean. (There's code that parses the keys etc out of the > internally > > > generated tokens. I have no idea where to even find the information o= n > > > how/where the MIT code hides this stuff and it a large part of > krb5_mech.c > > > looks like it will have to be re-written to work with the MIT > libraries.) > > > > It might be better to extract the required bits and keep just them. > > Perhaps even moving that bits from vendor to FreeBSD-owned code area. > The problem is that the code in sys/kgssapi/krb5/krb5_mech.c does contain > bits extracted from the Heimdal code. Basically, a detailed knowledge of = an > internal structure that the keys are extracted from. > --> I am now thinking that adding an upcall to the gssd and letting it > extract > the keys might be a better plan. (At least it moves the maintenance > to > userland and, hopefully, library calls can replace the detailed > knowledge > about the internals of the implementation.) > > Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context() API that does a lot of the work of getting useful bits out of an established GSS security context. > > > > I do not think that keeping large pieces of code in vendor without > updates > > is a good plan. > Agreed. I'll work on it. (But no guarantees w.r.t. timeline.) > > Maybe doing a transition to Heimdal 7.8 (or 8.n) would be less painful? > (It looks like Heimdal is getting maintenance these days. I think Debian > is using it, which suggests it will get at least some TLC?) > > I think adapting this to the MIT krb5 code is feasible. I think that kg_ctx_externalize() is where the actual exported security context token is produced (no structure, just bashing bytes out into the buffer). -Ben --000000000000812483063b047b97 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jul 28, 2025 at 7:04=E2=80=AFAM R= ick Macklem <rick.macklem@gmai= l.com> wrote:
=
On Mon, Jul 28, 2025 at 1= :20=E2=80=AFAM Konstantin Belousov <kostikbel@gmail.com> wrote:
>
> CAUTION: This email originated from outside of the University of Guelp= h. Do not click links or open attachments unless you recognize the sender a= nd know the content is safe. If in doubt, forward suspicious emails to IThelp@uoguelph.ca.=
>
> On Sun, Jul 27, 2025 at 08:26:03PM -0700, Rick Macklem wrote:
> > On Tue, Jul 22, 2025 at 9:00=E2=80=AFAM Cy Schubert <Cy.Schubert@cschube= rt.com> wrote:
> > >
> > > CAUTION: This email originated from outside of the Universit= y of Guelph. Do not click links or open attachments unless you recognize th= e sender and know the content is safe. If in doubt, forward suspicious emai= ls to IThelp@uoguel= ph.ca.
> > >
> > I know diddly about how libraries are handled, = but is it possible to put the
> > old Heimdal 1.5.2 libraries somewhere (semi-private) under differ= ent names?
> >
> > I ask because it is going to be very difficult to port the gssd t= o the
> > new libraries.
> >
> > The problem is that the KGSSAPI code assumes some stuff very spec= ific
> > to Heimdal. Take a look at sys/kgssapi/krb5/krb5_mech.c and you&#= 39;ll see
> > what I mean. (There's code that parses the keys etc out of th= e internally
> > generated tokens. I have no idea where to even find the informati= on on
> > how/where the MIT code hides this stuff and it a large part of kr= b5_mech.c
> > looks like it will have to be re-written to work with the MIT lib= raries.)
>
> It might be better to extract the required bits and keep just them. > Perhaps even moving that bits from vendor to FreeBSD-owned code area.<= br> The problem is that the code in sys/kgssapi/krb5/krb5_mech.c does contain bits extracted from the Heimdal code. Basically, a detailed knowledge of an=
internal structure that the keys are extracted from.
--> I am now thinking that adding an upcall to the gssd and letting it e= xtract
=C2=A0 =C2=A0 =C2=A0 the keys might be a better plan. (At least it moves th= e maintenance to
=C2=A0 =C2=A0 =C2=A0 userland and, hopefully, library calls can replace the= detailed knowledge
=C2=A0 =C2=A0 =C2=A0 about the internals of the implementation.)



Note that MIT krb5 prov= ides the=C2=A0gss_krb5_export_lucid_sec_context() API that does a lot of th= e work of getting useful bits out of an established GSS security context.
=C2=A0
>
> I do not think that keeping large pieces of code in vendor without upd= ates
> is a good plan.
Agreed. I'll work on it. (But no guarantees w.r.t. timeline.)

Maybe doing a transition to Heimdal 7.8 (or 8.n) would be less painful?
(It looks like Heimdal is getting maintenance these days. I think Debian is using it, which suggests it will get at least some TLC?)


I think adapting this to the MIT krb5 code is feas= ible.
I think that kg_ctx_externalize() is where the actual expor= ted security context token is produced (no structure, just bashing bytes ou= t into the buffer).

-Ben=C2=A0
--000000000000812483063b047b97-- From nobody Mon Jul 28 22:14:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brXnn1xy6z63XQf for ; Mon, 28 Jul 2025 22:14:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brXnm41M0z4Cn7 for ; Mon, 28 Jul 2025 22:14:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-31c4a546cc2so4179603a91.2 for ; Mon, 28 Jul 2025 15:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1753740857; x=1754345657; 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=Dr2pu4GIU4LWciHZ8PeknxApHxC9sg4KemjLIxhbH44=; b=bh22uV2666IAfnsbLknRBcsflh1BSJUJHCcnTTCWdsbtFGn8sAdgNzw40yg1TzV5sm h1o0YuySK6+jLFdiRT4JWJyIBEY76Na56G33CZyzAKuWNWTTc45BWYYh8/Xs+scIGNbM KtNhpiJkx8OBGmpkdf7s0p5uKa/DORkLZwtqYrFXneirUFEi783vSRxqiJ+Uv3RwR9HV tKH9uhUipde2q+cJYf5elwqSH/V0adlxuHe6ugi8/xK5fiaVWi54J+1ti3wSbr3pWqVM 6F56KsF9rLEaEMbJJWfVmz+NmrRB7+xp3yAuPbGHOs9zdHJbDeQyykiuGDGGTleECC1U c9PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753740857; x=1754345657; 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=Dr2pu4GIU4LWciHZ8PeknxApHxC9sg4KemjLIxhbH44=; b=iuZ9dIiI9ZecpaCSDFgs0hqwJ4uxtmpgtuy9vhTtIvKw5Pu/e7U19j0tphTaGuwUP9 w98nuNqk001r0K3vfx8mMyURODU4EvPuzc6Xi2a37CiX1cxGQGKu3+0l0QngUWXRMntq OSKY8YQUDRacMbHiutlf36JRdizjQq1KrGeC0AjUEqRzJ6jS1Sx7LKAmVPACa9GCEyaB 7L2b/rVlxgqeQeHQFaxomPyD5DXUa78QQ/ruajvDd4Q0Auy2mdu0UGpCcmJONdb1JIr+ w0BcnV3mrJUVea15/AwuLJeP8yRXHmKqB3p/U3KGNun0herpIIbNx8aegRe7sbbFp6D5 RIWg== X-Forwarded-Encrypted: i=1; AJvYcCWEHOSxDcFdq5iwh9JtGDWK/vO+rvIZqRL0BBf5JQ6BdfSccRrJJe4lBJ5AJDlAYozOPUDvhvQyJfne1XBXvnaSjfgE@freebsd.org X-Gm-Message-State: AOJu0Yzx7FFTq5KWkhibyvPoXvPmDkyAhd+6yjERRDHszSrdE5XdOCY2 JcJ78sdEF/lRa5IlaMoTcLH4U1xNt12cZX55r8lwn4Bie//MFcubGdTRpQ+7XSYBXiqbvKzOf3f 2M4+IjCNpa+oR8o6xEkywN9VIkFyTa1crhwUZJWyLNQ== X-Gm-Gg: ASbGncsdve4YcvKfQk3Lw1Er7B3/EQCrnXDFmF2yd/8f7siTZP41Ihe1npJXwv1XA4D LWRbrpiOV5tlaPb2l2FW5ffigacCm0MOWP9AiX7kgRMwi8ITlWVqVNAUDt0Pc8EmFMiLz1E5m26 rQMHLsQNVEuOV1tfdO1L1aLhAJp2iaukU2LnnLaiIYulrWL1MmtvyNw9ezP8jiXublHzkxSkyZW A6EuTVuQ2hRBpweQCCqH6wnqWPoXMMl5rBCIJfX6A== X-Google-Smtp-Source: AGHT+IHASGZHh7eO3HTPou6xgkU9bmn9wCou29L7LvKOxaTcj6YEDH3GHPEcedhOlnGBPLm6ipwR+kKoAdhnpTfkvbo= X-Received: by 2002:a17:90b:2750:b0:311:ff02:3fcc with SMTP id 98e67ed59e1d1-31e778a0660mr19780645a91.14.1753740857421; Mon, 28 Jul 2025 15:14:17 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507181916.56IJGLMK001122@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 28 Jul 2025 12:14:05 -1000 X-Gm-Features: Ac12FXxogHR2YNaxRkZZDw4gBwkC14RTLiOlLf9WDo2hFtoPNiwKkFtslD9R9Hk Message-ID: Subject: Re: git: 430f1acc451c - main - ice(4): Add MAC filter and VLAN resource limits to VFs To: Kevin Bowling Cc: Kristof Provost , Krzysztof Galazka , Warner Losh , Eric Joyner , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000d5cb60063b049cc7" X-Rspamd-Queue-Id: 4brXnm41M0z4Cn7 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --000000000000d5cb60063b049cc7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 28, 2025, 9:42=E2=80=AFAM Kevin Bowling wrote: > One gentle reminder in all this, kgalazka@ is under mentorship and > should be included in especially ixl and ice work and follow ups so we > can release him to make all these mistakes and fixes :) > This was my mistake for pushing the pull request without enough interaction or testing. Warner Regards, > Kevin > > > On Mon, Jul 28, 2025 at 12:01=E2=80=AFPM Kristof Provost = wrote: > > > > That=E2=80=99s confirmed, that has indeed fixed the arm64 LINT build er= rors. > > Thanks des. > > > > We=E2=80=99re still failing riscv and i386, but those are different err= ors. > > > > The riscv one is new (or I haven=E2=80=99t seen it before, anyway): > > > > --- all_subdir_usr.bin --- > > ld: error: undefined symbol: llvm::DisableABIBreakingChecks > > >>> referenced by ClangScanDeps.cpp > > >>> > ClangScanDeps.pieo:(llvm::VerifyDisableABIBreakingChecks) > > c++: error: linker command failed with exit code 1 (use -v to see > invocation) > > > > i386 has been failing for a while: > > > > --- all_subdir_sbin/recoverdisk --- > > /usr/src/sbin/recoverdisk/recoverdisk.c:830:38: error: comparison of > integers of different signs: 'unsigned int' and 'time_t' (aka 'int') > [-Werror,-Wsign-compare] > > --- all_subdir_usr.bin --- > > --- uuencode.o --- > > cc -target i386-unknown-freebsd15.0 > --sysroot=3D/usr/obj/usr/src/i386.i386/tmp > -B/usr/obj/usr/src/i386.i386/tmp/usr/bin -O2 -pipe -fno-common -g > -gz=3Dzlib -MD -MF.depend.uuencode.o -MTuu > > encode.o -std=3Dgnu17 -Wno-format-zero-length -fstack-protector-strong > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpoi > > nter-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow > -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs > -Wold-style-definition -Wno-pointer-sign -Wdate-t > > ime -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body > -Wno-string-plus-int -Wno-unused-const-variable > -Wno-error=3Dunused-but-set-parameter -Wno-error=3Dcast-function-type-mis= ma > > tch -Qunused-arguments -c /usr/src/usr.bin/bintrans/uuencode.c -o > uuencode.o > > --- all_subdir_sbin --- > > 830 | if (unsaved && (t_save + snapshot) < t_now) { > > | ~~~~~~~~~~~~~~~~~ ^ ~~~~~ > > 1 error generated. > > *** [recoverdisk.o] Error code 1 > > > > =E2=80=94 > > Kristof > > > > On 28 Jul 2025, at 19:45, Warner Losh wrote: > > > > I think DES may have just fixed this. Can you confirm? > > > > Warner > > > > On Mon, Jul 28, 2025 at 3:23=E2=80=AFAM Kristof Provost kp@freebsd.org = wrote: > > > > I=E2=80=99m not sure if it=E2=80=99s this specific commit or another on= e in the recent > dev/ice updates, but the arm64 LINT-FDT, LINT-ACPI and LINT builds all fa= il. > > > > This is from arm64-LINT: > > > > ld: error: undefined symbol: ice_iov_attach > > >>> referenced by if_ice_iflib.c:859 > (/usr/src/sys/dev/ice/if_ice_iflib.c:859) > > >>> if_ice_iflib.o:(ice_if_attach_post) > > > > ld: error: undefined symbol: ice_iov_detach > > >>> referenced by if_ice_iflib.c:989 > (/usr/src/sys/dev/ice/if_ice_iflib.c:989) > > >>> if_ice_iflib.o:(ice_if_detach) > > >>> referenced by if_ice_iflib.c:2323 > (/usr/src/sys/dev/ice/if_ice_iflib.c:2323) > > >>> if_ice_iflib.o:(ice_if_update_admin_status) > > >>> referenced by if_ice_iflib.c:2376 > (/usr/src/sys/dev/ice/if_ice_iflib.c:2376) > > >>> if_ice_iflib.o:(ice_transition_safe_mode) > > > > ld: error: undefined symbol: ice_iov_add_vf > > >>> referenced by if_ice_iflib.c:3464 > (/usr/src/sys/dev/ice/if_ice_iflib.c:3464) > > >>> if_ice_iflib.o:(ice_if_iov_vf_add) > > > > ld: error: undefined symbol: ice_iov_init > > >>> referenced by if_ice_iflib.c:3429 > (/usr/src/sys/dev/ice/if_ice_iflib.c:3429) > > >>> if_ice_iflib.o:(ice_if_iov_init) > > > > ld: error: undefined symbol: ice_iov_uninit > > >>> referenced by if_ice_iflib.c:3445 > (/usr/src/sys/dev/ice/if_ice_iflib.c:3445) > > >>> if_ice_iflib.o:(ice_if_iov_uninit) > > > > ld: error: undefined symbol: ice_iov_handle_vflr > > >>> referenced by if_ice_iflib.c:3480 > (/usr/src/sys/dev/ice/if_ice_iflib.c:3480) > > >>> if_ice_iflib.o:(ice_if_vflr_handle) > > > > ld: error: undefined symbol: ice_vc_notify_all_vfs_link_state > > >>> referenced by if_ice_iflib.c:757 > (/usr/src/sys/dev/ice/if_ice_iflib.c:757) > > >>> if_ice_iflib.o:(ice_update_link_status) > > > > ld: error: undefined symbol: ice_vc_handle_vf_msg > > >>> referenced by ice_lib.c:2285 > (/usr/src/sys/dev/ice/ice_lib.c:2285) > > >>> ice_lib.o:(ice_process_ctrlq) > > *** [kernel.full] Error code 1 > > > > =E2=80=94 > > Kristof > > > > On 18 Jul 2025, at 21:16, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D430f1acc451c7084d1d5aa7df7e7ecc= cea1a8b51 > > > > commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51 > > Author: Eric Joyner eric.joyner@intel.com > > AuthorDate: 2024-10-17 22:19:09 +0000 > > Commit: Warner Losh imp@FreeBSD.org > > CommitDate: 2025-07-18 19:16:17 +0000 > > > > ice(4): Add MAC filter and VLAN resource limits to VFs > > > > Adds two new parameters to iovctl config for VLAN filter limits and MAC > > filter limits and gives them defaults of 64 and 16, respectively. > > > > These are intended to limit the number of resources that a VF can > > consume so that any one VF cannot starve an other VFs or the PF of > > filters. > > > > Signed-off-by: Eric Joyner > > Signed-off-by: Krzysztof Galazka > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 > > > > ________________________________ > > > > sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++++++++++++++--= - > > sys/dev/ice/ice_iov.h | 8 ++++++++ > > 2 files changed, 50 insertions(+), 3 deletions(-) > > > > diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c > > index fc37a0e7679c..e06c7eb56f7a 100644 > > --- a/sys/dev/ice/ice_iov.c > > +++ b/sys/dev/ice/ice_iov.c > > @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc) > > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES); > > pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi", > > IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI); > > > > pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed", > > > > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT); > > > > pci_iov_schema_add_uint16(vf_schema, "max-mac-filters", > > > > IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT); > > > > error =3D pci_iov_attach(dev, pf_schema, vf_schema); > > if (error !=3D 0) { > > > > @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum= , > const nvlist_t *params) > > > > vsi->mirror_src_vsi =3D nvlist_get_number(params, "mirror-src-vsi"); > > > > vf->vlan_limit =3D nvlist_get_number(params, "max-vlan-allowed"); > > > > vf->mac_filter_limit =3D nvlist_get_number(params, "max-mac-filters"); > > > > vf->vf_flags |=3D VF_FLAG_VLAN_CAP; > > > > /* Create and setup VSI in HW */ > > > > @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, > struct ice_vf *vf, u8 *msg_buf) > > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > > struct virtchnl_ether_addr_list *addr_list; > > struct ice_hw *hw =3D &sc->hw; > > > > u16 added_addr_cnt =3D 0; > > int error =3D 0; > > > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > > > if (addr_list->num_elements > > > > > (vf->mac_filter_limit - vf->mac_filter_cnt)) { > > > > v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > > > goto done; > > > > } > > > > for (int i =3D 0; i < addr_list->num_elements; i++) { > > u8 *addr =3D addr_list->list[i].addr; > > > > @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, > struct ice_vf *vf, u8 *msg_buf) > > "%s: VF-%d: Error adding MAC addr for VSI %d\n", > > func, vf->vf_num, vf->vsi->idx); > > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > > > goto done; > > > > continue; > > } > > > > /* Don't count VF's MAC against its MAC filter limit */ > > > > if (memcmp(addr, vf->mac, ETHER_ADDR_LEN)) > > > > added_addr_cnt++; > > } > > > > vf->mac_filter_cnt +=3D added_addr_cnt; > > > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR, > > v_status, NULL, 0, NULL); > > @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, struc= t > ice_vf *vf, u8 *msg_buf) > > enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS; > > struct virtchnl_ether_addr_list *addr_list; > > struct ice_hw *hw =3D &sc->hw; > > > > u16 deleted_addr_cnt =3D 0; > > int error =3D 0; > > > > addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf; > > > > @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, > struct ice_vf *vf, u8 *msg_buf) > > "%s: VF-%d: Error removing MAC addr for VSI %d\n", > > func, vf->vf_num, vf->vsi->idx); > > v_status =3D VIRTCHNL_STATUS_ERR_PARAM; > > > > goto done; > > > > continue; > > } > > > > /* Don't count VF's MAC against its MAC filter limit */ > > > > if (memcmp(addr_list->list[i].addr, vf->mac, ETHER_ADDR_LEN)) > > > > deleted_addr_cnt++; > > } > > > > -done: > > > > if (deleted_addr_cnt >=3D vf->mac_filter_cnt) > > > > vf->mac_filter_cnt =3D 0; > > > > else > > > > vf->mac_filter_cnt -=3D deleted_addr_cnt; > > > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR, > > v_status, NULL, 0, NULL); > > > > } > > @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct > ice_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_cnt)) { > > > > v_status =3D VIRTCHNL_STATUS_ERR_NO_MEMORY; > > > > goto done; > > > > } > > > > status =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id, > > vlan_list->num_elements); > > if (status) { > > > > @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct > ice_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > vf->vlan_cnt +=3D vlan_list->num_elements; > > > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN, > > v_status, NULL, 0, NULL); > > @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct > ice_vf *vf, u8 *msg_buf) > > goto done; > > } > > > > if (vlan_list->num_elements >=3D vf->vlan_cnt) > > > > vf->vlan_cnt =3D 0; > > > > else > > > > vf->vlan_cnt -=3D vlan_list->num_elements; > > > > done: > > ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN, > > v_status, NULL, 0, NULL); > > diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h > > index c2ac5fcd5c94..c4fb3e932e3f 100644 > > --- a/sys/dev/ice/ice_iov.h > > +++ b/sys/dev/ice/ice_iov.h > > @@ -85,6 +85,11 @@ struct ice_vf { > > u16 vf_num; > > struct virtchnl_version_info version; > > > > u16 mac_filter_limit; > > > > u16 mac_filter_cnt; > > > > u16 vlan_limit; > > > > u16 vlan_cnt; > > > > u16 num_irq_vectors; > > u16 *vf_imap; > > struct ice_irq_vector *tx_irqvs; > > > > @@ -101,6 +106,9 @@ struct ice_vf { > > #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC | > > FLAG_VF_MULTICAST_PROMISC) > > > > +#define ICE_DEFAULT_VF_VLAN_LIMIT 64 > > +#define ICE_DEFAULT_VF_FILTER_LIMIT 16 > > + > > int ice_iov_attach(struct ice_softc *sc); > > int ice_iov_detach(struct ice_softc *sc); > --000000000000d5cb60063b049cc7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Jul 28, 2025, 9:42=E2=80= =AFAM Kevin Bowling <kevin.b= owling@kev009.com> wrote:
On= e gentle reminder in all this, kgalazka@ is under mentorship and
should be included in especially ixl and ice work and follow ups so we
can release him to make all these mistakes and fixes :)

This was my mistake = for pushing the pull request without enough interaction or testing.

Warner
<= br>

Regards,
Kevin


On Mon, Jul 28, 2025 at 12:01=E2=80=AFPM Kristof Provost <kp@freebsd.org= > wrote:
>
> That=E2=80=99s confirmed, that has indeed fixed the arm64 LINT build e= rrors.
> Thanks des.
>
> We=E2=80=99re still failing riscv and i386, but those are different er= rors.
>
> The riscv one is new (or I haven=E2=80=99t seen it before, anyway): >
> --- all_subdir_usr.bin ---
> ld: error: undefined symbol: llvm::DisableABIBreakingChecks
> >>> referenced by ClangScanDeps.cpp
> >>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Cla= ngScanDeps.pieo:(llvm::VerifyDisableABIBreakingChecks)
> c++: error: linker command failed with exit code 1 (use -v to see invo= cation)
>
> i386 has been failing for a while:
>
> --- all_subdir_sbin/recoverdisk ---
> /usr/src/sbin/recoverdisk/recoverdisk.c:830:38: error: comparison of i= ntegers of different signs: 'unsigned int' and 'time_t' (ak= a 'int') [-Werror,-Wsign-compare]
> --- all_subdir_usr.bin ---
> --- uuencode.o ---
> cc -target i386-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/i386.= i386/tmp -B/usr/obj/usr/src/i386.i386/tmp/usr/bin=C2=A0 -O2 -pipe -fno-comm= on=C2=A0 =C2=A0-g -gz=3Dzlib -MD=C2=A0 -MF.depend.uuencode.o -MTuu
> encode.o -std=3Dgnu17 -Wno-format-zero-length -fstack-protector-strong= -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -W= strict-prototypes -Wmissing-prototypes -Wpoi
> nter-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow= -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-s= tyle-definition -Wno-pointer-sign -Wdate-t
> ime -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -W= no-string-plus-int -Wno-unused-const-variable -Wno-error=3Dunused-but-set-p= arameter -Wno-error=3Dcast-function-type-misma
> tch=C2=A0 -Qunused-arguments=C2=A0 =C2=A0 =C2=A0-c /usr/src/usr.bin/bi= ntrans/uuencode.c -o uuencode.o
> --- all_subdir_sbin ---
>=C2=A0 =C2=A0830 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0if (unsaved && (t_save + snapshot) < t_now) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0~~~~~~~~~~~~~~~~~=C2=A0 ^ ~~~~~
> 1 error generated.
> *** [recoverdisk.o] Error code 1
>
> =E2=80=94
> Kristof
>
> On 28 Jul 2025, at 19:45, Warner Losh wrote:
>
> I think DES may have just fixed this. Can you confirm?
>
> Warner
>
> On Mon, Jul 28, 2025 at 3:23=E2=80=AFAM Kristof Provost kp@freebsd.org= wrote:
>
> I=E2=80=99m not sure if it=E2=80=99s this specific commit or another o= ne in the recent dev/ice updates, but the arm64 LINT-FDT, LINT-ACPI and LIN= T builds all fail.
>
> This is from arm64-LINT:
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_iov_attach
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:859 (/usr= /src/sys/dev/ice/if_ice_iflib.c:859)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_if_attach_post)
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_iov_detach
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:989 (/usr= /src/sys/dev/ice/if_ice_iflib.c:989)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_if_detach)
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:2323 (/us= r/src/sys/dev/ice/if_ice_iflib.c:2323)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_if_update_admin_status)
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:2376 (/us= r/src/sys/dev/ice/if_ice_iflib.c:2376)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_transition_safe_mode)
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_iov_add_vf
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:3464 (/us= r/src/sys/dev/ice/if_ice_iflib.c:3464)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_if_iov_vf_add)
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_iov_init
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:3429 (/us= r/src/sys/dev/ice/if_ice_iflib.c:3429)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_if_iov_init)
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_iov_uninit
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:3445 (/us= r/src/sys/dev/ice/if_ice_iflib.c:3445)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_if_iov_uninit)
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_iov_handle_vflr >=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:3480 (/us= r/src/sys/dev/ice/if_ice_iflib.c:3480)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_if_vflr_handle)
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_vc_notify_all_vfs_= link_state
>=C2=A0 =C2=A0 =C2=A0>>> referenced by if_ice_iflib.c:757 (/usr= /src/sys/dev/ice/if_ice_iflib.c:757)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if_ice_iflib.o:(ice_update_link_status)
>
>=C2=A0 =C2=A0 =C2=A0ld: error: undefined symbol: ice_vc_handle_vf_msg >=C2=A0 =C2=A0 =C2=A0>>> referenced by ice_lib.c:2285 (/usr/src= /sys/dev/ice/ice_lib.c:2285)
>=C2=A0 =C2=A0 =C2=A0>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0ice_lib.o:(ice_process_ctrlq)
>=C2=A0 =C2=A0 =C2=A0*** [kernel.full] Error code 1
>
> =E2=80=94
> Kristof
>
> On 18 Jul 2025, at 21:16, Warner Losh wrote:
>
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D430f1acc451c7084d1d5aa7df7e7ec= ccea1a8b51
>
> commit 430f1acc451c7084d1d5aa7df7e7ecccea1a8b51
> Author: Eric Joyner eric.joyner@intel.com
> AuthorDate: 2024-10-17 22:19:09 +0000
> Commit: Warner Losh imp@FreeBSD.org
> CommitDate: 2025-07-18 19:16:17 +0000
>
> ice(4): Add MAC filter and VLAN resource limits to VFs
>
> Adds two new parameters to iovctl config for VLAN filter limits and MA= C
> filter limits and gives them defaults of 64 and 16, respectively.
>
> These are intended to limit the number of resources that a VF can
> consume so that any one VF cannot starve an other VFs or the PF of
> filters.
>
> Signed-off-by: Eric Joyner <eric.joyner@intel.com>
> Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.= com>
> Reviewed by: imp
> Pull Request: https://github.com/fre= ebsd/freebsd-src/pull/1573
>
> ________________________________
>
> sys/dev/ice/ice_iov.c | 45 ++++++++++++++++++++++++++++++++++++++++++-= --
> sys/dev/ice/ice_iov.h | 8 ++++++++
> 2 files changed, 50 insertions(+), 3 deletions(-)
>
> diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c
> index fc37a0e7679c..e06c7eb56f7a 100644
> --- a/sys/dev/ice/ice_iov.c
> +++ b/sys/dev/ice/ice_iov.c
> @@ -117,6 +117,10 @@ ice_iov_attach(struct ice_softc *sc)
> IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_QUEUES);
> pci_iov_schema_add_uint16(vf_schema, "mirror-src-vsi",
> IOV_SCHEMA_HASDEFAULT, ICE_INVALID_MIRROR_VSI);
>
> pci_iov_schema_add_uint16(vf_schema, "max-vlan-allowed",
>
>=C2=A0 =C2=A0 =C2=A0IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_VLAN_LIMIT);<= br> >
> pci_iov_schema_add_uint16(vf_schema, "max-mac-filters",
>
>=C2=A0 =C2=A0 =C2=A0IOV_SCHEMA_HASDEFAULT, ICE_DEFAULT_VF_FILTER_LIMIT)= ;
>
> error =3D pci_iov_attach(dev, pf_schema, vf_schema);
> if (error !=3D 0) {
>
> @@ -360,6 +364,9 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnu= m, const nvlist_t *params)
>
>=C2=A0 =C2=A0vsi->mirror_src_vsi =3D nvlist_get_number(params, "= ;mirror-src-vsi");
>
> vf->vlan_limit =3D nvlist_get_number(params, "max-vlan-allowed= ");
>
> vf->mac_filter_limit =3D nvlist_get_number(params, "max-mac-fi= lters");
>
> vf->vf_flags |=3D VF_FLAG_VLAN_CAP;
>
> /* Create and setup VSI in HW */
>
> @@ -735,10 +742,17 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, st= ruct ice_vf *vf, u8 *msg_buf)
> enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS;
> struct virtchnl_ether_addr_list *addr_list;
> struct ice_hw *hw =3D &sc->hw;
>
> u16 added_addr_cnt =3D 0;
> int error =3D 0;
>
> addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf;
>
> if (addr_list->num_elements >
>
>=C2=A0 =C2=A0 =C2=A0(vf->mac_filter_limit - vf->mac_filter_cnt)) = {
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0v_status =3D VIRTCHNL_STATUS_ERR_NO_M= EMORY;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done;
>
> }
>
> for (int i =3D 0; i < addr_list->num_elements; i++) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0u8 *addr =3D addr_list->list[i].ad= dr;
>
> @@ -767,10 +781,15 @@ ice_vc_add_eth_addr_msg(struct ice_softc *sc, st= ruct ice_vf *vf, u8 *msg_buf)
> "%s: VF-%d: Error adding MAC addr for VSI %d\n",
> func, vf->vf_num, vf->vsi->idx);
> v_status =3D VIRTCHNL_STATUS_ERR_PARAM;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done= ;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Don't count VF's MAC again= st its MAC filter limit */
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (memcmp(addr, vf->mac, ETHER_AD= DR_LEN))
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0added_add= r_cnt++;
> }
>
> vf->mac_filter_cnt +=3D added_addr_cnt;
>
> done:
> ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_ETH_ADDR,
> v_status, NULL, 0, NULL);
> @@ -791,6 +810,7 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, stru= ct ice_vf *vf, u8 *msg_buf)
> enum virtchnl_status_code v_status =3D VIRTCHNL_STATUS_SUCCESS;
> struct virtchnl_ether_addr_list *addr_list;
> struct ice_hw *hw =3D &sc->hw;
>
> u16 deleted_addr_cnt =3D 0;
> int error =3D 0;
>
> addr_list =3D (struct virtchnl_ether_addr_list *)msg_buf;
>
> @@ -802,11 +822,18 @@ ice_vc_del_eth_addr_msg(struct ice_softc *sc, st= ruct ice_vf *vf, u8 *msg_buf)
> "%s: VF-%d: Error removing MAC addr for VSI %d\n",
> func, vf->vf_num, vf->vsi->idx);
> v_status =3D VIRTCHNL_STATUS_ERR_PARAM;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done= ;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Don't count VF's MAC again= st its MAC filter limit */
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (memcmp(addr_list->list[i].addr= , vf->mac, ETHER_ADDR_LEN))
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0deleted_a= ddr_cnt++;
> }
>
> -done:
>
> if (deleted_addr_cnt >=3D vf->mac_filter_cnt)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vf->mac_filter_cnt =3D 0;
>
> else
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vf->mac_filter_cnt -=3D deleted_ad= dr_cnt;
>
> ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_ETH_ADDR,
>=C2=A0 =C2=A0 =C2=A0v_status, NULL, 0, NULL);
>
> }
> @@ -838,6 +865,11 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct = ice_vf *vf, u8 *msg_buf)
> goto done;
> }
>
> if (vlan_list->num_elements > (vf->vlan_limit - vf->vlan_c= nt)) {
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0v_status =3D VIRTCHNL_STATUS_ERR_NO_M= EMORY;
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done;
>
> }
>
> status =3D ice_add_vlan_hw_filters(vsi, vlan_list->vlan_id,
>=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=A0vlan_list->num_elements)= ;
> if (status) {
>
> @@ -849,6 +881,8 @@ ice_vc_add_vlan_msg(struct ice_softc *sc, struct i= ce_vf *vf, u8 *msg_buf)
> goto done;
> }
>
> vf->vlan_cnt +=3D vlan_list->num_elements;
>
> done:
> ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_ADD_VLAN,
> v_status, NULL, 0, NULL);
> @@ -892,6 +926,11 @@ ice_vc_del_vlan_msg(struct ice_softc *sc, struct = ice_vf *vf, u8 *msg_buf)
> goto done;
> }
>
> if (vlan_list->num_elements >=3D vf->vlan_cnt)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vf->vlan_cnt =3D 0;
>
> else
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vf->vlan_cnt -=3D vlan_list->nu= m_elements;
>
> done:
> ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_DEL_VLAN,
> v_status, NULL, 0, NULL);
> diff --git a/sys/dev/ice/ice_iov.h b/sys/dev/ice/ice_iov.h
> index c2ac5fcd5c94..c4fb3e932e3f 100644
> --- a/sys/dev/ice/ice_iov.h
> +++ b/sys/dev/ice/ice_iov.h
> @@ -85,6 +85,11 @@ struct ice_vf {
> u16 vf_num;
> struct virtchnl_version_info version;
>
> u16 mac_filter_limit;
>
> u16 mac_filter_cnt;
>
> u16 vlan_limit;
>
> u16 vlan_cnt;
>
> u16 num_irq_vectors;
> u16 *vf_imap;
> struct ice_irq_vector *tx_irqvs;
>
> @@ -101,6 +106,9 @@ struct ice_vf {
> #define ICE_VIRTCHNL_VALID_PROMISC_FLAGS (FLAG_VF_UNICAST_PROMISC | > FLAG_VF_MULTICAST_PROMISC)
>
> +#define ICE_DEFAULT_VF_VLAN_LIMIT 64
> +#define ICE_DEFAULT_VF_FILTER_LIMIT 16
> +
> int ice_iov_attach(struct ice_softc *sc);
> int ice_iov_detach(struct ice_softc *sc);
--000000000000d5cb60063b049cc7-- From nobody Mon Jul 28 22:32:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brYCN3bHsz63Y9w; Mon, 28 Jul 2025 22:33:04 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brYCM2m9lz4Dh5; Mon, 28 Jul 2025 22:33:03 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=FmFdMHhE; spf=pass (mx1.freebsd.org: domain of bjkfbsd@gmail.com designates 2607:f8b0:4864:20::631 as permitted sender) smtp.mailfrom=bjkfbsd@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-23fc5aedaf0so18507765ad.2; Mon, 28 Jul 2025 15:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753741977; x=1754346777; 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=4A2j7zm42pi9Cgk+5zpTeG+2R5JskTxv+Fo9mXmtVl0=; b=FmFdMHhEznnqFlnWgGnnyuhsXi9OnPX5ivWXvnWdsjfWwe3mcfuqSqNVUP5ZCaUS6J JRAyPy/yJ7PGbctBo/nODD0t5gJ3o1BU9l1P5fRgDhVOibWAMFCAJVzv/BqheSt9pYx9 CyU7KwKGrz4Zs1E/o9kCD6cN0ps8wwcTujWnkHyjbQs4kaMmxylFx1RAe/OuN31VNXb2 qDvmAl8hf9PNAyDyveM0IUCFwRuHNHWlOdzb3fYSTONvWixPUcmNwPsRJi/JvpiHLol7 7PyBo3gZ00CWhzL/BaBNlsA2WbCAOElTpsgpJ898Ob0uR5XmltyKAR98DhOmSPhyR11k eVJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753741977; x=1754346777; 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=4A2j7zm42pi9Cgk+5zpTeG+2R5JskTxv+Fo9mXmtVl0=; b=HJzs1fIfQcPK5rxCJm/Dr2AKDJ0Lw6ioemFQGiref0l/JrucyxeTB3NiuvJX+jnyys +Xeommv8GkYgfLx32lQFvB5NK9QgGe3GaD8LOfzF7pE1s+PjDNFopcFNZkbqhl+EoAsT lCygNDF3KT8kerFMD0UacmR3wMkwH5uXLISIyqtIPR7lTgEY7HEJ/EnQV2l8IrZFgdiW aDbkcxrP3KZbrSJBbr8CWX0LafC+iQ0hLPE43Ua2ttg4FDDmCvZe8uuHV/M70Gypp1CO rXpCG45uYFPZXW3baYtNGjc1xwkR8LktEy4y4bgUoPxvL/SBuatcaBvoZUB4ohSsN+j2 BV8w== X-Forwarded-Encrypted: i=1; AJvYcCUk0RO8gSsYiX4+l4ZfHV1xGSv4G8a2ZrU6St60RdG6Zj5/g0vz/hw24dGxQQCMY0sGaA==@freebsd.org, AJvYcCUxo5bmOIJeiHwUXSIOq1ujBYJoTbXkEiNIT9J4XIYBshhFANBZbjuuf1kB5OYlG4+AYii3m8oB6QAqqAK37FjnMs6kLQ==@freebsd.org, AJvYcCVir57M5RR+QIoTHE34/ekeq23Sz1yZZGORvNbm/d8DF0lQr1JPE+uQU+AMoA1+BxfizHNx6u9En0NCoz7Kmkhwe7/132o=@freebsd.org, AJvYcCVxFWtZz+o4mw9liTSWhulHQo00Wkr3x0QoVoLdkDN+g2sxVz1Mj9kbd3/207++PZQVnRfjFrIF5CDTR2pylnM=@freebsd.org, AJvYcCWkQm7WL72EZGk16WHzzBMWNWhkgMWlxYZfxsgaOortVsy0jCNvOC0/BuSwU02zdvw+A0+ajGBI@freebsd.org X-Gm-Message-State: AOJu0YzTKDYTBjD3JDBPfRvkDiQSEd8SA/msYNOmciUnhvnlOGu/G1M/ j2rqEaGUSIvqGBJyCSh3yquwr+KBMCKCrGmFO7HnPxXJ0mQ6gn1E3ZYcp1On3PJzbPvSfqrmN5z ewmzXwdht4/h2WCpUEcxSZhKSmQMZM00eGy6A X-Gm-Gg: ASbGncu6ow6Sp0+QEtrjjwOAxo8Hy6K7fVVWTdw8wD1eoDecjniTsr7cRQlMZ0MSPOq D+H5sYdVkJjVSCFqS5j8sZra5BAqcvS28iSi+3sNCI77adqholnu/Oqx7NrtiA4z38SNzwEwzqG GRzoqWpGKFuUPe0daUwqodV3l/qQwd1qlIuy+v/sK5GauDupd6BD/x5ld+xDeZrwfEsOzbrhKuz 9NFHcc= X-Google-Smtp-Source: AGHT+IHLcddDeplLV0Nr3DzZNie+FP3T31vdedkZP5mGasTA46hsfGVJKcuJI7L2spYiDXNmyGiBNDvzSsdvDaM27fU= X-Received: by 2002:a17:902:ca95:b0:23f:bb95:6990 with SMTP id d9443c01a7336-23fbb956b99mr131834485ad.21.1753741976866; Mon, 28 Jul 2025 15:32:56 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Benjamin Kaduk Date: Mon, 28 Jul 2025 15:32:44 -0700 X-Gm-Features: Ac12FXwNwBv1t0aMjJDtzIbM9AzLPoXgdCBDLqqUQ9nzURq3yCS06iq98Ye3EIw Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Rick Macklem Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000008f1cdc063b04dfbb" X-Spamd-Result: default: False [-2.26 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.76)[-0.762]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; TAGGED_RCPT(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::631:from] X-Rspamd-Queue-Id: 4brYCM2m9lz4Dh5 X-Spamd-Bar: -- --0000000000008f1cdc063b04dfbb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk = wrote: > > Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context() API > that does a lot of the work of getting useful bits out of an established > GSS security context. > > And a bit more context on what is going on here and why kgssapi has to care= : The GSS-API (RFC 2743) is all about a way to "establish a security context" (i.e., do crypto negotiation, authentication, sometimes authorization, etc.) between two entities, the initiator and the acceprot, and then exchanging protected messages between the two (which can be either encrypted or just integrity protection tags for otherweise cleartext data); later extensions included the ability to produce identical PRF output on both parties, etc.. The details are "mechanism-specific", and for this purpose we're exclusively talking about the krb5 mechanism. The steps to establish the security context are complicated and sometimes fiddly, and in the general case can require a large number of round-trips between the initiator and acceptor before the security context is established. The individual message-protection parts are comparatively simple and amendable to implementation in the kernel for processing efficiency. RFC 2743 also defines functions for GSS_Export_sec_context() and GSS_Import_sec_context(), that are designed essentially to pass information about an established security context from one process to another on the same machine (which are presumably using the same implementation and version of the implementation), so the contents of the exported blob are opaque and implementation-specific. We are abusing that mechanism to export information about the security context that gssd has established and feed that information into the kernel implementation of the per-message processing routines. At present, this necessarily entails knowing the details of the implementation-specific opaque blob that is the "export sec context token", which is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get the information we want without breaking the abstraction barrier, such as via the gss_krb5_export_lucid_sec_context() API, we are in a more robust posture overall and somewhat future-proofed against future evolution by MIT krb5. (I note that recent Heimdal versions seem to also expose a gss_krb5_export_lucid_sec_context() API, so part of the problem is just that the Heimdal in base is so old.) -Ben --0000000000008f1cdc063b04dfbb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM B= enjamin Kaduk <bjkfbsd@gmail.com> wrote:


The GSS-API (RFC 2743) is all about a way to "= ;establish a security context" (i.e., do crypto negotiation, authentic= ation, sometimes authorization, etc.) between two entities, the initiator a= nd the acceprot, and then exchanging protected messages between the two (wh= ich can be either encrypted or just integrity protection tags for otherweis= e cleartext data); later extensions included the ability to produce identic= al PRF output on both parties, etc..=C2=A0 The details are "mechanism-= specific", and for this purpose we're exclusively talking about th= e krb5 mechanism.=C2=A0 The steps to establish the security context are com= plicated and sometimes fiddly, and in the general case can require a large = number of round-trips between the initiator and acceptor before the securit= y context is established.=C2=A0 The individual message-protection parts are= comparatively simple and amendable to implementation in the kernel for pro= cessing efficiency.
RFC 2743 also defines functions for GSS_Expor= t_sec_context() and GSS_Import_sec_context(), that are designed essentially= to pass information about an established security context from one process= to another on the same machine (which are presumably using the same implem= entation and version of the implementation), so the contents of the exporte= d blob are opaque and implementation-specific.=C2=A0 We are abusing that me= chanism to export information about the security context that gssd has esta= blished and feed that information into the kernel implementation of the per= -message processing routines.=C2=A0 At present, this necessarily entails kn= owing the details of the implementation-specific opaque blob that is the &q= uot;export sec context token", which is what the sys/kgssapi/krb5/krb5= _mech.c code is doing.=C2=A0 But if we can get the information we want with= out breaking the abstraction barrier, such as via the gss_krb5_export_lucid= _sec_context() API, we are in a more robust posture overall and somewhat fu= ture-proofed against future evolution by MIT krb5.

--0000000000008f1cdc063b04dfbb-- From nobody Mon Jul 28 22:49:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brYZj30BLz63YLc; Mon, 28 Jul 2025 22:49:49 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brYZh72P8z4Fhl; Mon, 28 Jul 2025 22:49:48 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-6154655c8aeso2223253a12.3; Mon, 28 Jul 2025 15:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753742982; x=1754347782; 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=1tQchiocoe9OXuYpcDIobAu7fdG/jlkrD2jSyfDqJ1k=; b=TGAB9+fNL9pyfcdnIR2HShmoFDI3xJpgOCMBLJK03hCYrQRTOR5CfP4tvj9rT3mDxB 7RABx6+yb3ouSG//chL2vBZRD9oAfed/WXND7ub8O5ZKTgqm/MxwuTLSAXTKsSNh4F7a EVwd6l21vCbPEoXs/EUIEUJ2CUbzbJJzacaiE24HbZgUeeFYbqfkT7jjrxjUji7uoUWY qQT9xrMRJF+7MistImQegnkOXKqnqvj8TCbxcm1NC5LcqdINGxn9VALUMHeGD2dz14JS p+s9FgEP0Cp35ff9MhAWIjeEG38/qfRZXMLo/+PT/Y3Klj+jwdnwEmn80mLo/CCh4T7s 3XFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753742982; x=1754347782; 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=1tQchiocoe9OXuYpcDIobAu7fdG/jlkrD2jSyfDqJ1k=; b=lyeol0mevieWnTAUIG6mTdb3WS3HgRMbAfOwNRbeM2mwRdqnqksMONRDfMNws43xY6 HelULzOwE3zdgEnsRY9kz1xm6uyUuKB0ioIYHXeBLZao5xt/fwDYRK/nIiV6+Y+3C92X 4nfkmhVaFtag2hKzTApCh0aRXcwkgVGIDwbV6psQO4Q1gGIeEolAaPkDZRtmCxjTZNpU dOapYFLbZ9Kt9yYo5mNpJ50y15zQG3zSiAxiiWb0FdTOJpPIVsLA5Sx5kmicZ41+1ihv xHrNkjRqXBcKeZmfRJ/rrD9zrhEvd/fVZ0Ew+DVnJu8OnUVMeArcqEub0q/LHjpjQefH uKiQ== X-Forwarded-Encrypted: i=1; AJvYcCUMvtSX/4KYR5G4x4r43MlhNBB/LIaOlbiqGP4PhmwC6trvGioqS2nT7NuDk7Rt63fXrPqMdKIkZxX8qbBWI0KbNc4IyQ==@freebsd.org, AJvYcCV5ZP0QNTaXcqqKI1ZcXxs52AwLQeNo+s3Lf84VLqrVmphnCRNkJOVRHCV8lCANAggzP7J/0BlNcLydREt9EY8=@freebsd.org, AJvYcCW9Z6L8SJpmSYH7J7BXU2DP6z+Ut7H6pluDtYSkJpo0pc4QWpXSmbjQkWKxFMrnp/wBlQ==@freebsd.org, AJvYcCWfGdemkokhkCk4anvZ8qCZHGtT+vaqF54YOmmcJPqHnR6aGilsaysWAHcyNCYCfRx9Kp3yCAng@freebsd.org, AJvYcCXcf/UEs/T8SRzbpNcbi3+M/fCZO7iLGcoLiVmBemBBDI2vzwUTlq3H1slksWq0jjc6fZxqmLeGA3DK0jiIG1m6naQ/cEk=@freebsd.org X-Gm-Message-State: AOJu0YwztgQrE3IfYwl2dURJme/gJMVJQOk4F9ScqPVj+CcCTW3WwUJb A/HADoNlr8ZMyVj4fjuMgTpkPDzErjNqIYHkvy1wIkJ6ZSaCnAucvRYUWrJpOk1/ntstkIT2oFa IWJ1PBD4yCi3ejF+EdzlqH0Ka2OWBJQ== X-Gm-Gg: ASbGncu/Uii8LiZyXHsuA7U0zDcRQWkYG2dnJW2vXTb7bdYUY3fW3xFyfKBnhNPJSeY bWJKXg8S5zYHoIaRBDcfQyZOSl1qIT0RRxJ1HhgJwIrLo3LdD+o9ww9j658ueah1AnUWbwTgjAY 8d/AFXZcEXC0mA53uEsL3yjJxIJ8j0SNwD8W5uf1cy0tgo8o2J3Zil0h1VNWcTu8flpyK0q/r0r PzUsyVskqMluMWwMfqzFrHj6Q3Mt54Una4p1i0= X-Google-Smtp-Source: AGHT+IEuYNCFvn7j505DUpl7fcfs5Do4qL4XiiE/s3b+sI9fxFRQ/VhCO+VhCVgt+j5PiXgIMhwmprw27gxneA1LzHU= X-Received: by 2002:a17:907:7209:b0:ae0:ac28:ec21 with SMTP id a640c23a62f3a-af61730b8dfmr1405882766b.13.1753742982200; Mon, 28 Jul 2025 15:49:42 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Mon, 28 Jul 2025 15:49:28 -0700 X-Gm-Features: Ac12FXw3pXtt52JnQVQxCTzW8yTG_QZKwsGa6RA9OYQVh-Ng3u2tOY0ZNWmeCtg Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Benjamin Kaduk Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4brYZh72P8z4Fhl X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk = wrote: > > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk wrote: >> >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context() API = that does a lot of the work of getting useful bits out of an established GS= S security context. >> > > > > > And a bit more context on what is going on here and why kgssapi has to ca= re: > The GSS-API (RFC 2743) is all about a way to "establish a security contex= t" (i.e., do crypto negotiation, authentication, sometimes authorization, e= tc.) between two entities, the initiator and the acceprot, and then exchang= ing protected messages between the two (which can be either encrypted or ju= st integrity protection tags for otherweise cleartext data); later extensio= ns included the ability to produce identical PRF output on both parties, et= c.. The details are "mechanism-specific", and for this purpose we're exclu= sively talking about the krb5 mechanism. The steps to establish the securi= ty context are complicated and sometimes fiddly, and in the general case ca= n require a large number of round-trips between the initiator and acceptor = before the security context is established. The individual message-protect= ion parts are comparatively simple and amendable to implementation in the k= ernel for processing efficiency. > RFC 2743 also defines functions for GSS_Export_sec_context() and GSS_Impo= rt_sec_context(), that are designed essentially to pass information about a= n established security context from one process to another on the same mach= ine (which are presumably using the same implementation and version of the = implementation), so the contents of the exported blob are opaque and implem= entation-specific. We are abusing that mechanism to export information abo= ut the security context that gssd has established and feed that information= into the kernel implementation of the per-message processing routines. At= present, this necessarily entails knowing the details of the implementatio= n-specific opaque blob that is the "export sec context token", which is wha= t the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get the in= formation we want without breaking the abstraction barrier, such as via the= gss_krb5_export_lucid_sec_context() API, we are in a more robust posture o= verall and somewhat future-proofed against future evolution by MIT krb5. Yes, that was my thinking too. > (I note that recent Heimdal versions seem to also expose a gss_krb5_expor= t_lucid_sec_context() API, so part of the problem is just that the Heimdal = in base is so old.) Good to hear, just in case there is a decision to go that way. (At this poi= nt, I doubt that.) I am working on using gss_inquire_sec_context_by_oid(), which I think is ju= st a front-end to gss_krb5_export_lucid_sec_context()? If that doesn't work, I'll switch to gss_krb5_export_lucid_sec_context(). (I am still waiting for the day when there is another mechanism. I have heard rumblings w.r.t. a mechanism for the Oauth stuff, but as far as I know, about all that they did was define an OID for it.) Btw, do you have any experience porting KDC databases from Heimdal to MIT? (At this point, Cy has done it, but after doing so, the passwords all had to be reset. He thought he had used "--decrypt" when he dumped the Heimdal KDC.) rick > > -Ben From nobody Tue Jul 29 03:41:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brh3074P3z5yMJr; Tue, 29 Jul 2025 03:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brh306GRrz3Pp9; Tue, 29 Jul 2025 03:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753760476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wRVuFvVhXq8eU1ZR4qEEJv19Fbty7vbYT4CVT3aSV54=; b=QPRRbbWXUhS8zBIsZWIOZbyXuPlJwKN7RNdIyR9tG1PtaWXl3VHXAKgMYIZW+3iaVSIw3f AE4TznxiFGubnQoaHRw6RtCgnW534kqUsOsuTe7EkU8Rq96rxtZWT+M+6l/cD85E5+G/pT 945B8mkrdzf7f+2PdIb99rD51m7nImuJXA04nn1Zh+IBXKDg0og5fwnhiFiSIwoFXxZ26T WTLFRryQz63Ge3ZS+Mhc7Ob1j9IUyDy/H+K1dwDYgYYjXnleLURdU1MSXvz3qH5g8vuqAg x+jMHRM9xkCcGPlgOoiUDl+uauBGUTQrF0Ewx3PemU1Pv9jHwcjU9REjkXr0Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753760476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wRVuFvVhXq8eU1ZR4qEEJv19Fbty7vbYT4CVT3aSV54=; b=gRFOvR4cSDC6iBPP+UnTd1PFy/8v3YVC5sVadZEpbW8BylfoeRP7Wp+rwq6gl/R0yELo68 SYK8COXweCKX3UaKMegtalFCYa+xVcm0ysPL6/o6dnI1aoeTXDgjyaHchXz1zzkjs5jBYe YREqNjGCAFiYrtj2Po5lEfJFJE7Tv2miZF06xrYgB2Wa1pAT3tsLg5Lv+2kdEcl+93q+td UIkW5rmLA6Nzih4WBMTzF47pWKO96UN2hIeMz1DgLld6jjY/8udwXvQJBf8gUF253pKWdj n6+3LfRZCuGX6fwLO77AK2g+GrQb1/oFv0PK4MbN3XzM1KFztCxaAkpnx6Z5oA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753760476; a=rsa-sha256; cv=none; b=tw8bag+kbyNjvg7PLW8+22mko+nW0iq4sznvl/k6hsRYMhVdIxfvuKxe2h01SV5Jz5w0i9 z1O1zkpwoBWNJfg/fBdD4SwsNE/eolvjhRIsD/AoEED06rL8TrWapPYQKe1FpDILoH6xk3 jaBsrFRXi2iZbQDzRVsQLqpZxOeIzo9n/Ngo6OEnZOCTl+sJgGtJPMMweesJK4jjVmJoOv EuwqftbW9w+b4QQ68DUkPcEZzWWQ3gxBQGON95Vae/SbHK9SdJVI64LI1si5CgmiVh3a8Z Qgi9BTtHA9eT/SlIsIseEzeqdsEc1ZwimqMCgb1u6Ebe4GkjsKT9rvYtc6McCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brh305mDRz1CcK; Tue, 29 Jul 2025 03:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56T3fGNj084855; Tue, 29 Jul 2025 03:41:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56T3fG8B084852; Tue, 29 Jul 2025 03:41:16 GMT (envelope-from git) Date: Tue, 29 Jul 2025 03:41:16 GMT Message-Id: <202507290341.56T3fG8B084852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 99979f0eeb93 - stable/14 - setsockopt.2: Clarify SO_SPLICE action List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 99979f0eeb9381685c8b4601623a109235341016 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=99979f0eeb9381685c8b4601623a109235341016 commit 99979f0eeb9381685c8b4601623a109235341016 Author: Kevin Bowling AuthorDate: 2024-11-25 18:32:35 +0000 Commit: Kevin Bowling CommitDate: 2025-07-29 03:39:47 +0000 setsockopt.2: Clarify SO_SPLICE action Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D47720 Co-authored-by: Mark Johnston (cherry picked from commit c1e304c60c46a26af57f9638c53417dd6cffa9fe) --- lib/libc/sys/getsockopt.2 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2 index c738a152d859..f36a9fe7baf8 100644 --- a/lib/libc/sys/getsockopt.2 +++ b/lib/libc/sys/getsockopt.2 @@ -570,9 +570,14 @@ struct so_splice { .Pp Data received on .Fa s -will automatically be transmitted from the socket specified in +will automatically be transmitted via the socket specified in .Fa sp_fd without any intervention by userspace. +That is, the data will be transmitted via +.Fa sp_fd +as if userspace had called +.Xr send 2 +directly. Splicing is a one-way operation; a given pair of sockets may be spliced in one or both directions. Currently only connected From nobody Tue Jul 29 03:41:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brh320nxCz5yLhh; Tue, 29 Jul 2025 03:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brh3175c2z3PpB; Tue, 29 Jul 2025 03:41:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753760478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cLj4Q/gOHAEq3DYd2/0X1ZM828dloiyHPvnl4lKXzmc=; b=Dp8fCEtc7K/+1Nw9jv+w8YQNgrjCLP7qeJosKNG7QzOdhhJ+HogmgRbayPnSfzeS2pKSa3 G4e6Os8vxpXiE0sT5D2L6EeFlUo7b12pO2Ipes4WIdodfSd/nFOGA8t04fQ9tdPY4eu77y 5ml+tfNwlDqKnTzLA3R3j736X+KCRXTovDoDyrwDWJOEOcmZEsaRD3X42XjhSRKxc2bdkh fXhFeczjQT9+D6GR/ewwAFH7b6GcI8+Mi5jPH6crjlK20wmSNd5xqpm86/nQdBO9JnyoHT mjv/wMfH9fpgTVnyLX/GX/3l9hURCEEClfCwvQu9xlo7NXCRrJMbZ28Ufn17wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753760478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cLj4Q/gOHAEq3DYd2/0X1ZM828dloiyHPvnl4lKXzmc=; b=mFVjXrErvaTWt5RBeZsZDwyoejXKhXKooxDl84w9/KM3dblxGC03RdqdHIWXvzoEc7Z8vS pOUfdqVBeYsWFI3pmORTKKugidL0EsxpQXlQ+Pzl60IMVnW89wBEPG8FX5v6Qpz4eQVei3 jlCw/+C5f3az3Qib08TdZ8FWqUmTZguFjonaxfrVqISeRReJp2H7elPkt/MSHzlmO4833a yAx9AVTVK5MHChrftoEoMDF/6Itjk/BWfA1CCXPGxni5RUeQSvuQXl9XG20u0HkDeFxvlU zsL0iVm/FJUjUHZVhvHekyzBzqi9GMsbw2KNqgOH75g9ua2g3EabDY/f1adhMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753760478; a=rsa-sha256; cv=none; b=ic7Df5VnuFlKjKcQhapeEO19EyMlhzRBd5gCW29/g3mQP/E266Zs4zTkRV/jp4pVUE8yqE QdQTwJUEw1v632vxjmOoDKfhkGRxFp/MRwxtyfG/dmiZh69uM8anCrwrtsaF++jLUM0Cyj d1IY+Q3eeH14nR6HNF4qDo3y6vedh8dnVX5VHnDuiZa9WlT8Xg1n2MSPhgTb2b3Gilq45T ovrrfo6w+QysumMsqwAg1+OLN3eUtr6ztaMhBJWECqlnUfN1A+dEyGwAJ1w2G2jySBss1+ Oc1uOok27S78E7lOJWws5fI05j2An1as8l00J4vp0B/rXufcgsNzOy6gllPWuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brh316hTzz1CsV; Tue, 29 Jul 2025 03:41:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56T3fHXj084887; Tue, 29 Jul 2025 03:41:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56T3fHsc084884; Tue, 29 Jul 2025 03:41:17 GMT (envelope-from git) Date: Tue, 29 Jul 2025 03:41:17 GMT Message-Id: <202507290341.56T3fHsc084884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 677465720ad1 - stable/14 - getsockopt.2: Add SO_SPLICE source socket read and socket close behavior List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 677465720ad10f24de178c8bba0285cb3f3c23fe Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=677465720ad10f24de178c8bba0285cb3f3c23fe commit 677465720ad10f24de178c8bba0285cb3f3c23fe Author: Kevin Bowling AuthorDate: 2025-07-26 21:18:47 +0000 Commit: Kevin Bowling CommitDate: 2025-07-29 03:40:26 +0000 getsockopt.2: Add SO_SPLICE source socket read and socket close behavior Add select(2), poll(2), or kqueue(2) source socket semantics and close behavior. Reported by: Udip Pant Reviewed by: manpages (ziaee), markj Obtained from: OpenBSD Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51547 (cherry picked from commit 122b2a3530f8baab56d196b51724cc3ddd38abd2) --- lib/libc/sys/getsockopt.2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2 index f36a9fe7baf8..b9c6589d07ac 100644 --- a/lib/libc/sys/getsockopt.2 +++ b/lib/libc/sys/getsockopt.2 @@ -595,6 +595,15 @@ specified amount of time has elapsed since the initial call to If .Fa sp_fd is -1, the socket will be unspliced immediately. +A successful +.Xr select 2 , +.Xr poll 2 , +or +.Xr kqueue 2 +operation testing the ability to read from the source socket indicates +that the splicing has terminated and at least one byte is available for +reading. +When one of the sockets gets closed, splicing ends. .Pp When passed to .Fn getsockopt , From nobody Tue Jul 29 06:22:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brlcs5zq6z61p20; Tue, 29 Jul 2025 06:22:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brlcs5LmLz4NSj; Tue, 29 Jul 2025 06:22:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753770141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+DSA0WTtzH6VBiFLzzffaoCqLC3paFpDEJFQgOqL8ug=; b=TV9AySxJWtPkGU0/xcCwxZv1ygN6oRpJoR6Ip7y/lkY6SLh7IknM8e3Ja1vQUv9FFxb5k1 hw9qdW+Uv+u7GPCIl1bmatjtHmkDeVwRxzsfnHTToj6KXDi3sjfnHzccNbFh3GGGfN5XkD gRPPQ8eko3Kl7nF7Xp1RqB4rqxNQtkSW8bPNHCTBnH/xG27I/PTqp/sOWwyFRL/fErUlek upk2A5u0quU9dq+0y2RwLX1Mym7+DnHA3zh8AHuCll6rRY5yobqi8F6dVY+/qpvmK+UgR0 N3E5L8lseBCyBs/oYiOWlu6XeYvgrmNtOrCMzVlgilfsqK1FpQEzZGxd7QPiQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753770141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+DSA0WTtzH6VBiFLzzffaoCqLC3paFpDEJFQgOqL8ug=; b=gyxv2eSxb6XzG34SKqQ0MDpOGFeTFnnaZEaEvtz06EAx8XAlDaJ9OcBvY6LXWbNDBFDT96 yhKt/MAIK7iX1+w7z13lND7oaHmO5ptMiJa0chSyhTwJKBJanFvH6ZoLYXCB5Cv6oLv0da 8cal3H5InfmNJNb7ZRWYCT4iKicvgsY9ymdA2xmZcO1h8pEKhGr6jsXgrNiFbyv5wfpWEp 7Lg7TjM01o91a2Y7m1ZdZGcVdTLTwf6j+rAIAOzVtg2gd1Wd+dj/GnPKGuHxr6wbeCFTG8 BM8q9lbwh06z5lxzhWWG7tC3PGCuDHLoHyfpRZp4X2Nd7CHVrkHUl16FhcrdxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753770141; a=rsa-sha256; cv=none; b=AnxN0uxylPN1EMEgC8TJtGLqpBXAVJ7Tv19uIlMzjwVi/mHPNvlq6cVywH+IAkSxNcK5gj Ji0pyufxnXJh7l0BAqypBVoRy07vNrTRMvorFwD+kW1QibBxyDqcD9qEzdf7hqlOsqnp2t Jf/pHbZcAilAmbWjjWJbMZqv9pUS2ldhv2qocVQyAWBLb6Ii7kTKZq6EIk4t6nL9PvMyZ5 0Qin59j256kTAxch8/Zx21iD+4ZvaUEaAgD29wJM47s+sZj9WcoV+VSaKDZnr8IZD+Mfhz W6rH0M3n1wGTczUH0HWxVqeFVzUjRy5eoZvVJSNlQLrtHAPHvcGZRrKKjPaxEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brlcs4v3jz3vF; Tue, 29 Jul 2025 06:22:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56T6MLNY012830; Tue, 29 Jul 2025 06:22:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56T6MLh3012827; Tue, 29 Jul 2025 06:22:21 GMT (envelope-from git) Date: Tue, 29 Jul 2025 06:22:21 GMT Message-Id: <202507290622.56T6MLh3012827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: 36027361f9cf - main - =?utf-8?Q?iichid: Stop using split I=C2=B2C bus transactions?= List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36027361f9cfb76013153a032286eccda1512359 Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=36027361f9cfb76013153a032286eccda1512359 commit 36027361f9cfb76013153a032286eccda1512359 Author: Poul-Henning Kamp AuthorDate: 2025-07-29 06:17:43 +0000 Commit: Poul-Henning Kamp CommitDate: 2025-07-29 06:17:43 +0000 iichid: Stop using split I²C bus transactions Read IIC-HID reports as a single I²C transaction, instead of reading first the two byte length field, holding the bus, and then the rest of the report in a separate transaction. While technically legal, I²C bus split transactions are not universally supported, and in particular the "Snapdragon Elite" ARM CPU does not seem to support them. It is also not obvious that they are beneficial in this case, given the overhead of controller setup, interrupts and tear-down. Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D51302 --- sys/dev/iicbus/iichid.c | 74 ++++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 9c0324a24685..3f1d7a0cefba 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -275,62 +275,36 @@ iichid_cmd_read(struct iichid_softc* sc, void *buf, iichid_size_t maxlen, * 6.1.3 - Retrieval of Input Reports * DEVICE returns the length (2 Bytes) and the entire Input Report. */ - uint8_t actbuf[2] = { 0, 0 }; - /* Read actual input report length. */ + + memset(buf, 0xaa, 2); // In case nothing gets read struct iic_msg msgs[] = { - { sc->addr, IIC_M_RD | IIC_M_NOSTOP, sizeof(actbuf), actbuf }, + { sc->addr, IIC_M_RD, maxlen, buf }, }; - uint16_t actlen; int error; error = iicbus_transfer(sc->dev, msgs, nitems(msgs)); if (error != 0) return (error); - actlen = actbuf[0] | actbuf[1] << 8; -#ifdef IICHID_SAMPLING - if ((actlen == 0 && sc->sampling_rate_slow < 0) || - (maxlen == 0 && sc->sampling_rate_slow >= 0)) { -#else + DPRINTFN(sc, 5, "%*D\n", msgs[0].len, msgs[0].buf, " "); + + uint16_t actlen = le16dec(buf); + if (actlen == 0) { -#endif - /* Read and discard reset command response. */ - msgs[0] = (struct iic_msg) - { sc->addr, IIC_M_RD | IIC_M_NOSTART, - le16toh(sc->desc.wMaxInputLength) - 2, sc->intr_buf }; - actlen = 0; if (!sc->reset_acked) { mtx_lock(&sc->mtx); sc->reset_acked = true; wakeup(&sc->reset_acked); mtx_unlock(&sc->mtx); } -#ifdef IICHID_SAMPLING - } else if ((actlen <= 2 || actlen == 0xFFFF) && - sc->sampling_rate_slow >= 0) { - /* Read and discard 1 byte to send I2C STOP condition. */ - msgs[0] = (struct iic_msg) - { sc->addr, IIC_M_RD | IIC_M_NOSTART, 1, actbuf }; - actlen = 0; -#endif - } else { - actlen -= 2; - if (actlen > maxlen) { - DPRINTF(sc, "input report too big. requested=%d " - "received=%d\n", maxlen, actlen); - actlen = maxlen; - } - /* Read input report itself. */ - msgs[0] = (struct iic_msg) - { sc->addr, IIC_M_RD | IIC_M_NOSTART, actlen, buf }; } - error = iicbus_transfer(sc->dev, msgs, 1); - if (error == 0 && actual_len != NULL) + if (actlen <= 2 || actlen > maxlen) { + actlen = 0; + } + if (actual_len != NULL) { *actual_len = actlen; - - DPRINTFN(sc, 5, - "%*D - %*D\n", 2, actbuf, " ", msgs[0].len, msgs[0].buf, " "); + } return (error); } @@ -566,7 +540,7 @@ iichid_sampling_task(void *context, int pending) error = iichid_cmd_read(sc, sc->intr_buf, sc->intr_bufsize, &actual); if (error == 0) { if (actual > 0) { - sc->intr_handler(sc->intr_ctx, sc->intr_buf, actual); + sc->intr_handler(sc->intr_ctx, sc->intr_buf + 2, actual); sc->missing_samples = 0; if (sc->dup_size != actual || memcmp(sc->dup_buf, sc->intr_buf, actual) != 0) { @@ -577,7 +551,7 @@ iichid_sampling_task(void *context, int pending) ++sc->dup_samples; } else { if (++sc->missing_samples == 1) - sc->intr_handler(sc->intr_ctx, sc->intr_buf, 0); + sc->intr_handler(sc->intr_ctx, sc->intr_buf + 2, 0); sc->dup_samples = 0; } } else @@ -632,7 +606,7 @@ iichid_intr(void *context) if (error == 0) { if (sc->power_on && sc->open) { if (actual != 0) - sc->intr_handler(sc->intr_ctx, sc->intr_buf, + sc->intr_handler(sc->intr_ctx, sc->intr_buf + 2, actual); else DPRINTF(sc, "no data received\n"); @@ -842,11 +816,12 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, sc = device_get_softc(dev); /* - * Do not rely on wMaxInputLength, as some devices may set it to - * a wrong length. Find the longest input report in report descriptor. + * Do not rely just on wMaxInputLength, as some devices (which?) + * may set it to a wrong length. Also find the longest input report + * in report descriptor, and add two for the length field. */ - rdesc->rdsize = - MAX(rdesc->isize, le16toh(sc->desc.wMaxInputLength) - 2); + rdesc->rdsize = 2 + + MAX(rdesc->isize, le16toh(sc->desc.wMaxInputLength)); /* Write and get/set_report sizes are limited by I2C-HID protocol. */ rdesc->grsize = rdesc->srsize = IICHID_SIZE_MAX; rdesc->wrsize = IICHID_SIZE_MAX; @@ -919,7 +894,7 @@ iichid_intr_poll(device_t dev, device_t child __unused) sc = device_get_softc(dev); error = iichid_cmd_read(sc, sc->intr_buf, sc->intr_bufsize, &actual); if (error == 0 && actual != 0) - sc->intr_handler(sc->intr_ctx, sc->intr_buf, actual); + sc->intr_handler(sc->intr_ctx, sc->intr_buf + 2, actual); } /* @@ -946,6 +921,7 @@ iichid_read(device_t dev, device_t child __unused, void *buf, { struct iichid_softc *sc; device_t parent; + uint8_t *tmpbuf; int error; if (maxlen > IICHID_SIZE_MAX) @@ -954,8 +930,12 @@ iichid_read(device_t dev, device_t child __unused, void *buf, parent = device_get_parent(sc->dev); error = iicbus_request_bus(parent, sc->dev, IIC_WAIT); if (error == 0) { - error = iichid_cmd_read(sc, buf, maxlen, actlen); + tmpbuf = malloc(maxlen + 2, M_DEVBUF, M_WAITOK | M_ZERO); + error = iichid_cmd_read(sc, tmpbuf, maxlen + 2, actlen); iicbus_release_bus(parent, sc->dev); + if (*actlen > 0) + memcpy(buf, tmpbuf + 2, *actlen); + free(tmpbuf, M_DEVBUF); } return (iic2errno(error)); } From nobody Tue Jul 29 06:54:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brmL867ndz61q6T; Tue, 29 Jul 2025 06:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brmL859lcz3CDY; Tue, 29 Jul 2025 06:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753772080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwxrHnLPLBEjB36gzrezSpDvrzC27MrdM+4J8mibHWQ=; b=P5IDSJ7RXaQ4V3UNVjJgd9LVKLnhjW63hoeMPjG0nJ0ycq17xqiZar8p+HbJPeWimK1m+U N1BqhoM148yvA2QzZAI9rRZqnOWTr07Y6gm5raY0o6vNprVgs4/sW5GZwcnIOnqbu4rwaK s/tPAZyl2xSx3ZzIVfrDibU/Wgkoq8Bfn6kgsIiAwADzPyJ6lk8E1J4qwxWHVpDzLjBHFB x/LAq7QvPDxpymP9yA9ZV8im8/PeFGMiijuR2XYTmCFJ890q/SSPI40Jnn1oe8fF/rGy/K pt37nMtvHA94BfLDRF13ZTqCdn6B62TMjtrk+wE0oQTtEeyjcs1Q0vKG2uMbTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753772080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwxrHnLPLBEjB36gzrezSpDvrzC27MrdM+4J8mibHWQ=; b=HcwVxiwjFAIJOzRygX/QBIj6ecMrQcjbS42DEtXAz9RVR2YIjaGvBl9kUZG/Q/cFMo0CoY +ZTPbPoNmpAhrD9ZaDM7XlAt8ytJjRIr7sNxEQdM7L1ClG/1Y4LuNHd+mB5nNfykdYWWP3 mq4xE1gl2s2wU3MzPAw9kPUGqWLpcjcBXiymqfE5z4sBOMBUd352VsKGEMZp2dYtKn7141 553MiHhJwnMPohr/nROl8iUJcM2QHkptUp/dDMXzpc1RO99DAcLrclpHBch4XRVMhabAB5 0e53MGbAxQIEREJC5DhinyytkMY3hBp7Lc5BSXpGn3dESAtxaLRgIn+g00xaXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753772080; a=rsa-sha256; cv=none; b=MtP183ozb6enkMwLtL19UDfz4G1f78pIgG4hyEZfERXehxUUwT96gfZuXm2qhjNtnE8LJN dHxGBP5eNoTBkrNvHojhUjQEoxaHCc5+hUdsZ/HmWo9pGlvcJGdC1pFCqOAD0wUg+at87e U0BRW73ztaEZ52ws3B+I9gvoiTuNST27fzowDSw1+h/GE4nUpTcvQIUuR6Ly7N0VZcLVUS kOJSYnjQu7/q+qhcWHxJ//aQrrNvn3pmH+bvDopg5ShaScDRZ5NlU1TvR4Lml8yPalMrc1 qS+NTDjUytlG2eLQfNraUjsPFW2RImMpfubX/apWzaLh15qAC5UZquVs99XHyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brmL84nJpz4ks; Tue, 29 Jul 2025 06:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56T6sebo068617; Tue, 29 Jul 2025 06:54:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56T6seur068614; Tue, 29 Jul 2025 06:54:40 GMT (envelope-from git) Date: Tue, 29 Jul 2025 06:54:40 GMT Message-Id: <202507290654.56T6seur068614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: fe35f275ab02 - main - mbuf.9: describe checksum offloading for SCTP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe35f275ab0240cb5ed05484c943293a71aadb5f Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fe35f275ab0240cb5ed05484c943293a71aadb5f commit fe35f275ab0240cb5ed05484c943293a71aadb5f Author: Michael Tuexen AuthorDate: 2025-07-29 06:52:06 +0000 Commit: Michael Tuexen CommitDate: 2025-07-29 06:52:06 +0000 mbuf.9: describe checksum offloading for SCTP This describes the current status of the implementation. While there, be a bit more precise on how long the checksum computation is delayed. Reviewed by: Timo Völker, bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51590 --- share/man/man9/mbuf.9 | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index 0262c598ed18..c05505716a30 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 28, 2023 +.Dd July 29, 2025 .Dt MBUF 9 .Os .\" @@ -1091,7 +1091,7 @@ network code, when data must be encrypted or otherwise altered prior to transmission. .El .Sh HARDWARE-ASSISTED CHECKSUM CALCULATION -This section currently applies to TCP/IP only. +This section currently applies to SCTP, TCP, and UDP over IP only. In order to save the host CPU resources, computing checksums is offloaded to the network interface hardware if possible. The @@ -1117,7 +1117,7 @@ in the .Vt mbuf chain containing the packet. .Pp -On output, checksum offloading is attempted after the outgoing +On output, the computation of the checksum is delayed until the outgoing interface has been determined for a packet. The interface-specific field .Va ifnet.if_data.ifi_hwassist @@ -1135,12 +1135,15 @@ such actions will never be requested through .Va csum_flags . .Pp The flags demanding a particular action from an interface are as follows: -.Bl -tag -width ".Dv CSUM_TCP" -offset indent +.Bl -tag -width ".Dv CSUM_SCTP" -offset indent .It Dv CSUM_IP The IP header checksum is to be computed and stored in the corresponding field of the packet. The hardware is expected to know the format of an IP header to determine the offset of the IP checksum field. +.It Dv CSUM_SCTP +The SCTP checksum is to be computed. +(See below.) .It Dv CSUM_TCP The TCP checksum is to be computed. (See below.) @@ -1149,14 +1152,16 @@ The UDP checksum is to be computed. (See below.) .El .Pp -Should a TCP or UDP checksum be offloaded to the hardware, +Should a SCTP, TCP, or UDP checksum be offloaded to the hardware, the field .Va csum_data will contain the byte offset of the checksum field relative to the end of the IP header. -In this case, the checksum field will be initially -set by the TCP/IP module to the checksum of the pseudo header +In the case of TCP or UDP, the checksum field will be initially +set by the TCP or UDP implementation to the checksum of the pseudo header defined by the TCP and UDP specifications. +In the case of SCTP, the checksum field will be initially +set by the SCTP implementation to 0. .Pp On input, an interface indicates the actions it has performed on a packet by setting one or more of the following flags in @@ -1187,13 +1192,13 @@ to obtain the final checksum to be used for TCP or UDP validation purposes. .El .Pp If a particular network interface just indicates success or -failure of TCP or UDP checksum validation without returning +failure of SCTP, TCP, or UDP checksum validation without returning the exact value of the checksum to the host CPU, its driver can mark .Dv CSUM_DATA_VALID -and -.Dv CSUM_PSEUDO_HDR in -.Va csum_flags , +.Va csum_flags +as well as, for TCP and UDP, +.Dv CSUM_PSEUDO_HDR and set .Va csum_data to @@ -1203,6 +1208,13 @@ It is a peculiarity of the algorithm used that the Internet checksum calculated over any valid packet will be .Li 0xFFFF as long as the original checksum field is included. +Note that for SCTP the value of +.Va csum_data +is not relevant and +.Dv CSUM_PSEUDO_HDR +in +.Va csum_flags +is not set, since SCTP does not use a pseudo header checksum. .Sh STRESS TESTING When running a kernel compiled with the option .Dv MBUF_STRESS_TEST , From nobody Tue Jul 29 07:49:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brnYK73hcz61tbN; Tue, 29 Jul 2025 07:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brnYK65TXz3H3Q; Tue, 29 Jul 2025 07:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753775365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vZ8ozSA3Fc0QWoCwPJhg/isleSsEWjwWGBmjC8k+RWM=; b=V7s0+8BOPBFRRuk6KKRpXtY9ov9F77BpDQAFKkwfjmfHiJFwr3+AOmEzScIA3rJ2Ko+Ilx XatFuz8ONnO9YUVWGOlgJecIS1OoE5ZmI/nJ1P8MypvCCgnKjePJsMJHG76zerpJY7WtSg 6Bh0S/TGDNbtO9uRkTl0LxKZkb4E5VPzhl6zyD9vZeX2GYXfR3Or8GMQa9VH4qDiEP5XX3 azQgVnQnhzyHPGBaV2qro1Ry+SEcLj+yn/p0fFMwc1ghpnEFmakpFRgM1f6wX3N8K3Ty5n XtnhziwYAHhdLPYV9swPIAZfhpJhT4xM/oWrR46EGNGqfgqYE4i/H8j1TyNUjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753775365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vZ8ozSA3Fc0QWoCwPJhg/isleSsEWjwWGBmjC8k+RWM=; b=hz2RwCTXdyNC5CQpex9F+Tjg/gfabPeyTe6jhgvkxtfpp5WD04MOG3HFLf0oWwCaEjUH9a 0MOx7wxAREk6k4lTLBsd3DGp6bXlHMsYbVwRiDV2JYK5ey520n5iNfLo36+MvoNnhV/GJP 1cOkoA821pJyMNoG8YCH5Rz0GaF0D0x8BlRsZNm88znz3UgTVWbUbTF2N2C3tmRaJKPO+i QZibQSJrATdqpibnqkwMA269LuAgpIXrazv4LLjJGsxKrJD/9l2KaqKuEzW+ckfrKo2OiS op6FxuTP6w4QF/mt6jJNny5BaD9qy6D/dYo/3RLLbZs+fffeRHVmidh3C6Mb5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753775365; a=rsa-sha256; cv=none; b=pWw1FhpZV6HRpKNxokKEnYygppj1TW4B350X0o1LXdL+72bRtCN2hs2YmVoi9HMb0bUqbq t2jIwi9Szp7oiGaZvbar49NmleDQE3nu6q11Fjg9tPMu6M6MeWFkEKMIsOyGUzMkgI7xNH ba2pOYse/XQYkyzp0TC8JH5vgi16JwD6GsieZB+108JwHa6Ph7h87TjADBVGDXBa9VzPvS PDbbRHZ9L8hkwrqpp8emZ4QnAQtxA9OqVXBEscWa5CMwAbqnnV8A+qbQ1bZ48Cinj+XtiJ 0UvIk5pRmaMjr/aSDXLZxZo7jKpZr7p4k7nTsy7L33l+255Z0I23u6xhY8pCEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brnYK5Y9bz6bH; Tue, 29 Jul 2025 07:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56T7nPUd065631; Tue, 29 Jul 2025 07:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56T7nPd8065628; Tue, 29 Jul 2025 07:49:25 GMT (envelope-from git) Date: Tue, 29 Jul 2025 07:49:25 GMT Message-Id: <202507290749.56T7nPd8065628@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: b731570eca60 - stable/14 - /etc/rc.d/pf: Fix for multi-line pf_fallback_rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b731570eca60c421f9c42208d542b49073e33a6d Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b731570eca60c421f9c42208d542b49073e33a6d commit b731570eca60c421f9c42208d542b49073e33a6d Author: Michael Proto AuthorDate: 2025-07-13 21:30:28 +0000 Commit: Kristof Provost CommitDate: 2025-07-29 07:48:39 +0000 /etc/rc.d/pf: Fix for multi-line pf_fallback_rules Setting multiple pf_fallback_rules in /etc/rc.conf as per the documentation produces invalid pf syntax due to the lack of echo quoting $pf_fallback_rules in /etc/rc.d/pf. Adding quotes around the $pf_fallback_rules echo maintains newlines needed for valid pfctl syntax. Provided patch resolves the issue Also updating rc.conf(5) to reflect that multi-line pf_fallback_rules should not include a trailing backslash (\) as line breaks are needed when passing rules to pfctl via stdin. PR: 288197 Reviewed by: kp MFC after: 2 weeks (cherry picked from commit 9e8c1f9576e75fcd34007c6e8a4a6da0b1b2f1e2) --- libexec/rc/rc.d/pf | 2 +- share/man/man5/rc.conf.5 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc.d/pf b/libexec/rc/rc.d/pf index f227782e640c..f5871c367c6a 100755 --- a/libexec/rc/rc.d/pf +++ b/libexec/rc/rc.d/pf @@ -35,7 +35,7 @@ pf_fallback() $pf_program -f "$pf_fallback_rules_file" $pf_flags else warn "Loading fallback rules: $pf_fallback_rules" - echo $pf_fallback_rules | $pf_program -f - $pf_flags + echo "$pf_fallback_rules" | $pf_program -f - $pf_flags fi } diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 51e9ff7d9f86..a023d04a1bb6 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 7, 2025 +.Dd July 15, 2025 .Dt RC.CONF 5 .Os .Sh NAME @@ -1140,8 +1140,8 @@ and is not found. Multiple rules can be set as follows: .Bd -literal -pf_fallback_rules="\\ - block drop log all\\ +pf_fallback_rules=" + block drop log all pass in quick on em0" .Pp .Ed From nobody Tue Jul 29 07:49:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brnYM38WXz61tDR; Tue, 29 Jul 2025 07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brnYM0vFyz3H8J; Tue, 29 Jul 2025 07: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=1753775367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9//ny0HBfwdvMZnyTsOw62o/HsghTEPH7U/RWOK2K0=; b=XWxBzSXm/ZJugNDOxmdXZrReeTtBBI6BQpB4UggMq5RHcX/sribakUQzfJ8EACIkP/i1/R goVjXxqE/LWmRXuL54Hqejb02q35pGfawKfOx0mhDygrK+VB8anIwjYzUt6ZqDV3YtBtVm jgblNfjP1kihPE+BC/ZnCAQzNlaiQBQZAOWu0Ly4Hi6NG7RO0lfmBhkijzL8QzsDt7yA2D 6nptLe/Eo3uihzaQc4bADba+WmxA7kLP2/iuFqLHnydez6mnO6J4P/P1nQtJ6o/efx8z84 +prOCaOhyZVurE0+2CFIkYU7BYjCkpBl5MX5xQeQez+4mMa7hUSHj+gMU2ntVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753775367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9//ny0HBfwdvMZnyTsOw62o/HsghTEPH7U/RWOK2K0=; b=mpLej0u2qjS73cmeiFSj4wE3ASxs/a7/VZWEOUWl8ww0V9Tni5vOQk8nfGLxeHzA8h726u ARg0GKwu+ZaBcnMO5eSUUwQCxEyN20ITrjcQ65jv3wIxk9d1xUPZpmeBNOsYYnFCYJ9TZM VZqbke6krBooblUoeEh91t8utUuBHqdHtkyaW0TrM/5Ma8zQCfEjICOUsUfBAjJT5RyxtD msBkxmUEGePqml2BIo/ERQ2Hdb5nrWGOPJjIotd55/7ou9+TXIkZx4PMEK1kvZBXglvjzJ D/Gtrl3Yrsh/qKicBgF11BQ+kFeWtIduBMRpd/iIo59+EEqWOZTpIVJjgiVPYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753775367; a=rsa-sha256; cv=none; b=TZbvtdrLX9TVojJRkfC7/C669trUYfK6UgYdMzIXOuAWNLuJeb8TKd1bfEAi1ZBpV93+xb M8QntgwGHgaVYYaO5ppy0R2NciqUMKqJUkyeoa1v3al26ehMI/Scv5uh9tA6Z91rCMVu9d qL9fj6FH4B0mFUeo41zPpY6XgBdX9Fzy1BKeEmkQ2Ul6oU4NrbdkWgsdIBV2SGnJwN5ZTa Mux+jSbEONF7RMedV9MIDtEYSR1TMDRZDbtGnD+gaRY6349DD0tTvnSoAALx6neg4yhpqW 2oZQZW05szznVHZbd72SaHC4AjGEG/9yjp5VKq5YUCxd+O+JRqsQbDsthG6Kqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brnYM0Qjgz6W3; Tue, 29 Jul 2025 07:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56T7nQfp065756; Tue, 29 Jul 2025 07:49:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56T7nQQR065753; Tue, 29 Jul 2025 07:49:26 GMT (envelope-from git) Date: Tue, 29 Jul 2025 07:49:26 GMT Message-Id: <202507290749.56T7nQQR065753@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: 0bb490bdbff4 - stable/13 - /etc/rc.d/pf: Fix for multi-line pf_fallback_rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0bb490bdbff4bb39e7a3429ee2176bd123b627ca Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0bb490bdbff4bb39e7a3429ee2176bd123b627ca commit 0bb490bdbff4bb39e7a3429ee2176bd123b627ca Author: Michael Proto AuthorDate: 2025-07-13 21:30:28 +0000 Commit: Kristof Provost CommitDate: 2025-07-29 07:48:51 +0000 /etc/rc.d/pf: Fix for multi-line pf_fallback_rules Setting multiple pf_fallback_rules in /etc/rc.conf as per the documentation produces invalid pf syntax due to the lack of echo quoting $pf_fallback_rules in /etc/rc.d/pf. Adding quotes around the $pf_fallback_rules echo maintains newlines needed for valid pfctl syntax. Provided patch resolves the issue Also updating rc.conf(5) to reflect that multi-line pf_fallback_rules should not include a trailing backslash (\) as line breaks are needed when passing rules to pfctl via stdin. PR: 288197 Reviewed by: kp MFC after: 2 weeks (cherry picked from commit 9e8c1f9576e75fcd34007c6e8a4a6da0b1b2f1e2) --- libexec/rc/rc.d/pf | 2 +- share/man/man5/rc.conf.5 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/rc/rc.d/pf b/libexec/rc/rc.d/pf index f227782e640c..f5871c367c6a 100755 --- a/libexec/rc/rc.d/pf +++ b/libexec/rc/rc.d/pf @@ -35,7 +35,7 @@ pf_fallback() $pf_program -f "$pf_fallback_rules_file" $pf_flags else warn "Loading fallback rules: $pf_fallback_rules" - echo $pf_fallback_rules | $pf_program -f - $pf_flags + echo "$pf_fallback_rules" | $pf_program -f - $pf_flags fi } diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index f588f12eee59..8dd871d7c779 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 7, 2025 +.Dd July 15, 2025 .Dt RC.CONF 5 .Os .Sh NAME @@ -1101,8 +1101,8 @@ and is not found. Multiple rules can be set as follows: .Bd -literal -pf_fallback_rules="\\ - block drop log all\\ +pf_fallback_rules=" + block drop log all pass in quick on em0" .Pp .Ed From nobody Tue Jul 29 07:51:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brnb903d4z61tlC; Tue, 29 Jul 2025 07:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brnb86MXpz3HTJ; Tue, 29 Jul 2025 07:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753775460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3Q/R2j5IZ555J95jgc/ThPTNevQc75HmqfjOgla+Dg=; b=m/ogIEFSCU7ETq6OxwsqNuX/zhJdzQR9wajluQrrF/jE6SzLfwUhowwrFtvquHIFHwbPeX ewPiaa9BD8YFx8JBE6WaVsYmYTBogtBNrnMdLAlwvRk9jyXQrljOdfmwAqVVh6zVslPvq0 IovGGPidqU6x/7eWdyuuPwt/T+sPuawK347C3A1JJnjYKJkpclPyH86fBBYM/oNhZrnmUe mrkmFT6m7e+XK3V5Uidraa1L+WfT2Ftf7x0oZu4tsTMYpcx6PxTxpFMPiXdI+6XhqFCWwT ENNDw++qjwFlH3Yq5WBh2dz28M686PcmNs5/DLZZ1g75qHsWjk2jCa1BwMqhTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753775460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3Q/R2j5IZ555J95jgc/ThPTNevQc75HmqfjOgla+Dg=; b=UO7xzWrVJsNQfH962XXu6fhNu6hCjgRzgOl7dQo19ORRhqV5+J7tPuKmkp38wbaLIiWbaL e7MAjSCW+k5nlBoAPfqRwRWHV7kiMz2WibzYqgoVmApw00vhfnIeZJYGV2Lc/xI+hO1GqA rIqlqKTrJQ16vlaaUF4wMsgy0avAu6i5vqsYO+lTTLC4ODwaYhnGCrs2iq1KJlpR2kdNgg gNuwMNPkWAfPO5dY87Zjj5Tk3SVeG8U/SVW9gjz6WO1Mv8KW6p2tCRc6kSu0E8icsYh8tW s5p07tGIIaRdcdtsLJEsTQxFeDgKB/YzUOU9fCRhx8HzxIgeLrF831RNmAC3jQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753775460; a=rsa-sha256; cv=none; b=eghhmzWcam6voCJYHQBQUxBv2wt1gyX1lto0gtg7z83zf3tVRsyHz0yLrD0mtDy5kvWDNZ KnhwHHUnTgLdl2xuQ8aJ8b2gAQwZDT6cOzSuSKdhzngwtW0IvEFRDGe/F5nOcRar2XWghL ry0MrRyCzJZfnXkCg9EMM1UNtMyB25HqDAXYpomPV7uku4wIHHdYpDlqaNDko0Xu4FgQJU 3JVm19DHtlxM4dcvp8NyN3BsWcvZHr62CwFVAPC4Y5hPh6R+rIh8Vl9KhgEMJHGp8Z6NnP VWfdAyGarx8vLr0/w8m2zmcN0Xwo8RQpjiZVwu9b4rwc3arZG0OJrcDiCle4QQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brnb85dRBz78D; Tue, 29 Jul 2025 07:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56T7p0h4075949; Tue, 29 Jul 2025 07:51:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56T7p0Vd075946; Tue, 29 Jul 2025 07:51:00 GMT (envelope-from git) Date: Tue, 29 Jul 2025 07:51:00 GMT Message-Id: <202507290751.56T7p0Vd075946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 0ded4647215c - main - vtnet.4: update description of loader tunables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ded4647215cffde9076ab4e82870b0f491bd0b2 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0ded4647215cffde9076ab4e82870b0f491bd0b2 commit 0ded4647215cffde9076ab4e82870b0f491bd0b2 Author: Michael Tuexen AuthorDate: 2025-07-29 07:17:52 +0000 Commit: Michael Tuexen CommitDate: 2025-07-29 07:17:52 +0000 vtnet.4: update description of loader tunables This is based on the description of sysctl -d. Reviewed by: Timo Völker, bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51604 --- share/man/man4/vtnet.4 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 270366488a98..8b99cd9f17b9 100644 --- a/share/man/man4/vtnet.4 +++ b/share/man/man4/vtnet.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 22, 2012 +.Dd July 29, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -70,6 +70,11 @@ prompt before booting the kernel or stored in .It Va hw.vtnet. Ns Ar X Ns Va .csum_disable This tunable disables receive and send checksum offload. The default value is 0. +.It Va hw.vtnet.fixup_needs_csum +.It Va hw.vtnet. Ns Ar X Ns Va .fixup_needs_csum +This tunable enforces the calculation of a valid checksum for NEEDS_CSUM +packets. +The default value is 0. .It Va hw.vtnet.tso_disable .It Va hw.vtnet. Ns Ar X Ns Va .tso_disable This tunable disables TSO. @@ -91,6 +96,22 @@ The number of queue pairs used is the lesser of the maximum supported by the driver and the hypervisor, the number of CPUs present in the guest, and this tunable if not zero. The default value is 0. +.It Va hw.vtnet.tso_maxlen +.It Va hw.vtnet. Ns Ar X Ns Va .tso_maxlen +This tunable sets the TSO burst limit. +The default value is 65535. +.It Va hw.vtnet.rx_process_limit +.It Va hw.vtnet. Ns Ar X Ns Va .rx_process_limit +This tunable sets the number of RX segments processed in one pass. +The default value is 1024. +.It Va hw.vtnet.lro_entry_count +.It Va hw.vtnet. Ns Ar X Ns Va .lro_entry_count +This tunable sets the software LRO entry count. +The default value is 128, the minimum value is 8. +.It Va hw.vtnet.lro_mbufq_depth +.It Va hw.vtnet. Ns Ar X Ns Va .lro_mbufq_depth +This tunable sets the depth of the software LRO mbuf queue. +The default value is 0. .It Va hw.vtnet.altq_disable This tunable disables ALTQ support, allowing the use of multiqueue instead. This option applies to all interfaces. From nobody Tue Jul 29 12:26:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brvjg57s0z62vKh; Tue, 29 Jul 2025 12:27:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brvjg1Ytlz3jDm; Tue, 29 Jul 2025 12:27:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-7e344e0212eso81333585a.0; Tue, 29 Jul 2025 05:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753792017; x=1754396817; 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=bYL8MinZma1FaL9ZElNdYOL9zvc2IzZ9hrXyWQ9YRnc=; b=U8Km6HxB+cSfpo/WBH7ZBnvymJTued2ASFdsfAQcSd5EAoAxbb6MKNa87wbjwj1/G5 0AYg/wIKP/nWNQJSj2q0B1dlgpYgMK8vq5BzvMVdZnKFX+zHQR2B2xaOc0IdYp+J/NuO IhYnQULSxvrtVf1qwrUZvDg70b8XkFUkuwzAFSaWLhzbTowzDgki0CERPy7AAQDTQFnO Xn9Y3L8afyHobsrDR9UKn3bbfdfHA5RGwVXk3a4B2xHbq5uT6EmOi7i5msncyYFlPZK3 sjxZeAcaD6NloTeGN3jlEIuKWC0nJG46ExaCgNT45VgyCoNiROUj8jzSuNQYr830ZN45 yYBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753792017; x=1754396817; 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=bYL8MinZma1FaL9ZElNdYOL9zvc2IzZ9hrXyWQ9YRnc=; b=Ku0dryXHNc1vAMbmiF7coUcl0zQkYrzBypPfFO/+FoceHlG+aOzS5kaznj7JfdLk4b jC37v7AMqlu16GhRcyqNh0ubj6dPJYQhC9hqVa8Rn1CpTvXlyP4tA6IFrK4nRu4sQFfb FMEm9+OxrJEEVdaQf3QHZ25lRWnn+ul2vK/eMhKcTVV5SstvsahWTzQdY9H2lYgb67Sz Q0ZeorkEr63j9rihXFYddDpQGCKBvYr5BnHqe9rk2w5XUzLGX/A670i3zvGyc1MGBkFf nF4/6g7PEXSKvPi1e3Ol68C72Bn6cjfM+4VND6MKyoZ2oc+cYjGfZWj601w1UP8or2nw fBaQ== X-Forwarded-Encrypted: i=1; AJvYcCUeNfYkNzUYjTvdfJlTVzqzvIGIoePzlZFSA/Ts5XH72d6x7svqMZgUqmt5Z5u5mKjJLDvdZfR7jCsnjYYF2nS7xlqPvqc=@freebsd.org, AJvYcCV/jI2NSVfqojA0Kh0Z02aye4v/a4TK3FgqmyJqb91B5iRxFIAdXyvWYjFsOD/JcfDTr6e+Cpy6i5vL8LZkzHI7r12I@freebsd.org X-Gm-Message-State: AOJu0YwfCmQwGPHlE+1KloYjhHV9LfwN0wKoFPGEasDy1QTBxSvHAkps Okgfj3fIqJme4kuuFS2aijbFQaxZICRgEPZ2GrIDIlLugvB61TRE975kpyQhvqho X-Gm-Gg: ASbGnct8UP38HmOIuuU4nsJkP9tuKQOkhMynVdEJXgFklqhFujQDUiAmKAdlHzyB5kQ pNdJVaGZAmXfULfUkqJpV+PiHGj5cK+SwajPbHaN5C+tfHj9mk5APOPo7y0uRapmknBRmQSWmx0 VzkjU7T4hILXcJuFITl2OfMTqLCpUsobTnvtR8Oy7wKcTpv2vsB/5PlXaqDiRwXndYYEBGzrXDL 0H0P9mWHjCED9rjrcsyqcUAOIFDyPeUKZe3jq7WwVTBxyx0hy2rtcnoqYcwjj6F4dOj5ztqG16a NC5BV7q3N8nUA+6kHOfz9V+OZWwBdcfHtWq6dNII+dKB1ZxbdAJdZSVoaXEPzsoXQbo2uHW9wwE nq9K2pr+KsYyMD+nmRmUIp5Uln5GHnmd99yIv X-Google-Smtp-Source: AGHT+IEELTq0g1zpp0jvD3hKjn+k8O5PCGnY7FfXtqgi0vvikymNKRjfnbF4HvMMQ5fnNIzY2lI9sQ== X-Received: by 2002:a05:620a:d95:b0:7e6:4f86:580d with SMTP id af79cd13be357-7e65f314cc7mr476514085a.30.1753792016359; Tue, 29 Jul 2025 05:26:56 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e668fd0d44sm21840885a.47.2025.07.29.05.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 05:26:55 -0700 (PDT) Date: Tue, 29 Jul 2025 08:26:52 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4brvjg1Ytlz3jDm X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > Author: Konstantin Belousov > AuthorDate: 2025-07-27 13:50:57 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-07-28 20:57:14 +0000 > > ufs_vnops.c: newparent is not bool > > Use proper comparision operators when we need to see if newparent was > set to not-zero value. > > Reviewed by: mckusick, olce > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D51573 > --- > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > index 406b8f943077..2757fb066981 100644 > --- a/sys/ufs/ufs/ufs_vnops.c > +++ b/sys/ufs/ufs/ufs_vnops.c > @@ -1476,7 +1476,7 @@ relock: > * the user must have write permission in the source so > * as to be able to change "..". > */ > - if (doingdirectory && newparent) { > + if (doingdirectory && newparent != 0) { > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > if (error) > goto unlockout; > @@ -1539,7 +1539,7 @@ relock: > if (tip == NULL) { > if (ITODEV(tdp) != ITODEV(fip)) > panic("ufs_rename: EXDEV"); > - if (doingdirectory && newparent) { > + if (doingdirectory && newparent != 0) { > /* > * Account for ".." in new directory. > * When source and destination have the same > @@ -1632,7 +1632,7 @@ relock: > goto bad; > } > if (doingdirectory) { > - if (!newparent) { > + if (newparent == 0) { > tdp->i_effnlink--; > if (DOINGSOFTDEP(tdvp)) > softdep_change_linkcnt(tdp); > @@ -1642,11 +1642,10 @@ relock: > softdep_change_linkcnt(tip); > } > error = ufs_dirrewrite(tdp, tip, fip->i_number, > - IFTODT(fip->i_mode), > - (doingdirectory && newparent) ? newparent : doingdirectory); > + IFTODT(fip->i_mode), doingdirectory); Is this part of the change correct? syzbot is reporting some panics after this change and commit c069ca085bd185eda4a90dc4bc2b76cceb74579d: https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > if (error) { > if (doingdirectory) { > - if (!newparent) { > + if (newparent == 0) { > tdp->i_effnlink++; > if (DOINGSOFTDEP(tdvp)) > softdep_change_linkcnt(tdp); > @@ -1669,7 +1668,7 @@ relock: > * disk, so when running with that code we avoid doing > * them now. > */ > - if (!newparent) { > + if (newparent == 0) { > tdp->i_nlink--; > DIP_SET_NLINK(tdp, tdp->i_nlink); > UFS_INODE_SET_FLAG(tdp, IN_CHANGE); > @@ -1698,7 +1697,7 @@ relock: > * parent directory must be decremented > * and ".." set to point to the new parent. > */ > - if (doingdirectory && newparent) { > + if (doingdirectory && newparent != 0) { > /* > * Set the directory depth based on its new parent. > */ From nobody Tue Jul 29 12:47:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brw9X2kWMz62xCt; Tue, 29 Jul 2025 12:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brw9X1pwsz3l6y; Tue, 29 Jul 2025 12:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1KC8nkubBSx8eVDs4ReGtByjFc8IkQyE1k5V+qrkgE=; b=qOTk24mD96V3LgWcf9C4mDu4xxnDlOnRYanz+b73X7FxQhuTLMl3T3G8cPm4Kyrs2+q1lO G/smaMv7EKbuWtikiDgMLp8t6E1yYBhqtAOnXdsGqV82OWHKFUg2bzDcdItBPq7PiJUGe6 LjCq/dCF7MvKiqxvmZyhiG+jFu/Phtpbqfrr9Z/1qm0eIGwF3KGDt53R8noT4iYUio/M96 GQFae+6YRffJHdaw/M8pjp+NoFODMYzdrgQf+aODz0AEJO9DNC7bLoarF5p7LwzuDQ/O20 LIpp9rMA7RKgJq4d1YYBqwpU8GHuQplPAbLb33LLXl0EXgyjWdlvu5cT3B/8/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1KC8nkubBSx8eVDs4ReGtByjFc8IkQyE1k5V+qrkgE=; b=hoyoxMF+KABsV9stHhLsI9xnoeB5/8G+MGqPpp3OiVEAQFjgkv9uPAGIzpOTFtDjGiBj2I w/ReotPPwSSKLMJELG5u9Lf1hW4jWv3q+TpHNHBT4UiXQDuZXp0mmG515KzkC7HMCpZLS0 rvrBWww3oOFwJ4wjLu3PxrlR8Lpg5rUu0uRH2PSUpRi0paAnlY0bFJDn7rGwttLWSnDfGP ymiTvFuARIwbtjJFASCVsnSNhQrPYLdD8n8X2sL665wS1jjEJUYl9YzCDZoQ9cm0V6bwSH 0F/NZ0pKwr/eE0CvhHRZKAgHHSODJSkd7GltPAJ7YHc/F9kfTRL0oScfgjAOlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793264; a=rsa-sha256; cv=none; b=wN284cDzK56IJCsa3pDjIFCDpWxDSUvSSRPjhajbIuWKGcy9uQaRYLt0kLtGc2obV+cw4W 8CLQHIENf8dX7ylJfE8ck74HqWgYW6zPgzp4cRiH8nMgyh98OJ8EVm4cD9IRfv4LceeTvB btutmoCSqhHzeo4aasE59uxDj0WjNY9Erg74+0bem8oC+HaY/2wbqk0neuBXPhbeWQG7sx HDx1Td/hEn7IZ5WeWaaGLqL7eMJSuAbK1Qs2N8Hr+EjOI8o6kYZOaGyImMtvj13x14bUKL 7rqNas7mzfs/njzabjlZRnh+yMBYU61PtlecJNq0O/Ak3Pje1GYbLHgEUO8CBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brw9X13cLzXq1; Tue, 29 Jul 2025 12:47:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TClh3c032685; Tue, 29 Jul 2025 12:47:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TClhiR032682; Tue, 29 Jul 2025 12:47:43 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:47:43 GMT Message-Id: <202507291247.56TClhiR032682@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: 98eb6f0eaa50 - main - ufs: restore conditional List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8 commit 98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8 Author: Konstantin Belousov AuthorDate: 2025-07-29 12:45:25 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-29 12:47:37 +0000 ufs: restore conditional Fixes: 610319c766e941de96e52f2d28fea9f8cfc51aeb Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/ufs/ufs/ufs_vnops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 2757fb066981..050b21c2be0b 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1642,7 +1642,8 @@ relock: softdep_change_linkcnt(tip); } error = ufs_dirrewrite(tdp, tip, fip->i_number, - IFTODT(fip->i_mode), doingdirectory); + IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? + newparent != 0: doingdirectory); if (error) { if (doingdirectory) { if (newparent == 0) { From nobody Tue Jul 29 12:49:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwC312VMz62xSk; Tue, 29 Jul 2025 12:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwC30f0Bz3lQX; Tue, 29 Jul 2025 12:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y78qBz+SWSFFuXKbpEu8YaRlrzUpecJRD5FU+bWDsYY=; b=L/AqhsG13hx6ZnRuh3Lk7Jd/rzHplvGjyLsTymyM2l3Vx/7x6P90nqPQSLJ3mlTHKElkvm ubF1kg+S3XgPqhrVgkZzZlQxTTZsJ7efRoRhA9elxHntBo5g4DpGfu+2iSk7+MPexi2QQO VieNiCDOH3abZv/VVfjCXxOC02nacyLknk5t7Z7gJ/WHrA5IIWQM4dc2KiyG+MnEFql+Dh U05ZKter5rtAvQ30sGYRFVLQ8EFGfVNqvSz78gwIe+/ihB8PUNNIci2eJfJk7UER+x5YC/ wQAmrCYfynzm81c0i+tkE/BJKAswYCgqeDfkRgl5YAz8MoGBUfj6ycPV+XXYvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y78qBz+SWSFFuXKbpEu8YaRlrzUpecJRD5FU+bWDsYY=; b=w2k6YOgNs82u3RpjxCQYbsSb0agW9mlOtEehV/xg5cQIkosn9PU6YRFn/CBaHIiGiZCa/x avrPHkKtDFF1brIbqFXUT3s0VOIZUv1F4yVoxiH5H8TI9TCL981kZWOrvp8Al8MsQ1MSeR wHGbR0YZu46QQRKJqEXW3bAN0TIuNyNbimwZ8AhlwWigENplayxZF8BHKL3FvUE/7cK/6Q hHFbcR/OnUcjf4NQYtIVxe3gSPQHUAMZXPt1Tl5s48En/I9c2M/iPkr9szdGunKTHnRBmE 7vFYFP51w9b5uPp5/dtdMK6eHeYOvxqtYAgG2AU4i/eX0LryB6YOXYA9bryktw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793343; a=rsa-sha256; cv=none; b=hHY2napPpdo6JF6B3fDpLFxrlKIvsyBqfKCL5bZbDliJTDPKEBUlMrkkrIN5kztXdFFn6h dvf00Ri+YvHe8urbqG1oQ0rLu1s1IQKiABdbOOz5ghK10ecg8eVvJ/8MytaJilCzZiXOeD Poc11IdU3jP48GF2LyKAiOSnzOKqug9+NXtx+ly8vCJGdEHsRacHa2ZNL81YbdQ5u1blod Gvxs5X3BgTrIdxtnCxvi60MqLAF7Rxr8MkniDD10iPQPBuklALnzY9q/rXYwfp9yP+odoa RKjR1gRt09m56c7vUmOHuBQ4HSaZylpwF+TQone1tLXcaBuRuSh9UhjmXO8dFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwC26pbSzY1h; Tue, 29 Jul 2025 12:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCn2N7033321; Tue, 29 Jul 2025 12:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCn25R033313; Tue, 29 Jul 2025 12:49:02 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:02 GMT Message-Id: <202507291249.56TCn25R033313@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: 10b3f2138573 - stable/14 - file: Add a fd flag with O_RESOLVE_BENEATH semantics List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 10b3f2138573da952b4db29f88f6d67cfc3300cd Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10b3f2138573da952b4db29f88f6d67cfc3300cd commit 10b3f2138573da952b4db29f88f6d67cfc3300cd Author: Mark Johnston AuthorDate: 2025-06-24 20:17:07 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 file: Add a fd flag with O_RESOLVE_BENEATH semantics The O_RESOLVE_BENEATH openat(2) flag restricts name lookups such that they remain under the directory referenced by the dirfd. This commit introduces an implicit version of the flag, FD_RESOLVE_BENEATH, stored in the file descriptor entry. When the flag is set, any lookup relative to that fd automatically has O_RESOLVE_BENEATH semantics. Furthermore, the flag is sticky, meaning that it cannot be cleared, and it is copied by dup() and openat(). File descriptors with FD_RESOLVE_BENEATH set may not be passed to fchdir(2) or fchroot(2). Various fd lookup routines are modified to return fd flags to the caller. This flag will be used to address a case where jails with different root directories and the ability to pass SCM_RIGHTS messages across the jail boundary can transfer directory fds in such as way as to allow a filesystem escape. PR: 262180 Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D50371 (cherry picked from commit f35525ff2053e026a423e852136d73ed93c95803) --- lib/libc/sys/fcntl.2 | 63 +++++++++++++++++++---------- sys/fs/fdescfs/fdesc_vnops.c | 4 +- sys/kern/kern_descrip.c | 95 ++++++++++++++++++++++++++++++++------------ sys/kern/uipc_syscalls.c | 2 +- sys/kern/vfs_acl.c | 4 +- sys/kern/vfs_cache.c | 14 +++++-- sys/kern/vfs_extattr.c | 8 ++-- sys/kern/vfs_syscalls.c | 21 +++++++--- sys/sys/fcntl.h | 2 + sys/sys/file.h | 2 +- sys/sys/filedesc.h | 8 +++- sys/sys/namei.h | 1 + 12 files changed, 156 insertions(+), 68 deletions(-) diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2 index 5de41f4c0476..fdd29c9f5d78 100644 --- a/lib/libc/sys/fcntl.2 +++ b/lib/libc/sys/fcntl.2 @@ -27,7 +27,7 @@ .\" .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" -.Dd December 7, 2021 +.Dd June 5, 2025 .Dt FCNTL 2 .Os .Sh NAME @@ -82,6 +82,11 @@ associated with the new file descriptor is cleared, so the file descriptor is to remain open across .Xr execve 2 system calls. +.It +The +.Dv FD_RESOLVE_BENEATH +flag, described below, will be set if it was set on the original +descriptor. .El .It Dv F_DUPFD_CLOEXEC Like @@ -115,29 +120,47 @@ Use instead of .Dv F_DUP2FD . .It Dv F_GETFD -Get the close-on-exec flag associated with the file descriptor -.Fa fd -as -.Dv FD_CLOEXEC . -If the returned value ANDed with -.Dv FD_CLOEXEC -is 0, -the file will remain open across -.Fn exec , -otherwise the file will be closed upon execution of +Get the flags associated with the file descriptor +.Fa fd . +The following flags are defined: +.Bl -tag -width FD_RESOLVE_BENEATH +.It Dv FD_CLOEXEC +The file will be closed upon execution of .Fn exec .Fa ( arg is ignored). +Otherwise, the file descriptor will remain open. +.It Dv FD_RESOLVE_BENEATH +All path name lookups relative to that file descriptor +will behave as if the lookup had +.Dv O_RESOLVE_BENEATH +or +.Dv AT_RESOLVE_BENEATH +semantics. +It is not permitted to call +.Xr fchdir 2 +or +.Xr fchroot 2 +on such a file descriptor. +The +.Dv FD_RESOLVE_BENEATH +flag is sticky, meaning that it is preserved by +.Xr dup 2 +and similar operations, and opening a directory with +.Xr openat 2 +where the directory descriptor has the flag set causes the new directory +descriptor to also have the flag set. +.El .It Dv F_SETFD -Set the close-on-exec flag associated with -.Fa fd -to -.Fa arg , -where -.Fa arg -is either 0 or -.Dv FD_CLOEXEC , -as described above. +Set flags associated with +.Fa fd . +The available flags are +.Dv FD_CLOEXEC +and +.Dv FD_RESOLVE_BENEATH . +The +.Dv FD_RESOLVE_BENEATH +flag cannot be cleared once set. .It Dv F_GETFL Get descriptor status flags, as described below .Fa ( arg diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 9c451aa9247a..47fb387a007e 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -504,7 +504,7 @@ fdesc_setattr(struct vop_setattr_args *ap) cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); } else { error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_SET), NULL, &fp); } if (error) { /* @@ -641,7 +641,7 @@ fdesc_readlink(struct vop_readlink_args *va) VOP_UNLOCK(vn); td = curthread; - error = fget_cap(td, fd_fd, &cap_no_rights, &fp, NULL); + error = fget_cap(td, fd_fd, &cap_no_rights, NULL, &fp, NULL); if (error != 0) goto out; diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 30be63d8e5d5..d84c97669320 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -111,8 +111,8 @@ static void fdgrowtable_exp(struct filedesc *fdp, int nfd); static void fdunused(struct filedesc *fdp, int fd); static void fdused(struct filedesc *fdp, int fd); static int fget_unlocked_seq(struct thread *td, int fd, - const cap_rights_t *needrightsp, struct file **fpp, - seqc_t *seqp); + const cap_rights_t *needrightsp, uint8_t *flagsp, + struct file **fpp, seqc_t *seqp); static int getmaxfd(struct thread *td); static u_long *filecaps_copy_prep(const struct filecaps *src); static void filecaps_copy_finish(const struct filecaps *src, @@ -529,7 +529,9 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) fde = fdeget_noref(fdp, fd); if (fde != NULL) { td->td_retval[0] = - (fde->fde_flags & UF_EXCLOSE) ? FD_CLOEXEC : 0; + ((fde->fde_flags & UF_EXCLOSE) ? FD_CLOEXEC : 0) | + ((fde->fde_flags & UF_RESOLVE_BENEATH) ? + FD_RESOLVE_BENEATH : 0); error = 0; } FILEDESC_SUNLOCK(fdp); @@ -540,8 +542,13 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) FILEDESC_XLOCK(fdp); fde = fdeget_noref(fdp, fd); if (fde != NULL) { + /* + * UF_RESOLVE_BENEATH is sticky and cannot be cleared. + */ fde->fde_flags = (fde->fde_flags & ~UF_EXCLOSE) | - (arg & FD_CLOEXEC ? UF_EXCLOSE : 0); + ((arg & FD_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | + ((arg & FD_RESOLVE_BENEATH) != 0 ? + UF_RESOLVE_BENEATH : 0); error = 0; } FILEDESC_XUNLOCK(fdp); @@ -2166,7 +2173,8 @@ _finstall(struct filedesc *fdp, struct file *fp, int fd, int flags, seqc_write_begin(&fde->fde_seqc); #endif fde->fde_file = fp; - fde->fde_flags = (flags & O_CLOEXEC) != 0 ? UF_EXCLOSE : 0; + fde->fde_flags = ((flags & O_CLOEXEC) != 0 ? UF_EXCLOSE : 0) | + ((flags & O_RESOLVE_BENEATH) != 0 ? UF_RESOLVE_BENEATH : 0); if (fcaps != NULL) filecaps_move(fcaps, &fde->fde_caps); else @@ -2914,7 +2922,7 @@ out: #ifdef CAPABILITIES int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, struct filecaps *havecapsp) + uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp) { struct filedesc *fdp = td->td_proc->p_fd; int error; @@ -2923,7 +2931,8 @@ fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, *fpp = NULL; for (;;) { - error = fget_unlocked_seq(td, fd, needrightsp, &fp, &seq); + error = fget_unlocked_seq(td, fd, needrightsp, flagsp, &fp, + &seq); if (error != 0) return (error); @@ -2954,10 +2963,10 @@ get_locked: #else int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, struct filecaps *havecapsp) + uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp) { int error; - error = fget_unlocked(td, fd, needrightsp, fpp); + error = fget_unlocked(td, fd, needrightsp, flagsp, fpp); if (havecapsp != NULL && error == 0) filecaps_fill(havecapsp); @@ -3040,7 +3049,7 @@ out: #ifdef CAPABILITIES int -fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp) { const struct filedescent *fde; const struct fdescenttbl *fdt; @@ -3050,7 +3059,7 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) const cap_rights_t *haverights; cap_rights_t rights; seqc_t seq; - int fd; + int fd, flags; VFS_SMR_ASSERT_ENTERED(); @@ -3070,7 +3079,9 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) return (EAGAIN); if (__predict_false(cap_check_inline_transient(haverights, &rights))) return (EAGAIN); - *fsearch = ((fp->f_flag & FSEARCH) != 0); + flags = fp->f_flag & FSEARCH; + flags |= (fde->fde_flags & UF_RESOLVE_BENEATH) != 0 ? + O_RESOLVE_BENEATH : 0; vp = fp->f_vnode; if (__predict_false(vp == NULL)) { return (EAGAIN); @@ -3104,17 +3115,19 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) #endif } *vpp = vp; + *flagsp = flags; return (0); } #else int -fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp) { + const struct filedescent *fde; const struct fdescenttbl *fdt; struct filedesc *fdp; struct file *fp; struct vnode *vp; - int fd; + int fd, flags; VFS_SMR_ASSERT_ENTERED(); @@ -3123,9 +3136,13 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) fdt = fdp->fd_files; if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) return (EBADF); - fp = fdt->fdt_ofiles[fd].fde_file; + fde = &fdt->fdt_ofiles[fd]; + fp = fde->fde_file; if (__predict_false(fp == NULL)) return (EAGAIN); + flags = fp->f_flag & FSEARCH; + flags |= (fde->fde_flags & UF_RESOLVE_BENEATH) != 0 ? + O_RESOLVE_BENEATH : 0; *fsearch = ((fp->f_flag & FSEARCH) != 0); vp = fp->f_vnode; if (__predict_false(vp == NULL || vp->v_type != VDIR)) { @@ -3141,6 +3158,7 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch) return (EAGAIN); filecaps_fill(&ndp->ni_filecaps); *vpp = vp; + *flagsp = flags; return (0); } #endif @@ -3154,13 +3172,15 @@ fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp) struct componentname *cnp; cap_rights_t rights; int error; + uint8_t flags; td = curthread; rights = *ndp->ni_rightsneeded; cap_rights_set_one(&rights, CAP_LOOKUP); cnp = &ndp->ni_cnd; - error = fget_cap(td, ndp->ni_dirfd, &rights, &fp, &ndp->ni_filecaps); + error = fget_cap(td, ndp->ni_dirfd, &rights, &flags, &fp, + &ndp->ni_filecaps); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_ops == &badfileops)) { @@ -3178,6 +3198,10 @@ fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp) */ if ((fp->f_flag & FSEARCH) != 0) cnp->cn_flags |= NOEXECCHECK; + if ((flags & UF_RESOLVE_BENEATH) != 0) { + cnp->cn_flags |= RBENEATH; + ndp->ni_resflags |= NIRES_BENEATH; + } fdrop(fp, td); #ifdef CAPABILITIES @@ -3225,7 +3249,7 @@ out_free: #ifdef CAPABILITIES static int fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, seqc_t *seqp) + uint8_t *flagsp, struct file **fpp, seqc_t *seqp) { struct filedesc *fdp; const struct filedescent *fde; @@ -3234,6 +3258,7 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, seqc_t seq; cap_rights_t haverights; int error; + uint8_t flags; fdp = td->td_proc->p_fd; fdt = fdp->fd_files; @@ -3245,6 +3270,7 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde_inline(fde); fp = fde->fde_file; + flags = fde->fde_flags; if (__predict_false(fp == NULL)) { if (seqc_consistent(fd_seqc(fdt, fd), seq)) return (EBADF); @@ -3273,19 +3299,21 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, fdrop(fp, td); } *fpp = fp; - if (seqp != NULL) { + if (flagsp != NULL) + *flagsp = flags; + if (seqp != NULL) *seqp = seq; - } return (0); } #else static int fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, seqc_t *seqp __unused) + uint8_t *flagsp, struct file **fpp, seqc_t *seqp __unused) { struct filedesc *fdp; const struct fdescenttbl *fdt; struct file *fp; + uint8_t flags; fdp = td->td_proc->p_fd; fdt = fdp->fd_files; @@ -3294,6 +3322,7 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, for (;;) { fp = fdt->fdt_ofiles[fd].fde_file; + flags = fdt->fdt_ofiles[fd].fde_flags; if (__predict_false(fp == NULL)) return (EBADF); if (__predict_false(!refcount_acquire_if_not_zero(&fp->f_count))) { @@ -3310,6 +3339,8 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, break; fdrop(fp, td); } + if (flagsp != NULL) + *flagsp = flags; *fpp = fp; return (0); } @@ -3323,8 +3354,8 @@ fget_unlocked_seq(struct thread *td, int fd, const cap_rights_t *needrightsp, * racing with itself. */ int -fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp) +fget_unlocked_flags(struct thread *td, int fd, const cap_rights_t *needrightsp, + uint8_t *flagsp, struct file **fpp) { struct filedesc *fdp; #ifdef CAPABILITIES @@ -3336,6 +3367,7 @@ fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, seqc_t seq; const cap_rights_t *haverights; #endif + uint8_t flags; fdp = td->td_proc->p_fd; fdt = fdp->fd_files; @@ -3348,8 +3380,10 @@ fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, fde = &fdt->fdt_ofiles[fd]; haverights = cap_rights_fde_inline(fde); fp = fde->fde_file; + flags = fde->fde_flags; #else fp = fdt->fdt_ofiles[fd].fde_file; + flags = fdt->fdt_ofiles[fd].fde_flags; #endif if (__predict_false(fp == NULL)) goto out_fallback; @@ -3373,12 +3407,21 @@ fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, #endif goto out_fdrop; *fpp = fp; + if (flagsp != NULL) + *flagsp = flags; return (0); out_fdrop: fdrop(fp, td); out_fallback: *fpp = NULL; - return (fget_unlocked_seq(td, fd, needrightsp, fpp, NULL)); + return (fget_unlocked_seq(td, fd, needrightsp, flagsp, fpp, NULL)); +} + +int +fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, + struct file **fpp) +{ + return (fget_unlocked_flags(td, fd, needrightsp, NULL, fpp)); } /* @@ -3530,7 +3573,7 @@ fget_mmap(struct thread *td, int fd, const cap_rights_t *rightsp, fdp = td->td_proc->p_fd; MPASS(cap_rights_is_set(rightsp, CAP_MMAP)); for (;;) { - error = fget_unlocked_seq(td, fd, rightsp, &fp, &seq); + error = fget_unlocked_seq(td, fd, rightsp, NULL, &fp, &seq); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_ops == &badfileops)) { @@ -3585,7 +3628,7 @@ fget_fcntl(struct thread *td, int fd, const cap_rights_t *rightsp, *fpp = NULL; MPASS(cap_rights_is_set(rightsp, CAP_FCNTL)); for (;;) { - error = fget_unlocked_seq(td, fd, rightsp, &fp, &seq); + error = fget_unlocked_seq(td, fd, rightsp, NULL, &fp, &seq); if (error != 0) return (error); error = cap_fcntl_check(fdp, fd, needfcntl); @@ -3647,7 +3690,7 @@ fgetvp_rights(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file *fp; int error; - error = fget_cap(td, fd, needrightsp, &fp, &caps); + error = fget_cap(td, fd, needrightsp, NULL, &fp, &caps); if (error != 0) return (error); if (fp->f_ops == &badfileops) { diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 4dca0522f707..86b3731468fa 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -93,7 +93,7 @@ getsock_cap(struct thread *td, int fd, const cap_rights_t *rightsp, struct file *fp; int error; - error = fget_cap(td, fd, rightsp, &fp, havecapsp); + error = fget_cap(td, fd, rightsp, NULL, &fp, havecapsp); if (__predict_false(error != 0)) return (error); if (__predict_false(fp->f_type != DTYPE_SOCKET)) { diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 58b950a04cd1..b4b1285400d3 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -435,7 +435,7 @@ sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) AUDIT_ARG_FD(uap->filedes); error = getvnode_path(td, uap->filedes, - cap_rights_init_one(&rights, CAP_ACL_GET), &fp); + cap_rights_init_one(&rights, CAP_ACL_GET), NULL, &fp); if (error == 0) { error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); @@ -570,7 +570,7 @@ sys___acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) AUDIT_ARG_FD(uap->filedes); error = getvnode_path(td, uap->filedes, - cap_rights_init_one(&rights, CAP_ACL_CHECK), &fp); + cap_rights_init_one(&rights, CAP_ACL_CHECK), NULL, &fp); if (error == 0) { error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); fdrop(fp, td); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 3942371c0962..bb9c68e05afc 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4441,17 +4441,23 @@ cache_fplookup_dirfd(struct cache_fpl *fpl, struct vnode **vpp) { struct nameidata *ndp; struct componentname *cnp; - int error; - bool fsearch; + int error, flags; ndp = fpl->ndp; cnp = fpl->cnp; - error = fgetvp_lookup_smr(ndp, vpp, &fsearch); + error = fgetvp_lookup_smr(ndp, vpp, &flags); if (__predict_false(error != 0)) { return (cache_fpl_aborted(fpl)); } - fpl->fsearch = fsearch; + if (__predict_false((flags & O_RESOLVE_BENEATH) != 0)) { + _Static_assert((CACHE_FPL_SUPPORTED_CN_FLAGS & RBENEATH) == 0, + "RBENEATH supported by fplookup"); + cache_fpl_smr_exit(fpl); + cache_fpl_aborted(fpl); + return (EOPNOTSUPP); + } + fpl->fsearch = (flags & FSEARCH) != 0; if ((*vpp)->v_type != VDIR) { if (!((cnp->cn_flags & EMPTYPATH) != 0 && cnp->cn_pnbuf[0] == '\0')) { cache_fpl_smr_exit(fpl); diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index dc1bbb58644b..831090f02f90 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -254,7 +254,7 @@ kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_TEXT(attrname); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_SET), NULL, &fp); if (error) return (error); @@ -442,7 +442,7 @@ kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_TEXT(attrname); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_GET), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_GET), NULL, &fp); if (error) return (error); @@ -598,7 +598,7 @@ kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_TEXT(attrname); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_DELETE), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_DELETE), NULL, &fp); if (error) return (error); @@ -765,7 +765,7 @@ kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace, AUDIT_ARG_FD(fd); AUDIT_ARG_VALUE(attrnamespace); error = getvnode_path(td, fd, - cap_rights_init_one(&rights, CAP_EXTATTR_LIST), &fp); + cap_rights_init_one(&rights, CAP_EXTATTR_LIST), NULL, &fp); if (error) return (error); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index d2a7b4d9d364..37dc48c6a297 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -375,7 +375,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) int error; AUDIT_ARG_FD(fd); - error = getvnode_path(td, fd, &cap_fstatfs_rights, &fp); + error = getvnode_path(td, fd, &cap_fstatfs_rights, NULL, &fp); if (error != 0) return (error); vp = fp->f_vnode; @@ -898,12 +898,17 @@ sys_fchdir(struct thread *td, struct fchdir_args *uap) struct mount *mp; struct file *fp; int error; + uint8_t fdflags; AUDIT_ARG_FD(uap->fd); - error = getvnode_path(td, uap->fd, &cap_fchdir_rights, + error = getvnode_path(td, uap->fd, &cap_fchdir_rights, &fdflags, &fp); if (error != 0) return (error); + if ((fdflags & UF_RESOLVE_BENEATH) != 0) { + fdrop(fp, td); + return (ENOTCAPABLE); + } vp = fp->f_vnode; vrefact(vp); fdrop(fp, td); @@ -1252,6 +1257,10 @@ success: else #endif fcaps = NULL; + if ((nd.ni_resflags & NIRES_BENEATH) != 0) + flags |= O_RESOLVE_BENEATH; + else + flags &= ~O_RESOLVE_BENEATH; error = finstall_refed(td, fp, &indx, flags, fcaps); /* On success finstall_refed() consumes fcaps. */ if (error != 0) { @@ -1939,7 +1948,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd, fp = NULL; if (fd != FD_NONE) { - error = getvnode_path(td, fd, &cap_no_rights, &fp); + error = getvnode_path(td, fd, &cap_no_rights, NULL, &fp); if (error != 0) return (error); } @@ -4326,12 +4335,12 @@ out: */ int getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp, - struct file **fpp) + uint8_t *flagsp, struct file **fpp) { struct file *fp; int error; - error = fget_unlocked(td, fd, rightsp, &fp); + error = fget_unlocked_flags(td, fd, rightsp, flagsp, &fp); if (error != 0) return (error); @@ -4368,7 +4377,7 @@ getvnode(struct thread *td, int fd, const cap_rights_t *rightsp, { int error; - error = getvnode_path(td, fd, rightsp, fpp); + error = getvnode_path(td, fd, rightsp, NULL, fpp); if (__predict_false(error != 0)) return (error); diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index c4c4207af4ff..7f8645e9eedf 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -290,6 +290,8 @@ typedef __pid_t pid_t; /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ +#define FD_RESOLVE_BENEATH 2 /* all lookups relative to fd have + O_RESOLVE_BENEATH semantics */ /* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */ #define F_RDLCK 1 /* shared or read lock */ diff --git a/sys/sys/file.h b/sys/sys/file.h index bad161d5d46b..7d1a191b4374 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -300,7 +300,7 @@ int fgetvp_read(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); int fgetvp_write(struct thread *td, int fd, const cap_rights_t *rightsp, struct vnode **vpp); -int fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, bool *fsearch); +int fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp); int fgetvp_lookup(struct nameidata *ndp, struct vnode **vpp); static __inline __result_use_check bool diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index ecb8c58e5d29..440c5d3d15f9 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -150,6 +150,7 @@ struct filedesc_to_leader { * Per-process open flags. */ #define UF_EXCLOSE 0x01 /* auto-close on exec */ +#define UF_RESOLVE_BENEATH 0x02 /* lookups must be beneath this dir */ #ifdef _KERNEL @@ -280,17 +281,20 @@ struct filedesc_to_leader * int getvnode(struct thread *td, int fd, const cap_rights_t *rightsp, struct file **fpp); int getvnode_path(struct thread *td, int fd, const cap_rights_t *rightsp, - struct file **fpp); + uint8_t *flagsp, struct file **fpp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); int fget_cap_noref(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp, struct file **fpp, struct filecaps *havecapsp); int fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, - struct file **fpp, struct filecaps *havecapsp); + uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp); /* Return a referenced file from an unlocked descriptor. */ int fget_unlocked(struct thread *td, int fd, const cap_rights_t *needrightsp, struct file **fpp); +int fget_unlocked_flags(struct thread *td, int fd, + const cap_rights_t *needrightsp, uint8_t *flagsp, + struct file **fpp); /* Return a file pointer without a ref. FILEDESC_IS_ONLY_USER must be true. */ int fget_only_user(struct filedesc *fdp, int fd, const cap_rights_t *needrightsp, struct file **fpp); diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 7033e5469240..dae714f97aef 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -195,6 +195,7 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, #define NIRES_ABS 0x00000001 /* Path was absolute */ #define NIRES_STRICTREL 0x00000002 /* Restricted lookup result */ #define NIRES_EMPTYPATH 0x00000004 /* EMPTYPATH used */ +#define NIRES_BENEATH 0x00000008 /* O_RESOLVE_BENEATH is to be inherited */ /* * Flags in ni_lcf, valid for the duration of the namei call. From nobody Tue Jul 29 12:49:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwC43030z62xQk; Tue, 29 Jul 2025 12:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwC4247Xz3lHb; Tue, 29 Jul 2025 12:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ckW9zw0MdTH3wfoLbkjlXtPIvjbxKSsU+mUI/xktN/U=; b=J8CzOP9zyqAbtTWsvDTXYBLWDasxBtWGT//dEdPDFeHnu5Acck6H2us3GcZJt+jzexy+K5 J3Ltpm6f12/Sz4seuTtBGcdapH71XRWqLZgML+cxVQg632EhHgFg4OQ+9JNCpYQfliNlQ3 JS8FBtTO9eMVkzjXNZFlAO6JAEJQSqr7tfjuwxUDYytfOx1w3CkDjrYB9M4Nw8kXQkcDr6 nq+QMFTXzo0rtP1bgxzw9udHXTmD1gLUKFmWf9wFKyPbHEujS7X2wUFkS2e27EuatY/Vt5 bFGU7cLunLW2MYGydtaEm0RgrjILindeGCGZWUkQWgyvpPRNw5qTneFLIZgRDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ckW9zw0MdTH3wfoLbkjlXtPIvjbxKSsU+mUI/xktN/U=; b=lCUZf1SGfg7sEAzySvJKGN0WQ4qmJeEyB/W/cz044FkOotOAayO/TZzNEIRY1rQDKOlEv+ hnN7lJRyMiZyTsuLWNF8StecEAL+YmhjMpingckfvTgtqxNqbU2QpGS/4qvCIaAH+E8OCa M8MhVRuca3tuWr6/ibBw9fe696eFuajZoOTHtcaLCQobFktSUjVtFoLE0pBRThcvcGmOgD yfIDb1JT9jb0X7xcnLWw07wdRZ2AZ+jt06mBfoVwe1Lj/v81w/tKkABKRboARpPRNKSG0a G0JUACBsd7KJ7hW/AD+bD9fdk9Aiqen/jQAUdpaPo9xO/Ref42j7QZIIyvylEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793344; a=rsa-sha256; cv=none; b=yQazE1FCRz79BRs3pq9covxl8mblJYYxlRW2hr38SqRZTGCqFPJ6IuJ904tkfLAjlj7T/X APuZIDtX9wDKyIG1mi7y7cxeCYEfNbauLirAp/sTg+J4vkEiyJtmtRp9nYC/znAgwbz3k0 L8CJ8IscNQzO5KypUdRsbiDgOpg8m/ILOMoTol029iJ2CLiENvRzH844kN55bazwQ5k3Nh FE07O+DnLoiSFHj1uLCEWVfMFcvnMpFMxKh/xplYb8z4s/Hoo5aJrzT5bLD2vz/K9/BZyt /50gXcm36aVdHJVGVvFa6xfdaN8UVvXg/YBoW97sejwsjfizFnZIRHNRkRuziw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwC40YbYzY1j; Tue, 29 Jul 2025 12:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCn3aP033361; Tue, 29 Jul 2025 12:49:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCn3CS033358; Tue, 29 Jul 2025 12:49:03 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:03 GMT Message-Id: <202507291249.56TCn3CS033358@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: 3ad3ab5f9b6e - stable/14 - unix: Set O_RESOLVE_BENEATH on fds transferred between 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 3ad3ab5f9b6e91efc923bae9799697a823eb7227 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3ad3ab5f9b6e91efc923bae9799697a823eb7227 commit 3ad3ab5f9b6e91efc923bae9799697a823eb7227 Author: Mark Johnston AuthorDate: 2025-06-24 20:05:37 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 unix: Set O_RESOLVE_BENEATH on fds transferred between jails If a pair of jails with different filesystem roots is able to exchange SCM_RIGHTS messages (e.g., using a unix socket in a shared nullfs mount), a process in one jail can open a directory outside of the root of the second jail and then pass the fd to that second jail, allowing the receiving process to escape the jail chroot. Address this using the new FD_RESOLVE_BENEATH flag. When externalizing an SCM_RIGHTS message into the receiving process, automatically set this flag on all new fds where a jail boundary is crossed. This ensures that the receiver cannot do more than access files underneath the directory; in particular, the received fd cannot be used to access vnodes not accessible by the sender. PR: 262179 Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D50371 (cherry picked from commit 350ba9672a7f4f16e30534a603df577dfd083b3f) --- sys/amd64/conf/SYZKALLER | 5 +++++ sys/kern/uipc_usrreq.c | 31 +++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/sys/amd64/conf/SYZKALLER b/sys/amd64/conf/SYZKALLER new file mode 100644 index 000000000000..965841313616 --- /dev/null +++ b/sys/amd64/conf/SYZKALLER @@ -0,0 +1,5 @@ +include GENERIC-KASAN +ident SYZKALLER + +options COVERAGE +options KCOV diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 80ac5cc0b775..4df36221bc6a 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -58,7 +58,6 @@ * need a proper out-of-band */ -#include #include "opt_ddb.h" #include @@ -68,6 +67,7 @@ #include #include #include +#include #include #include #include @@ -2433,22 +2433,34 @@ unp_freerights(struct filedescent **fdep, int fdcount) free(fdep[0], M_FILECAPS); } +static bool +restrict_rights(struct file *fp, struct thread *td) +{ + struct prison *prison1, *prison2; + + prison1 = fp->f_cred->cr_prison; + prison2 = td->td_ucred->cr_prison; + return (prison1 != prison2 && prison1->pr_root != prison2->pr_root && + prison2 != &prison0); +} + static int unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) { struct thread *td = curthread; /* XXX */ struct cmsghdr *cm = mtod(control, struct cmsghdr *); - int i; int *fdp; struct filedesc *fdesc = td->td_proc->p_fd; struct filedescent **fdep; void *data; socklen_t clen = control->m_len, datalen; - int error, newfds; + int error, fdflags, newfds; u_int newlen; UNP_LINK_UNLOCK_ASSERT(); + fdflags = (flags & MSG_CMSG_CLOEXEC) ? O_CLOEXEC : 0; + error = 0; if (controlp != NULL) /* controlp == NULL => free control messages */ *controlp = NULL; @@ -2490,11 +2502,14 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) *controlp = NULL; goto next; } - for (i = 0; i < newfds; i++, fdp++) { - _finstall(fdesc, fdep[i]->fde_file, *fdp, - (flags & MSG_CMSG_CLOEXEC) != 0 ? O_CLOEXEC : 0, - &fdep[i]->fde_caps); - unp_externalize_fp(fdep[i]->fde_file); + for (int i = 0; i < newfds; i++, fdp++) { + struct file *fp; + + fp = fdep[i]->fde_file; + _finstall(fdesc, fp, *fdp, fdflags | + (restrict_rights(fp, td) ? + O_RESOLVE_BENEATH : 0), &fdep[i]->fde_caps); + unp_externalize_fp(fp); } /* From nobody Tue Jul 29 12:49:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwC52V27z62x43; Tue, 29 Jul 2025 12:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwC51cDbz3lRt; Tue, 29 Jul 2025 12:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sCIeVVbgC3OZ/GvDKtYDwb8z6C0vfk4eKJTE6FoesZ4=; b=BHcvEqi0zbhGzz7kV2jSASqG2bNt3K9gyS75tEmib0dr3khPMxANuyVYVLw3YnzSlcohU2 oHuEnS4vhy5w/SF0vVIb8OmmIc/yItZ+3kaFrPbDDViVJM+79udAnDMw2fft8eSyFZvUCk YEVbteLTA9kTsGkK3/Iwq5eB10ZQ5rK++4e3oMfeJpIPuT8ou2JLFmFQwfllTwa3ABqIXn yjWCgg+hyOlLdnR/BFS2Mw5H/XBY5QzrjrpfgJVjwWf/8hz32d0ip+mRvyxgcYKTduKipg 0lGixk4F00oadzLnIGqL6ccAok824n9CPRwZvV92TWDhkkV0qgWWmAJJ1xJMvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sCIeVVbgC3OZ/GvDKtYDwb8z6C0vfk4eKJTE6FoesZ4=; b=iFFiq3Ze5wTtK8Q2Kx5c4Z3Yp3TRl3EZ5B4g3prt4rferjXBgT39V6b/t1VZEH+cDqDEbK 50KR3qDimZGqsUdDy05lCRKbslyn6Ysa4zbyzM1teiUTTlFUvgRZLupeVc48y3WmAt6zhA /Ssk9YsReVGgi37SpPzOS8rw2JalQM5DsqPDgqOsTq79Ls0Mp/45MQN4SyA7YHF746lsWW 55vEbTLlD5JXm6IafRuGVJdmyDknxqPEFS3OLpwR02+Z7yhsYumLArQDTnOvVhu9GC8sK4 AsBYHrqnWmQ5sABU8QBWqASmDrPTCrApP1+Ajn+Y5ZA44OevNhj4PGOuMsGthQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793345; a=rsa-sha256; cv=none; b=MfRRN7B/kz2vFZExEBGD6JXcQ+ovMErOQDQZaT9zIuTmWWefFKGmhGostD6+FdsDtgx78t DpsBdQyCHw2SzQzRvW2AkiFwpaVIbVRTGX970uKUUCl21Jkd1PD209uJv9+Mttq02ABCxl YYiX06l5D9pqDtHq5zt0TMoyCMss3G04IRwPAY6tDVea9CRwITstuSRr1VcMA4BttwOPVy R1nYrkpjmOdd3BjyxKrdmFWDFxzwT3IE4HsmyKy3s5GqeEKVpIomN9taqHPODkgL3C2DeC GgxT+8DGtWcL4UJVCYcgaHVHoT/D2lPZd/YVWvW2/DPEy/TvASHmEovm8sD8EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwC51B1hzXVp; Tue, 29 Jul 2025 12:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCn5HR033397; Tue, 29 Jul 2025 12:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCn57J033393; Tue, 29 Jul 2025 12:49:05 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:05 GMT Message-Id: <202507291249.56TCn57J033393@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: ac2279ea57b7 - stable/14 - unix/tests: Add a regression test for fd transfer across 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: ac2279ea57b72d688cf0af5a6fa7f5dbd1d4521b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ac2279ea57b72d688cf0af5a6fa7f5dbd1d4521b commit ac2279ea57b72d688cf0af5a6fa7f5dbd1d4521b Author: Mark Johnston AuthorDate: 2025-06-24 20:08:22 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 unix/tests: Add a regression test for fd transfer across jails MFC after: 3 weeks (cherry picked from commit 5843b8ee02e99527c28f579acfc1f48e10033529) --- tests/sys/kern/Makefile | 2 + tests/sys/kern/unix_passfd_test.c | 131 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index cb6c3066a03d..ba53e8ffe40d 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -88,6 +88,8 @@ LIBADD.sendfile_helper+= pthread LIBADD.fdgrowtable_test+= util pthread kvm procstat LIBADD.sigwait+= rt LIBADD.ktrace_test+= sysdecode +LIBADD.unix_passfd_dgram+= jail +LIBADD.unix_passfd_stream+= jail NETBSD_ATF_TESTS_C+= lockf_test NETBSD_ATF_TESTS_C+= mqueue_test diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c index d8c0efe5b9ea..dd68020e1bc4 100644 --- a/tests/sys/kern/unix_passfd_test.c +++ b/tests/sys/kern/unix_passfd_test.c @@ -28,15 +28,19 @@ #include #include +#include #include #include #include #include #include #include +#include +#include #include #include +#include #include #include #include @@ -946,6 +950,132 @@ ATF_TC_BODY(empty_rights_message, tc) (void)close(putfd); } +ATF_TC_WITH_CLEANUP(cross_jail_dirfd); +ATF_TC_HEAD(cross_jail_dirfd, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(cross_jail_dirfd, tc) +{ + int error, sock[2], jid1, jid2, status; + pid_t pid1, pid2; + + domainsocketpair(sock); + + error = mkdir("./a", 0755); + ATF_REQUIRE(error == 0); + error = mkdir("./b", 0755); + ATF_REQUIRE(error == 0); + error = mkdir("./c", 0755); + ATF_REQUIRE(error == 0); + error = mkdir("./a/c", 0755); + ATF_REQUIRE(error == 0); + + jid1 = jail_setv(JAIL_CREATE, + "name", "passfd_test_cross_jail_dirfd1", + "path", "./a", + "persist", NULL, + NULL); + ATF_REQUIRE_MSG(jid1 >= 0, "jail_setv: %s", jail_errmsg); + + jid2 = jail_setv(JAIL_CREATE, + "name", "passfd_test_cross_jail_dirfd2", + "path", "./b", + "persist", NULL, + NULL); + ATF_REQUIRE_MSG(jid2 >= 0, "jail_setv: %s", jail_errmsg); + + pid1 = fork(); + ATF_REQUIRE(pid1 >= 0); + if (pid1 == 0) { + ssize_t len; + int dfd, error; + char ch; + + error = jail_attach(jid1); + if (error != 0) + err(1, "jail_attach"); + + dfd = open(".", O_RDONLY | O_DIRECTORY); + if (dfd < 0) + err(1, "open(\".\") in jail %d", jid1); + + ch = 0; + len = sendfd_payload(sock[0], dfd, &ch, sizeof(ch)); + if (len == -1) + err(1, "sendmsg"); + + _exit(0); + } + + pid2 = fork(); + ATF_REQUIRE(pid2 >= 0); + if (pid2 == 0) { + int dfd, dfd2, error, fd; + char ch; + + error = jail_attach(jid2); + if (error != 0) + err(1, "jail_attach"); + + /* Get a directory from outside the jail root. */ + recvfd_payload(sock[1], &dfd, &ch, sizeof(ch), + CMSG_SPACE(sizeof(int)), 0); + + if ((fcntl(dfd, F_GETFD) & FD_RESOLVE_BENEATH) == 0) + errx(1, "dfd does not have FD_RESOLVE_BENEATH set"); + + /* Make sure we can't chdir. */ + error = fchdir(dfd); + if (error == 0) + errx(1, "fchdir succeeded"); + if (errno != ENOTCAPABLE) + err(1, "fchdir"); + + /* Make sure a dotdot access fails. */ + fd = openat(dfd, "../c", O_RDONLY | O_DIRECTORY); + if (fd >= 0) + errx(1, "openat(\"../c\") succeeded"); + if (errno != ENOTCAPABLE) + err(1, "openat"); + + /* Accesses within the sender's jail root are ok. */ + fd = openat(dfd, "c", O_RDONLY | O_DIRECTORY); + if (fd < 0) + err(1, "openat(\"c\")"); + + dfd2 = openat(dfd, "", O_EMPTY_PATH | O_RDONLY | O_DIRECTORY); + if (dfd2 < 0) + err(1, "openat(\"\")"); + if ((fcntl(dfd2, F_GETFD) & FD_RESOLVE_BENEATH) == 0) + errx(1, "dfd2 does not have FD_RESOLVE_BENEATH set"); + + _exit(0); + } + + error = waitpid(pid1, &status, 0); + ATF_REQUIRE(error != -1); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + error = waitpid(pid2, &status, 0); + ATF_REQUIRE(error != -1); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + closesocketpair(sock); +} +ATF_TC_CLEANUP(cross_jail_dirfd, tc) +{ + int jid; + + jid = jail_getid("passfd_test_cross_jail_dirfd1"); + if (jid >= 0 && jail_remove(jid) != 0) + err(1, "jail_remove"); + jid = jail_getid("passfd_test_cross_jail_dirfd2"); + if (jid >= 0 && jail_remove(jid) != 0) + err(1, "jail_remove"); +} + ATF_TP_ADD_TCS(tp) { @@ -964,6 +1094,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, truncated_rights); ATF_TP_ADD_TC(tp, copyout_rights_error); ATF_TP_ADD_TC(tp, empty_rights_message); + ATF_TP_ADD_TC(tp, cross_jail_dirfd); return (atf_no_error()); } From nobody Tue Jul 29 12:49:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwC64BWwz62xSq; Tue, 29 Jul 2025 12:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwC62fBCz3lS2; Tue, 29 Jul 2025 12:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dPrrD95xI9ljqFLKOqRgms+GhvWSemkVG93qZs+8fdI=; b=Aza2EaFPkP12ruyCGBm8GiLQ+sPbRUnOcNRNi7FOca7B72A9lfeDCFt853VfvuRpu2sUYJ QIo7rwyeM6rg+J+pNPUv0J4KfnG8ZsvdWqxn+H5k1aUBwD9jZ3RwRvRm+zcwBq+hb6gGZm tOkMB2AoxZIAQkQ16UUkJobElAUNwAGMphoemkhD5g72XLjbYKOOp1rjpAxUplLywbol65 iegwFIhlB3tklla0cECKaxwqvv4tzyrEG7VBL9vxqvb6INJg6H8CjfZnplxJriMMmslPnS c9bc383MU1LBXMuEGkoAInf0dr5d3LEw6n3BoxAifDQe2VrMLoSA1ZAXZeTrEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dPrrD95xI9ljqFLKOqRgms+GhvWSemkVG93qZs+8fdI=; b=FVCf/PUqzsafKTt23MoVw8be34HfDneK4hev8056YKn6kN+805Z4YqeRiEL9/Tup0iZrKR J53E3ie20YJsGg4kxLF/WB2man87QZtg2Jbl6GCN7irMmaxA+o1xSYeTnF1nF66IOWYuiQ cv+MdHVPSsKef8CxerZuSzhMAVvBAnZOrJvgRvWqLBMtZ7NXNHlhiy+5tI4D6GjeBXDWDu WZ9kGP1rdtyOVNHdQGSc3QQrHwYJLcCstq7RZjBOzydhlEq35P6A888+2wZnYBOt+6pzPU xAt9bUkkD6ooi+5Ki5l2kAjNC4I1aJEDTew/NoqhZlqkILwmByhVnMv3Zq6PnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793346; a=rsa-sha256; cv=none; b=jElD5JJ9SMAL/voF1JjZlJAvIgTkEUKGcRBVNsWu0LU0x+RsvSLRp8nkLJnP4KtaINdclj En8VmElWpOlrgX5d0bArETj7+Mbipi47MvUaQMgCd+/w3Yy+Mox5YEv/EyATlMnCUZfwL4 S1jdHEKCmivWaJsluWtClkEE6VOTqiiNJPaR/NNBbMwuzEWvPJLYBBmV4n3i+BI78Ur1jO iqW8/vHvsGHI430PCfjVJC5gsri9O4IRBkmeRZpITW+AS4pkawhuQu7xuf1lIOkskXrG9I 8R/yebSgExDNwB3uDiZBPnI9HgzzOQwMAPSRJB43iJuwo7k4u6bqB6TftBKJqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwC61m9mzXVq; Tue, 29 Jul 2025 12:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCn6i9033431; Tue, 29 Jul 2025 12:49:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCn61H033428; Tue, 29 Jul 2025 12:49:06 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:06 GMT Message-Id: <202507291249.56TCn61H033428@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: afe2a4025c1f - stable/14 - savecore/tests: Serialize the livedump test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: afe2a4025c1fbb9efb62bfbe59e50e573c7124d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=afe2a4025c1fbb9efb62bfbe59e50e573c7124d3 commit afe2a4025c1fbb9efb62bfbe59e50e573c7124d3 Author: Mark Johnston AuthorDate: 2025-07-02 15:04:25 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 savecore/tests: Serialize the livedump test It assumes that the output of kldstat doesn't change over the course of the test, but this isn't true with parallel tests enabled. MFC after: 2 weeks (cherry picked from commit 3e041faa828a359ef0b91b5203eed5ab2c11e42d) --- sbin/savecore/tests/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/savecore/tests/Makefile b/sbin/savecore/tests/Makefile index 81e6b8ce2667..7ec3c9aeedcc 100644 --- a/sbin/savecore/tests/Makefile +++ b/sbin/savecore/tests/Makefile @@ -1,3 +1,6 @@ ATF_TESTS_SH= livedump_test log_test +# The test fails if any kernel modules are loaded while the test is running. +TEST_METADATA.livedump_test+= is_exclusive=true + .include From nobody Tue Jul 29 12:49:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwC75cSFz62xSr; Tue, 29 Jul 2025 12:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwC72x1mz3lBw; Tue, 29 Jul 2025 12:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=421g4m5ZJfF70pZesdQLNvZsLd16Dq7FpZGtNyBcGz0=; b=blvGMp+6a0LGfaqHO754LogxfylajkkjNtJEAwZnzqNDIBn8wJQZZg2D4HvwXtrYTaV5XE YKXul9nB4Pkff6wUGInCWlK0l2peBEDdvP5yJhQX3goaiU0ybtflfbW0opbG0M59hbj/5W Th9Dumfe5lmsRC9ZRFYBNDtmV5tnAvv7dXu/D0nSX7eV+4Dhc0McVZt+/zCM6xthMT27dc Z6TD6PBCajWlO1GgpLPf++8bLf6tJAX6a3+29l0u+UcDpFF5Vw0FWL/or502uNXVcwOJkn GKxtVZ+gHXeKSziUuNX+sMl1uEmIu+xfKXuQLur3kxC2Ale2WfEyVtrVrdgDlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=421g4m5ZJfF70pZesdQLNvZsLd16Dq7FpZGtNyBcGz0=; b=GXsKaJOvq9eCcYrHwGVOqW+2hDzvhMa/QkWCObe3c1X/+XTBkejBCztWXTtIlxuAyXnrgA y1arbovVs8X1NiNFNhL2/hwbCzDn7Mx60zFSkk4F8Hio7hMV183zJOSOO+4hr9VfpZSz/4 a/093jjQq7V9zdmevu+J+oqvoEbALSKcBkq9bICB87CgcKuOoIawFByYrdS5KQcamz4QVE k0VNduqCkgqbfSI22GhErzZmveMDZB1mK+gQduKTlQJFm+W3ICs/BabXkMaiS73CZNjh4w 7Xv75sh/u9CQjpCGmQcQRJTikJdostsXzWtglplMLMWecBscqbTx0j9M2Oz1TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793347; a=rsa-sha256; cv=none; b=PdmWEplI1JVu84aSLnVgtHXdXccRvrEJDXNtr0RwxqGYwxtC4pe+OE0Ydw05fe2GhLzeb4 kBHqfsLD6VUaPj1IeB/SZtbJWXXRGPh46ZsWkwokrNT0w0FviYqLlvKaKAZQAKXGSGyvxS n3h/vm6YaLgaYbbrrJbjL0QP4CP3j392Tyj6Ldzpt5GXLTusOG48uuH9x6s8zqmKX7zNxT EIXmGNGvXDPqLS+1+mEuwud+xX07W8mNnV1IwoOqoNos1AkJxL9zJeQvl9KCZGOv7OLo5g 22sFfnKwFuS9g0+ZagdyUZlInitNSVo+nfweFusrAO9kUPkTPV/des6V9LKm2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwC726VHzXq2; Tue, 29 Jul 2025 12:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCn73e033464; Tue, 29 Jul 2025 12:49:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCn7xb033461; Tue, 29 Jul 2025 12:49:07 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:07 GMT Message-Id: <202507291249.56TCn7xb033461@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: cd0359507027 - stable/14 - lposix: Use reentrant passwd and group lookup functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cd03595070272fa97b0f3c9ca78e9d828918580b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cd03595070272fa97b0f3c9ca78e9d828918580b commit cd03595070272fa97b0f3c9ca78e9d828918580b Author: Mark Johnston AuthorDate: 2025-07-04 19:06:10 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 lposix: Use reentrant passwd and group lookup functions The implementation of chown() in the posix module handles user and group names as well as numeric IDs. When resolving names, be sure to use reentrant lookup functions rather than assuming it's safe to clobber the internal buffers used by getpwnam() and getgrnam(). Fix some style nits while here. Reviewed by: imp, bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46555 (cherry picked from commit 88d94ead7f7cfb7ea7c4134b4cd2f89da670a8e1) --- libexec/flua/modules/lposix.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/libexec/flua/modules/lposix.c b/libexec/flua/modules/lposix.c index fa3fd5f8e589..bc55f35a942a 100644 --- a/libexec/flua/modules/lposix.c +++ b/libexec/flua/modules/lposix.c @@ -68,19 +68,24 @@ lua_chown(lua_State *L) { int n; const char *path; - uid_t owner = (uid_t) -1; - gid_t group = (gid_t) -1; + uid_t owner = (uid_t)-1; + gid_t group = (gid_t)-1; + int error; n = lua_gettop(L); luaL_argcheck(L, n > 1, n, "chown takes at least two arguments"); path = luaL_checkstring(L, 1); if (lua_isinteger(L, 2)) - owner = (uid_t) lua_tointeger(L, 2); + owner = (uid_t)lua_tointeger(L, 2); else if (lua_isstring(L, 2)) { - struct passwd *p = getpwnam(lua_tostring(L, 2)); - if (p != NULL) - owner = p->pw_uid; + char buf[4096]; + struct passwd passwd, *pwd; + + error = getpwnam_r(lua_tostring(L, 2), &passwd, + buf, sizeof(buf), &pwd); + if (error == 0) + owner = pwd->pw_uid; else return (luaL_argerror(L, 2, lua_pushfstring(L, "unknown user %s", @@ -93,11 +98,15 @@ lua_chown(lua_State *L) } if (lua_isinteger(L, 3)) - group = (gid_t) lua_tointeger(L, 3); + group = (gid_t)lua_tointeger(L, 3); else if (lua_isstring(L, 3)) { - struct group *g = getgrnam(lua_tostring(L, 3)); - if (g != NULL) - group = g->gr_gid; + char buf[4096]; + struct group gr, *grp; + + error = getgrnam_r(lua_tostring(L, 3), &gr, buf, sizeof(buf), + &grp); + if (error == 0) + group = grp->gr_gid; else return (luaL_argerror(L, 3, lua_pushfstring(L, "unknown group %s", From nobody Tue Jul 29 12:49:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwC949qwz62xMv; Tue, 29 Jul 2025 12:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwC84Jvlz3lNb; Tue, 29 Jul 2025 12:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KiwhLSEKmGE/vwaJuiSEGWpsi+2A/5GYNJayDP85l8w=; b=YkAx8wj1Oeqbay4HZgs8oQ8fBl1T37iV+V0vNtrqLN09+iEOfh5jPUTXh1Ymuq46C8LguB Zcy3EdAtzysnl4QdCgzFg+yukz3Gf6Uzv45RYpFi49eZVgHJL3WFn9P5+BPHBvhpjRqbM6 cj18nBtl/28VSGhP6VDQrp6WsGmJu5YNDQxV/CeAocwiF1DxdCeoYCYAKfm7egi4a8WDmy TSZytJvP6f77yStXnrYEHK4fpMydDVIZOhYptDpRhJQ7qq0ofpph1VtmLtf9p16DRzlmor 6MttkgZZWbsibCQGa3RhhfTX81enmZQJR5Qb95SYNUl/l+UlPZXs0Ys5qOiDDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KiwhLSEKmGE/vwaJuiSEGWpsi+2A/5GYNJayDP85l8w=; b=cM0CTQ+7M8aPbO83B4j8lClDsx6OGkOgMF4dRhaP8gmYxgs8V5Iv7bWH+d2BLHfriHEZxn vDlwtWlmNsbApg5Ox7bWeQPEK1dP53HFZthK9mt8ESV8ueijT9BXI/9h/E0KAwFNhclrGr eRy0N8MqcQSlPpH6QXCnxsb2PZTtiW3njYZ1vE+k8eEV5uPVaAwEcI14/C05ZZtVM66vv7 QRil+LJJwSkKc5fBG4uh/e3eRT4KyCbFx4t2tSIGyvDwsz6HEsckzT9l/nzgxMoYXBejbU SM4mvk+McwKe7bImAo/BM/q3iygTjK5eby7IfM1JcAF20Me0a5VbUbbFBbdLQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793348; a=rsa-sha256; cv=none; b=TQw9AiK+MWWDGd5WwP1I5uJQc5V/pmwfMLaL8PbhTZKWI73x9OC9Rl3fnyw70qtgfrscBm BQtUkJBKuDQgMdWT/P0HnTXf1FmqOgtVVb6Idbky9fXKSKjnTdni2Edm6DQl5kuapmY+Pw j+HIhbZtqphLZB3HSOHaqNotLQC5/BpeEQT7upQgkZyuzeXujAR9tKe6KH3A6gY/nDdOJs 2bVNSwxzlRDUeCuQG5C5qvNeKWzH2LQVvKL82hKNifjOzSvdSkLTjn5qtN4tB5Bw9oRKoP ZIVAD6BVg8R9tJ0gaKF+y4/PjYwN5II3iyl7Fn5YDZGjzapIdVhHyimUBEgA8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwC82y83zXNx; Tue, 29 Jul 2025 12:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCn82D033497; Tue, 29 Jul 2025 12:49:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCn8MF033494; Tue, 29 Jul 2025 12:49:08 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:08 GMT Message-Id: <202507291249.56TCn8MF033494@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: e9e13081931f - stable/14 - dtrace: fix symbol address resolution List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: e9e13081931f7dbe8e785d15502b07aab6267b26 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e9e13081931f7dbe8e785d15502b07aab6267b26 commit e9e13081931f7dbe8e785d15502b07aab6267b26 Author: Jiacong Fang AuthorDate: 2025-07-07 18:51:51 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 dtrace: fix symbol address resolution Dtrace assumes only ELF sections of type SHT_PROGBITS or SHT_NOBITS occupy memory space. However, sections with SHF_ALLOC flag also consume memory space. Moreover, the symbol address initialization skips symbols at the very beginning of a section in ET_REL KLDs. Fix: Check section flag for calculating section offset, and disable the skipping at the beginning of a section. PR: 288000 Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51188 (cherry picked from commit 12bef37a824c52582ee8f38699b8ae4fde17068d) --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 2a0386c33124..f6a328bb9b39 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -109,8 +109,7 @@ dt_module_syminit32(dt_module_t *dmp) if (sym->st_name == 0 || sym->st_name >= ss_size) continue; /* skip null or invalid names */ - if (sym->st_value != 0 && - (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) { + if (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) { asrsv++; /* reserve space in the address map */ #if defined(__FreeBSD__) @@ -159,8 +158,7 @@ dt_module_syminit64(dt_module_t *dmp) if (sym->st_name == 0 || sym->st_name >= ss_size) continue; /* skip null or invalid names */ - if (sym->st_value != 0 && - (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) { + if (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) { asrsv++; /* reserve space in the address map */ #if defined(__FreeBSD__) sym->st_value += (Elf_Addr) dmp->dm_reloc_offset; @@ -245,8 +243,7 @@ dt_module_symsort32(dt_module_t *dmp) for (i = 1; i < n; i++, dsp++) { Elf32_Sym *sym = symtab + dsp->ds_symid; - if (sym->st_value != 0 && - (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) + if (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) *sympp++ = sym; } @@ -269,8 +266,7 @@ dt_module_symsort64(dt_module_t *dmp) for (i = 1; i < n; i++, dsp++) { Elf64_Sym *sym = symtab + dsp->ds_symid; - if (sym->st_value != 0 && - (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) + if (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size) *sympp++ = sym; } @@ -1218,7 +1214,7 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) continue; /* skip any malformed sections */ if (sh.sh_size == 0) continue; - if (sh.sh_type == SHT_PROGBITS || sh.sh_type == SHT_NOBITS) { + if (sh.sh_flags & SHF_ALLOC) { alignmask = sh.sh_addralign - 1; mapbase += alignmask; mapbase &= ~alignmask; From nobody Tue Jul 29 12:49:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwC974qGz62xQr; Tue, 29 Jul 2025 12:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwC954DJz3lSs; Tue, 29 Jul 2025 12:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fKz3XhMk18ZZ74YqDAOufgX0tXNPTnFYAcoxjewXFOY=; b=pMsg8X98ayA0J7yoqPzQxpc9TFKV8MUFAl8KSMje66YNefYUHV8wqVDDBmWB4XDO+ORPmF Oju3jWCxO/LsDnMNUiUe3uZs8RfDw7iGla+j3/eS3r5yPhcMOXTmWw76Ez7yas+uo8VIA1 BsfNv7rh7JcKXVrUqXUvMUhpAC6L6yh98gRmI01GkazwaczEzpmYqUNeQ+rwnJ/L07jegk RxNXE9vpN+wy0uVkaLEJEA6HlQQ4Q7ALsD+3yp3ZE9eeskN5FP/NWDvXcLVjADhCFDYGX2 NNqsq1hdKta3iNauxK3p8Rr+OU67/d/y7CoOzsBr+YcCiSbFKUzVCHF0009fJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fKz3XhMk18ZZ74YqDAOufgX0tXNPTnFYAcoxjewXFOY=; b=uwwtuXntQNVrdB8xxfthGUR+WJEDSmoQb0mO2NtBdgPmPRe27PYDpNk5jmkc/btiyAcS14 hejVzdBYVbas44tKTqrkd6h6GMRRAEpqMRm4d9EguN2cdnX+0T/xS1xtInle2cjMkOjH9W IhfPNQChOyW8nuP4p2FtfTF/8bPpkM6w+n1/FUCtmF0puH4K1VVpqigzfQWm2JXufi8B94 cwN7pyawBWQECLq0yFyydqa4HK6/uOEin3ujbgOtCPVovchjJvRQ+QmQETJj0HlUiEAsNE 90nOEPWA2mm5uSAyWYaA5HH8axevmSVvSqDPcYHb0n0xBV15/toylarK0Nyvaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793349; a=rsa-sha256; cv=none; b=gyIGatPbFQPEVwWXIBWNpTBwXXzMmFU2KOSs8l177vI/onbX5BjLvGHBvc4lymHOksAvWo T0kabF0F/lYfWAY9FBv3j36QGO+wXjORRvV1/W88ud12Hv51MxMf7mSqkIYo6EucrDONpo he2G8hsnKvCt6Y/gjI7sEyl+MxyxrADlPZx+XwDriq13yBm48T4JoVaOv1WgD9TYbe6i4N 7WLR37eAkl9A8eqkerWCD/SihOiEkl6bnIeQAISvBvTlqmThRhquFub53eWfCKhbEKg8X4 +tG5g/ENZ30LopEZRsibVXMUEQX9KT5mJh8FFZH+jHQMXzJgJhU7EPw20nfNDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwC93vydzXNy; Tue, 29 Jul 2025 12:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCn9Jh033535; Tue, 29 Jul 2025 12:49:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCn9Y4033532; Tue, 29 Jul 2025 12:49:09 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:09 GMT Message-Id: <202507291249.56TCn9Y4033532@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: 414a01b9e62b - stable/14 - mkimg: Add a reproducible mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 414a01b9e62bdd6b10bbae87b0df52983bf4ca14 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=414a01b9e62bdd6b10bbae87b0df52983bf4ca14 commit 414a01b9e62bdd6b10bbae87b0df52983bf4ca14 Author: Mark Johnston AuthorDate: 2025-06-26 14:28:14 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 mkimg: Add a reproducible mode mkimg embeds a UUID in the GPT header and uses the current time of day to generate it, so its output is not reproducible by default. Add a -R flag to ask it to use a fixed time for UUID generation. Merge the FreeBSD-specific implementation of osdep_uuidgen() with that of Linux, as the use of uuidgen(2) is incompatible with reproducible output mode. Reviewed by: bnovkov MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D49716 (cherry picked from commit 95ac5b0e27e9070ba91c28f9a6ecbed743d148cb) --- usr.bin/mkimg/mkimg.1 | 8 +++++++- usr.bin/mkimg/mkimg.c | 10 +++++++++- usr.bin/mkimg/mkimg.h | 3 +++ usr.bin/mkimg/uuid.c | 19 +++++-------------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1 index 82bbee53a267..f6b151d2d5c7 100644 --- a/usr.bin/mkimg/mkimg.1 +++ b/usr.bin/mkimg/mkimg.1 @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 12, 2024 +.Dd June 25, 2025 .Dt MKIMG 1 .Os .Sh NAME @@ -41,6 +41,7 @@ .Op Fl f Ar format .Op Fl o Ar outfile .Op Fl a Ar active +.Op Fl R .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -138,6 +139,11 @@ option is a shorthand to specify the minimum and maximum capacity at the same time. .Pp The +.Fl R +option enables reproducible mode: any timestamps or random identifiers will +be fixed so as to ensure consistent output. +.Pp +The .Fl v option increases the level of output that the .Nm diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index f3bb9cb05708..58bf90fd5ad4 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -62,6 +62,8 @@ static struct option longopts[] = { static uint64_t min_capacity = 0; static uint64_t max_capacity = 0; +bool reproducible = false; + struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -562,7 +564,7 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:S:T:", + while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:RS:T:", longopts, NULL)) != -1) { switch (c) { case 'a': /* ACTIVE PARTITION, if supported */ @@ -607,6 +609,9 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "partition"); break; + case 'R': + reproducible = true; + break; case 's': /* SCHEME */ if (scheme_selected() != NULL) usage("multiple schemes given"); @@ -676,6 +681,9 @@ main(int argc, char *argv[]) if (max_capacity != 0 && min_capacity > max_capacity) usage("minimum capacity cannot be larger than the maximum one"); + if (reproducible) + srandom(42); + if (secsz > blksz) { if (blksz != 0) errx(EX_DATAERR, "the physical block size cannot " diff --git a/usr.bin/mkimg/mkimg.h b/usr.bin/mkimg/mkimg.h index e85f77de0ec7..608de458e83c 100644 --- a/usr.bin/mkimg/mkimg.h +++ b/usr.bin/mkimg/mkimg.h @@ -29,6 +29,9 @@ #include #include +#include + +extern bool reproducible; /* Generate reproducible output. */ struct part { TAILQ_ENTRY(part) link; diff --git a/usr.bin/mkimg/uuid.c b/usr.bin/mkimg/uuid.c index 470d92c76293..f3415a8c1111 100644 --- a/usr.bin/mkimg/uuid.c +++ b/usr.bin/mkimg/uuid.c @@ -45,20 +45,9 @@ osdep_uuidgen(mkimg_uuid_t *uuid) } #endif /* __APPLE__ */ -#ifdef __FreeBSD__ -#include - -static void -osdep_uuidgen(mkimg_uuid_t *uuid) -{ - - uuidgen((void *)uuid, 1); -} -#endif /* __FreeBSD__ */ - -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) +#include #include -#include static void osdep_uuidgen(mkimg_uuid_t *uuid) @@ -68,7 +57,9 @@ osdep_uuidgen(mkimg_uuid_t *uuid) u_int i; uint16_t seq; - if (gettimeofday(&tv, NULL) == -1) + if (reproducible) + memset(&tv, 0, sizeof(tv)); + else if (gettimeofday(&tv, NULL) == -1) abort(); time += (uint64_t)tv.tv_sec * 10000000LL; From nobody Tue Jul 29 12:49:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCB6xQBz62xMy; Tue, 29 Jul 2025 12:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCB4wTNz3lbY; Tue, 29 Jul 2025 12:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D8/zqK77CRaXsNb5RbqE1nhpJEHTnetrlkiNmcnNf4g=; b=cXlmxDwI9/7v+DPCrMFpoN24ZA+0ciDC8ywjUln8cVFySuB/DZugiEm7LdmBLOj1g7Flw/ iANnLhx3+wXeT99xVXLpneW8lPZ1Yxw5WyZR+hmfyhFG0ow5/IJ7fJM5hRI5xAu/81eyLa /qpwOBM9Mh/bt7ADuvwQOX59AvNteUgbT6KRm5weWGg9keHrWl2a8I+uzvrVxHkHyNZGUp +EElPj962Kv68DOhVQvpnEL0WrS71X04aXZcWkoKrweT03qzGqQ8Xfz2H84C0IUjd8rXS7 PE+UdMGAhc3lOFp+A5p/UckHhyffKEXPHRQodPJODEbQdVnd8n/b8i1bkG6MBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D8/zqK77CRaXsNb5RbqE1nhpJEHTnetrlkiNmcnNf4g=; b=KTIqOc5WIpaQTJKpe1PaRWu05/4BopTtUF3NN/wB39BmsAfN8vAvrqETAE/d3kAxV+nMMX ITRTrL6Z0jh2Nz9qFHqHeacNlBRVhwZcOOhaYA2PBA4z7lAaFSHu/2izsrUcvP9LvVyAan qvY5q5PrgUHddCmG3SAxXjYMjJoRuJzEzeyqOFvtGzNujXMw8QuQAbIH6MKJEwpKwA4MVp XtBQ/R1UfCIK8p0ajhUB7k6sUO9TtZx48miQNjS+x6dLhZuM2v+EkvOH1mwfJ/BN7P3NFO 0bbQ1p4tznBvgHNZkp4eYIDKTJnkSQeUkukTAFmLIGUAVV3kXTtk+EtdfQB2yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793350; a=rsa-sha256; cv=none; b=KnJpk5xZE25OSWXDBRBEhNZ7Jt0W8EUmpUQGPxWeTzrP6IB2+6ulK3S1PlL7yE1yKFBP27 q1jqrORE1upq1OqaiXRk4+WJ6YzAsDjdrYP1045YU3EN1uCZ1jsCNHIwU2ITvWmUm2omt5 Xmu41f1RHakN925DxajWOstx9ON0m44+gavLqVaFgLBgGCCcIJrsrKE7w+JZrv7eu2lFYS vPNv9tGFgR6CXtJMK13mddRqgUtRdmZnotTMIdESrlfXxnJeaYQP4b30hj3ASni87BdoTz MvGlxbkyjHs+QQ5v+nq02C3Ha1hZ4ysOYVxbwTYV90cQFw9dRrEHMd9LOCmusQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCB4XGBzXZd; Tue, 29 Jul 2025 12:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnAxZ033567; Tue, 29 Jul 2025 12:49:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnAur033564; Tue, 29 Jul 2025 12:49:10 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:10 GMT Message-Id: <202507291249.56TCnAur033564@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: f6ed43d346b1 - stable/14 - mkimg: Make output reproducible using a specific timestamp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: f6ed43d346b1a79f62e33e3a3fe001d3fc5bcbde Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f6ed43d346b1a79f62e33e3a3fe001d3fc5bcbde commit f6ed43d346b1a79f62e33e3a3fe001d3fc5bcbde Author: Mark Johnston AuthorDate: 2025-07-07 20:27:24 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 mkimg: Make output reproducible using a specific timestamp In commit 95ac5b0e27e9 ("mkimg: Add a reproducible mode"), I added a -R flag to mkimg, indicating that output should be reproducible. There is one place in the VHD image backend that uses time(3) to populate an image metadata field; this field is visible to tools which know how to process VHD images. Rather than picking an arbitrary value for that timestamp, it seems better to behave like makefs(8) and let the invoker pick a suitable timestamp. So, remove -R and instead add a -t option which lets the timestamp be specified directly. Then, modify the VHD backend to use that timestamp. Fixes: 95ac5b0e27e9 ("mkimg: Add a reproducible mode") Reviewed by: bnovkov MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51077 (cherry picked from commit 393fefa3d9c78948d911e5de0182a9b858b23475) --- usr.bin/mkimg/mkimg.1 | 8 ++++---- usr.bin/mkimg/mkimg.c | 24 ++++++++++++++++-------- usr.bin/mkimg/mkimg.h | 4 ++-- usr.bin/mkimg/uuid.c | 7 ++++--- usr.bin/mkimg/vhd.c | 2 +- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1 index f6b151d2d5c7..ae48904eb16c 100644 --- a/usr.bin/mkimg/mkimg.1 +++ b/usr.bin/mkimg/mkimg.1 @@ -41,7 +41,7 @@ .Op Fl f Ar format .Op Fl o Ar outfile .Op Fl a Ar active -.Op Fl R +.Op Fl t Ar timestamp .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -139,9 +139,9 @@ option is a shorthand to specify the minimum and maximum capacity at the same time. .Pp The -.Fl R -option enables reproducible mode: any timestamps or random identifiers will -be fixed so as to ensure consistent output. +.Fl t +option causes any timestamps embedded in the output file to be set to the +given time, specified in seconds since the epoch. .Pp The .Fl v diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index 58bf90fd5ad4..80c79777575e 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -62,7 +62,8 @@ static struct option longopts[] = { static uint64_t min_capacity = 0; static uint64_t max_capacity = 0; -bool reproducible = false; +/* Fixed timestamp for reproducible builds. */ +time_t timestamp = (time_t)-1; struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -564,7 +565,7 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:RS:T:", + while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:t:vyH:P:S:T:", longopts, NULL)) != -1) { switch (c) { case 'a': /* ACTIVE PARTITION, if supported */ @@ -609,9 +610,6 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "partition"); break; - case 'R': - reproducible = true; - break; case 's': /* SCHEME */ if (scheme_selected() != NULL) usage("multiple schemes given"); @@ -619,6 +617,19 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "scheme"); break; + case 't': { + char *ep; + long long val; + + errno = 0; + val = strtoll(optarg, &ep, 0); + if (ep == optarg || *ep != '\0') + errno = EINVAL; + if (errno != 0) + errc(EX_DATAERR, errno, "timestamp"); + timestamp = (time_t)val; + break; + } case 'y': unit_testing++; break; @@ -681,9 +692,6 @@ main(int argc, char *argv[]) if (max_capacity != 0 && min_capacity > max_capacity) usage("minimum capacity cannot be larger than the maximum one"); - if (reproducible) - srandom(42); - if (secsz > blksz) { if (blksz != 0) errx(EX_DATAERR, "the physical block size cannot " diff --git a/usr.bin/mkimg/mkimg.h b/usr.bin/mkimg/mkimg.h index 608de458e83c..aa0ec2a8d944 100644 --- a/usr.bin/mkimg/mkimg.h +++ b/usr.bin/mkimg/mkimg.h @@ -29,9 +29,9 @@ #include #include -#include +#include -extern bool reproducible; /* Generate reproducible output. */ +extern time_t timestamp; struct part { TAILQ_ENTRY(part) link; diff --git a/usr.bin/mkimg/uuid.c b/usr.bin/mkimg/uuid.c index f3415a8c1111..885a6c36b522 100644 --- a/usr.bin/mkimg/uuid.c +++ b/usr.bin/mkimg/uuid.c @@ -57,9 +57,10 @@ osdep_uuidgen(mkimg_uuid_t *uuid) u_int i; uint16_t seq; - if (reproducible) - memset(&tv, 0, sizeof(tv)); - else if (gettimeofday(&tv, NULL) == -1) + if (timestamp != (time_t)-1) { + tv.tv_sec = timestamp; + tv.tv_usec = 0; + } else if (gettimeofday(&tv, NULL) == -1) abort(); time += (uint64_t)tv.tv_sec * 10000000LL; diff --git a/usr.bin/mkimg/vhd.c b/usr.bin/mkimg/vhd.c index 1e1f1e7f3c3e..c0fe45ab416e 100644 --- a/usr.bin/mkimg/vhd.c +++ b/usr.bin/mkimg/vhd.c @@ -188,7 +188,7 @@ vhd_timestamp(void) time_t t; if (!unit_testing) { - t = time(NULL); + t = timestamp != (time_t)-1 ? timestamp : time(NULL); return (t - 0x386d4380); } From nobody Tue Jul 29 12:49:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCF2df9z62xWD; Tue, 29 Jul 2025 12:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCF09rhz3lWL; Tue, 29 Jul 2025 12:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cVkCl1EriEukKfarAnqPub1Ck4nk+bj9zZ3FQOwbREE=; b=mo5demti8MJlyU6renm7s9NO82RWuqDFbhCG5QVeMkKsN0CwlSHjb/NrBpofmy2mISXlxk 5lj784d6fmNEtX1YWANq8g9Vg+UZqH9h/g8jKl9qzdnx/peIfBr7eF2ibj8aswW/R/MySQ /Uowr7EENwbpzLsbKtm/3hwVR668i8BGH+Nnw5wFnpcch8U6XMDs132gmK3f1qftJHUw62 mYK9+nmhjrpt5MbHTNgHjScNOlRMHhPv75VqOGuvQupI9aySeMpgoG3/sT3UR/WRHbh8mX +PYSA2RFGW7MF8yDrccVPZi7jKNwlRMo09OA01k/Kh3Nnt4xG20E/0uSglQC4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cVkCl1EriEukKfarAnqPub1Ck4nk+bj9zZ3FQOwbREE=; b=rKBRG7uTh3pLV5thVP8qlIhPJxNr8zlQ2d/TcwFM80YaPMnpozoXghjEGaXCHWfU5fGx0P lnuJw/OY9yQ8B+iUcTdPQOXEeUErL72vnKYbp5AME/yxrhMBKXNMooBL1HmmvaoquBtpP6 vXpDa3enuM7TX+7HyOYnxUWrc7k1WoboCqRwQCD6fYZrOxda1/2sBFEBgJRrMDoqm1FHa9 b5Setc7WZ6xVQl2XpK7Az7229MgEsinBnGJGo/U4ZxF1M8N4W5SOtNTKLJWZ0r2ytNICQt ALIuYEYRsPfTNzpRiB6BGnPlZc2LWnmsuAp2zXXJ9TVin7s7fVjiIhhG9/J+Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793353; a=rsa-sha256; cv=none; b=Rd+kbiLy4YwTk/Wc/pcuTvjN1vCsd6LAPo9B2f+i0GwAqifg84/NSN2Ll2EmAyqVXV9xP+ 1vtqALpD4oj72aEFEtzp1pW4mxrS0wSnHofCmlKUuRuakPVlihMQ5/08mk1/QE0KS5pTIo IDVKCWLpRuMICrtooRJN09erLPBauDgiyzVnn28LckHr4zlAGqexLTD9vn4O3MOFLjwrTZ vq+98db1yo2GUqA85N9vcVn0t9b8gsrbmzuH6NcuavVrq1inAAfmu/5+BBrl3b1vPFBgsg xL3KoEeAAJrP8iVBLIoWxOTed/jokEWdkF/mt9FzYpXHntz0uNMjRS6W0rHfxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCD6trjzXZf; Tue, 29 Jul 2025 12:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnCen033633; Tue, 29 Jul 2025 12:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnCTH033630; Tue, 29 Jul 2025 12:49:12 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:12 GMT Message-Id: <202507291249.56TCnCTH033630@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: bb4a12ff9ac0 - stable/14 - nuageinit: Add wrappers for chmod and chown List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: bb4a12ff9ac0feb05af7232c1ffc8e7cdd00f2dd Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bb4a12ff9ac0feb05af7232c1ffc8e7cdd00f2dd commit bb4a12ff9ac0feb05af7232c1ffc8e7cdd00f2dd Author: Mark Johnston AuthorDate: 2025-07-05 14:54:07 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 nuageinit: Add wrappers for chmod and chown In the wrappers, check for errors and abort if one is raised. At some point it may be useful to have a mechanism to ignore errors, but I'm not sure yet how that should look. For chmod, let the mode be specified as an octal number, otherwise it's hard to understand what's happening. Note that this must be specified as a string, otherwise tonumber() will raise an error. Reviewed by: bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51159 (cherry picked from commit 667ef8875bad115d334a85c1023db0cf4d8379ba) --- libexec/nuageinit/nuage.lua | 35 +++++++++++++++++++++++++---------- libexec/nuageinit/nuageinit | 7 +++---- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 11958e8b5cc2..493ae11d6ca7 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -56,6 +56,21 @@ local function errmsg(str, prepend) os.exit(1) end +local function chmod(path, mode) + local mode = tonumber(mode, 8) + local _, err, msg = sys_stat.chmod(path, mode) + if err then + errmsg("chmod(" .. path .. ", " .. mode .. ") failed: " .. msg) + end +end + +local function chown(path, owner, group) + local _, err, msg = unistd.chown(path, owner, group) + if err then + errmsg("chown(" .. path .. ", " .. owner .. ", " .. group .. ") failed: " .. msg) + end +end + local function dirname(oldpath) if not oldpath then return nil @@ -252,12 +267,12 @@ local function addsshkey(homedir, key) f:write(key .. "\n") f:close() if chownak then - sys_stat.chmod(ak_path, 384) - unistd.chown(ak_path, dirattrs.uid, dirattrs.gid) + chmod(ak_path, "0600") + chown(ak_path, dirattrs.uid, dirattrs.gid) end if chowndotssh then - sys_stat.chmod(dotssh_path, 448) - unistd.chown(dotssh_path, dirattrs.uid, dirattrs.gid) + chmod(dotssh_path, "0700") + chown(dotssh_path, dirattrs.uid, dirattrs.gid) end end @@ -296,10 +311,10 @@ local function addsudo(pwd) end f:close() if chmodsudoers then - sys_stat.chmod(sudoers, 416) + chmod(sudoers, "0640") end if chmodsudoersd then - sys_stat.chmod(sudoers, 480) + chmod(sudoers, "0740") end end @@ -521,16 +536,14 @@ local function addfile(file, defer) end f:close() if file.permissions then - -- convert from octal to decimal - local perm = tonumber(file.permissions, 8) - sys_stat.chmod(filepath, perm) + chmod(filepath, file.permissions) end if file.owner then local owner, group = string.match(file.owner, "([^:]+):([^:]+)") if not owner then owner = file.owner end - unistd.chown(filepath, owner, group) + chown(filepath, owner, group) end return true end @@ -538,6 +551,8 @@ end local n = { warn = warnmsg, err = errmsg, + chmod = chmod, + chown = chown, dirname = dirname, mkdir_p = mkdir_p, sethostname = sethostname, diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 84133d4373c5..0fcdc7274db3 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -7,7 +7,6 @@ local nuage = require("nuage") local ucl = require("ucl") local yaml = require("lyaml") -local sys_stat = require("posix.sys.stat") if #arg ~= 2 then nuage.err("Usage: " .. arg[0] .. " ( | )", false) @@ -157,7 +156,7 @@ local function ssh_keys(obj) sshkey:close() end if keytype == "private" then - sys_stat.chmod(path, 384) + nuage.chmod(path, "0600") end end end @@ -281,7 +280,7 @@ local function runcmd(obj) end if f ~= nil then f:close() - sys_stat.chmod(root .. "/var/cache/nuageinit/runcmds", 493) + nuage.chmod(root .. "/var/cache/nuageinit/runcmds", "0755") end end @@ -503,5 +502,5 @@ if line == "#cloud-config" then end elseif line:sub(1, 2) == "#!" then -- delay for execution at rc.local time -- - sys_stat.chmod(root .. "/var/cache/nuageinit/user_data", 493) + nuage.chmod(root .. "/var/cache/nuageinit/user_data", "0755") end From nobody Tue Jul 29 12:49:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCD4Vy3z62xL0; Tue, 29 Jul 2025 12:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCD0GvMz3ldv; Tue, 29 Jul 2025 12:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YetsfsM8lpe4xd3WSa9wpRHFxJ9xdqHUEziY4SmgmtE=; b=qwMQAgq5ghVHr/sLyT9rFiaJ6NUGTI8Gpd7g8ephgh0zi8oCS2oEz8ptVn/4sgPUJz0vTE nw975bnADgvC9qVON+NaBhkelu/7IUGhDQ09WoKFLQN9tLv97kLWlwFJ5ykt1PxnoXgYQm dkq6zI2qGVMc4BuL51+UuJHCLpuQtzsWVza1k/Uw2j08LkLjBEk6R/T7QQu5WoM4jOCIxZ XjSCtCK2rRdpLog72fViMYAP5ZrMGoJ/3xEER6leby5hyVRZJfl/9HkQ6kPbWwZzFx5e75 dPGgTSEgLOhnjfzrpcXo2GgDW7AQJ//ukm9lMslEvO0B+Y8ZTC5xGNcimb5Jxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YetsfsM8lpe4xd3WSa9wpRHFxJ9xdqHUEziY4SmgmtE=; b=VI4nRle4ahEweliq4Zv47q0JpzGDrh3g4SFsoWqOTiam/uqbvmYsr2Wpcs2q6qt9IvPT1b UIm8bLjam/C/knuAH4S3qiEJ0+CiOxrQqi29Du53TP9oJUeoTM+R1X7xqmtUpMSWzQixep B5KJE3+v4yCV66F96ZRXawEUzE9sAObrzO3vVXn+9zU6Eq0d+CdShhrSpo0Fo59aqeeoki o/au36Nzaw7ttQkjauFu9t9iYHQojzXSllBfVznzqNbwf5Tg1/1UqEi4zq7SKcT7DJE71n qFgkZFKqY94CN2Zj2vWoYTR+N0Y/STDoCsNjHEyxkveGo7tWbiEYVPJL+MpE6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793352; a=rsa-sha256; cv=none; b=I7hLq9Jsnwu8Yz4xh7/gMKMVoA5VvO8BdVgDdm6H/UBzfZv+LV5dNE0DI2WyE3TZCKnf5n xFe7mSxjsozydyKHCo6NfduG8Gv2FSDlzs5WwvbugvfYH6joP9Rgu4Jzm8xBMmv5JCFKIy 4GGkS18mgsRQZwpxvmdmcbj7ksyKqloVjm8bWSoX8/cnNtyQxpktCST8NRede649MTeE1Z DdEGn+Jqjrp3GWgFgziVwS1tGkl46QYBOfuwfkG1BJfEbarm0aLpce9p4a2O0tT2ZuE4qg RqJ/sWM4kWyfiIZpXIqysV+oRtMxX0KrSB/XICpXgVyqT59ISLYNX9iKkiGp/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 4brwCC5XRVzXVr; Tue, 29 Jul 2025 12:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnBhA033600; Tue, 29 Jul 2025 12:49:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnBCk033597; Tue, 29 Jul 2025 12:49:11 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:11 GMT Message-Id: <202507291249.56TCnBCk033597@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: 12718429e89f - stable/14 - rc_subr_test: Bump some sleep timeouts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 12718429e89f1fe64ebe2865db562f2f2296c7a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=12718429e89f1fe64ebe2865db562f2f2296c7a9 commit 12718429e89f1fe64ebe2865db562f2f2296c7a9 Author: Mark Johnston AuthorDate: 2025-07-13 15:08:00 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 rc_subr_test: Bump some sleep timeouts The test verifies that the rc framework will OOM-protect a process spawned by rc. It just wraps a 5-second /bin/sleep invocation as part of this test. The rc framework uses procctl to set the OOM-protect bit after the process has started, i.e., it uses procctl -p. So, with a 5 second timeout, it's possible for the process to exit before procctl actually runs, if the system is heavily loaded. (I see this failure occasionally with KMSAN configured and many tests running in parallel.) Bump the timeout to reduce the risk of this happening. The timeout value is arbitrary since the test will stop the rc process, i.e., we don't have to wait for 60 seconds to elapse before the test passes. MFC after: 1 week (cherry picked from commit da89500adbea360533d2442a674c8af0741b7ff1) --- libexec/rc/tests/rc_subr_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh index 60f77c2c2de3..9931389e7a02 100644 --- a/libexec/rc/tests/rc_subr_test.sh +++ b/libexec/rc/tests/rc_subr_test.sh @@ -52,7 +52,7 @@ oomprotect_all_body() _rc_arg="$4" setvar "${name}_oomprotect" all command="/usr/sbin/daemon" - command_args="-P $pidfile -p $_childpidfile -- /bin/sleep 5" + command_args="-P $pidfile -p $_childpidfile -- /bin/sleep 60" run_rc_command "$_rc_arg" LITERAL @@ -92,7 +92,7 @@ oomprotect_yes_body() setvar "${name}_oomprotect" yes procname="/bin/sleep" command="/usr/sbin/daemon" - command_args="-p $pidfile -- $procname 5" + command_args="-p $pidfile -- $procname 60" run_rc_command "$_rc_arg" LITERAL From nobody Tue Jul 29 12:49:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCG3Tb7z62xN2; Tue, 29 Jul 2025 12:49:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCG0v3Sz3lbt; Tue, 29 Jul 2025 12:49:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bZxJ6uR9uPESuvUsgFfco+k9TosdaBYR8pUod4jFKIk=; b=VLjQs64nL0DCBtu1mcjSvLR2i1IcCqh3Lz5yojKc5Le+ijSGbnRTydUm69S6dJyQLQ6kXF y46vOZs0gpN7PyFyx9KEfBfxBqfuPIKdmQSXB5zrcKUVwU/OxV85h/ZmLaU1IoWSkfiok0 UpdrSRP4y+HBOFnGHwWWGklVYxyWKu1MA1UdD7r0YGOTEkKeU3aXILjSZcUPtsu9kA1H7R oc152d2R79L7dh9ADGeKxb5dtWdRiiKA7wD/z6PfpIJqfLXrAGUV4ZXEj/VIvawv9RpcJs R645SnlZBA+81bHwRjHEIYPx0GFf96Lac2X6+f/PdhRbgfyarI119Nn/oChu8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bZxJ6uR9uPESuvUsgFfco+k9TosdaBYR8pUod4jFKIk=; b=AH8IE2SGbV/tQGZgIbSc2ViwQaLdUdGJ7JHi0zLDpJ3+jZgeCijSBfhvZnBe+FcrGnoMU7 MEkriKXoQf1IHHXdjHByx3lAVRItxDRqF1BzhpmQHwkiXliuyI88AOu3c12JiORdaA3mJh jrNydAvh3ccsQu+YxRox5OpMU2vl+OFiuld4UqE5N9Lpjg+AH29FCPU3HjsNKn9CofvMDg hQnrTjOgkGB2Tb4zHMvKm8E4dknLvAWcZdshk2/DJXQkcwbmKfMiDldqJne+gbTFZzGlYJ T3o3XVeZeieWqJb/j9I8MSqBgTvLThXSFhpDr75WYD4AYhvjS+Knsc6vgIGD6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793354; a=rsa-sha256; cv=none; b=ACuATf1brWdv+spesYT1Jvp06k0IVpt5A33vgRSsSxDOa5qNnxyluvAKL5ICckVlWQcxXz pXEYEJ3Agu3GP9MZkHhWCZZ9d5hQAgKIoFUBZLfc8RVkZKZqlzsBX8q5ClNCz/k81yJEIC 4Ap9e2tLKcSFEAqq5msCs29UfXlW1Zt5iCFstfyJ7W0diQ6zrh9gfeChmrCAOKsJi6o1ow BIPEZGSUnnsMww1AVFD8L1Y2oZTeAFnH3YV300i7ZDjngRSYJ8NrdvBla46IspLF5TthSc 21DrLAItD3S/p3yQfl3DbyWSIKQD23C/JHFcDMztzKnhUDuw9N7T1g/DsRjrVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCG0VLVzXq3; Tue, 29 Jul 2025 12:49:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnEKk033665; Tue, 29 Jul 2025 12:49:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnErs033662; Tue, 29 Jul 2025 12:49:14 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:14 GMT Message-Id: <202507291249.56TCnErs033662@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: 6c6add72d064 - stable/14 - msdosfs: Fix handling of eofflag in VOP_READDIR List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 6c6add72d0640f83f69843af1d52c65642a96142 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6c6add72d0640f83f69843af1d52c65642a96142 commit 6c6add72d0640f83f69843af1d52c65642a96142 Author: Mark Johnston AuthorDate: 2025-07-13 15:05:51 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 msdosfs: Fix handling of eofflag in VOP_READDIR We also need to set it when an end-of-directory marker is reached. Reported by: vishwin Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51290 (cherry picked from commit 9f6718073382608519912e178e4c313dd61246b3) --- sys/fs/msdosfs/msdosfs_vnops.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 6417b7dac16b..73c235b0f368 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1530,6 +1530,9 @@ msdosfs_readdir(struct vop_readdir_args *ap) ap->a_vp, uio, ap->a_cred, ap->a_eofflag); #endif + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; + /* * msdosfs_readdir() won't operate properly on regular files since * it does i/o only with the filesystem vnode, and hence can @@ -1623,8 +1626,11 @@ msdosfs_readdir(struct vop_readdir_args *ap) on = (offset - bias) & pmp->pm_crbomask; n = min(pmp->pm_bpcluster - on, uio->uio_resid); diff = dep->de_FileSize - (offset - bias); - if (diff <= 0) - break; + if (diff <= 0) { + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; + goto out; + } n = min(n, diff); error = pcbmap(dep, lbn, &bn, &cn, &blsize); if (error) @@ -1655,6 +1661,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) */ if (dentp->deName[0] == SLOT_EMPTY) { brelse(bp); + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; goto out; } /* @@ -1752,15 +1760,6 @@ out: uio->uio_offset = off; - /* - * Set the eofflag (NFS uses it) - */ - if (ap->a_eofflag) { - if (dep->de_FileSize - (offset - bias) <= 0) - *ap->a_eofflag = 1; - else - *ap->a_eofflag = 0; - } return (error); } From nobody Tue Jul 29 12:49:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCJ72M4z62xR3; Tue, 29 Jul 2025 12:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCJ2Vchz3lLZ; Tue, 29 Jul 2025 12:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30XXBRxxGEVv6lcX1Cj0EnTQf9Fkbrfc06BORyO4mWU=; b=BTg9LW/p/1hl1ljt6yNAk8FWN7pYlWKmk9iPkcj9OmSi2V8yEQ0XKRPAEakBBDZ7F74Hp7 w7RVaYtGLltA84APceN45Y5LYG1KKZofxQZD9uSMC+j48MmwtIQBifmmdQh50miss/FLBS geb8SqCpx8OR1mvUJsfHUO82eOxdUQdAn4j/N3tA3GdD92FWRXvrumgw/Jct1iSegVWfrF kw+qYc4tpitIV6ad1mkC5cQ4oMThdpy7mYJQpgwytUugJ7k26XSiqBzoceoCUfA61fVdId /buoIgldj13uSdXA7RSdpHTMNJruXLJL6T4ZlxImqPqrpijA6RBQMoFCjQivTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30XXBRxxGEVv6lcX1Cj0EnTQf9Fkbrfc06BORyO4mWU=; b=rEpXVrq59HOOCoYZldzDjw+qS9R35XPDCYqvwYBHBSC4Ee+cJEkBAfxdTqfHCtW5w03fPD JLdy2o6F2noL/5EE+Sv1q3c0ucU/9BkGhpR1KnjnQ6z033rmQp3PJYAO30WT+u6XIbPQVi +MGAlr4O9re2iqx4a/qJMyBQYN+ish6msT8QbnMszQRGnGyGsIQJS9lP1FELBDDuW3zEAi D9Eg7dz+W/V28s/CovemSTKju2sU9oQ2ut1u6IgWszXbujfQwbItGX/zRFyx2c4CaNR20x B70FxHRT1vz/B168NbOq1Wb6RzckU5WTOa2V82q+IxJAauAlLC5fL7hk2Hvsxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793356; a=rsa-sha256; cv=none; b=gFIoa+xNRw99rvvtoGqCZGlaYkydk960ghSrCFACr9IKsXvAnyBmu/O+XBMd0Wdk7L6tVY y6uokDQWKMUUCSTybrVcGiW1C0TqMtOb7YpUMn1lJIA/v353lb7rstPHct4N8twA6q4zh0 GBU7O3oG6Acwn9sjtkJxISlEUGlot7Vv0Ek/8aBNlIK2Ln67ww8XeelA8pmHha8ssg/B1u 831q2Fu6YITvyPUS3Zb9RYXUZTyof2BlqHrafFlbShfiWYF4dH/ow6w8i9758L6eyMEgj6 9JnPvu04uLXs6LdoDdgRyn6Ox9OanL60S5d6tIfuSr06uE8xSLS3GpWaJCfDXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCJ26CgzY1n; Tue, 29 Jul 2025 12:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnG9p033737; Tue, 29 Jul 2025 12:49:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnG06033734; Tue, 29 Jul 2025 12:49:16 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:16 GMT Message-Id: <202507291249.56TCnG06033734@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: 1392b97d0388 - stable/14 - kasan: Use kasan_md_unsupported() to check 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 1392b97d03883e53cf2b92c6c896a9a1ce6f4f04 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1392b97d03883e53cf2b92c6c896a9a1ce6f4f04 commit 1392b97d03883e53cf2b92c6c896a9a1ce6f4f04 Author: Mark Johnston AuthorDate: 2025-07-15 00:31:10 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:46 +0000 kasan: Use kasan_md_unsupported() to check for invalid addresses The subsequent assert verifies that the address is in the kernel map anyway, and this removes uses of the MD DMAP_*_ADDRESS constants from MI code. This fixes the amd64 KASAN build after commit 4dd828c80828 ("amd64: add kva_layout"). MFC after: 2 weeks (cherry picked from commit 1f683624df878b2e4c0187137640bf2e6662c36f) --- sys/kern/subr_asan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 0edb631d1475..464efda1e91a 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -263,8 +263,7 @@ kasan_mark(const void *addr, size_t size, size_t redzsize, uint8_t code) if (__predict_false(!kasan_enabled)) return; - if ((vm_offset_t)addr >= DMAP_MIN_ADDRESS && - (vm_offset_t)addr < DMAP_MAX_ADDRESS) + if (kasan_md_unsupported((vm_offset_t)addr)) return; KASSERT((vm_offset_t)addr >= VM_MIN_KERNEL_ADDRESS && From nobody Tue Jul 29 12:49:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCH4FxDz62xLG; Tue, 29 Jul 2025 12:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCH1vC3z3lWZ; Tue, 29 Jul 2025 12:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zAjgpqQY8skxMtN6VjzQeGRwWmZ+ZRQXRd+PUmRRHOo=; b=X/lno30Zd85Uy8njfhhyP32igxi7cs0b32jPh/3swQliCgyzdTXvXuSUL0A21wz2fk25Jj EG9wlvJl73S/+64ISbL3WT0281L1u9r+QyWf+QbIM27LRgbpQN9LAT0ubqhwoYGWeL50aH A9sUTP+HaqPtX4IiLo3kvzp/J2lGLP+4tX54shv2Ox+5kLGVgyleE+BQnsv7Y+mnnzFqcD MdXB9jxm1+Y5NddL9BxZPGP9FBnGDvp2bY4VE1e3GxnAJ+ipoOFltjQoI1M2mo1m81YKgw JzLFOyT1hAvpdmLeANiheu4fkOvuU12TiV6QiwTLXD477BswitVSVokYR9hO4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zAjgpqQY8skxMtN6VjzQeGRwWmZ+ZRQXRd+PUmRRHOo=; b=CqahUAD4yf9otFbRkV92jxRshFNXXyzDZyZyvlSvHRVVSZ82nKKElVTq0Jp2M0ZabU47iD FsiZmkzS/OlCYZTTNUDOPNDTeYFRmbx5dTN7xYZF6j1YamAZQ5LgOrVTpZdGb56jV7Hz6Q 5vhWf2RR+L8ZCOCIp/8jWUDDP+jpMejyLHmd90gNLWkHsJIC/gQZ4F/cEim4jaCgpiLOXD rDT8kFQpVo5hTSBdua2mOath3FL0fbmIzWRgDB3m10cNaXJxmrwHeFKuFmpXlEKHW6L0NG eAq04S/aOldsLnxTX1ul3gCt/m/jkSMfZ3+KPPeg5+FI8kkHPUWE9lAVLY9ZqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793355; a=rsa-sha256; cv=none; b=xvciHHM+99Y3gj3lQhhXSub2UVEO4VKPudmNAKQaqB5dEuxYTxBmiZCZp3l5i2JZPJLWwh Fb0aGc/3LVrmec5nFs2jzJY9ZEHdsOCIyCoUfTxq0cCH16wYm5mbAoxTh+TLMFhOyITDq6 TF9itF8baStO9gaPOWgm76mg+ps7j8eNA352g25+EcwnwI9MSILMAmOnIu34hNKKKgkG7Z fd5conx3MZvw20hcATyweLdJSQdqNvMpn60yfDRk1xGMqKkyyKFxrKcAPE1FYyhpFYO28s DacoJn/AF59moHXQqf+CBWdRFPCFYv6aXMxxoieVLgkuM/ylGIZzRXJBFOFUhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCH1TBkzXq4; Tue, 29 Jul 2025 12:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnF6H033703; Tue, 29 Jul 2025 12:49:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnFkE033700; Tue, 29 Jul 2025 12:49:15 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:15 GMT Message-Id: <202507291249.56TCnFkE033700@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: 3060f4fda70d - stable/14 - libdtrace: Use a designated array initializer for dt_cook_funcs[] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 3060f4fda70d5bd80720dbdb7014eda09ff1c501 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3060f4fda70d5bd80720dbdb7014eda09ff1c501 commit 3060f4fda70d5bd80720dbdb7014eda09ff1c501 Author: Mark Johnston AuthorDate: 2025-07-21 13:34:21 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:32 +0000 libdtrace: Use a designated array initializer for dt_cook_funcs[] Also make the array const. No functional change intended. MFC after: 1 week (cherry picked from commit 654dea596703eb422055a7d637356fbde36f8540) --- .../opensolaris/lib/libdtrace/common/dt_parser.c | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c index d1ebaa8791da..dd68f9278308 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c @@ -4506,30 +4506,30 @@ dt_cook_none(dt_node_t *dnp, uint_t idflags) return (dnp); } -static dt_node_t *(*dt_cook_funcs[])(dt_node_t *, uint_t) = { - dt_cook_none, /* DT_NODE_FREE */ - dt_cook_none, /* DT_NODE_INT */ - dt_cook_none, /* DT_NODE_STRING */ - dt_cook_ident, /* DT_NODE_IDENT */ - dt_cook_var, /* DT_NODE_VAR */ - dt_cook_none, /* DT_NODE_SYM */ - dt_cook_none, /* DT_NODE_TYPE */ - dt_cook_func, /* DT_NODE_FUNC */ - dt_cook_op1, /* DT_NODE_OP1 */ - dt_cook_op2, /* DT_NODE_OP2 */ - dt_cook_op3, /* DT_NODE_OP3 */ - dt_cook_statement, /* DT_NODE_DEXPR */ - dt_cook_statement, /* DT_NODE_DFUNC */ - dt_cook_aggregation, /* DT_NODE_AGG */ - dt_cook_none, /* DT_NODE_PDESC */ - dt_cook_clause, /* DT_NODE_CLAUSE */ - dt_cook_inline, /* DT_NODE_INLINE */ - dt_cook_member, /* DT_NODE_MEMBER */ - dt_cook_xlator, /* DT_NODE_XLATOR */ - dt_cook_none, /* DT_NODE_PROBE */ - dt_cook_provider, /* DT_NODE_PROVIDER */ - dt_cook_none, /* DT_NODE_PROG */ - dt_cook_none, /* DT_NODE_IF */ +static dt_node_t *(* const dt_cook_funcs[])(dt_node_t *, uint_t) = { + [DT_NODE_FREE] = dt_cook_none, + [DT_NODE_INT] = dt_cook_none, + [DT_NODE_STRING] = dt_cook_none, + [DT_NODE_IDENT] = dt_cook_ident, + [DT_NODE_VAR] = dt_cook_var, + [DT_NODE_SYM] = dt_cook_none, + [DT_NODE_TYPE] = dt_cook_none, + [DT_NODE_FUNC] = dt_cook_func, + [DT_NODE_OP1] = dt_cook_op1, + [DT_NODE_OP2] = dt_cook_op2, + [DT_NODE_OP3] = dt_cook_op3, + [DT_NODE_DEXPR] = dt_cook_statement, + [DT_NODE_DFUNC] = dt_cook_statement, + [DT_NODE_AGG] = dt_cook_aggregation, + [DT_NODE_PDESC] = dt_cook_none, + [DT_NODE_CLAUSE] = dt_cook_clause, + [DT_NODE_INLINE] = dt_cook_inline, + [DT_NODE_MEMBER] = dt_cook_member, + [DT_NODE_XLATOR] = dt_cook_xlator, + [DT_NODE_PROBE] = dt_cook_none, + [DT_NODE_PROVIDER] = dt_cook_provider, + [DT_NODE_PROG] = dt_cook_none, + [DT_NODE_IF] = dt_cook_none, }; /* From nobody Tue Jul 29 12:49:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCL0yT7z62xWJ; Tue, 29 Jul 2025 12:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCK3bqYz3lg9; Tue, 29 Jul 2025 12:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=98uWn30uJp77OTibe0MldIYmCTjATri++HOdbh8LtOA=; b=KCzPw5BMWW0SyUg2mH+7FMp1hgnwDCFvZWRcsb42hS55wIdxSK/S2EMoapdLcv2f/r8z5X oTyhtb/nmeXd2SPlxb708KHqDm+ZUrPoc/mumeLv9iMYzJAWmgYv0l2wKXFfFLtPfPTgAB PAPagkwf4vGbnCFuYKXUnpcwOzfLO6ZM2ywWSuZ4371r04j7/AdhONE9OiOHMRh5oNPuyy ZnbFHAAy/MSvGx/ihApVifH7Q4B62Iw8zEZIA8oG+9Q6P2SxEqzrZeBl7np6YH5D/hvNcw J0dqA9doMbjo3efAC08JW69+99P/2qqf/gqlXVGYvZ/82QUiwt/LBgGOgDUg7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=98uWn30uJp77OTibe0MldIYmCTjATri++HOdbh8LtOA=; b=OjnC/q5U8gpdSwvsweVg2gveVBn7j2PxAtX5NMA73A3Ija2KAPmUvzFB1Axj0Z8Dx45ABU EvZXsFbMC5kIVMPcVgR3g2bE/qIYqrxHWdT2m19Nj0fijKVbs0BgYel0Se8sQJltoB5rJ7 rvu8aklCp75uSWCqYeHWcG9HSZm1wAnXFPIhEYWymwPDHFrAYNG4J5H9wNh3qa6LVvb7a6 /Rkc6YnHqZvc7i9NTLGjmpVAMoRXyvdCv6DDGL4Yz5cO/XYjapzM4DDSL0jgMojK09ScQu hj1EF1ZQp9vZFfKMMfbaTsc2/1z8BpyWWIAjELHLO5G19sGepfkRin3u2OwEFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793357; a=rsa-sha256; cv=none; b=EpqfFR1qUJMeto0tzqd7kQnOInCbWIvMtGf+mUJUSFWW5Owc/UrYKC/T5saz8SX//Y5C1y JlG22boN8IsTDO0dKWJTY1co3kHzG1m4CeVSm7Hjqkh3yz1ndb8eaNDB7JTW4fK87dekoa zv8gnfdpFkc1CFmmwU2EY2KQnujxvzm4FqrzoGoNYd+hqVqvFptzM9SD8Ro6/HRIIdifXj bYKuMUcvaG7SNVaMAVkA8LCQFmsOdHRzDo/GwbLunW3D/81gpjz06wc02NZk8Pm8g+DjyI i8j95BtuFQlfSa1kW/PsyoCOAJUVvaSitLLli6YN+W+2gMIcs8GvY5MxXLs99Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCK39HXzY1p; Tue, 29 Jul 2025 12:49:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnHSw033769; Tue, 29 Jul 2025 12:49:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnHdx033766; Tue, 29 Jul 2025 12:49:17 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:17 GMT Message-Id: <202507291249.56TCnHdx033766@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: d8ef477a7bfe - stable/14 - fdescfs: Set *eofflag in fdesc_readdir() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: d8ef477a7bfeed988561ad5a224878b24ee65352 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d8ef477a7bfeed988561ad5a224878b24ee65352 commit d8ef477a7bfeed988561ad5a224878b24ee65352 Author: Mark Johnston AuthorDate: 2025-07-15 00:38:21 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:08:54 +0000 fdescfs: Set *eofflag in fdesc_readdir() Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51319 (cherry picked from commit da84054f3a508ceab4474e4a002c87813963cc84) --- sys/fs/fdescfs/fdesc_vnops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 47fb387a007e..f4b3eba91ef3 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -549,6 +549,8 @@ fdesc_readdir(struct vop_readdir_args *ap) fmp = VFSTOFDESC(ap->a_vp->v_mount); if (ap->a_ncookies != NULL) *ap->a_ncookies = 0; + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; off = (int)uio->uio_offset; if (off != uio->uio_offset || off < 0 || (u_int)off % UIO_MX != 0 || @@ -561,7 +563,12 @@ fdesc_readdir(struct vop_readdir_args *ap) fcnt = i - 2; /* The first two nodes are `.' and `..' */ FILEDESC_SLOCK(fdp); - while (i < fdp->fd_nfiles + 2 && uio->uio_resid >= UIO_MX) { + while (uio->uio_resid >= UIO_MX) { + if (i >= fdp->fd_nfiles + 2) { + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; + break; + } bzero((caddr_t)dp, UIO_MX); switch (i) { case 0: /* `.' */ From nobody Tue Jul 29 12:49:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCM15cRz62xWN; Tue, 29 Jul 2025 12:49:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCL4cyxz3lqw; Tue, 29 Jul 2025 12:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nqUVrelY1eETxGsUYr0awUZ6hV85vvvsj2j5+17k/ZE=; b=BMqesLVyeTuZpcQ2Hf/TPAoq/SMCF0CxzgY+hZcxkBNokOnsEMixOdcyqlWJCXIFNMgC2i uOJme3PWfQ4HXlpfUM6COxSBp8pZ6qD9aLPoIfFDzDUMYjXh09Id8X0fxhZ0OjYybZA43R jaNIoXz5EQkLHUao/CNOpT+f3EEVF44683V5l8mLDuEw6Kk5psm2N7D6lMf45J3B5p1MY3 ox9rfI8vP1bfTtjRgvtqTdaM+WtVBhNAahht5ESwMD/gIKzBJmWGs1xmH9Cs+1Bageuakm M/9OTYoE8b1TuK4B4gyf0xTBdJI/B60zriEmy4K1Ft5BQmTkoa9NTTlI35trUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nqUVrelY1eETxGsUYr0awUZ6hV85vvvsj2j5+17k/ZE=; b=Jp+Njb+zp1nyOeZAeLctJaCCOSaAE4cLLBSXkfDxIB2o0+zryZwog1Bw5p2tyFYH8OMSvD JCfJTtmV7U9g6P5Zm5jc+wls4YiXdudHZZFWlxFwObYep0PnKwsLybsQ4yP0van2f0i1fL kZjYV4HOdpZz/bNnvbhlhxemVJjitlmGQtJOZKftxXXZU/mJt8bcYnS/SM7KtzuKBy/4Ii cQ7qjqj+NiQ/8qhRcY23eoOziPBZV6L22ezq15Skk+PJtwURQjS1aqjn83/NOzk2zJe77h sTTJgO7xqXUkT6c7zLywkccZxjDhjs282Eb1B4IFpoKrPPJeLnYo+32KNe85qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793358; a=rsa-sha256; cv=none; b=rMvwmlNZc+/WoUfdJLOjXXgCWQRvqNd5+jiI0g3kNoteBtToUsdCaMVG0d9ntZNeWFFQJN OFs3SKSlhNhmXJXyOxPFxx5g9DACerUJyUWCGwuFGXcbpN+nOn4igurrX9IVWFqonkyCHN F5WqKB2sa3SKewhZJTNQ885xbhNqj3wMiK9odjaBVLync0yokBbHFBYBm1nh9qyi3W2m+G kJLTL4me6ylFx0Afep9MvuK1a8ojlikg8KKPMOz2d/mWx775zvsc5llOh3e81jsnNDAeD4 1vemOk2AdwPzSnu0TILYdBUet+rxIF0bZW0ay0JoGtgqGYW/1Cj1LVVPRlFn8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCL44KXzY1q; Tue, 29 Jul 2025 12:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnIgJ033801; Tue, 29 Jul 2025 12:49:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnIcO033798; Tue, 29 Jul 2025 12:49:18 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:18 GMT Message-Id: <202507291249.56TCnIcO033798@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: 2019311525ce - stable/14 - swap_pager: Convert swap-space-full flags to bools List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2019311525ce724c79bdf7cb677c44bf7383323e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2019311525ce724c79bdf7cb677c44bf7383323e commit 2019311525ce724c79bdf7cb677c44bf7383323e Author: Mark Johnston AuthorDate: 2025-07-15 15:16:57 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:09:04 +0000 swap_pager: Convert swap-space-full flags to bools No functional change intended. Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51321 (cherry picked from commit 5c76e9f4579677482b0f96d4b3581f5e1ea2e072) --- sys/vm/swap_pager.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 53cd8294e299..c23f8bc1f966 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -377,8 +377,8 @@ swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) #endif } -static int swap_pager_full = 2; /* swap space exhaustion (task killing) */ -static int swap_pager_almost_full = 1; /* swap space exhaustion (w/hysteresis)*/ +static bool swap_pager_full = true; /* swap space exhaustion (task killing) */ +static bool swap_pager_almost_full = true; /* swap space exhaustion (w/hysteresis) */ static struct mtx swbuf_mtx; /* to sync nsw_wcount_async */ static int nsw_wcount_async; /* limit async write buffers */ static int nsw_wcount_async_max;/* assigned maximum */ @@ -542,14 +542,14 @@ swp_sizecheck(void) { if (swap_pager_avail < nswap_lowat) { - if (swap_pager_almost_full == 0) { + if (!swap_pager_almost_full) { printf("swap_pager: out of swap space\n"); - swap_pager_almost_full = 1; + swap_pager_almost_full = true; } } else { - swap_pager_full = 0; + swap_pager_full = false; if (swap_pager_avail > nswap_hiwat) - swap_pager_almost_full = 0; + swap_pager_almost_full = false; } } @@ -858,11 +858,10 @@ swp_pager_getswapspace(int *io_npages) swp_sizecheck(); swdevhd = TAILQ_NEXT(sp, sw_list); } else { - if (swap_pager_full != 2) { + if (!swap_pager_full) { printf("swp_pager_getswapspace(%d): failed\n", *io_npages); - swap_pager_full = 2; - swap_pager_almost_full = 1; + swap_pager_full = swap_pager_almost_full = true; } swdevhd = NULL; } @@ -2581,10 +2580,8 @@ swapoff_one(struct swdevt *sp, struct ucred *cred, u_int flags) sp->sw_id = NULL; TAILQ_REMOVE(&swtailq, sp, sw_list); nswapdev--; - if (nswapdev == 0) { - swap_pager_full = 2; - swap_pager_almost_full = 1; - } + if (nswapdev == 0) + swap_pager_full = swap_pager_almost_full = true; if (swdevhd == sp) swdevhd = NULL; mtx_unlock(&sw_dev_mtx); From nobody Tue Jul 29 12:49:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCN2r9pz62xLL; Tue, 29 Jul 2025 12:49:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCM5kWdz3lcq; Tue, 29 Jul 2025 12:49:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32uQH8ag+DTEGdLc2KiJSnKriuUlOplT8TjS/MqESE0=; b=P51Gah5GdcSis0NzsuB2WslHTOx6ni2Ie3MILx/7jmu6pJddTbb8d7bsopodH0negQ4vl7 nqpgLbVmjuC4ZsyyWop65a3qGPQuG0EHxg8T+Jsa98ZEY7uLS+BDo0VTB7ye0/xAoW0IU5 EhepUBCJ1MPw5bB0pbZ1DrsICn+iohUA3T0QPxUJVTRc2fEyCsgnkbx3SDnsyC0Yl9V16B 9Z8YeLmAJelpUS6AkAc8BpPDCUV85mgNOHAbQ+llXYkA2XnT92lEOZxLwBMWsq/9U1otWT O0Hmr1bAaO7InrTL6JZzDYLTAnd3q/zrjeZzkBmCi3cKiWh4tLYxlgXSo5sPCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32uQH8ag+DTEGdLc2KiJSnKriuUlOplT8TjS/MqESE0=; b=GOlOWQJnAiaPbqbyCwP4ivcjXxFpYHXDsGq776E7Ci2o3rEIZ2FCKSMVKlb/q53MUT7N6n J6RN1dCpPUgvdCh8Gy0ottenaOWLCBADy8DaQE7tcbpT4zWCevnLiTFcXIiA07B3pXI1Ba FzC+8j1BEAISBuVBmpxvpEYbQL0260RGWwMOvn6WQrh27GoVGcoExzv1peCA5ybfGa4rAE p16y5xnsyKFTZ//GR3kda/+QWu7SaZfEZy3PwXoj5iIyGp2xtAzGWX9LB58g0u2kX0+DYp NCbSTItdSqAh15xbhK1/QVZ9pWsGC9JIMq8TW5L1xxXZ7JsJPNPY6+NKRG5kXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793359; a=rsa-sha256; cv=none; b=g0c2PB4YjhThQhDSdliWkJA5tmS8IAs0M0J6Kh92a3BWFNTPP0Eajw3va6SS6b/BJ5GQ7x G7tu2j4QaJzK/XpUn7XS7PGMCEofz280kaC5pnHw++cH0ayY7GGZ3QRx9oNzOhlG6ddJRP miEwqGrMgxfBpr8iNDBqKTDp0EqVD86zYD5+ZSkZ3K+VI/zWNaBPnus/+9vzUSbiOvwTX5 b7CRU/kwV8aNMs1zV5CY80HfqM12rbc/nIRSQCeqpNQhrw6z6NNG9eV4GKdOAeky5KYOVC Q051vF8BIdI71RYz7fFPs2iyrOq2ev4zmR0sFanxNRjG+FdJxAT9udfKvm5CEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCM5BWtzY1r; Tue, 29 Jul 2025 12:49:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnJVh033834; Tue, 29 Jul 2025 12:49:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnJQC033831; Tue, 29 Jul 2025 12:49:19 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:19 GMT Message-Id: <202507291249.56TCnJQC033831@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: 852cc22dda9b - stable/14 - vm_pageout: Remove a volatile qualifier from some vm_domain members List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 852cc22dda9b69dac61068b8507958aee048068a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=852cc22dda9b69dac61068b8507958aee048068a commit 852cc22dda9b69dac61068b8507958aee048068a Author: Mark Johnston AuthorDate: 2025-07-15 15:16:40 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:09:12 +0000 vm_pageout: Remove a volatile qualifier from some vm_domain members These are always accessed using atomic(9) intrinsics, so do not need the qualifier. No functional change intended. Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51322 (cherry picked from commit fad79db405052f3faad7184ea2c8bfe9f92a700d) --- sys/vm/vm_pagequeue.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index 43cb67a252b5..29280f859bab 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -260,9 +260,9 @@ struct vm_domain { u_int vmd_inactive_shortage; /* Per-thread shortage. */ blockcount_t vmd_inactive_running; /* Number of inactive threads. */ blockcount_t vmd_inactive_starting; /* Number of threads started. */ - volatile u_int vmd_addl_shortage; /* Shortage accumulator. */ - volatile u_int vmd_inactive_freed; /* Successful inactive frees. */ - volatile u_int vmd_inactive_us; /* Microseconds for above. */ + u_int vmd_addl_shortage; /* (a) Shortage accumulator. */ + u_int vmd_inactive_freed; /* (a) Successful inactive frees. */ + u_int vmd_inactive_us; /* (a) Microseconds for above. */ u_int vmd_inactive_pps; /* Exponential decay frees/second. */ int vmd_oom_seq; int vmd_last_active_scan; From nobody Tue Jul 29 12:49:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwCP3Vlsz62xYs; Tue, 29 Jul 2025 12:49:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwCN6BP7z3lmF; Tue, 29 Jul 2025 12:49:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0RBoLpM6oOz/MW7GHz+XgjHzeX0UQ/aXeWNUyYZhgWA=; b=FZnwSJ1hRF4ceNyPtQtdecf3snnoiwTI+Ok0x9uvzsQzagjMShmCnxXOdElXjxyeUpqG3H x2TDTn56bXKySD5H+dbr++7yVG+EATuEQG8VKFJXTCgBJyhKnbOHYy+91Ldiwh3lzbPfVV AwD67mucyPbdGSG83/8zDPvyFTNVu8w/IIvgLtGyme3Ja9eQd861ACVlxXpL2SDVIGRwV0 VsInq6075xdmiPl/4PtzATtQ9rF6nQjWAB5EPjJ+ZsKWhTddave6P9ir3E//i75KZwHTtz gG1B7IuF3vaAvEYv2Y5dNlbdQNtTG+RAiCLvqVA9bW/tI+Bo6W/jvZFDj82hyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753793360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0RBoLpM6oOz/MW7GHz+XgjHzeX0UQ/aXeWNUyYZhgWA=; b=CMIre62Vcy855Kt9Gd0x2Fu3LrbiNVIcKbju1hYeCVQ02Xf//Vy8BBQj8F0zC9leobr1UV aRof7GaUVbBiMqdf+o5oh9mFc7y2qIHme72FZAgznwy5wwvPkjhOau1FdYnoN4UcORtx9u 4j+SKJ2a82yACq57MOEV5aK4zVo7EDBOMOqNjtJqL6y6JnVGmK5yPimXJ4TjHuldJL2mAQ 16lqFeVMqsKvZAWODlnZk6DppKbg6+hXZRInzQsXRZPDrJrZAK3luDDVTHMzXG41HeGfvE HTJAilVHLsL8PFeCCqmjBq7VpxmPDnxkYnDCf2lKEvPiwUt6VPGaP9atwuEnKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753793360; a=rsa-sha256; cv=none; b=pyu/FLvQ+iPI7fCr3+dl29AaYq5xMCb1/X5AEea+k4zUWVlPyFm2VtA2E1Eh88+NIVFuvE x0LQY9iN/91dIpEWm1VspTYXjkXK0fTrd/rYmxmreY/tRkBkxxPj1xVLYak8IoHBjiB3Ea 1ILkWHvRy72t01JJD2pFJ17jYvkcTAHP06P2BRjXcbuRNwUBSUBgfLvn5GiYAXRohv+lgB Rlw0HUb8cPPjG+FSg0VXLBc9A81uql08/nzNJU/6eV6LgeZsdqWgGtOshx7quTT8ICjNU9 +9yuMkGLsb7ZZRVB/sAOxr2smkU4zCLEpr7gkhno6+Z4vjMTlnfAgos59dQ2GA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwCN5n9GzXZg; Tue, 29 Jul 2025 12:49:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TCnKcW033877; Tue, 29 Jul 2025 12:49:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TCnKm2033873; Tue, 29 Jul 2025 12:49:20 GMT (envelope-from git) Date: Tue, 29 Jul 2025 12:49:20 GMT Message-Id: <202507291249.56TCnKm2033873@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: 8aeeb4b7f0ff - stable/14 - p9fs: Set *eofflag in p9fs_readdir() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 8aeeb4b7f0ff21844617def38f89fe34bf05ae4c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8aeeb4b7f0ff21844617def38f89fe34bf05ae4c commit 8aeeb4b7f0ff21844617def38f89fe34bf05ae4c Author: Mark Johnston AuthorDate: 2025-07-15 00:20:06 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 12:09:19 +0000 p9fs: Set *eofflag in p9fs_readdir() Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50760 (cherry picked from commit d4cdba5b2f55b62ba1558995226dd9d93fe00af8) --- sys/fs/p9fs/p9fs_vnops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 56bf766ef801..227e2b93883e 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -1784,6 +1784,9 @@ p9fs_readdir(struct vop_readdir_args *ap) return (EBADF); } + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; + io_buffer = uma_zalloc(p9fs_io_buffer_zone, M_WAITOK); /* We haven't reached the end yet. read more. */ @@ -1801,8 +1804,11 @@ p9fs_readdir(struct vop_readdir_args *ap) count = p9_client_readdir(vofid, (char *)io_buffer, diroffset, count); - if (count == 0) + if (count == 0) { + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; break; + } if (count < 0) { error = EIO; From nobody Tue Jul 29 13:01:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwTz722Yz62xq0; Tue, 29 Jul 2025 13:01:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwTz3MvTz3rkx; Tue, 29 Jul 2025 13:01:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56TD1lvr066818; Tue, 29 Jul 2025 16:01:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56TD1lvr066818 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56TD1kW5066817; Tue, 29 Jul 2025 16:01:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 29 Jul 2025 16:01:46 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4brwTz3MvTz3rkx X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > Author: Konstantin Belousov > > AuthorDate: 2025-07-27 13:50:57 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > ufs_vnops.c: newparent is not bool > > > > Use proper comparision operators when we need to see if newparent was > > set to not-zero value. > > > > Reviewed by: mckusick, olce > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D51573 > > --- > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > index 406b8f943077..2757fb066981 100644 > > --- a/sys/ufs/ufs/ufs_vnops.c > > +++ b/sys/ufs/ufs/ufs_vnops.c > > @@ -1476,7 +1476,7 @@ relock: > > * the user must have write permission in the source so > > * as to be able to change "..". > > */ > > - if (doingdirectory && newparent) { > > + if (doingdirectory && newparent != 0) { > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > if (error) > > goto unlockout; > > @@ -1539,7 +1539,7 @@ relock: > > if (tip == NULL) { > > if (ITODEV(tdp) != ITODEV(fip)) > > panic("ufs_rename: EXDEV"); > > - if (doingdirectory && newparent) { > > + if (doingdirectory && newparent != 0) { > > /* > > * Account for ".." in new directory. > > * When source and destination have the same > > @@ -1632,7 +1632,7 @@ relock: > > goto bad; > > } > > if (doingdirectory) { > > - if (!newparent) { > > + if (newparent == 0) { > > tdp->i_effnlink--; > > if (DOINGSOFTDEP(tdvp)) > > softdep_change_linkcnt(tdp); > > @@ -1642,11 +1642,10 @@ relock: > > softdep_change_linkcnt(tip); > > } > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > - IFTODT(fip->i_mode), > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > + IFTODT(fip->i_mode), doingdirectory); > > Is this part of the change correct? > > syzbot is reporting some panics after this change and commit > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 I committed the revert, with the Fixes tag, for now. But consider: Two cases: 1. doingdirectory == true: the expression can be rewritten as newparent ? newparent : true. Then this is the same as true. 2. doingdirectory == false: then the expression is false. From nobody Tue Jul 29 13:13:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwlC0x1gz62yrG; Tue, 29 Jul 2025 13:13:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwlC022nz3t8c; Tue, 29 Jul 2025 13:13:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753794807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0U+paByuBx8cwvbQ3DI4p1UZJfbd/qf3lrAHZ7SGKRc=; b=KsNUIGvX6kQQVRFMmwCeM5f75+jAnsIau8xj4DnGInL++fZIQq66RVq2T26YHGbvROPlrS ZBlzCSHV4kwLPLFY7BeAERWpI6jcDlqqMz7YZUNT9LoXYzKvYU9jPX2tlCJSeQ7meiFlWz Cv9xpY4TQgeMc4O7KDsrvT8f3PF/TRECWXD3dsmCYyv9j/gg++9eixet4qfELm/2aLJA6l 8CLcUgOHT8f4I8WNp6OuZ6lObOB6AvT4fWYD6LJRv2Ri0lVm3mVb4ErSLycXJR5L4g2PC4 R3jitkVdrFPlyfx0zW3KNZoz1xzMForfjXpjgopy2/e22PB5TOa6Wr5uXXOtCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753794807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0U+paByuBx8cwvbQ3DI4p1UZJfbd/qf3lrAHZ7SGKRc=; b=e+8uoYC/IvmO8fiW61VCWYNA10x0fWZpcFwAvVjLugUlD0Yx8ZMcS4qUA+xux47B/RbrIy L7wP7Qkt7/iZzFM24Ca5JuXAuRAvFldxJyRAvupemD1ni4dx8nH45XYGUqNdQTcrJN17zh gQlHbbCMxMWzkcjGgh2Mud3br77M4FKuvcUDsWbVmx/pxLcIwipuUw2LzugBFP7f/Mr/il mdEnQdf4YG9BDNVERpV6gQ49kKeBhyK/RmC+sXt1dVXiznutHD8s2fWtHXRvhEcdfvq9gM tIJeAYISkvI+160yAMdReU6u1dutFqhRKpBFBl1vJ7VGbOMUsvdiLkiMJuOJBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753794807; a=rsa-sha256; cv=none; b=vYZ7KhGgi9fDwbPO9dQW1ZK96ZATkZ7X/deHvH4c/rv0x2AQNJr5hm6czMOgJbs4T6fr0q oTow40q5OXEUZErqGSJWBV8iHVNyMll+EIvTWR9pHBQL01rvuvdpXC8QO72t8k5AEgD2Kk ozyIKfcPZh+PBaOii9if9G298hOMexZpzeQeW63ALIVc0QnRYg9ZE612rMePbEXvN4lhAx seMqdhD/M04TQA+rq3uiQN6n1RGxA1qIySPMk7stCmdNci2Ka9BXqmPp3wZZa2YI8CFnob lZy4quUK4amY4ixTCmVXi+ex4MJjJdd+vadBlrV7nYjH//1E2yZ0YJYMDoQkCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwlB6l2qzY6g; Tue, 29 Jul 2025 13:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TDDQNg089340; Tue, 29 Jul 2025 13:13:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TDDQFb089337; Tue, 29 Jul 2025 13:13:26 GMT (envelope-from git) Date: Tue, 29 Jul 2025 13:13:26 GMT Message-Id: <202507291313.56TDDQFb089337@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: da50f49977cc - main - ifconfig: fix removing IPv6 addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da50f49977cc4e6aae55cb2379313599249a8dd2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=da50f49977cc4e6aae55cb2379313599249a8dd2 commit da50f49977cc4e6aae55cb2379313599249a8dd2 Author: Kristof Provost AuthorDate: 2025-07-29 09:50:11 +0000 Commit: Kristof Provost CommitDate: 2025-07-29 13:13:09 +0000 ifconfig: fix removing IPv6 addresses Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/ifconfig/af_inet6.c | 2 +- sbin/ifconfig/tests/inet6.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index 17dc068ee875..7986edf490b4 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -759,7 +759,7 @@ static struct afswtch af_inet6 = { #else .af_difaddr = NL_RTM_DELADDR, .af_aifaddr = NL_RTM_NEWADDR, - .af_ridreq = &in6_add, + .af_ridreq = &in6_del, .af_addreq = &in6_add, .af_exec = in6_exec_nl, #endif diff --git a/sbin/ifconfig/tests/inet6.sh b/sbin/ifconfig/tests/inet6.sh index edfd88d93af7..22399915a64d 100644 --- a/sbin/ifconfig/tests/inet6.sh +++ b/sbin/ifconfig/tests/inet6.sh @@ -76,8 +76,38 @@ broadcast_cleanup() vnet_cleanup } +atf_test_case "delete6" "cleanup" +delete6_head() +{ + atf_set descr 'Test removing IPv6 addresses' + atf_set require.user root +} + +delete6_body() +{ + vnet_init + + ep=$(vnet_mkepair) + + atf_check -s exit:0 \ + ifconfig ${ep}a inet6 fe80::42/64 + atf_check -s exit:0 -o match:"fe80::42%${ep}" \ + ifconfig ${ep}a inet6 + + atf_check -s exit:0 \ + ifconfig ${ep}a inet6 -alias fe80::42 + atf_check -s exit:0 -o not-match:"fe80::42%${ep}" \ + ifconfig ${ep}a inet6 +} + +delete6_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case netmask atf_add_test_case broadcast + atf_add_test_case delete6 } From nobody Tue Jul 29 13:13:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwlD3Ny6z62ymV; Tue, 29 Jul 2025 13:13:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwlD14lzz3t6R; Tue, 29 Jul 2025 13:13:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753794808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqbDq1vlFCzZ5mmdx9XB1FQS+TPJDv1SAUvVN5nz0fk=; b=i28QPEI7DTlRCIynzBny9JspFL/KQbW/+XLcBp1ZkqUvVHlz9qCUDVxgf8995vudf1k6ia h/JODf8cavrTsWRwInAl772qdtrgh9qXEjNMZrm9tYUbIQRzgLYRKlf3uK6FsP4bNmk+fz i/xFc0DNVlOe51lSJ9OJ1RhNsDPyjJZV4vZMvBjw+49xegkKKT8X4V/U3/NlEjWqLN5DzK WwN3ZjLjA6CMYbtXD4UJsoA2IX+gt4kDxj/PjuXYshEs3f9H/kfdxRhO9KDj2fNvvhpjyo rBoGM4JWXLYirSuU0YuNCM4ajPIorh0VIoEaCZu0fzYO80v7GoAxzd8tAJfDpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753794808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PqbDq1vlFCzZ5mmdx9XB1FQS+TPJDv1SAUvVN5nz0fk=; b=VKMg8zi0qib5E70l/ZCQC/LPFNT07BeK/q1DSvGu6oVOzMz9nSRx/se6t76BPzK7idjuFE DTjCI9h1Mxt4LiL0fCtMsko+OOBRzn/GrYKvEVYwJgJWT3yy9uJoEhTiuR7KGnuRueEGiE IZYify4+izJ+UNnVYfgGTQAa0/CMQ3cuq8vg+9vrlUmO1pdg1qlwaPC5uf+/ZOTl3t4jVz y2kgoT3fde2lBmsfNw/u669zToNSXfphS133+iGy6k5C5ik+HfqXKO8MfwxPcFuTbmhnsi eG3buLAJ+W0RPMlZ1W60+FxcPdZButETnkSJbM/4wjjBL128g+8Al2wFccLgbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753794808; a=rsa-sha256; cv=none; b=sWTLa9jgCK55wRABY+yf3c7/splaGt9TJTvKC4GI+yqMyavGu2dF9ohGp3bXWDV8jWK65n DUg7f+gTECEYFJkKcJWO4TZPSm/yraT257YTJ8bXGe4UrUYfXpBEqXXX5uvQleBpxFD1Fh mYIksBF1byUZ7ctAACSFGydbC7oCQKoLJBDVB99gaBIuvTM+Av6PMiflyKnOBgpT2jqjlq uCv5roSdHyT0uIImdacAqqidHAXovEsiRAWBkKdUShrV/NPtdfBRsmbwq8fvv60OG9QiEq O5TMl0EGIUTs1A9sFjGon1aNqQOAnHag/YAIkSF8O4qdkzZVwHFZkMgnTwFLOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwlD0hFpzZ9m; Tue, 29 Jul 2025 13:13:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TDDRGD089373; Tue, 29 Jul 2025 13:13:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TDDReZ089370; Tue, 29 Jul 2025 13:13:27 GMT (envelope-from git) Date: Tue, 29 Jul 2025 13:13:27 GMT Message-Id: <202507291313.56TDDReZ089370@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: e9ca883b12c0 - main - netinet6: Don't return non-IPv6 enabled interfaces from in6_getlinkifnet() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: e9ca883b12c0db6210717025f539ef846b986d5b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e9ca883b12c0db6210717025f539ef846b986d5b commit e9ca883b12c0db6210717025f539ef846b986d5b Author: Kristof Provost AuthorDate: 2025-07-24 14:31:41 +0000 Commit: Kristof Provost CommitDate: 2025-07-29 13:13:10 +0000 netinet6: Don't return non-IPv6 enabled interfaces from in6_getlinkifnet() There are scenarios where we can end up looking up an interface by its scope and turn up an interface that doesn't have IPv6 enabled on it. If that happens we could end up dereferencing a NULL pointer accessing ifp->if_afdata[AF_INET6]. Check for this. One such scenario is if a firewall rewrites a destination address to a link-local address, with an embedded scope for such an interface. Attach a test case which provokes this. PR: 288263 Reported by: Robert Morris Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D51500 --- sys/netinet6/scope6.c | 17 ++++++++++++++++- tests/sys/netpfil/pf/nat64.py | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c index 0987ea7e99ad..08702a2e81ab 100644 --- a/sys/netinet6/scope6.c +++ b/sys/netinet6/scope6.c @@ -505,8 +505,23 @@ in6_set_unicast_scopeid(struct in6_addr *in6, uint32_t scopeid) struct ifnet* in6_getlinkifnet(uint32_t zoneid) { + struct ifnet *ifp; - return (ifnet_byindex((u_short)zoneid)); + ifp = ifnet_byindex((u_short)zoneid); + + if (ifp == NULL) + return (NULL); + + /* An interface might not be IPv6 capable. */ + if (ifp->if_afdata[AF_INET6] == NULL) { + log(LOG_NOTICE, + "%s: embedded scope points to an interface without " + "IPv6: %s%%%d.\n", __func__, + if_name(ifp), zoneid); + return (NULL); + } + + return (ifp); } /* diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py index 5cc4713a16cc..a5890fc4a161 100644 --- a/tests/sys/netpfil/pf/nat64.py +++ b/tests/sys/netpfil/pf/nat64.py @@ -33,7 +33,7 @@ from atf_python.sys.net.tools import ToolsHelper from atf_python.sys.net.vnet import VnetTestTemplate class TestNAT64(VnetTestTemplate): - REQUIRED_MODULES = [ "pf" ] + REQUIRED_MODULES = [ "pf", "pflog" ] TOPOLOGY = { "vnet1": {"ifaces": ["if1"]}, "vnet2": {"ifaces": ["if1", "if2"]}, @@ -92,12 +92,15 @@ class TestNAT64(VnetTestTemplate): def vnet2_handler(self, vnet): ifname = vnet.iface_alias_map["if1"].name + ToolsHelper.print_output("/sbin/sysctl net.inet6.ip6.forwarding=1") ToolsHelper.print_output("/sbin/route add default 192.0.2.2") ToolsHelper.print_output("/sbin/pfctl -e") ToolsHelper.pf_rules([ "pass inet6 proto icmp6", "pass in on %s inet6 af-to inet from 192.0.2.1" % ifname]) + vnet.pipe.send(socket.if_nametoindex("pflog0")) + @pytest.mark.require_user("root") @pytest.mark.require_progs(["scapy"]) def test_tcp_rst(self): @@ -287,3 +290,39 @@ class TestNAT64(VnetTestTemplate): reply = sp.sr1(packet, timeout=3) # We don't expect a reply to a corrupted packet assert not reply + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) + def test_noip6(self): + """ + PR 288263: link-local target address in icmp6 ADVERT can cause NULL deref + """ + ifname = self.vnet.iface_alias_map["if1"].name + gw_mac = self.vnet.iface_alias_map["if1"].epairb.ether + scopeid = self.wait_object(self.vnet_map["vnet2"].pipe) + ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1") + + import scapy.all as sp + + pkt = sp.Ether(dst=gw_mac) \ + / sp.IPv6(dst="64:ff9b::203.0.113.2") \ + / sp.ICMPv6ND_NA(tgt="FFA2:%x:2821:125F:1D27:B3B2:3F6F:C43C" % scopeid) + pkt.show() + sp.hexdump(pkt) + s = DelayedSend(pkt, sendif=ifname) + + packets = sp.sniff(iface=ifname, timeout=5) + for r in packets: + r.show() + + # Try scope id that likely doesn't have an interface at all + pkt = sp.Ether(dst=gw_mac) \ + / sp.IPv6(dst="64:ff9b::203.0.113.2") \ + / sp.ICMPv6ND_NA(tgt="FFA2:%x:2821:125F:1D27:B3B2:3F6F:C43C" % 255) + pkt.show() + sp.hexdump(pkt) + s = DelayedSend(pkt, sendif=ifname) + + packets = sp.sniff(iface=ifname, timeout=5) + for r in packets: + r.show() From nobody Tue Jul 29 13:13:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwlF5JKHz62yy3; Tue, 29 Jul 2025 13:13:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwlF1zlcz3skq; Tue, 29 Jul 2025 13:13:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753794809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/rLh4qCq6tbDl/2T7nlbEJN5fqCslSDzkB5PLE11TMM=; b=H37gMu4q3YD2md+98i9ViH3WzDLrIRvlVxQ04/wQQMbIMDCdkMoEmxzeFiyzBGOCM9Bge/ ZsTR89u1HY7hDAYSpdbU4v9TkLIHor5YvfNNP6kSbrJ7/tYgDe3HLf5RRuooo6YJudzqkA xBumIKTIaVAViByG3ZdDCvNG0fdzHCaFpajcZL8MUuAKA2arBn1Ha3QkKlP1CJRB37M3Bw w7Ry2khTNf9/AI9jNitu9Uedk6T2AJptkyMuK+lczO2rVJI/yxUWqF2MZm1SpcxcYRaBxG 4pX/k7q1DGwwvwhIaO0Zvp7ZX+ZYpCkLBwTU4C2XFuWw1whvwhDZJIT3le8k0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753794809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/rLh4qCq6tbDl/2T7nlbEJN5fqCslSDzkB5PLE11TMM=; b=KH+HWaBYrfNHK5YEIkAaEbe3W57WtJe/nSja/unvXn2DTTMVEvlphYl5SpaKSk+hBSbAOB pM71ndnA5ASKrJ0I8PIraQaX3oNpnt9UoCC7AcSmCLMCdoswpT76dfYRup0Ooz0PguheY3 Fb0/BL+G/kIZ3f/DOzMblSghXF3glB6H80bnniHh4yjxeT44MIMGSlbi/4pc5zHGGoKFEo 5S7LH3DOaOn7cCOxwBt7QZriYGTNxDRF0TCFaQ3/xgWPcjvKIG0YJNuwRCAgiyLYrPbBq6 UR65kuME+RLucqG+QFRZobOuZI253w7TtfKybASeKZFzXUlgkqLeZKDuw+cwRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753794809; a=rsa-sha256; cv=none; b=GseP1X/2MOjRVf0RUFXlCEA0SB7JvPV3iDkyQEPjvL9OUoVr/4q1YGzxcpM8YT60FF2Z2X 931/nTjoZZ/hySVz+BO7gAKRNcEV051zMC3NWGPMbyfwnQrEcpz4hNRG0f6tNGojEZTmft MFZu39SLhPW7tEtbwMbkj5QDtwSPCYXk5J2lbyNQVUR6t8gAq5Iq4r378k7qhfA0NadpgL pE641LwOKihhQUuXTWIn90/Tdg099QyhNgCPEWvdnbSLt59ui4ZBUU+EKWNlRHAz9aP2tk mLfx9iCU19lZTB+dDL+wcyfCPkNHubiAhf3BfR/i3WWMhHVd1EWTF/XPmVrySA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brwlF1b2BzYxs; Tue, 29 Jul 2025 13:13:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TDDTYG089407; Tue, 29 Jul 2025 13:13:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TDDTGQ089404; Tue, 29 Jul 2025 13:13:29 GMT (envelope-from git) Date: Tue, 29 Jul 2025 13:13:29 GMT Message-Id: <202507291313.56TDDTGQ089404@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: f1f77adfd9bc - main - pf: remove incorrect __unused annotation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: f1f77adfd9bcd80d95b674a032b6f37449ee827f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f1f77adfd9bcd80d95b674a032b6f37449ee827f commit f1f77adfd9bcd80d95b674a032b6f37449ee827f Author: Kristof Provost AuthorDate: 2025-07-29 08:18:24 +0000 Commit: Kristof Provost CommitDate: 2025-07-29 13:13:10 +0000 pf: remove incorrect __unused annotation Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 41e9ca27912d..79c298c18b46 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7399,7 +7399,7 @@ pf_sctp_multihome_delayed(struct pf_pdesc *pd, struct pfi_kkif *kif, { struct pf_sctp_multihome_job *j, *tmp; struct pf_sctp_source *i; - int ret __unused; + int ret; struct pf_kstate *sm = NULL; struct pf_krule *ra = NULL; struct pf_krule *r = &V_pf_default_rule; From nobody Tue Jul 29 13:16:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwpk0RRmz62yYv; Tue, 29 Jul 2025 13:16:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwpj5bwTz3tm8; Tue, 29 Jul 2025 13:16:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-7e169ac6009so551633985a.0; Tue, 29 Jul 2025 06:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753794987; x=1754399787; 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=VEO22Z/KBo3ziKIQxnPdXVzhU7BhlGpGLTjm26K70Ts=; b=gPliyqZGhY1pXyqVlUIbQ239hFQV6pbPjjOIpSPHMC3W83RVANXjG0r2kdVvMbooAs Mab7SfGvRfxAN+fhA9fk0TEFqbJIDS+/Z0ma+kfR6TsG9NfVFPWQ6xfzYcmUm3nCnYT8 /nx8i8p0OYDkHrbN7vxkH8J+qkSKGabpqYwyzq4qaYB/zosmgAU5gKOc3RN1rjntNHzg 2Hy0i3MFYnS2rYQHjjqBHqhp8mpz2LwBfU53iWWRz49AM/xYePPrBvImUg7sDNNfQS6s lqRNc0ngI7xiwXfCuEQEt3EIIiSMYEwmq2DWkNdCIFnOPNOcK+kNHbmKxxvDRG8+EERR 0wPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753794987; x=1754399787; 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=VEO22Z/KBo3ziKIQxnPdXVzhU7BhlGpGLTjm26K70Ts=; b=A2TQ1uCZ62y4EONBpvK2JpMA6nSBJ8H+ZA9pYuX+q04AWNdTVi7LOcy0QRWo+eug+N R/bkw4EhNfArjnFnCRH5guPLI9gK3CsVV+ktNT9cjSvzTi+ZLs0mFW0/NIOEBVQS+msp w7V2PiHal0tq6XLlv8M0zHAxPUMDP2+yU3NKcTiKRYoSDBZ5P/bbaNU8Repi7RxvXpnr 0Ow08nwFgNjngAJfR9ZuFbuGu1MlGYy/LgR5MQ/i4T+B9JWDESI1cvmZ4ds5K7Foy8cB N1LEfJRcA5l/iRO3o4yAj8qszS17a9F3jNCWIpWfZTEAApXRWaKRLSYAORBOjWScTKVz gEIw== X-Forwarded-Encrypted: i=1; AJvYcCXX2XBWMI+yjUC/wIcP82PchsPXgG2lK46OFkvu015P+7xF+/oA3DsWMDS99ktTBzJF4LjTM3MQ4FhUbLq473gUpKCbuxI=@freebsd.org, AJvYcCXZIVafixNMsJSN+7Dkjiv3GBmIV+uKca38BueUOF9XeqJTBAHxJ6LC41OP2uVkS3dtQIZM9gALoXl0ue2mat9WiikS@freebsd.org X-Gm-Message-State: AOJu0YzIIca0mi5sQWbx8ohEy6yaGmVWcJS+dpVk3yHlWwu+qsaMiQkK Om0llQCGnZ8KWvzVrIoY4mMs1tm2eY+WyR1ffwQiGhY4N8zfkfXyeyWq X-Gm-Gg: ASbGncvABM91sFXG7EG/fNmHYu0khJpLwj/mWSiQdWtChOuQCCDaW0vX0q+rfo1hRfj 68fhVGUQR/GAslidY6bSI9CRkWQgw2iQ1Bb7jO/AFNDMwKOgtMAf+atLuXr9fh1Mwz0gCiQONpt bHtF2wNc2LjM5GnjAWujBKwB7vVeI3o95XUsNKIT9Ne6GKwttFeX+aT3uy3JzutQ0NPx5YUE7f6 0MIuR4MjAE1XjaYnCFf8hoB8LNWlBgnnr9CDbPGpRX2ARCj2uN0wCN7zjUqPHX+/YPYvB9PdZ3D HlVHi6UHCyqWRwOjho7SM3YRG3I/kQNI5vGyA2gCkUbZLBUyMquEU2YNoqvUiBuypgCVarqrZvr 7G7U96mkF/zLJcPEoumhWnLTQCL/YzKZ7xUrl X-Google-Smtp-Source: AGHT+IHGLLPfDiszZbihtdUysKDFyb2CaEc343R3x8byn0AqlVUnZVBn4FE2k8brGd67SiPa0JH/Yg== X-Received: by 2002:a05:620a:aa09:b0:7e3:2f18:e2aa with SMTP id af79cd13be357-7e63bf60f5cmr2052114685a.25.1753794987353; Tue, 29 Jul 2025 06:16:27 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e6438a144bsm417895885a.81.2025.07.29.06.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 06:16:26 -0700 (PDT) Date: Tue, 29 Jul 2025 09:16:23 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4brwpj5bwTz3tm8 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > Author: Konstantin Belousov > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > ufs_vnops.c: newparent is not bool > > > > > > Use proper comparision operators when we need to see if newparent was > > > set to not-zero value. > > > > > > Reviewed by: mckusick, olce > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D51573 > > > --- > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > index 406b8f943077..2757fb066981 100644 > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > @@ -1476,7 +1476,7 @@ relock: > > > * the user must have write permission in the source so > > > * as to be able to change "..". > > > */ > > > - if (doingdirectory && newparent) { > > > + if (doingdirectory && newparent != 0) { > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > if (error) > > > goto unlockout; > > > @@ -1539,7 +1539,7 @@ relock: > > > if (tip == NULL) { > > > if (ITODEV(tdp) != ITODEV(fip)) > > > panic("ufs_rename: EXDEV"); > > > - if (doingdirectory && newparent) { > > > + if (doingdirectory && newparent != 0) { > > > /* > > > * Account for ".." in new directory. > > > * When source and destination have the same > > > @@ -1632,7 +1632,7 @@ relock: > > > goto bad; > > > } > > > if (doingdirectory) { > > > - if (!newparent) { > > > + if (newparent == 0) { > > > tdp->i_effnlink--; > > > if (DOINGSOFTDEP(tdvp)) > > > softdep_change_linkcnt(tdp); > > > @@ -1642,11 +1642,10 @@ relock: > > > softdep_change_linkcnt(tip); > > > } > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > - IFTODT(fip->i_mode), > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > + IFTODT(fip->i_mode), doingdirectory); > > > > Is this part of the change correct? > > > > syzbot is reporting some panics after this change and commit > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > I committed the revert, with the Fixes tag, for now. But consider: > > Two cases: > 1. doingdirectory == true: > the expression can be rewritten as newparent ? newparent : true. > Then this is the same as true. > > 2. doingdirectory == false: > then the expression is false. I think the problem is that the isrmdir parameter to ufs_dirrewrite() is not a bool as the name implies. See softdep_setup_directory_change(), which checks isrmdir > 1. From nobody Tue Jul 29 13:22:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brwyQ5yBBz630HX; Tue, 29 Jul 2025 13:23:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4brwyQ39XTz3wCG; Tue, 29 Jul 2025 13:23:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56TDMvuK068341; Tue, 29 Jul 2025 16:23:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56TDMvuK068341 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56TDMuj3068340; Tue, 29 Jul 2025 16:22:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 29 Jul 2025 16:22:56 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4brwyQ39XTz3wCG X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 29, 2025 at 09:16:23AM -0400, Mark Johnston wrote: > On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > Author: Konstantin Belousov > > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > > > ufs_vnops.c: newparent is not bool > > > > > > > > Use proper comparision operators when we need to see if newparent was > > > > set to not-zero value. > > > > > > > > Reviewed by: mckusick, olce > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D51573 > > > > --- > > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > > index 406b8f943077..2757fb066981 100644 > > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > > @@ -1476,7 +1476,7 @@ relock: > > > > * the user must have write permission in the source so > > > > * as to be able to change "..". > > > > */ > > > > - if (doingdirectory && newparent) { > > > > + if (doingdirectory && newparent != 0) { > > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > > if (error) > > > > goto unlockout; > > > > @@ -1539,7 +1539,7 @@ relock: > > > > if (tip == NULL) { > > > > if (ITODEV(tdp) != ITODEV(fip)) > > > > panic("ufs_rename: EXDEV"); > > > > - if (doingdirectory && newparent) { > > > > + if (doingdirectory && newparent != 0) { > > > > /* > > > > * Account for ".." in new directory. > > > > * When source and destination have the same > > > > @@ -1632,7 +1632,7 @@ relock: > > > > goto bad; > > > > } > > > > if (doingdirectory) { > > > > - if (!newparent) { > > > > + if (newparent == 0) { > > > > tdp->i_effnlink--; > > > > if (DOINGSOFTDEP(tdvp)) > > > > softdep_change_linkcnt(tdp); > > > > @@ -1642,11 +1642,10 @@ relock: > > > > softdep_change_linkcnt(tip); > > > > } > > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > > - IFTODT(fip->i_mode), > > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > > + IFTODT(fip->i_mode), doingdirectory); > > > > > > Is this part of the change correct? > > > > > > syzbot is reporting some panics after this change and commit > > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > > > I committed the revert, with the Fixes tag, for now. But consider: > > > > Two cases: > > 1. doingdirectory == true: > > the expression can be rewritten as newparent ? newparent : true. > > Then this is the same as true. > > > > 2. doingdirectory == false: > > then the expression is false. > > I think the problem is that the isrmdir parameter to ufs_dirrewrite() is > not a bool as the name implies. See softdep_setup_directory_change(), > which checks isrmdir > 1. Right, then revert does not fix anything. From nobody Tue Jul 29 13:38:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brxJ421mJz630ly; Tue, 29 Jul 2025 13:38:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brxJ35Fcpz3D1j; Tue, 29 Jul 2025 13:38:27 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-4abc006bcadso63087981cf.0; Tue, 29 Jul 2025 06:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753796305; x=1754401105; 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=DkSMTbVJtZ28aAxDo/6AKFMRgZH6cBGph/6DqauDKGQ=; b=aVGnlzYvoh/ORlgHc3BVjSN+O4Ah/GDwCxdhAsjDJ9U8L+TFTNXnYz1RkNYzpALUAW VTtwXKXYBjt+O2aO2H9ynnZfWyGYkhBhVKXRra2wjGRI8GogqNG94nBS8dYJ92ovynEh UMhbI/FQpMHLZ7bx/8ppKwQg4PQRSJw+u2lyaviYyEXZGpUX448j5+5zyaiKhXPFVFBz oDKGvWc8yFDlWQCTAhO95WNhgTkp2NDawt1mBRKJwcut40tt4egCmhgkiDApoHaUkkE2 LQbuQWUZ8gfcJkGqa+ib1vifbRUsevbLXjh+aSbSG2jMt5/gKnIeC+nvxuB4d/BHshuN /2aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753796305; x=1754401105; 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=DkSMTbVJtZ28aAxDo/6AKFMRgZH6cBGph/6DqauDKGQ=; b=ZTfH3vZkM5aSh4yKQC8w5X1qaykA+YljSi0ZjUJC5759/YYzfEu5sAw4PVdVVCoGJ2 dVOETpdFRFgNSTveamlF8CP3pAWF8qTWctU71rEFriqEOEXyRhKxHR9xWRSrYXVPT35Z oLQ3SUMJxp4eC+w9wDRdWIaZbzJyO7FqQL4QTNpFi4zQF9GCiPzo5c1C5hVYB33SETAe OJxWjtr3KeV33z3xesTCHdbA/bd8mjsIz79H4yRYhtSbXgDMoi9gu5tSbS4qEofNdejN uXr+X/yjFLpBJ3i8W2k58LwFiwvryzOib5ASp4xiR6eCZ4Bs5L+J0ZIyLRSXpy0oP1/d 12lw== X-Forwarded-Encrypted: i=1; AJvYcCXTSg9S4eKN+X7H0xaqsoJmofjkNrzlIuqUhSrBQre4JBjvy3lcgGMoa0Om5/Gs/nv0VkFtrzh0ATBH6mBmV89cbiQqpYA=@freebsd.org, AJvYcCXzweEiLOg1YbTpy77XODVYvoYveTyTlcfV1YAYI/5KOSpqC+AP/ckcHBpW/y05z7CPXwve3668iLjzC0+LedGZxAIA@freebsd.org X-Gm-Message-State: AOJu0Yyf6FJGfhrHXj77n2AjBSwsT748Hqw2gh16kH4GKVpmaeMZrQdp iraKJ0APoUt072FBQkZX1TbvSpUE55z5JvYmvLj7SA6kJxoZjmPuYKPR X-Gm-Gg: ASbGnctKJFrU4xbrq5jtj0AI5c2WRboNMeIeYi6bQ9ZKqaaK4NsAx2Vb7YURYhK7AAQ FN9snb+UzNyF1Xu9qn5iMbTKahkgQxJTspHUGBn0W7eARYstbwOSde3LKKTBDBM+0whsHRWK+zv zGeBPbdVMdyflUx74QqKkTb1xfbghlVvMJATFcxlR3pR3Y5lb20OKw9mPqy+w/48UUqhRgrkcAL CyLiEKUlIP4jsfYtNjauD0ME3aiwdQ+PMQwdHIhpswDVxoBXG0fZWM3BCvfhu9fLNjUnw6e5oZE 3DPL0gstwcc4A0fyqltfAkidP6Rw0DCS4dChGV4ZduTa8TglA+fJi53ccL1fxCNTZua1cn2fbTA cmAFV7QEaZtj9KI1w+kE2JjEc+icLQx+eY83tWyx3noNhYU8= X-Google-Smtp-Source: AGHT+IEBWamxDM4kf/wY4lU6ynM3tizcRvdxzDdJaxAzhndSeP7IUaALXPhYgLnf6Xga1Jz32f87eA== X-Received: by 2002:ad4:5ba6:0:b0:707:5d35:2a54 with SMTP id 6a1803df08f44-7075d352bb4mr19476296d6.43.1753796304662; Tue, 29 Jul 2025 06:38:24 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-70729aafa4csm44481746d6.42.2025.07.29.06.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 06:38:23 -0700 (PDT) Date: Tue, 29 Jul 2025 09:38:21 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4brxJ35Fcpz3D1j X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 29, 2025 at 04:22:56PM +0300, Konstantin Belousov wrote: > On Tue, Jul 29, 2025 at 09:16:23AM -0400, Mark Johnston wrote: > > On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > > > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > > > The branch main has been updated by kib: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > Author: Konstantin Belousov > > > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > > > Commit: Konstantin Belousov > > > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > > > > > ufs_vnops.c: newparent is not bool > > > > > > > > > > Use proper comparision operators when we need to see if newparent was > > > > > set to not-zero value. > > > > > > > > > > Reviewed by: mckusick, olce > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 1 week > > > > > Differential revision: https://reviews.freebsd.org/D51573 > > > > > --- > > > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > > > index 406b8f943077..2757fb066981 100644 > > > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > > > @@ -1476,7 +1476,7 @@ relock: > > > > > * the user must have write permission in the source so > > > > > * as to be able to change "..". > > > > > */ > > > > > - if (doingdirectory && newparent) { > > > > > + if (doingdirectory && newparent != 0) { > > > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > > > if (error) > > > > > goto unlockout; > > > > > @@ -1539,7 +1539,7 @@ relock: > > > > > if (tip == NULL) { > > > > > if (ITODEV(tdp) != ITODEV(fip)) > > > > > panic("ufs_rename: EXDEV"); > > > > > - if (doingdirectory && newparent) { > > > > > + if (doingdirectory && newparent != 0) { > > > > > /* > > > > > * Account for ".." in new directory. > > > > > * When source and destination have the same > > > > > @@ -1632,7 +1632,7 @@ relock: > > > > > goto bad; > > > > > } > > > > > if (doingdirectory) { > > > > > - if (!newparent) { > > > > > + if (newparent == 0) { > > > > > tdp->i_effnlink--; > > > > > if (DOINGSOFTDEP(tdvp)) > > > > > softdep_change_linkcnt(tdp); > > > > > @@ -1642,11 +1642,10 @@ relock: > > > > > softdep_change_linkcnt(tip); > > > > > } > > > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > > > - IFTODT(fip->i_mode), > > > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > > > + IFTODT(fip->i_mode), doingdirectory); > > > > > > > > Is this part of the change correct? > > > > > > > > syzbot is reporting some panics after this change and commit > > > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > > > > > I committed the revert, with the Fixes tag, for now. But consider: > > > > > > Two cases: > > > 1. doingdirectory == true: > > > the expression can be rewritten as newparent ? newparent : true. > > > Then this is the same as true. > > > > > > 2. doingdirectory == false: > > > then the expression is false. > > > > I think the problem is that the isrmdir parameter to ufs_dirrewrite() is > > not a bool as the name implies. See softdep_setup_directory_change(), > > which checks isrmdir > 1. > > Right, then revert does not fix anything. Indeed. In the meantime, syzbot produced a reproducer: https://syzkaller.appspot.com/text?tag=ReproC&x=12fe9782580000 With the diff below, I no longer see any panics: diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 050b21c2be0b..b7453db9013c 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1643,7 +1643,7 @@ ufs_rename( } error = ufs_dirrewrite(tdp, tip, fip->i_number, IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? - newparent != 0: doingdirectory); + newparent : doingdirectory); if (error) { if (doingdirectory) { if (newparent == 0) { From nobody Tue Jul 29 13:45:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brxSS1gzcz631ck; Tue, 29 Jul 2025 13:45:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4brxSR4VKNz3DxT; Tue, 29 Jul 2025 13:45:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56TDjViJ069014; Tue, 29 Jul 2025 16:45:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56TDjViJ069014 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56TDjVrh069013; Tue, 29 Jul 2025 16:45:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 29 Jul 2025 16:45:30 +0300 From: Konstantin Belousov To: Mark Johnston , mckusick@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4brxSR4VKNz3DxT X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 29, 2025 at 09:16:23AM -0400, Mark Johnston wrote: > On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > Author: Konstantin Belousov > > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > > > ufs_vnops.c: newparent is not bool > > > > > > > > Use proper comparision operators when we need to see if newparent was > > > > set to not-zero value. > > > > > > > > Reviewed by: mckusick, olce > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D51573 > > > > --- > > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > > index 406b8f943077..2757fb066981 100644 > > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > > @@ -1476,7 +1476,7 @@ relock: > > > > * the user must have write permission in the source so > > > > * as to be able to change "..". > > > > */ > > > > - if (doingdirectory && newparent) { > > > > + if (doingdirectory && newparent != 0) { > > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > > if (error) > > > > goto unlockout; > > > > @@ -1539,7 +1539,7 @@ relock: > > > > if (tip == NULL) { > > > > if (ITODEV(tdp) != ITODEV(fip)) > > > > panic("ufs_rename: EXDEV"); > > > > - if (doingdirectory && newparent) { > > > > + if (doingdirectory && newparent != 0) { > > > > /* > > > > * Account for ".." in new directory. > > > > * When source and destination have the same > > > > @@ -1632,7 +1632,7 @@ relock: > > > > goto bad; > > > > } > > > > if (doingdirectory) { > > > > - if (!newparent) { > > > > + if (newparent == 0) { > > > > tdp->i_effnlink--; > > > > if (DOINGSOFTDEP(tdvp)) > > > > softdep_change_linkcnt(tdp); > > > > @@ -1642,11 +1642,10 @@ relock: > > > > softdep_change_linkcnt(tip); > > > > } > > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > > - IFTODT(fip->i_mode), > > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > > + IFTODT(fip->i_mode), doingdirectory); > > > > > > Is this part of the change correct? > > > > > > syzbot is reporting some panics after this change and commit > > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > > > I committed the revert, with the Fixes tag, for now. But consider: > > > > Two cases: > > 1. doingdirectory == true: > > the expression can be rewritten as newparent ? newparent : true. > > Then this is the same as true. > > > > 2. doingdirectory == false: > > then the expression is false. > > I think the problem is that the isrmdir parameter to ufs_dirrewrite() is > not a bool as the name implies. See softdep_setup_directory_change(), > which checks isrmdir > 1. Right. While phab is down, this should fix it, and another error with the signess of the inum passed in isrmdir (the > 1 check would fail in fact). While the phab is broken, I am posting the fix there. commit 897f2b45277def12bac6d87dd8a139a04970b8d7 Author: Konstantin Belousov Date: Tue Jul 29 16:35:17 2025 +0300 ufs: change isrmdir type to bool or u_int as appropriate Use bool for isrmdir argument to ufs_dirremove()/softdep_setup_remove()/newdirrem(), where it is used as bool. Use u_int for isrmdir argument to ufs_dirrewrite()/softdep_setup_directory_change() where it is 0/1/ino. Without the change to unsigned, the if (isrmdir > 1) test is broken on volumes with many inodes. Noted by: markj Fixes: 610319c766e941de96e52f2d28fea9f8cfc51aeb Fixes: 98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 3f4aec02ba49..9393938d60c5 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -274,7 +274,7 @@ void softdep_setup_remove(struct buf *bp, struct inode *dp, struct inode *ip, - int isrmdir) + bool isrmdir) { panic("softdep_setup_remove called"); @@ -285,7 +285,7 @@ softdep_setup_directory_change(struct buf *bp, struct inode *dp, struct inode *ip, ino_t newinum, - int isrmdir) + u_int isrmdir) { panic("softdep_setup_directory_change called"); @@ -765,7 +765,7 @@ static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *); static void handle_workitem_freefile(struct freefile *); static int handle_workitem_remove(struct dirrem *, int); static struct dirrem *newdirrem(struct buf *, struct inode *, - struct inode *, int, struct dirrem **); + struct inode *, bool, struct dirrem **); static struct indirdep *indirdep_lookup(struct mount *, struct inode *, struct buf *); static void cancel_indirdep(struct indirdep *, struct buf *, @@ -9169,7 +9169,7 @@ softdep_setup_remove( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir) /* indicates if doing RMDIR */ + bool isrmdir) /* indicates if doing RMDIR */ { struct dirrem *dirrem, *prevdirrem; struct inodedep *inodedep; @@ -9361,7 +9361,7 @@ newdirrem( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir, /* indicates if doing RMDIR */ + bool isrmdir, /* indicates if doing RMDIR */ struct dirrem **prevdirremp) /* previously referenced inode, if any */ { int offset; @@ -9490,7 +9490,7 @@ newdirrem( dirrem->dm_state |= COMPLETE; cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref); #ifdef INVARIANTS - if (isrmdir == 0) { + if (!isrmdir) { struct worklist *wk; LIST_FOREACH(wk, &dirrem->dm_jwork, wk_list) @@ -9525,7 +9525,7 @@ softdep_setup_directory_change( struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ ino_t newinum, /* new inode number for changed entry */ - int isrmdir) /* indicates if doing RMDIR */ + u_int isrmdir) /* indicates if doing RMDIR */ { int offset; struct diradd *dap = NULL; @@ -9558,7 +9558,7 @@ softdep_setup_directory_change( /* * Allocate a new dirrem and ACQUIRE_LOCK. */ - dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem); + dirrem = newdirrem(bp, dp, ip, isrmdir != 0, &prevdirrem); pagedep = dirrem->dm_pagedep; /* * The possible values for isrmdir: diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index ccd9046a5fa8..111fb1cb40b3 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -66,8 +66,8 @@ void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); int ufs_direnter(struct vnode *, struct vnode *, struct direct *, struct componentname *, struct buf *); -int ufs_dirremove(struct vnode *, struct inode *, int, int); -int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); +int ufs_dirremove(struct vnode *, struct inode *, int, bool); +int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, u_int); int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, ino_t *); int ufs_getlbns(struct vnode *, ufs2_daddr_t, struct indir *, int *); @@ -93,9 +93,9 @@ int softdep_setup_directory_add(struct buf *, struct inode *, off_t, ino_t, struct buf *, int); void softdep_change_directoryentry_offset(struct buf *, struct inode *, caddr_t, caddr_t, caddr_t, int); -void softdep_setup_remove(struct buf *,struct inode *, struct inode *, int); +void softdep_setup_remove(struct buf *,struct inode *, struct inode *, bool); void softdep_setup_directory_change(struct buf *, struct inode *, - struct inode *, ino_t, int); + struct inode *, ino_t, u_int); void softdep_change_linkcnt(struct inode *); int softdep_slowdown(struct vnode *); void softdep_setup_create(struct inode *, struct inode *); diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 3f9c95e934fc..4877ff0c4db5 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1101,7 +1101,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, * to the size of the previous entry. */ int -ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) +ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, bool isrmdir) { struct inode *dp; struct direct *ep, *rep; @@ -1224,7 +1224,7 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) */ int ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, - int isrmdir) + u_int isrmdir) { struct buf *bp; struct direct *ep; diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 050b21c2be0b..ee2188baf28d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1051,7 +1051,7 @@ ufs_remove( #ifdef UFS_GJOURNAL ufs_gjournal_orphan(vp); #endif - error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, 0); + error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, false); if (ip->i_nlink <= 0) vp->v_vflag |= VV_NOSYNC; if (IS_SNAPSHOT(ip)) { @@ -1209,7 +1209,7 @@ ufs_whiteout( #endif cnp->cn_flags &= ~DOWHITEOUT; - error = ufs_dirremove(dvp, NULL, cnp->cn_flags, 0); + error = ufs_dirremove(dvp, NULL, cnp->cn_flags, false); break; default: panic("ufs_whiteout: unknown op"); @@ -1643,7 +1643,7 @@ ufs_rename( } error = ufs_dirrewrite(tdp, tip, fip->i_number, IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? - newparent != 0: doingdirectory); + newparent : doingdirectory); if (error) { if (doingdirectory) { if (newparent == 0) { @@ -1728,7 +1728,7 @@ ufs_rename( "rename: missing .. entry"); cache_purge(fdvp); } - error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); + error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, false); /* * The kern_renameat() looks up the fvp using the DELETE flag, which * causes the removal of the name cache entry for fvp. @@ -2309,7 +2309,7 @@ ufs_rmdir( ip->i_effnlink--; if (DOINGSOFTDEP(vp)) softdep_setup_rmdir(dp, ip); - error = ufs_dirremove(dvp, ip, cnp->cn_flags, 1); + error = ufs_dirremove(dvp, ip, cnp->cn_flags, true); if (error) { dp->i_effnlink++; ip->i_effnlink++; From nobody Tue Jul 29 13:54:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brxfm6LKNz631n7; Tue, 29 Jul 2025 13:54:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4brxfm4P45z3Fqq; Tue, 29 Jul 2025 13:54:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56TDsXI9069373; Tue, 29 Jul 2025 16:54:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56TDsXI9069373 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56TDsXLh069372; Tue, 29 Jul 2025 16:54:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 29 Jul 2025 16:54:33 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4brxfm4P45z3Fqq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 29, 2025 at 09:38:21AM -0400, Mark Johnston wrote: > On Tue, Jul 29, 2025 at 04:22:56PM +0300, Konstantin Belousov wrote: > > On Tue, Jul 29, 2025 at 09:16:23AM -0400, Mark Johnston wrote: > > > On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > > > > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > > > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > > > > The branch main has been updated by kib: > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > Author: Konstantin Belousov > > > > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > > > > Commit: Konstantin Belousov > > > > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > > > > > > > ufs_vnops.c: newparent is not bool > > > > > > > > > > > > Use proper comparision operators when we need to see if newparent was > > > > > > set to not-zero value. > > > > > > > > > > > > Reviewed by: mckusick, olce > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > MFC after: 1 week > > > > > > Differential revision: https://reviews.freebsd.org/D51573 > > > > > > --- > > > > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > > > > index 406b8f943077..2757fb066981 100644 > > > > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > > > > @@ -1476,7 +1476,7 @@ relock: > > > > > > * the user must have write permission in the source so > > > > > > * as to be able to change "..". > > > > > > */ > > > > > > - if (doingdirectory && newparent) { > > > > > > + if (doingdirectory && newparent != 0) { > > > > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > > > > if (error) > > > > > > goto unlockout; > > > > > > @@ -1539,7 +1539,7 @@ relock: > > > > > > if (tip == NULL) { > > > > > > if (ITODEV(tdp) != ITODEV(fip)) > > > > > > panic("ufs_rename: EXDEV"); > > > > > > - if (doingdirectory && newparent) { > > > > > > + if (doingdirectory && newparent != 0) { > > > > > > /* > > > > > > * Account for ".." in new directory. > > > > > > * When source and destination have the same > > > > > > @@ -1632,7 +1632,7 @@ relock: > > > > > > goto bad; > > > > > > } > > > > > > if (doingdirectory) { > > > > > > - if (!newparent) { > > > > > > + if (newparent == 0) { > > > > > > tdp->i_effnlink--; > > > > > > if (DOINGSOFTDEP(tdvp)) > > > > > > softdep_change_linkcnt(tdp); > > > > > > @@ -1642,11 +1642,10 @@ relock: > > > > > > softdep_change_linkcnt(tip); > > > > > > } > > > > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > > > > - IFTODT(fip->i_mode), > > > > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > > > > + IFTODT(fip->i_mode), doingdirectory); > > > > > > > > > > Is this part of the change correct? > > > > > > > > > > syzbot is reporting some panics after this change and commit > > > > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > > > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > > > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > > > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > > > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > > > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > > > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > > > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > > > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > > > > > > > I committed the revert, with the Fixes tag, for now. But consider: > > > > > > > > Two cases: > > > > 1. doingdirectory == true: > > > > the expression can be rewritten as newparent ? newparent : true. > > > > Then this is the same as true. > > > > > > > > 2. doingdirectory == false: > > > > then the expression is false. > > > > > > I think the problem is that the isrmdir parameter to ufs_dirrewrite() is > > > not a bool as the name implies. See softdep_setup_directory_change(), > > > which checks isrmdir > 1. > > > > Right, then revert does not fix anything. > > Indeed. In the meantime, syzbot produced a reproducer: > https://syzkaller.appspot.com/text?tag=ReproC&x=12fe9782580000 > > With the diff below, I no longer see any panics: > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > index 050b21c2be0b..b7453db9013c 100644 > --- a/sys/ufs/ufs/ufs_vnops.c > +++ b/sys/ufs/ufs/ufs_vnops.c > @@ -1643,7 +1643,7 @@ ufs_rename( > } > error = ufs_dirrewrite(tdp, tip, fip->i_number, > IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? > - newparent != 0: doingdirectory); > + newparent : doingdirectory); > if (error) { > if (doingdirectory) { > if (newparent == 0) { Go ahead if you want, my patch fixes more bugs there, I believe, and is still needed. From nobody Tue Jul 29 13:55:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brxh92d2cz631fd; Tue, 29 Jul 2025 13:55:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brxh90Z3gz3GMV; Tue, 29 Jul 2025 13:55:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7e1f3b95449so102748685a.1; Tue, 29 Jul 2025 06:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753797350; x=1754402150; 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=B80Nm0gCl8CqKQfle0hnzhqxHp4ZfUhz3lIya7VQ2Eg=; b=RVLbYlIVTaMWgeew9jHMcLh62NRlRq8J1R3ZhsMOcgoJsSaH16hmCEQ1yAp1NGE3iT BgwbwFdKDHlTtfZnqYpGTrHl8+Bfecy9GgwdZGG2IGvBSlL6h422roTCkEsxp9M74m0y 7Q1pfSeu19XkC8RpQWZASAa1cQxqQ5eRuc6RZ9FRfm2MMJOUUw4wE5g+ll/go8fK5N8V rK1i/MZ4Ig9xw5VRccygIhAOdEk9jZXoYVutE/Xp56lGhVMuhjnga2daZgwUK2E2V27h 7AIGJFgXto3Py6Ki9MVKco/hyJa+nhApr8kYlTVGrioEXhOCz1B5325T7q1Yjw7mOHA2 HyuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753797350; x=1754402150; 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=B80Nm0gCl8CqKQfle0hnzhqxHp4ZfUhz3lIya7VQ2Eg=; b=EHao1lcUUnsakefEfIFq1yQabfIdIJ2VZfwgsIIZNiMtJH2Z60I2lB42rbKpo1CB/m Dic2u8LbTXEDMsDpscY9XbUdbLHqJCAgNKYTsWdZAzmig3XvbCiULDPByXUuJuDoqNgg iU0H5p/roIjpGFlxnXfIJvLixgo/ZRUfv/H54nwA/cnDjyij4wcZ3UtJ1bCyzjZ02eFD E7YzQYqIYLzshLgdqQK/B1CQB7Reps7KnvtFPU5sbB1gmMFoYISrrxWgUtpGE+4Y4LJH 99oAM0RSqhQS7rqAdFJOoOCjKja0RnVGWVs/fEooF54CCyYrECn/snKW9nkyd82vWwFp oYVw== X-Forwarded-Encrypted: i=1; AJvYcCUC4D1Wnb2jecuvtxuKzNX+RNSJIWshScaUmZuIwFu0AAkUGmbwwFQbQ+3JJ4L1/pmaz9lJbv6DBTxpFlxd5/KYvmNkhcI=@freebsd.org, AJvYcCVtpJRcuDsNSU9+J9GRmRGcObWCo4p09n13wgqfZwbz8HfKTpvowXtYRHZWN8bA+zOB7h6BnO4lkvB8KBG1gXE=@freebsd.org, AJvYcCWWHYSa/5oDn9glXrlt6rAxGaDW2RxVEBM4sGH0G8yj9tGgHHGfE+wcf2TWyYUUPkHTGD2r10M5jjMtJjNrJm7kK9Tp@freebsd.org X-Gm-Message-State: AOJu0YzxjwovY0Thj7hTIit/flA9/bSfLW4T/Ll20g7qwPpSaQ6GC+eu 1bcBnxrS+eUSR8hDltamDiVI+aGPXgyCHF70umQIQhnMTRTDNa7D1hfD X-Gm-Gg: ASbGncv7Bpde/LI96bzTX2igD8rw3QmMy6LmcVaxh8ukQ1xroxoL+uY+bit71ABBU5S RqlRyvip20QcyQEG4fY70wduh8Gzuedanrxwv5UO0XqdxwmqpAnqMTeAPe1uwclERSHH3voS5cU 0mRpxqoOGotiLG68uPoIdjJ+tRgDBTM3/7f9id2K2J9ZoGn8sg4AOAnnJS6UyZoGb6/Hm318Csd XDKijP99Zt6tPR1ueCNqxYxm/uVIjCbKwaMpYSgp0npbGpx1Cs6SOOnIWmS7miH3+NqBuwYniR/ pwT7Ea/CKFQUHASp+ro4CR4JBwJzvWrSUNLgBTPNj6wecjxsmZBMZdtS3xc8DNdE5mwD3RsXf0z 956pyzQrJAAJvGdmXIYZ3CtYhevg5J9hB4i0A X-Google-Smtp-Source: AGHT+IEbxMX0znUhRkKY3m8rShudW9cMoVzNxqf0As47o+u8i7uA32QXpZ2NeFiYkN0t+yl8KJjKzQ== X-Received: by 2002:a05:620a:268f:b0:7dc:86f1:ee1a with SMTP id af79cd13be357-7e65f281c5emr489547885a.11.1753797350298; Tue, 29 Jul 2025 06:55:50 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e64328255bsm423271385a.17.2025.07.29.06.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 06:55:49 -0700 (PDT) Date: Tue, 29 Jul 2025 09:55:46 -0400 From: Mark Johnston To: Konstantin Belousov Cc: mckusick@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4brxh90Z3gz3GMV X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 29, 2025 at 04:45:30PM +0300, Konstantin Belousov wrote: > On Tue, Jul 29, 2025 at 09:16:23AM -0400, Mark Johnston wrote: > > On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > > > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > > > The branch main has been updated by kib: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > Author: Konstantin Belousov > > > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > > > Commit: Konstantin Belousov > > > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > > > > > ufs_vnops.c: newparent is not bool > > > > > > > > > > Use proper comparision operators when we need to see if newparent was > > > > > set to not-zero value. > > > > > > > > > > Reviewed by: mckusick, olce > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 1 week > > > > > Differential revision: https://reviews.freebsd.org/D51573 > > > > > --- > > > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > > > index 406b8f943077..2757fb066981 100644 > > > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > > > @@ -1476,7 +1476,7 @@ relock: > > > > > * the user must have write permission in the source so > > > > > * as to be able to change "..". > > > > > */ > > > > > - if (doingdirectory && newparent) { > > > > > + if (doingdirectory && newparent != 0) { > > > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > > > if (error) > > > > > goto unlockout; > > > > > @@ -1539,7 +1539,7 @@ relock: > > > > > if (tip == NULL) { > > > > > if (ITODEV(tdp) != ITODEV(fip)) > > > > > panic("ufs_rename: EXDEV"); > > > > > - if (doingdirectory && newparent) { > > > > > + if (doingdirectory && newparent != 0) { > > > > > /* > > > > > * Account for ".." in new directory. > > > > > * When source and destination have the same > > > > > @@ -1632,7 +1632,7 @@ relock: > > > > > goto bad; > > > > > } > > > > > if (doingdirectory) { > > > > > - if (!newparent) { > > > > > + if (newparent == 0) { > > > > > tdp->i_effnlink--; > > > > > if (DOINGSOFTDEP(tdvp)) > > > > > softdep_change_linkcnt(tdp); > > > > > @@ -1642,11 +1642,10 @@ relock: > > > > > softdep_change_linkcnt(tip); > > > > > } > > > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > > > - IFTODT(fip->i_mode), > > > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > > > + IFTODT(fip->i_mode), doingdirectory); > > > > > > > > Is this part of the change correct? > > > > > > > > syzbot is reporting some panics after this change and commit > > > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > > > > > I committed the revert, with the Fixes tag, for now. But consider: > > > > > > Two cases: > > > 1. doingdirectory == true: > > > the expression can be rewritten as newparent ? newparent : true. > > > Then this is the same as true. > > > > > > 2. doingdirectory == false: > > > then the expression is false. > > > > I think the problem is that the isrmdir parameter to ufs_dirrewrite() is > > not a bool as the name implies. See softdep_setup_directory_change(), > > which checks isrmdir > 1. > Right. While phab is down, this should fix it, and another error with > the signess of the inum passed in isrmdir (the > 1 check would fail in > fact). > > While the phab is broken, I am posting the fix there. This looks right to me. I quickly tested it with the reproducers from syzbot and didn't see any problems. I'd also rename non-bool isrmdir to something like "newparent", just to make it a bit clearer that it's not a boolean value. From nobody Tue Jul 29 14:01:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brxpJ5ywDz631p2; Tue, 29 Jul 2025 14:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brxpJ57H0z3GyJ; Tue, 29 Jul 2025 14:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753797672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mAA3FaHy3L3Eo2AYlrvI84v2BaL0W4nlsmLesdq898Y=; b=VRgSqTeIBGzltqvW4qCstin78lAVC/8vtNv9bPCjjlxbM75UZv65w7yH2UwLDVXof2I1N+ GLzjUbwqV65rkEPkouRSRPrfVv88g/RlaIezkLqsD9y9aAWA6eUyHKwyfoVMNLLT+U572/ eMGRsQmkKfk1c3uEsTl+cfLDCI4rkdblJoYtQxDbifkKi9vN+tIOJPp7M9jtM1iAd/ockA viVBZ3MF5E5EIujpSnG/HbqrlX4s/76yHI6lkvqIgachULErXILUSYVq0liuktzoK+DLjN X21kUYA9bD+mQrXInxv7mID3e/UzojtY0MQNLwN5ZBJC+5oeadRaF/I+73OrCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753797672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mAA3FaHy3L3Eo2AYlrvI84v2BaL0W4nlsmLesdq898Y=; b=ekuESUwbvXc7d4QajxpY/r0ICOtYTse9qQfhNNtvwU40ePzp5HtaIeexDTkwgoYnKOcikj XfaeKGZtD0uhMtRhPj+1/A3esYXSaqJp9DZ4Sptf8SbmxuRMhk6NMlESXoUCQPrBhzrZ1U 68kDg/h61GYJSbMjwKEIk44pkllpxpZmLlRbEwGR0M23kCZfUAs1dvjbn8u51qR/2u3t6L yn90M/z65EmVWQNeToq9vJtMO85rY1/ib6lCcXqraEFZn8iDjSKoyIp9nUiGWsCApybTOh N+RW4/6K2aGKhqaQf5DgE1zyh5M7ypcPoXzNPU6onyqsM9z+aeNKN0bsggEw6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753797672; a=rsa-sha256; cv=none; b=ZAkadtrqF3AOQIlSVruBkYgzhjCn4KvvNwNwLLusfz/h263oJH+QalnVkx/+kPmlxs5TTz hnlqWLJtlorOypSpQkVb3MGTQo7fygDrg9kRIOEhtgGUSL5b0TlwQVZnGcZs4MOq7tncBC OfbhyazkkKjvNeXgistMxg80epKh0du/DbKL4+nccSyh7jIU+LlNHCAz9lKDpYBHga7u0B +w4yI/9q6Q1afyCJt64LmVjdVWaFGUwvm+gNtHI3dk739YCdxUxzyKiaGclu9uANOnJlDO KmPp0ekOBXBd/l+twcPEuMTfr8xnpcNclXBuffRc4hdg5EFbvFJVxp8LbmjzHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brxpJ4V6dzbNZ; Tue, 29 Jul 2025 14:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TE1Cue077725; Tue, 29 Jul 2025 14:01:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TE1CkO077722; Tue, 29 Jul 2025 14:01:12 GMT (envelope-from git) Date: Tue, 29 Jul 2025 14:01:12 GMT Message-Id: <202507291401.56TE1CkO077722@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: 2bc355c0182a - main - ufs: Pass the new parent inode number to ufs_dirrewrite() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2bc355c0182a889acc97a09e1272f7d7593949af Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2bc355c0182a889acc97a09e1272f7d7593949af commit 2bc355c0182a889acc97a09e1272f7d7593949af Author: Mark Johnston AuthorDate: 2025-07-29 13:56:48 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 13:56:48 +0000 ufs: Pass the new parent inode number to ufs_dirrewrite() Despite the name, isrmdir is not a boolean-valued, it is also used to pass a new parent inode number down to the SU layer. Fixes: 98eb6f0eaa50 ("ufs: restore conditional") Reviewed by: kib Reported by: syzbot+fbfff9613b6dab616124@syzkaller.appspotmail.com Reported by: syzbot+02cb048d48b51bcd9c41@syzkaller.appspotmail.com Reported by: syzbot+98c39c45a437812f7683@syzkaller.appspotmail.com Reported by: syzbot+6fb8cb919cc686d1a1d0@syzkaller.appspotmail.com Reported by: syzbot+fb35cce6a6f5075a6692@syzkaller.appspotmail.com Reported by: syzbot+602fb6ee1a39abfd3b5c@syzkaller.appspotmail.com Reported by: syzbot+5cb82352555d5d505640@syzkaller.appspotmail.com Reported by: syzbot+6a4ea1e13f4e07369785@syzkaller.appspotmail.com Reported by: syzbot+18722c8e4008048efb51@syzkaller.appspotmail.com --- sys/ufs/ufs/ufs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 050b21c2be0b..b7453db9013c 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1643,7 +1643,7 @@ relock: } error = ufs_dirrewrite(tdp, tip, fip->i_number, IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? - newparent != 0: doingdirectory); + newparent : doingdirectory); if (error) { if (doingdirectory) { if (newparent == 0) { From nobody Tue Jul 29 14:10:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bry132Wwpz632l2; Tue, 29 Jul 2025 14:10:31 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bry1262Jyz3J0G; Tue, 29 Jul 2025 14:10:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56TEAI6V069939; Tue, 29 Jul 2025 17:10:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56TEAI6V069939 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56TEAIB7069938; Tue, 29 Jul 2025 17:10:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 29 Jul 2025 17:10:18 +0300 From: Konstantin Belousov To: Mark Johnston , mckusick@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bry1262Jyz3J0G X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jul 29, 2025 at 09:55:46AM -0400, Mark Johnston wrote: > On Tue, Jul 29, 2025 at 04:45:30PM +0300, Konstantin Belousov wrote: > > On Tue, Jul 29, 2025 at 09:16:23AM -0400, Mark Johnston wrote: > > > On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > > > > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > > > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > > > > The branch main has been updated by kib: > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > Author: Konstantin Belousov > > > > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > > > > Commit: Konstantin Belousov > > > > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > > > > > > > ufs_vnops.c: newparent is not bool > > > > > > > > > > > > Use proper comparision operators when we need to see if newparent was > > > > > > set to not-zero value. > > > > > > > > > > > > Reviewed by: mckusick, olce > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > MFC after: 1 week > > > > > > Differential revision: https://reviews.freebsd.org/D51573 > > > > > > --- > > > > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > > > > index 406b8f943077..2757fb066981 100644 > > > > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > > > > @@ -1476,7 +1476,7 @@ relock: > > > > > > * the user must have write permission in the source so > > > > > > * as to be able to change "..". > > > > > > */ > > > > > > - if (doingdirectory && newparent) { > > > > > > + if (doingdirectory && newparent != 0) { > > > > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > > > > if (error) > > > > > > goto unlockout; > > > > > > @@ -1539,7 +1539,7 @@ relock: > > > > > > if (tip == NULL) { > > > > > > if (ITODEV(tdp) != ITODEV(fip)) > > > > > > panic("ufs_rename: EXDEV"); > > > > > > - if (doingdirectory && newparent) { > > > > > > + if (doingdirectory && newparent != 0) { > > > > > > /* > > > > > > * Account for ".." in new directory. > > > > > > * When source and destination have the same > > > > > > @@ -1632,7 +1632,7 @@ relock: > > > > > > goto bad; > > > > > > } > > > > > > if (doingdirectory) { > > > > > > - if (!newparent) { > > > > > > + if (newparent == 0) { > > > > > > tdp->i_effnlink--; > > > > > > if (DOINGSOFTDEP(tdvp)) > > > > > > softdep_change_linkcnt(tdp); > > > > > > @@ -1642,11 +1642,10 @@ relock: > > > > > > softdep_change_linkcnt(tip); > > > > > > } > > > > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > > > > - IFTODT(fip->i_mode), > > > > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > > > > + IFTODT(fip->i_mode), doingdirectory); > > > > > > > > > > Is this part of the change correct? > > > > > > > > > > syzbot is reporting some panics after this change and commit > > > > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > > > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > > > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > > > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > > > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > > > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > > > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > > > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > > > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > > > > > > > I committed the revert, with the Fixes tag, for now. But consider: > > > > > > > > Two cases: > > > > 1. doingdirectory == true: > > > > the expression can be rewritten as newparent ? newparent : true. > > > > Then this is the same as true. > > > > > > > > 2. doingdirectory == false: > > > > then the expression is false. > > > > > > I think the problem is that the isrmdir parameter to ufs_dirrewrite() is > > > not a bool as the name implies. See softdep_setup_directory_change(), > > > which checks isrmdir > 1. > > Right. While phab is down, this should fix it, and another error with > > the signess of the inum passed in isrmdir (the > 1 check would fail in > > fact). > > > > While the phab is broken, I am posting the fix there. > > This looks right to me. I quickly tested it with the reproducers from > syzbot and didn't see any problems. > > I'd also rename non-bool isrmdir to something like "newparent", just to > make it a bit clearer that it's not a boolean value. commit 6dfbc1e9bde38761f0b2267732bf690640cece0b Author: Konstantin Belousov Date: Tue Jul 29 16:35:17 2025 +0300 ufs: change isrmdir type to bool or u_int as appropriate Use bool for isrmdir argument to ufs_dirremove()/softdep_setup_remove()/newdirrem(), where it is used as bool. Use u_int for isrmdir argument to ufs_dirrewrite()/softdep_setup_directory_change() where it is 0/1/ino. Without the change to unsigned, the if (isrmdir > 1) test is broken on volumes with many inodes. Use newparent instead of isrmdir for the argument name in this case. Noted by: markj Fixes: 610319c766e941de96e52f2d28fea9f8cfc51aeb Fixes: 98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 3f4aec02ba49..67cd6fb4b738 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -274,7 +274,7 @@ void softdep_setup_remove(struct buf *bp, struct inode *dp, struct inode *ip, - int isrmdir) + bool isrmdir) { panic("softdep_setup_remove called"); @@ -285,7 +285,7 @@ softdep_setup_directory_change(struct buf *bp, struct inode *dp, struct inode *ip, ino_t newinum, - int isrmdir) + u_int newparent) { panic("softdep_setup_directory_change called"); @@ -765,7 +765,7 @@ static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *); static void handle_workitem_freefile(struct freefile *); static int handle_workitem_remove(struct dirrem *, int); static struct dirrem *newdirrem(struct buf *, struct inode *, - struct inode *, int, struct dirrem **); + struct inode *, bool, struct dirrem **); static struct indirdep *indirdep_lookup(struct mount *, struct inode *, struct buf *); static void cancel_indirdep(struct indirdep *, struct buf *, @@ -9169,7 +9169,7 @@ softdep_setup_remove( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir) /* indicates if doing RMDIR */ + bool isrmdir) /* indicates if doing RMDIR */ { struct dirrem *dirrem, *prevdirrem; struct inodedep *inodedep; @@ -9361,7 +9361,7 @@ newdirrem( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir, /* indicates if doing RMDIR */ + bool isrmdir, /* indicates if doing RMDIR */ struct dirrem **prevdirremp) /* previously referenced inode, if any */ { int offset; @@ -9490,7 +9490,7 @@ newdirrem( dirrem->dm_state |= COMPLETE; cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref); #ifdef INVARIANTS - if (isrmdir == 0) { + if (!isrmdir) { struct worklist *wk; LIST_FOREACH(wk, &dirrem->dm_jwork, wk_list) @@ -9525,7 +9525,7 @@ softdep_setup_directory_change( struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ ino_t newinum, /* new inode number for changed entry */ - int isrmdir) /* indicates if doing RMDIR */ + u_int newparent) /* indicates if doing RMDIR */ { int offset; struct diradd *dap = NULL; @@ -9558,10 +9558,10 @@ softdep_setup_directory_change( /* * Allocate a new dirrem and ACQUIRE_LOCK. */ - dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem); + dirrem = newdirrem(bp, dp, ip, newparent != 0, &prevdirrem); pagedep = dirrem->dm_pagedep; /* - * The possible values for isrmdir: + * The possible values for newparent: * 0 - non-directory file rename * 1 - directory rename within same directory * inum - directory rename to new directory of given inode number @@ -9572,7 +9572,7 @@ softdep_setup_directory_change( * the DIRCHG flag to tell handle_workitem_remove to skip the * followup dirrem. */ - if (isrmdir > 1) + if (newparent > 1) dirrem->dm_state |= DIRCHG; /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index ccd9046a5fa8..111fb1cb40b3 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -66,8 +66,8 @@ void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); int ufs_direnter(struct vnode *, struct vnode *, struct direct *, struct componentname *, struct buf *); -int ufs_dirremove(struct vnode *, struct inode *, int, int); -int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); +int ufs_dirremove(struct vnode *, struct inode *, int, bool); +int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, u_int); int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, ino_t *); int ufs_getlbns(struct vnode *, ufs2_daddr_t, struct indir *, int *); @@ -93,9 +93,9 @@ int softdep_setup_directory_add(struct buf *, struct inode *, off_t, ino_t, struct buf *, int); void softdep_change_directoryentry_offset(struct buf *, struct inode *, caddr_t, caddr_t, caddr_t, int); -void softdep_setup_remove(struct buf *,struct inode *, struct inode *, int); +void softdep_setup_remove(struct buf *,struct inode *, struct inode *, bool); void softdep_setup_directory_change(struct buf *, struct inode *, - struct inode *, ino_t, int); + struct inode *, ino_t, u_int); void softdep_change_linkcnt(struct inode *); int softdep_slowdown(struct vnode *); void softdep_setup_create(struct inode *, struct inode *); diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 3f9c95e934fc..fd0539c40c0d 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1101,7 +1101,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, * to the size of the previous entry. */ int -ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) +ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, bool isrmdir) { struct inode *dp; struct direct *ep, *rep; @@ -1224,7 +1224,7 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) */ int ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, - int isrmdir) + u_int newparent) { struct buf *bp; struct direct *ep; @@ -1267,7 +1267,8 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, if (!OFSFMT(vdp)) ep->d_type = newtype; if (DOINGSOFTDEP(vdp)) { - softdep_setup_directory_change(bp, dp, oip, newinum, isrmdir); + softdep_setup_directory_change(bp, dp, oip, newinum, + newparent); bdwrite(bp); } else { if (DOINGASYNC(vdp)) { diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 050b21c2be0b..ee2188baf28d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1051,7 +1051,7 @@ ufs_remove( #ifdef UFS_GJOURNAL ufs_gjournal_orphan(vp); #endif - error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, 0); + error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, false); if (ip->i_nlink <= 0) vp->v_vflag |= VV_NOSYNC; if (IS_SNAPSHOT(ip)) { @@ -1209,7 +1209,7 @@ ufs_whiteout( #endif cnp->cn_flags &= ~DOWHITEOUT; - error = ufs_dirremove(dvp, NULL, cnp->cn_flags, 0); + error = ufs_dirremove(dvp, NULL, cnp->cn_flags, false); break; default: panic("ufs_whiteout: unknown op"); @@ -1643,7 +1643,7 @@ ufs_rename( } error = ufs_dirrewrite(tdp, tip, fip->i_number, IFTODT(fip->i_mode), (doingdirectory && newparent != 0) ? - newparent != 0: doingdirectory); + newparent : doingdirectory); if (error) { if (doingdirectory) { if (newparent == 0) { @@ -1728,7 +1728,7 @@ ufs_rename( "rename: missing .. entry"); cache_purge(fdvp); } - error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); + error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, false); /* * The kern_renameat() looks up the fvp using the DELETE flag, which * causes the removal of the name cache entry for fvp. @@ -2309,7 +2309,7 @@ ufs_rmdir( ip->i_effnlink--; if (DOINGSOFTDEP(vp)) softdep_setup_rmdir(dp, ip); - error = ufs_dirremove(dvp, ip, cnp->cn_flags, 1); + error = ufs_dirremove(dvp, ip, cnp->cn_flags, true); if (error) { dp->i_effnlink++; ip->i_effnlink++; From nobody Tue Jul 29 14:20:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bryDH10wqz6336W; Tue, 29 Jul 2025 14:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bryDH0DShz3KKF; Tue, 29 Jul 2025 14:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753798815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tRGC8m2haVEFXA2OuziHfm164CrpIE8UHhI5EPSVmIE=; b=J/T+QCtuDIe8mQAOiIjjaymBV0YUOQBLdTEMlIKxcd7ftR57g0MP3y4gsnKeRItXN6oX2u Zy2SPUiIDkGWO1Z3n1Hqr/a828QeThjFWwZoaXjP/+cYaJ072WffecbjQALFTUcOHZO1i/ WmAf7+Vo0FbOz1J8LivB9D+7W2K+gaqauiDrsJ7Xp4NddowAePhhpRtvN/dM/3tpXGGO0K 4mEOPqfxZnf5+WRQfgRGb4UjPRvqxM8TxtRBftQ+1FV916TMmNXx/OmyUWpTZ0vUGShHHf NlBHrIFZ2lX6rqbN8fL7Z0M8RVAv/hfVk362RyPpsf9NrWou348M1Kiji9hZsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753798815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tRGC8m2haVEFXA2OuziHfm164CrpIE8UHhI5EPSVmIE=; b=c2GLySRflELPHgz/QcjU1bssxq+lYIS/xkXSduTJRm0R2Cs7gWHubc+bsBDn7cjwzAvviJ Wc6v25mpMSesED3IzQC/8kPQIge65NtzZE7qNa2j5bAx3efFOZmiXWZ58lz3s4+fAp6uny 4kT2Qb16PwpdunC4hR4Ea1wRdycNqcSjwJnteOeiQiM9s2FkPwkFrYympiYvX47o5BMjnM 9KMy37pbSspOnXnD5Y7vlVs9oT2vRLGZZwnZ4p7ZHokzBGjku4DyO92CxOKKV8SNM1zTRO busbSGrWOsepKaujykQ47gvfKewMaE2e9HHkCYMdwecAgBZTOyuwIct0NUgrZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753798815; a=rsa-sha256; cv=none; b=vjuR4zSFwyW2YEAbByq34Lnx+hFJLNvfiOv+7FGq0ORVkN4W4LkL8aO7Eh+2WvtK5aW4D2 cjfXQrv+b2DLYgRwVPYAsYG+tr7ZJLKybCoICgG87CJ6lr1o+n7Oh/Q6wHXcNN8NGxmt4F 8TSQ6+vTBRTkvnw/wvywZdwkoqO6tI328WrYq5EhytKGR3GkaJyQxcQjmjmQVtJ44tdL8O 29uqhZZjLMCE669vJocnutVr7Junc5VufxLQ79R4d0j81LVh3h/Xk7LhCW+TCdetuhti73 rlsgnGfOs1vzy6tCrwWpxKFitHiMqOd806EGhHihT+RpXttn+A1hhfbrGKmnyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bryDG6fb4zbV3; Tue, 29 Jul 2025 14:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TEKE1M012972; Tue, 29 Jul 2025 14:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TEKEx3012961; Tue, 29 Jul 2025 14:20:14 GMT (envelope-from git) Date: Tue, 29 Jul 2025 14:20:14 GMT Message-Id: <202507291420.56TEKEx3012961@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: 3fe326bfa030 - stable/14 - memcmp.3: Clarify return 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3fe326bfa03025654c017dde7ac8124beb5142fb Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3fe326bfa03025654c017dde7ac8124beb5142fb commit 3fe326bfa03025654c017dde7ac8124beb5142fb Author: Ed Maste AuthorDate: 2024-06-05 20:03:13 +0000 Commit: Ed Maste CommitDate: 2025-07-29 14:19:49 +0000 memcmp.3: Clarify return value The return value is not required to be the difference between the differing bytes, only less than zero, zero, or greater than zero. Reviewed by: fuz Event: Kitchener-Waterloo Hackathon 202406 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47683 (cherry picked from commit 5cc53d79655bf7f67b1a794c088d896aa6475c2e) --- lib/libc/string/memcmp.3 | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/lib/libc/string/memcmp.3 b/lib/libc/string/memcmp.3 index bf02412d9e70..8f4980d61c05 100644 --- a/lib/libc/string/memcmp.3 +++ b/lib/libc/string/memcmp.3 @@ -29,14 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)memcmp.3 8.1 (Berkeley) 6/4/93 -.\" -.Dd August 15, 2016 +.Dd November 20, 2024 .Dt MEMCMP 3 .Os .Sh NAME .Nm memcmp -.Nd compare byte string +.Nd compare bytes in memory .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -47,27 +45,25 @@ The .Fn memcmp function -compares byte string +compares byte object .Fa b1 -against byte string +against byte object .Fa b2 . -Both strings are assumed to be +Both objects are assumed to be .Fa len bytes long. .Sh RETURN VALUES The .Fn memcmp -function -returns zero if the two strings are identical, -otherwise returns the difference between the first two differing bytes -(treated as -.Vt "unsigned char" -values, so that -.Sq Li \e200 -is greater than -.Sq Li \&\e0 , -for example). -Zero-length strings are always identical. +function returns zero if the two objects are identical. +Zero-length objects are considered identical. +The +.Fn memcmp +function returns a negative value if the first differing byte has a lower +value in +.Fa b1 +and a positive value if the first differing byte has a higher value in +.Fa b1 . .Sh SEE ALSO .Xr bcmp 3 , .Xr strcasecmp 3 , @@ -82,3 +78,14 @@ The function conforms to .St -isoC . +.Sh CAVEATS +If the objects differ, the C library +.Fn memcmp +implementation returns the difference between the first two differing bytes +.Po treated as +.Vt "unsigned char" +values +.Pc . +This behavior is not specified by +.St -isoC , +is not portable, and may not occur in light of compiler optimizations. From nobody Tue Jul 29 14:20:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bryDJ1LJVz6336Z; Tue, 29 Jul 2025 14:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bryDJ06V4z3KF2; Tue, 29 Jul 2025 14:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753798816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zHpeDkIJ6Rb45xEr14rXbdPk4QdTd0VKFFUgZIKMXgk=; b=DExp21kXVxuM6mp2T/4IiYJYtvkQhDm3+4PP/pveRXlPlI8O9W40Ep4/dgFuRQxTZH95/R cZ7vKjMIPX1nVrTYhSezCEKbOYU4Pc87XcqQu5/Sp7kX/zJOcHNPYwwYZ9hDrvIFuwfhI/ rqPIwYtiRNDw3fKFSOPFK0LnnVYSGvTyN7ts7PjelGULHpKsZLqILzieIRfKDDY4cALyoW k1ndrYPxB4sIDqYhwSyEMv5sCVxIgH674ybYKRtWh/PEmPGmc+02Qqi1errXPa2V2DBoQf ge0N3D66VomnfzwEzXR6+0GKSwPrecZBcYEE3MlmQ7HIVaOkk0M9KU6cm2eunA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753798816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zHpeDkIJ6Rb45xEr14rXbdPk4QdTd0VKFFUgZIKMXgk=; b=abtzH0FJ+xe2ybIJ/Mte8ExB5P7qBbqUv+BW3EN/BnvjAFfWJ4kbEPrOg/uHqKsetH+q4e K7qODH1szdkRZsNfEnceLX9XPmGCV/yUKyQvCzjyfZ4Q8n3S4EMNABfwVUamvBXJDivzNq Ygq3jEY08CXbS2+D2t4r6jMDIuhqWD1HXONqAB+s0K0J3Ohup0V1lf5Pm6WwnMiuGrk4nR eqU2V4RLFSvyK1+IOuDl29rrJFavbLk/+vHzR3DTQ9sDPyk5C3bU7ozxYylINLXN495YXE kKuD+fhIvS3Ao2qUL2+MCPAsbpkUlukBo8y38PuGWg8K+J475Lpt3I5Y754RhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753798816; a=rsa-sha256; cv=none; b=D9Ic8zLvuRWV7nxa0a1pH+oNkgXfd9i/6XySlwVCFtnVRfj63iYAPCcaFEn02JRl6fw2VF TdvRkYPMAAAIzc951dpPYLbkOZHad0v6WcOrtW/2FMrRxKgE4CgxtAD9WMr3cRsRLrgva+ 13dJYBAixVkaNiJteBJFYtzJwkXm7uztueKY4fbLPt15JJSxnemhZEMhHVXhpf/keh+lXR BjJxxhx5J8iGS4TpQhH/5iR8aoWq43bQV7hAb5bEeHjISAgNzIo5lxtWZvH1t/6gaqPoco hQijM8c50vtEbhXnIQlptb9P9MtHRE/bYPeut+11m+dNnOUuIgxTY0WKY2U8MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bryDH6pcszbD1; Tue, 29 Jul 2025 14:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TEKFH1013625; Tue, 29 Jul 2025 14:20:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TEKFLe013616; Tue, 29 Jul 2025 14:20:15 GMT (envelope-from git) Date: Tue, 29 Jul 2025 14:20:15 GMT Message-Id: <202507291420.56TEKFLe013616@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: 27ed3497bb55 - stable/14 - =?utf-8?Q?uk.kbd: Fix =E2=82=AC mapping?= List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 27ed3497bb553374f7d80d7a0ff65f0296ee5ce4 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=27ed3497bb553374f7d80d7a0ff65f0296ee5ce4 commit 27ed3497bb553374f7d80d7a0ff65f0296ee5ce4 Author: Ed Maste AuthorDate: 2025-06-05 15:18:45 +0000 Commit: Ed Maste CommitDate: 2025-07-29 14:19:49 +0000 uk.kbd: Fix € mapping We previously emitted the generic currency sign `¤` for Ctrl+4. Generally speaking the modifer should be AltGr not Ctrl, and this should be the Euro symbol `€`. Fixes: eb8f9028fb38 ("Add the Euro symbol mapping to the UK keyboard keymap.") Fixes: a232c1d130d2 ("Copy country-code .iso syscons keymaps for vt(4)") Fixes: fdd869bd8a89 ("Another rpund of fixes, after checking keymaps for plausibility and with") Reviewed by: ivy Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50702 (cherry picked from commit 5c66d7a2b8a000b6307c0a12e78eb1b50376c9f8) --- share/vt/keymaps/uk.kbd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/vt/keymaps/uk.kbd b/share/vt/keymaps/uk.kbd index 4a805fae12b9..261af190dcbe 100644 --- a/share/vt/keymaps/uk.kbd +++ b/share/vt/keymaps/uk.kbd @@ -7,7 +7,7 @@ 002 '1' '!' nop nop '`' '`' nop nop O 003 '2' '"' nul nul '@' '@' nul nul O 004 '3' 0xa3 nop nop '#' '#' nop nop O - 005 '4' '$' 0xa4 0xa4 '4' '$' nop nop O + 005 '4' '$' nop nop 0x20ac '$' nop nop O 006 '5' '%' nop nop '5' '%' nop nop O 007 '6' '^' rs rs '^' '^' rs rs O 008 '7' '&' nop nop '[' '[' esc esc O From nobody Tue Jul 29 14:27:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bryNf6Kk6z633TR; Tue, 29 Jul 2025 14:27:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bryNf1bBLz3LFd; Tue, 29 Jul 2025 14:27:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-7074710a809so18262176d6.1; Tue, 29 Jul 2025 07:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753799248; x=1754404048; 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=zYRVKscjHKwsXWKH9q5/YDir/JbKTrZ9K45yeAvGrpM=; b=RVH0XUE6EDik3DmbctyhZxxPA1vl01LCDsBep8+E0CEpZG75JHywX9OS+/nyWEAzqI q5prTgiGsJkFU/4Sj/WErKCnpZqEqu0eBMnUKcyal2SasD5LlWepbSV7yONP7axVIS5U k5idHKk/k+8LQrX8z0/s1nFecY8w6rieL0NDmjsVpHxauM5WFr1RJw5w1vBWObOpiI3E jc16Sdj56V0398nvuVArjSoUWKc65tNs2nXrEgEhiBJPSeO474gpeUm3z+XTu0MBbH3o +71SHQxs4epHIkWq7EzVAPkSeH5XHfIyIz3lCYMD/B2YTqQGWaLo6N6dI6mzZ8LqwQNM /b0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753799248; x=1754404048; 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=zYRVKscjHKwsXWKH9q5/YDir/JbKTrZ9K45yeAvGrpM=; b=hB4uvWSnKt4keyPrISv4V86x/73jdsRaQ1SRFFTS8dWwZybDaTd/Sb+PQDvLPHaHJF DmK7DZN0ITvTcUHvZGxWysv/VSDdHvrDB4cVm/GOgJ6UJ1Lw9TRLDP9UvkipihTwsdKX xYIhUYgdDLWbMCERaydFUzQytUdt43P6Mdk5b7MigUCPhFjNPpfy593QY4/XpyWaJaly xw6S2akXlAIgo8J5TxSdyzJHIS3WcExzIE5j7CZfXNGO3W1SJmuqTF0PsFMIwCDzL8Lk TGSMeU1baw9Jy18Tt22PEUofPIqQh7MjJyGFP0ypo2rXudF1hg/guqbyctfKJ4cfsYlD rdRA== X-Forwarded-Encrypted: i=1; AJvYcCVbhtwQ96GGTRsMD5woYDI72rZfto/ZeZW0oCrPVqOQyjbq1qM6VwSFbKweH6rLhp6ceurWW421yZPHqJ11aOI=@freebsd.org, AJvYcCWl1gxSJpzpSGDV5ZQAm2sdY3UHJgIR3OIJfxXlYto6fmjJt06sAbsFEIQcof+ArRhMSoQYyqzYkcmC7Yl7L3CurmLZDi8=@freebsd.org, AJvYcCXB3E3ZkFiM/POSoCEAlGTxhU8aPw36oTPnwbPsAkSF2te+cHNKLN3g0BZWYBh8sdjAOlrDHIVtg2p8X9Xpqk/AaGaB@freebsd.org X-Gm-Message-State: AOJu0YyLB9RVfHzswlLhAC3VA9sN+JAFpXxCtp/6SmfynDRJ6dYP9KZj gxowFcbyOo5LL1V+f9gaKoyDh0L4gpvxlzdRjakfGQWlYbZJMmJL5gLN X-Gm-Gg: ASbGncvboltPGq+mNamhlUfukTVsX+avSwEBxE6FtVGKR8wGx2FbfP/C3P8P//ezNqI 6Qu3pKlqi5kkWMbNk0dc3IBXPrsC7Oa77krJFGrblJCVEbVTd/4xzn5+SAV7ht/NCJol/Bcd/V6 THMCrltxuLowUyK0P8kcmkZOh5/rwsCHWQM4dzasZplmjZFPXG9VMzuyq9E9PDeJtJ9Yh2ZJmjK Dxlau4zeh42hOUeypQCPETHCUkKcf+QS63U2Q5FvynMl4dZJK7p3gTDGtL5YpYaBfX8bXgSVnT8 uImDMv6dyMFj34ZYXT6C49KKBOh1brJo1Mnx6+oYS/rpOUw72SRqj2IjHY+eaQrriuDOQ46/IRr a/JydJOYSVePNgVfE+moOsNjNJH9+Gj2P7NOU X-Google-Smtp-Source: AGHT+IEddwsuk4qeXDI5ugE0oGEW7OhgeBwoCmTL1nPtM+lWsCG2ZwITQli1FoE9D2Y1g0FrpvM0Gg== X-Received: by 2002:a05:6214:d88:b0:707:6087:72e5 with SMTP id 6a1803df08f44-70760877ba0mr19196486d6.35.1753799247460; Tue, 29 Jul 2025 07:27:27 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-7074c5f1b5asm22018336d6.24.2025.07.29.07.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jul 2025 07:27:26 -0700 (PDT) Date: Tue, 29 Jul 2025 10:27:24 -0400 From: Mark Johnston To: Konstantin Belousov Cc: mckusick@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 610319c766e9 - main - ufs_vnops.c: newparent is not bool Message-ID: References: <202507282057.56SKvL6x019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4bryNf1bBLz3LFd X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Tue, Jul 29, 2025 at 05:10:18PM +0300, Konstantin Belousov wrote: > On Tue, Jul 29, 2025 at 09:55:46AM -0400, Mark Johnston wrote: > > On Tue, Jul 29, 2025 at 04:45:30PM +0300, Konstantin Belousov wrote: > > > On Tue, Jul 29, 2025 at 09:16:23AM -0400, Mark Johnston wrote: > > > > On Tue, Jul 29, 2025 at 04:01:46PM +0300, Konstantin Belousov wrote: > > > > > On Tue, Jul 29, 2025 at 08:26:52AM -0400, Mark Johnston wrote: > > > > > > On Mon, Jul 28, 2025 at 08:57:21PM +0000, Konstantin Belousov wrote: > > > > > > > The branch main has been updated by kib: > > > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > > > > > > > > commit 610319c766e941de96e52f2d28fea9f8cfc51aeb > > > > > > > Author: Konstantin Belousov > > > > > > > AuthorDate: 2025-07-27 13:50:57 +0000 > > > > > > > Commit: Konstantin Belousov > > > > > > > CommitDate: 2025-07-28 20:57:14 +0000 > > > > > > > > > > > > > > ufs_vnops.c: newparent is not bool > > > > > > > > > > > > > > Use proper comparision operators when we need to see if newparent was > > > > > > > set to not-zero value. > > > > > > > > > > > > > > Reviewed by: mckusick, olce > > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > > MFC after: 1 week > > > > > > > Differential revision: https://reviews.freebsd.org/D51573 > > > > > > > --- > > > > > > > sys/ufs/ufs/ufs_vnops.c | 15 +++++++-------- > > > > > > > 1 file changed, 7 insertions(+), 8 deletions(-) > > > > > > > > > > > > > > diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c > > > > > > > index 406b8f943077..2757fb066981 100644 > > > > > > > --- a/sys/ufs/ufs/ufs_vnops.c > > > > > > > +++ b/sys/ufs/ufs/ufs_vnops.c > > > > > > > @@ -1476,7 +1476,7 @@ relock: > > > > > > > * the user must have write permission in the source so > > > > > > > * as to be able to change "..". > > > > > > > */ > > > > > > > - if (doingdirectory && newparent) { > > > > > > > + if (doingdirectory && newparent != 0) { > > > > > > > error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread); > > > > > > > if (error) > > > > > > > goto unlockout; > > > > > > > @@ -1539,7 +1539,7 @@ relock: > > > > > > > if (tip == NULL) { > > > > > > > if (ITODEV(tdp) != ITODEV(fip)) > > > > > > > panic("ufs_rename: EXDEV"); > > > > > > > - if (doingdirectory && newparent) { > > > > > > > + if (doingdirectory && newparent != 0) { > > > > > > > /* > > > > > > > * Account for ".." in new directory. > > > > > > > * When source and destination have the same > > > > > > > @@ -1632,7 +1632,7 @@ relock: > > > > > > > goto bad; > > > > > > > } > > > > > > > if (doingdirectory) { > > > > > > > - if (!newparent) { > > > > > > > + if (newparent == 0) { > > > > > > > tdp->i_effnlink--; > > > > > > > if (DOINGSOFTDEP(tdvp)) > > > > > > > softdep_change_linkcnt(tdp); > > > > > > > @@ -1642,11 +1642,10 @@ relock: > > > > > > > softdep_change_linkcnt(tip); > > > > > > > } > > > > > > > error = ufs_dirrewrite(tdp, tip, fip->i_number, > > > > > > > - IFTODT(fip->i_mode), > > > > > > > - (doingdirectory && newparent) ? newparent : doingdirectory); > > > > > > > + IFTODT(fip->i_mode), doingdirectory); > > > > > > > > > > > > Is this part of the change correct? > > > > > > > > > > > > syzbot is reporting some panics after this change and commit > > > > > > c069ca085bd185eda4a90dc4bc2b76cceb74579d: > > > > > > https://syzkaller.appspot.com/bug?extid=18722c8e4008048efb51 > > > > > > https://syzkaller.appspot.com/bug?extid=6a4ea1e13f4e07369785 > > > > > > https://syzkaller.appspot.com/bug?extid=5cb82352555d5d505640 > > > > > > https://syzkaller.appspot.com/bug?extid=602fb6ee1a39abfd3b5c > > > > > > https://syzkaller.appspot.com/bug?extid=fb35cce6a6f5075a6692 > > > > > > https://syzkaller.appspot.com/bug?extid=6fb8cb919cc686d1a1d0 > > > > > > https://syzkaller.appspot.com/bug?extid=98c39c45a437812f7683 > > > > > > https://syzkaller.appspot.com/bug?extid=02cb048d48b51bcd9c41 > > > > > > > > > > I committed the revert, with the Fixes tag, for now. But consider: > > > > > > > > > > Two cases: > > > > > 1. doingdirectory == true: > > > > > the expression can be rewritten as newparent ? newparent : true. > > > > > Then this is the same as true. > > > > > > > > > > 2. doingdirectory == false: > > > > > then the expression is false. > > > > > > > > I think the problem is that the isrmdir parameter to ufs_dirrewrite() is > > > > not a bool as the name implies. See softdep_setup_directory_change(), > > > > which checks isrmdir > 1. > > > Right. While phab is down, this should fix it, and another error with > > > the signess of the inum passed in isrmdir (the > 1 check would fail in > > > fact). > > > > > > While the phab is broken, I am posting the fix there. > > > > This looks right to me. I quickly tested it with the reproducers from > > syzbot and didn't see any problems. > > > > I'd also rename non-bool isrmdir to something like "newparent", just to > > make it a bit clearer that it's not a boolean value. > > commit 6dfbc1e9bde38761f0b2267732bf690640cece0b > Author: Konstantin Belousov > Date: Tue Jul 29 16:35:17 2025 +0300 > > ufs: change isrmdir type to bool or u_int as appropriate > > Use bool for isrmdir argument to > ufs_dirremove()/softdep_setup_remove()/newdirrem(), where it is used as > bool. > > Use u_int for isrmdir argument to > ufs_dirrewrite()/softdep_setup_directory_change() > where it is 0/1/ino. Without the change to unsigned, the > if (isrmdir > 1) > test is broken on volumes with many inodes. > Use newparent instead of isrmdir for the argument name in this case. > > Noted by: markj > Fixes: 610319c766e941de96e52f2d28fea9f8cfc51aeb > Fixes: 98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: Looks ok to me. From nobody Tue Jul 29 15:16:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brzTX5KDGz635cj; Tue, 29 Jul 2025 15:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4brzTX4T93z3NqV; Tue, 29 Jul 2025 15:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753802208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZEV/C4Jc5hChcn1My9xPiBiFf9HyB0Ey70GG3h9TG8=; b=SDgi8yNl2nsSKqej2yzPqzI0wgufq0VuLMiBYf93/nQBWXX6BYje7LsLoyId7wJav6FGeH 4SZlMMHROLVNe45WWJf0046GLv2VPjhb/qw7dfU1zS30S/5GqJb2WZSL+D2/FxrRTIBLM/ lpsOuSWbNOJ7iqMasimf2vB+Gtm4vr02GWDS0H5RUR2yXuqyRiHcdcPuJ/KTwjqzBnSgWH 4x3BXziCsgCSHpBZw+YewlE81Ttkpy+PpWBAxg4ihYl/9YUm8MZ2IyC4kLFYGq666mYEwF qI4+CUfhsiYA07oNAejrTzdK4/D/JZs/5a2VxFgReABXTl8OVQyJfNRppUfwog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753802208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZEV/C4Jc5hChcn1My9xPiBiFf9HyB0Ey70GG3h9TG8=; b=yNJrIL254GmeJoYmCGxdCkcsJxHpz4tUiixinlv4UXxEB3L8YFsCwOsRe9pJ3FX0UxV5lY 9zV87sEh5G/1q8hy0LDJI0WVuOTXeNRHcTI/9qZJOfgkgtzxqYWxc/mez/3Jc7aCCz/sNE c74Qz3sc5I+RXxVDH08oeOTYhCFlcQgvPfjFIsJiARlnmX5IP63AKtqfGg1hTRNgvn3XCt 5V+Q/XFcnN6SzkQuTSpa1q8cet8GhNbL5QBmEFs/LaQd9c4hzQj72doXmdEYHy/lB3sRa5 f3ZZFF9WdZONZHcqDPpn0nV+0kAuJAf+K1qfVDxnk+YI0l3XVNr1FbBa1QrAaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753802208; a=rsa-sha256; cv=none; b=VcXOyNLF84/O0YWYlyVhvItWv0uRYQ6bKZTw+PmDqKTofRMbjsVOo7umhFzNv82KG/sFmv a5/04PKGnjIf8hHPPnLCLp+WZ9+SiwMMoCdiDulB+HR6XAcRi6e1Qw14NmiKKPJPp5hpIh aUAtmJfMPPUllzBkyYKUwribPGIS0xisMOBwUuPwRNeiXeG/ylBH3YkWZrzf9cH4/1XIhW YCucUh0ZI0JzHG3ebs8t7WfDUZjW7YWJzfRd/eyhf3q+lzs7FVTnDJj/1SyxellatOjHdI rTmFYUJEXxGRaYcCzZzWSyY5vNlXAmnJPToKYPriRTZQz/ii7lY7KMUG+gFVGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4brzTX3VSYzd1k; Tue, 29 Jul 2025 15:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TFGm4H018090; Tue, 29 Jul 2025 15:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TFGme3018087; Tue, 29 Jul 2025 15:16:48 GMT (envelope-from git) Date: Tue, 29 Jul 2025 15:16:48 GMT Message-Id: <202507291516.56TFGme3018087@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: 5aaaa1a61024 - stable/14 - beep: Capsicumize List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5aaaa1a61024bb13aafef1716a4fb10f31147b6b Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5aaaa1a61024bb13aafef1716a4fb10f31147b6b commit 5aaaa1a61024bb13aafef1716a4fb10f31147b6b Author: Ed Maste AuthorDate: 2025-06-05 23:44:05 +0000 Commit: Ed Maste CommitDate: 2025-07-29 14:19:49 +0000 beep: Capsicumize While it's unlikely that beep(1) will be used in a context where a sandbox is particularly valuable, it does offer a simple demonstration of entering a capability sandbox after opening required fds, and is trivial to do. Reviewed by: christos Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50709 (cherry picked from commit 54eda43cc1e6b1d73804b6c397a15002e3519555) --- usr.bin/beep/beep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c index 0bdfe2cf97a7..9d274770ad75 100644 --- a/usr.bin/beep/beep.c +++ b/usr.bin/beep/beep.c @@ -25,6 +25,7 @@ #include +#include #include #include #include @@ -204,6 +205,9 @@ main(int argc, char **argv) if (f < 0) err(1, "Failed to open '%s'", oss_dev); + if (caph_enter() == -1) + err(1, "Failed to enter capability mode"); + c = 1; /* mono */ if (ioctl(f, SOUND_PCM_WRITE_CHANNELS, &c) != 0) errx(1, "ioctl SOUND_PCM_WRITE_CHANNELS(1) failed"); From nobody Tue Jul 29 17:04:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs1sW2Bb2z63BVx for ; Tue, 29 Jul 2025 17:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs1sW0z6nz3bX9; Tue, 29 Jul 2025 17:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753808655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNqb0U2M6aYk+/m7hs2xPz1LEWPKtBZQG9Bisqb5+gk=; b=WvR4FlFZegTVtuV0FJu7dy0XDIp4dHSMdU1VAxl4j+VpuMlVWlRmEHx7Mhpaz5sDs6Yj7A ocYI7g0qsnl5cW06MRTHVXptZvGfV1bHJldyjCl5EU/UKRHQK/ENgIuIW3qfPxvIcVzSBJ kfb389XZMHNfg8QDv8lb3z3QZNkzWg0gfoI9/gDgo++XW5JI1vdmj56GnhDGBDefyzcwAq rSBqp0sd7WjfBdb+FxjXyuHtaH8qyPH5S0wc+toIzj04lrKOxs/T00jneCmvmJBWDflIYU x1UZNOeKvC4uf45YjsFfQvkmcVSbE/OV87eWwZHexmxNyl6k9MbxU/ETwmhFWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753808655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNqb0U2M6aYk+/m7hs2xPz1LEWPKtBZQG9Bisqb5+gk=; b=irEBC4djhQE9ZRlrX9wkeO+q4O9u/dEwo2NCNAU69/a1uwnDkfmTFCzbVHGfD+0fXoNnuh cH4gWn3siLahr7WS4Ad4E+AC/hVhF75ZKvVxXz0mXB8drOnv+bBCcAtNOH5dlU4hbkZhvu Ohf8B9ym6y0XXXBycBbNP7klZs8zg6dy9XR+w47Kj3px1hUwkhUueXif2SoHsIfG9lLPgH pARSBttjW7G9RvpDLwD7rnSzYhsywoRBJQsqae7k2BsV0bihkIAK5AjPp6RF0vjgEz54YH 1ucWj0GIcB7igwTFJvmDueYRanG5A8IeJ9C3F8GrLpIbGBC3L2cdECFG4mh+lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753808655; a=rsa-sha256; cv=none; b=Mx57ZuSBMAYdpPFHWVe9EVcAA5j5irdnIcQmN8oyWa2drpYGqlbvdrsNKQPD8wPn8mi3FL n19Wtz8j/AyAFwujJhx4MZ2ejEe2fOAwHebpyODfZTGZ+H2W6XUs3jtcLfNexmbKu+so+s Y+EM88uESXPG3QM72xkKJyH8L3zahAvsQiIkyrwRe4BQAIQIycbt1xlA60qdLBT+3Qxtdj Xp+agm86B+v3PCtuOvzAdShRJVZWf9hr6v3YIzUvYac9ieZFEYHB6s66LY8O24tAOW0kaZ nDgYycRkykRfReuTpYhWmRqxDTO2RIF0gRYqOpTy4pOK+ajoh7fBqH7WqCHawQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs1sW0FMfzgGK; Tue, 29 Jul 2025 17:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TH4EfV025337; Tue, 29 Jul 2025 17:04:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TH4Etx025336; Tue, 29 Jul 2025 17:04:14 GMT (envelope-from git) Date: Tue, 29 Jul 2025 17:04:14 GMT Message-Id: <202507291704.56TH4Etx025336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 09e510c24802 - Create tag vendor/openssh/10.0p2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/tags/vendor/openssh/10.0p2 X-Git-Reftype: annotated tag X-Git-Commit: 09e510c248025f447517b1cf16a2d9674c1d5419 Auto-Submitted: auto-generated The annotated tag vendor/openssh/10.0p2 has been created by emaste: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssh/10.0p2 tag vendor/openssh/10.0p2 Tagger: Ed Maste TaggerDate: 2025-07-29 17:02:17 +0000 Tag OpenSSH 10.0p2 This is identical to OpenSSH 10.0p1. From upstream: > Regarding the Portable OpenSSH 10.0 release: > > Due to an error in the release process, the recent Portable OpenSSH > release identifies itself as 10.0p2 rather than the intended 10.0p1. > > We do not intend to make a new release to fix this mistake. This > portable OpenSSH release will henceforth be knows as 10.0p2 and no > release numbered 10.0p1 will be made. commit 9792a032f0a99557271d6b7f7b0a955386c1fdbe Author: Ed Maste AuthorDate: 2025-04-09 14:48:56 +0000 Commit: Ed Maste CommitDate: 2025-04-09 19:45:50 +0000 Vendor import of OpenSSH 10.0p1 Sponsored by: The FreeBSD Foundation From nobody Tue Jul 29 17:31:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs2Sh3m8tz63D4l; Tue, 29 Jul 2025 17:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs2Sh37cBz3dTJ; Tue, 29 Jul 2025 17:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753810276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ySZYAn1Zxi6il00h1POUNxNctoOAteHpjoz+kL6KYsk=; b=sqsd2nQyKqWcx+YY9NKOxCgH0NqXc6Zlet2et+AUKj89uN9xbaMQEdU0l6fZj9hITeEh2/ h2BvC+lNRCpgn/gOfI4qDKXhzu/FlQGSz9K97NF71LK4gnyBT4EGXoCcL5H8YgQc6DPN2/ GWWO/isPnhlL/wd6AhJxvAG97P5aBHpRz9QHrLxaiwzLeFBJ+eHhmOc2AgNOdIq2ajzDCk +vQOOVMOzTIVNoRX43sfrz7eMkG87GsFnRd9Q8GycHqC96tTJI0hvd75DiGbXNxqsBU2Q2 xHeTouPimH2kFCLsgOyEngZRI9bAMDDCaPlkNxL6Dt0hGvXbuRVQWhDTLVgFyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753810276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ySZYAn1Zxi6il00h1POUNxNctoOAteHpjoz+kL6KYsk=; b=yOY0/fPf6TTWXHcOWkK7zi3oRF7kL1OE1yAp5XH7FsG560sHbBbRK9eBoaFIw0H/Qm3ftn oHqWrT4yyZvYoMYmNYcECNF3s0jRre9HUh5E0cxCpp754+CEbqimMt9IaeV603T0b7ZydY a+DAy/x5dSOpjJ9pD4rgDUkfIJsgdOzZX2wldxmRXOSWzEKVTDBlgWBZtQQr3Zttr9sg0w C9dd2kXDVLxAtNcVxRxEyemahsGjQZnHWPiMgprUdgIkbVtdChwG3MZLGeJsvUJIWV5cfW YLH0BCEeHWsRcYSZmKpiPa0cHOg/BTOsrnqHXUxxvUiUryW6Uq/1E7RYnGk48A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753810276; a=rsa-sha256; cv=none; b=pruerl1AXgc09YmgoIMZIvAZCMDwBJZIAb1WCi9DLIHwmEOgEbj5HfKq61xDllbwXbAna6 9xDJDjY/e781rHYbvjo3hliRxmCCqIKiDNQ8qng6CmXZtRgRayofv4/OVr330djHyW/aVw 0jdGF09/c2AEIJzRT8u5UK/1xWEmm0A9Z7n3xP+q890KorXzvjDe8UVqhsl3DAA7xxD6T7 2TtjoSMG/91r2Fx3OWSsoeGtPQnOjcidQnnya3mR13/XVXPl/5y7bsYS7iKmD/dMlFWNqS 3KQZS2XOz2whnP0KtwW0iNQ4T9jAUq9xkjKjYMUgcZjbkE/FvC9Zim1OLkPBDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs2Sh2hcYzhBb; Tue, 29 Jul 2025 17:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56THVG1b073967; Tue, 29 Jul 2025 17:31:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56THVGF6073964; Tue, 29 Jul 2025 17:31:16 GMT (envelope-from git) Date: Tue, 29 Jul 2025 17:31:16 GMT Message-Id: <202507291731.56THVGF6073964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 7b68893ffa9b - main - krb5: remove libedit from the bootstrap tools List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b68893ffa9b1f9961c098207124c81c10f8c2ed Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7b68893ffa9b1f9961c098207124c81c10f8c2ed commit 7b68893ffa9b1f9961c098207124c81c10f8c2ed Author: Baptiste Daroussin AuthorDate: 2025-07-29 15:49:44 +0000 Commit: Baptiste Daroussin CommitDate: 2025-07-29 15:49:44 +0000 krb5: remove libedit from the bootstrap tools libedit breaks the bootstrap on MacOS and Linux. Activate libedit only for the regular build not for the bootstrap tools While here fix the definition of the dependency chain between libkrb5ss and libedit (and libtinfow) via src.libnames.mk Remove a local patch to find the readline compatible header and find them via proper CFLAGS. --- Makefile.inc1 | 2 -- crypto/krb5/src/util/ss/listen.c | 4 ---- krb5/include/autoconf.h | 2 +- krb5/usr.bin/kadmin/Makefile | 4 ++-- krb5/usr.bin/ktutil/Makefile | 2 +- krb5/usr.sbin/kadmin.local/Makefile | 4 ++-- krb5/util/ss/Makefile | 5 +++++ share/mk/src.libnames.mk | 1 + 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 010f5ac2bb55..b66743e154eb 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2627,8 +2627,6 @@ _kerberos5_bootstrap_tools= \ krb5/util/compile_et \ krb5/util/support \ krb5/util/et \ - lib/ncurses/tinfo \ - lib/libedit \ krb5/util/ss \ krb5/util/profile \ krb5/util/verto diff --git a/crypto/krb5/src/util/ss/listen.c b/crypto/krb5/src/util/ss/listen.c index 08427df1e5c7..fe18475447be 100644 --- a/crypto/krb5/src/util/ss/listen.c +++ b/crypto/krb5/src/util/ss/listen.c @@ -14,9 +14,6 @@ #include #include -#ifdef __FreeBSD__ -#include -#else #if defined(HAVE_LIBEDIT) #include #elif defined(HAVE_READLINE) @@ -25,7 +22,6 @@ #else #define NO_READLINE #endif -#endif static ss_data *current_info; static jmp_buf listen_jmpb; diff --git a/krb5/include/autoconf.h b/krb5/include/autoconf.h index a5e2ea5838b0..fe281d136954 100644 --- a/krb5/include/autoconf.h +++ b/krb5/include/autoconf.h @@ -260,7 +260,7 @@ #define HAVE_LIBCRYPTO 1 /* Define if building with libedit. */ -#define HAVE_LIBEDIT 1 +/* #undef HAVE_LIBEDIT */ /* Define to 1 if you have the `nsl' library (-lnsl). */ /* #undef HAVE_LIBNSL */ diff --git a/krb5/usr.bin/kadmin/Makefile b/krb5/usr.bin/kadmin/Makefile index b2a094795d48..182cabb8f9f6 100644 --- a/krb5/usr.bin/kadmin/Makefile +++ b/krb5/usr.bin/kadmin/Makefile @@ -9,8 +9,8 @@ PROG= kadmin -LIBADD= kadmin_common edit kadm5clnt_mit gssrpc gssapi_krb5 krb5 k5crypto \ - com_err krb5ss krb5profile krb5support tinfow sys +LIBADD= kadmin_common kadm5clnt_mit gssrpc gssapi_krb5 krb5 k5crypto \ + com_err krb5ss krb5profile krb5support sys SRCS= keytab.c diff --git a/krb5/usr.bin/ktutil/Makefile b/krb5/usr.bin/ktutil/Makefile index 6bcb4877ed6f..15991cb49bce 100644 --- a/krb5/usr.bin/ktutil/Makefile +++ b/krb5/usr.bin/ktutil/Makefile @@ -9,7 +9,7 @@ PROG= ktutil -LIBADD= edit krb5 k5crypto com_err krb5profile krb5support krb5ss tinfow sys +LIBADD= krb5 k5crypto com_err krb5profile krb5support krb5ss sys SRCS= ktutil.c \ ktutil_ct.c \ diff --git a/krb5/usr.sbin/kadmin.local/Makefile b/krb5/usr.sbin/kadmin.local/Makefile index 4b99f490bd7b..3930c0fc4694 100644 --- a/krb5/usr.sbin/kadmin.local/Makefile +++ b/krb5/usr.sbin/kadmin.local/Makefile @@ -11,8 +11,8 @@ PACKAGE= kerberos-kdc PROG= kadmin.local -LIBADD= kadmin_common edit kadm5srv_mit kdb5 gssrpc gssapi_krb5 krb5 \ - k5crypto com_err krb5profile krb5support krb5ss tinfow sys +LIBADD= kadmin_common kadm5srv_mit kdb5 gssrpc gssapi_krb5 krb5 \ + k5crypto com_err krb5profile krb5support krb5ss sys SRCS= keytab_local.c diff --git a/krb5/util/ss/Makefile b/krb5/util/ss/Makefile index e7e025184284..2c43f2b5934f 100644 --- a/krb5/util/ss/Makefile +++ b/krb5/util/ss/Makefile @@ -47,6 +47,11 @@ CFLAGS+=-I${KRB5_DIR}/util/ss \ -I${.OBJDIR:H} \ -I${.OBJDIR} +.if !defined(BOOTSTRAPPING) +CFLAGS+= -DHAVE_READLINE=1 \ + -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit +.endif + GEN= std_rqs.c ${GEN_SS_ERR_C} ${GEN_SS_ERR_H} GEN_SCRIPTS= ct_c.awk ct_c.sed mk_cmds GEN_SS_ERR_C= ${GEN_SS_ERR:S/.et$/.c/} diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index f21d519160d2..88202aeb78fe 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -487,6 +487,7 @@ _DP_be= zfs spl nvpair zfsbootenv _DP_netmap= _DP_ifconfig= m _DP_pfctl= nv +_DP_krb5ss= edit # OFED support .if ${MK_OFED} != "no" From nobody Tue Jul 29 17:36:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs2bB4RB8z63DLt; Tue, 29 Jul 2025 17:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs2bB35r9z3flk; Tue, 29 Jul 2025 17:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753810614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=seJr+u78hiWsszCtV3ox9DtZhp7C3Ct9ZGYSz+lBn64=; b=FOAZxoo6JfLsxAxCJa4G4m/1fsltdX+aQZErmt1wK0N+epaF3N7HSWL1oLvLXPrqXllcq5 9zvQLqZKKtMMXSpp0NUhQj04wXqQGDBqEpPdetFLsJ37Rv/+mGxkP9WcHnqg6oxiQPbS2t WiCEvq+JfbabeNh+bANvW3JE+/6Ii3WPRg1if6C9DrFn7rwEcYmEefOVH8zbBJM7p3CdaW wQjEr2tT1BkeG4EChT4ExIM9lTzNfLnX8cF777so4FV59bUcw7nKWYr/whGj2l8cVuNPfS zh5Vd7/CtT18r1fhbJrgTyJTsIkWH09um5DX2SlcY4Wv/xvOrZLLGWXhqyGO7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753810614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=seJr+u78hiWsszCtV3ox9DtZhp7C3Ct9ZGYSz+lBn64=; b=PTlK7f4bP4f/HTB+9Af3LT9yBQSKjx6cDYNbR45+kNUlcPMwqxuhktYjbXy9BwM7IKf7Kv WqB5lm2QEb3puvd7ZXoy8pX9KFz0jE2CUclvqc7tF6RMRPLtqQW+eDf1QMMZns2VpXcvmH qogKCv5+Y1cPQs/olPMHvgfUtExLHriMzBMiLvKezQv6FVoy7uvb5y3JbdrK4hV+dKWutz xz994cXjKS8VjufSzPYCEjO9yEoyS271cWuLkZhBnKPCd6eZS/Vj9dwCEwJV8xbGLmaq5F +N3L/BqgypG3gYaRHDP8I4ZR3+vZ/RFA68eJI+BqRlsgQQ9mAKcQBR4N/OwX2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753810614; a=rsa-sha256; cv=none; b=VGeVaZ4PqRyQjIp7HskRLbvvey1WJp314wrlGHgX8mkSTfFw/ng7s+pgYNV/HtSQmC3hJ8 N2iejC/jd+n3lEUXqM3mtCOFLTRS2/QH7CUbrs2RIS1JRxJlmq5HY8SqWlt3Ho9qk69Z0h V1S2rnDTl9UrCGjqitb1SCjKMox2kXd4LQ5bMGKFJDZqdJ/q+ZS9etMCace2OKseRvS+4L BHFu0MTn5AZAOky7cDFhvrLttdhUYTEwRGgBzoCfdatgjtfJbZ4KDFPR72tuL+GjWqHqYo 6QpeSI6NPBBB4XzWPIKtM1BNBsasL1xj0wIoL9jW7aP42NS0M11rIa+X+1Jlkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs2bB2dNrzhkq; Tue, 29 Jul 2025 17:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56THaspR081704; Tue, 29 Jul 2025 17:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56THasSW081701; Tue, 29 Jul 2025 17:36:54 GMT (envelope-from git) Date: Tue, 29 Jul 2025 17:36:54 GMT Message-Id: <202507291736.56THasSW081701@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: 8be24d80adb4 - main - ssh: Reduce sshd_config diffs against OpenSSH 10.0p2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 8be24d80adb4ba998240c1b5e20e678852dc0a05 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8be24d80adb4ba998240c1b5e20e678852dc0a05 commit 8be24d80adb4ba998240c1b5e20e678852dc0a05 Author: Ed Maste AuthorDate: 2025-07-29 17:20:15 +0000 Commit: Ed Maste CommitDate: 2025-07-29 17:36:33 +0000 ssh: Reduce sshd_config diffs against OpenSSH 10.0p2 Upstream had a poor description for KbdInteractiveAuthentication prior to the 10.0p2 release. We use KbdInteractiveAuthentication for PAM authentication, and we replaced the poor description with a note about use by PAM. In 10.0p2 the upstream description has been fixed. Incorporate that text now as it is an improvement and avoids a conflict in the upcoming 10.0p2 import. Reviewed by: jhb Sponsored by: The FreeBSD Foundation --- crypto/openssh/sshd_config | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/sshd_config b/crypto/openssh/sshd_config index a17484b1da2d..88c93386db65 100644 --- a/crypto/openssh/sshd_config +++ b/crypto/openssh/sshd_config @@ -56,12 +56,15 @@ AuthorizedKeysFile .ssh/authorized_keys # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes -# Change to yes to enable built-in password authentication. +# Change to "yes" to enable built-in password authentication. # Note that passwords may also be accepted via KbdInteractiveAuthentication. #PasswordAuthentication no #PermitEmptyPasswords no -# Change to no to disable PAM authentication +# Change to "no" to disable keyboard-interactive authentication. Depending on +# the system's configuration, this may involve passwords, challenge-response, +# one-time passwords or some combination of these and other methods. +# Keyboard interactive authentication is also used for PAM authentication. #KbdInteractiveAuthentication yes # Kerberos options From nobody Tue Jul 29 17:53:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs2yf4YSwz63F8m; Tue, 29 Jul 2025 17:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs2yf3KT3z3gvx; Tue, 29 Jul 2025 17:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753811626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lPgfXkr11936c1OEheU1G7mvvSCXNB+iixTYaDb3qQ=; b=gKCf8rpEoKtaTaOGF4SNSIONYjRna/4/Hl5Z9EVu/VGaa5yfeTjjtzGC6DXxKTuN8ZCHSK /QR6vOvmDi+7OIkwj52JYqPcfrSaLsHtB0HF9cP3DRdFC6gTz5ElA5Mo3MhAhsgiKf0Jo9 FrZ97E4vm7MTMcwjzxelWBOrXNvDf7SvzxICTElLT2HEbtU1DgwOgz8yM5Xp3SglnfYK9G PdVTQsIb/Q0BczSeJ+qTTl+f5kgz2vLRSAUHYo3um4dCSZEFrFDiJfKgmYigTHb+JYA/mY j9tPBeMZ37JLZqCvn27aK4V927Fqssx++NTXJ+dDUZ/EQhOcJLA6UmGMQWlPTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753811626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4lPgfXkr11936c1OEheU1G7mvvSCXNB+iixTYaDb3qQ=; b=K9pbhkDr4eGru9tXRlO5wuYdQJQcGjxml+/1Qjf8WtcO0blGb9tqsYB/I5L8E41Ahl1B+A 73aYvB07md2gLIA2qLvTKe/4TX/OnKlwpxxFbnlCIzpiMfF4AF6cll8+IvjevpBF89nkRY Egw3gJ6jhoDSqNHtzi9DjjkwjY1Ygj1bUcOnZB8wO4/Al718Wbrr94Oyvu769tjJ1CcFER Xux7KmRcxttYL2U4WAImJnYkVOoEo75ozb8tcLtHFOxwitIoFxWcDMxJjkkSTOdw+98B9j GtltikHNDeuO6cm/qWKOWuIHq2txxv/iOhrHBW1zJRxfWDELw57zSozGbe7Mzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753811626; a=rsa-sha256; cv=none; b=NE/S9bqAFNhLXoxXa+7gvSDjDJ1TonhgSACnBgkBV97Is0TFPq0f18mJ6+VitzVf4wuV2a lB2k1vB/JFk+GLMpA1o84R/JPGQxDXTLA+SpZypzGtibVJ9dObYM7heLXG071O7ktz1jM6 5A54flH8+gFM97DCG4zWsnGWgCfni5ViXEDKs5MFmXDlBcrNKnWZQlBL86L6h4tLfSYUYT HCsX3jX9iFbzh57KUZts103u4u6PbgXdn3LjmNAtIS/ovVQMxZFAjYX1L8zF5bijK75I16 UViAmD9/Yl6AyWM9HDHssHeLUqOU498Z3n0QDrNqT8ebfu+R+p4ixHJ/oPz6pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs2yf2lRBzhpN; Tue, 29 Jul 2025 17:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56THrkFX018243; Tue, 29 Jul 2025 17:53:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56THrkr0018240; Tue, 29 Jul 2025 17:53:46 GMT (envelope-from git) Date: Tue, 29 Jul 2025 17:53:46 GMT Message-Id: <202507291753.56THrkr0018240@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: 706d8ffa3953 - main - cross-build: Add a wrapper for macOS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 706d8ffa3953c5b30a3527cfc63730c99a835f4b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=706d8ffa3953c5b30a3527cfc63730c99a835f4b commit 706d8ffa3953c5b30a3527cfc63730c99a835f4b Author: John Baldwin AuthorDate: 2025-07-29 17:52:11 +0000 Commit: John Baldwin CommitDate: 2025-07-29 17:52:11 +0000 cross-build: Add a wrapper for macOS This is required to build libkrb5support. Fixes: 7e35117eb07f ("Makefile: Hook MIT KRB5 into the build") --- tools/build/cross-build/include/mac/endian.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/build/cross-build/include/mac/endian.h b/tools/build/cross-build/include/mac/endian.h new file mode 100644 index 000000000000..11788044f05a --- /dev/null +++ b/tools/build/cross-build/include/mac/endian.h @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025 John Baldwin + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include From nobody Tue Jul 29 19:10:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs4fy2bWpz63HwC; Tue, 29 Jul 2025 19:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs4fy084Hz3nfs; Tue, 29 Jul 2025 19:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753816218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Arkk2zJ0U2UXaRIyQOVMncE5Ju/p0tO3ZI/ZIW3LVUI=; b=lQh3Mzu4Brz8ScQ1ucjmU9FrzK+vc/fqT46FshY7D+Q1172a6HnDYtW5ZWW7+Z/+ut+ynB L9kGu6a3abalzwmbbajmPzTIYwV6+k6h5qrxV3PJxe5/2E7ZDstTlQEYvDfvSw3kdteBXb JYiWhjdF3Yb81psa7KnaJIiDrAOfLvZ4RibCCS4ltcd5RuBP+0gXIJ7/UYDG+WNvJTkbxq uiMfVQ6sbXews/nGANd4cv6a49KufU+wBtOuH07RBoLzgw8zMgbQqAruWPDSR76ARTG6V0 ELEtEToJOrS+q/OVSxWVEGEi2SHABDysWyM+BBLuBCC9ojPFwb7ssZtfLBNUGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753816218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Arkk2zJ0U2UXaRIyQOVMncE5Ju/p0tO3ZI/ZIW3LVUI=; b=KUS+GvnAQ9GoBJoOmnAcl0fMrbVX02h2fx1LIXTnouGLrDj8rbkK8CayyhSY4JUR/M/BHd dz/N9f5D8u4FSSJwBSHw8VZBHaHqx8ovP/g3EBV76ZxwYhVJOLrv0vzr4NZHDvZKDI/sYy sJ5IZYstxNkUeFrcVxUOJKQFv3WdG5qH+FybCLYNusDbfuMN52oXKT1xFjHC99j9qpDMBR Echrd90gd1TW5rek7cevHBQrGIS1Kz8mgm+tUwOyXy9ht9Xr2tEm+s8XfSo75YWGdBO/ou vvK3PPzR4uWiHRbkw+xeAutaOfSUJ8OnofbroSig4cfBR5MzU+TA5ZEisbeJlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753816218; a=rsa-sha256; cv=none; b=VF6gkRxD2JPSM0QcbXT/QAgWOzZ5rBnry5uLd6JCjS/MZtlgCQdKXeViQW0ULVdCOh9pmz zmfikcJLDFuHhpoXjK/yNBt/lWWeCmfQ1a7Xtlzu/QRLrNcDJnDQFLEzqMXO8O3nDwPlMS kum1/rLawLZ9K4j9L2HYjZqcZvayEGmHQK1cAGd4MQ+t4bFgZDykDIlZ4bSjnrWlgAGWLw nszKFNdZmxrjnXs3It8jMA/7mpD9MAyfBPQdF8KfCRyjTHPoktSBrslEdHLP/fuiAE87dP L8+mGnyn5/X1xlrhPnjK9imgIwyLOjag/hSkaRXuSM05wpTtfbcislCT9cxbpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs4fx6PxFzkhq; Tue, 29 Jul 2025 19:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TJAHSB062506; Tue, 29 Jul 2025 19:10:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TJAHl6062497; Tue, 29 Jul 2025 19:10:17 GMT (envelope-from git) Date: Tue, 29 Jul 2025 19:10:17 GMT Message-Id: <202507291910.56TJAHl6062497@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: f7951799877c - main - pci_iov: Support dynamic subordinate bus growth during VF creation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: f7951799877c16cb901be1acc8d6643f0693cec4 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f7951799877c16cb901be1acc8d6643f0693cec4 commit f7951799877c16cb901be1acc8d6643f0693cec4 Author: Chandrakanth Patil AuthorDate: 2025-07-29 00:28:51 +0000 Commit: John Baldwin CommitDate: 2025-07-29 19:09:53 +0000 pci_iov: Support dynamic subordinate bus growth during VF creation Certain SR-IOV devices enumerate Virtual Functions (VFs) on a different PCIe bus than their parent Physical Function (PF). In such cases, the default subordinate bus range assigned by BIOS may be insufficient to cover all VFs. This patch dynamically expands the subordinate bus range by: - Allocating additional bus numbers using bus_alloc_resource() when VFs are initialized - Releasing the reserved bus range during VF deletion via bus_release_resource() Reviewed by: jhb --- sys/dev/pci/pci_iov.c | 25 +++++++++++++++++++++---- sys/dev/pci/pci_iov_private.h | 2 ++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 1f72391fb6b4..0efcfeac9eff 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -734,11 +734,18 @@ pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg) first_rid = pci_get_rid(dev) + rid_off; last_rid = first_rid + (num_vfs - 1) * rid_stride; - /* We don't yet support allocating extra bus numbers for VFs. */ if (pci_get_bus(dev) != PCI_RID2BUS(last_rid)) { - device_printf(dev, "not enough PCIe bus numbers for VFs\n"); - error = ENOSPC; - goto out; + int rid = 0; + uint16_t last_rid_bus = PCI_RID2BUS(last_rid); + + iov->iov_bus_res = bus_alloc_resource(bus, PCI_RES_BUS, &rid, + last_rid_bus, last_rid_bus, 1, RF_ACTIVE); + if (iov->iov_bus_res == NULL) { + device_printf(dev, + "failed to allocate PCIe bus number for VFs\n"); + error = ENOSPC; + goto out; + } } if (!ari_enabled && PCI_RID2SLOT(last_rid) != 0) { @@ -786,6 +793,11 @@ out: } } + if (iov->iov_bus_res != NULL) { + bus_release_resource(bus, iov->iov_bus_res); + iov->iov_bus_res = NULL; + } + if (iov->iov_flags & IOV_RMAN_INITED) { rman_fini(&iov->rman); iov->iov_flags &= ~IOV_RMAN_INITED; @@ -896,6 +908,11 @@ pci_iov_delete_iov_children(struct pci_devinfo *dinfo) } } + if (iov->iov_bus_res != NULL) { + bus_release_resource(bus, iov->iov_bus_res); + iov->iov_bus_res = NULL; + } + if (iov->iov_flags & IOV_RMAN_INITED) { rman_fini(&iov->rman); iov->iov_flags &= ~IOV_RMAN_INITED; diff --git a/sys/dev/pci/pci_iov_private.h b/sys/dev/pci/pci_iov_private.h index 7ae2219b936d..ecf0a9b21be5 100644 --- a/sys/dev/pci/pci_iov_private.h +++ b/sys/dev/pci/pci_iov_private.h @@ -39,6 +39,8 @@ struct pcicfg_iov { struct cdev *iov_cdev; nvlist_t *iov_schema; + struct resource *iov_bus_res; + struct pci_iov_bar iov_bar[PCIR_MAX_BAR_0 + 1]; struct rman rman; char rman_name[64]; From nobody Tue Jul 29 20:54:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs6zP435Hz63PXj; Tue, 29 Jul 2025 20:54:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs6zP3BsPz43B3; Tue, 29 Jul 2025 20:54:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753822481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r6GVvLKS4FBYjXL1SF9lWqvOo9UCZkT5tEUimjC71AY=; b=DZzegmrLiWAkiaHj3HVdtTDBGtHpEPir5K6/Ew/tVuZRhPW76itSIjLnED7Q6BBQ4oWQfA tA39n+gd2EBAXzIUPKciZumjlyfHSzuVDcoJN1Z3i1n6hcp2RD1rOdw3yXopEcxxW56V4B T947/BbKhM/VmxEvtvxwTpAqR/xUyMxlqakK5+sfbp6aIL1XaldJZfEKAnCYD5h+pRkkV6 TqPExoqw6gWA03LkPoIrpcB6/0Hi5FweOv+fFZpUSAB+TIxa4iPb+MjdoPFFu1bz+yffUI LUIuJR65ym8L8ZP6tvygDS+thhh+E/nh8f4ZEmm/k1cXo8Hna6N746Hoj19oHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753822481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r6GVvLKS4FBYjXL1SF9lWqvOo9UCZkT5tEUimjC71AY=; b=wCCt8sEk6W1QcXACUnQhzX0FOM4gIjUE5kxw6Uh5Y+DiK+fV2cOB+KOXHDjwI+hLEmIyHl b1R2VRjDEzkxIHIZMRi4SYkBF/myO9bpR2uVTmNQKFNe0VEfoQYgzpAyTUHYpnGONJa8SJ 9GKZYKgRUNNwDQau8NzbqnAqTgR/AobZZp+TfyG1nG6cGuaX2q1TF9le0VVk13nFo9B6tK To6f1blWaAMSzr2uU+JEsQzV2n0PCNboqVnqGMYffhqoa9XZnhIIUiHo7Lmaw5rMZzQ3SF h6cN40XR0qywSgWzhYFqD9VKAqZ2sTOyLYl3ENrECl1gOsFO2PyMC+Cgkdpamw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753822481; a=rsa-sha256; cv=none; b=GRd6IRbr5vz+Igcjly1kJeDPpdb/jOQeDzXOJTfs5eHmv+FdfXvgoIxP6w8Cm34SqlK8WZ 7RenDS/i0tRV35Otcnc2kDefm4T+Np77Bl3ZwWSx3AkiJgxHQx8kXgc/9MF9yJ2AxECpPb XGkGzk5+QXX/5a1gHwW6LoU5b/F+AeCvQJYhOqGrpa/6t04ebA+8/ipvvjRpptdK+sxEmx lgaKTSqvUdcPBOESjLGzbgHFKsobsc3ihvazQSNtzsJIgouDkiZ94Nrmu8EJa/scyDjeSC 2+Fyw9f/rFO0pB8qaWuRvxDu1zivnMuelYBDzd8e3EPuseuDpk5h1Mt6aU56mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs6zP2p8GznkZ; Tue, 29 Jul 2025 20:54:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TKsfE6059258; Tue, 29 Jul 2025 20:54:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TKsfaN059255; Tue, 29 Jul 2025 20:54:41 GMT (envelope-from git) Date: Tue, 29 Jul 2025 20:54:41 GMT Message-Id: <202507292054.56TKsfaN059255@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: aa42e4984997 - main - sys_swapon: reject too small devices List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: aa42e4984997c9d3aa5d30534bdaf760e613e97b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=aa42e4984997c9d3aa5d30534bdaf760e613e97b commit aa42e4984997c9d3aa5d30534bdaf760e613e97b Author: Konstantin Belousov AuthorDate: 2025-07-29 16:30:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-29 20:54:16 +0000 sys_swapon: reject too small devices blist_create() panics on zero nblks. Reported by: olivier Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51618 --- sys/sys/exterr_cat.h | 1 + sys/vm/swap_pager.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index a8e1f56e132e..80cff53b3576 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -19,6 +19,7 @@ #define EXTERR_CAT_INOTIFY 5 #define EXTERR_CAT_GENIO 6 #define EXTERR_CAT_BRIDGE 7 +#define EXTERR_CAT_SWAP 8 #endif diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index d6bd06226d04..327cac661044 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -65,9 +65,9 @@ * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ */ -#include #include "opt_vm.h" +#define EXTERR_CATEGORY EXTERR_CAT_SWAP #include #include #include @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -2686,7 +2687,7 @@ swapon_check_swzone(void) } } -static void +static int swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strategy, sw_close_t *close, dev_t dev, int flags) { @@ -2701,6 +2702,8 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, */ nblks &= ~(ctodb(1) - 1); nblks = dbtoc(nblks); + if (nblks == 0) + return (EXTERROR(EINVAL, "swap device too small")); sp = malloc(sizeof *sp, M_VMPGDATA, M_WAITOK | M_ZERO); sp->sw_blist = blist_create(nblks, M_WAITOK); @@ -2742,6 +2745,8 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, swp_sizecheck(); mtx_unlock(&sw_dev_mtx); EVENTHANDLER_INVOKE(swapon, sp); + + return (0); } /* @@ -3286,10 +3291,10 @@ swapongeom_locked(struct cdev *dev, struct vnode *vp) return (error); } nblks = pp->mediasize / DEV_BSIZE; - swaponsomething(vp, cp, nblks, swapgeom_strategy, + error = swaponsomething(vp, cp, nblks, swapgeom_strategy, swapgeom_close, dev2udev(dev), (pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 ? SW_UNMAPPED : 0); - return (0); + return (error); } static int @@ -3378,9 +3383,9 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) if (error != 0) return (error); - swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close, + error = swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close, NODEV, 0); - return (0); + return (error); } static int From nobody Tue Jul 29 20:59:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs75F2FPfz63PSn; Tue, 29 Jul 2025 20:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs75F13P0z43TF; Tue, 29 Jul 2025 20:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753822785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L4YoiaEtPfn18jbm+EFKa5YhXoF26trw1NIts8wIYIs=; b=csZhLG15bBWKH+KVzCaegCm5RiwhCiE7QEhEYrIJLPx1Kwl2+AF+zMoLLi9ct6/2ljjypD 6jtKaSY1Z/o5dpaFYY1Ab/ldtpc0RSmHQiwp25I/7ZYVIbSPnVkYhcX2m0AtYiRmgYbvTC GNYf5p1Oszd+p+7zjTj2BINqdVHsNQfUZdNpdOuejxbfCENRxRsY7gZPJiK4dg9bG5tCPG JC8uQPUsy08w/jvQH4RYY5DaQswQKBOP/c2EE7if+6yCj9rOgULq/CWR0lkI8dDPqRudKl KjVtFY4y6uxxGOnh8JW6+TfkqawyTfuatDnm7GPwp9/GGlb3m0zamUJY7t12lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753822785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L4YoiaEtPfn18jbm+EFKa5YhXoF26trw1NIts8wIYIs=; b=GYsgjKmTODwtwzu0xtzF3EtwyaL1B2BBsRRpP+TUepo0i/6oveI4/fS0n61JbaMsob0ufR ZDd96xzmKhH/qQz8R6qJGGuePVoPbxkoRV9vQS5oTardnjdr1shBYv3gPz7FYXVY+3Hv/X I2s5uCxC+sdJ6jKT3/JJC8MNhwH5fJizx0Sv7ElWPm0rJPInQrjK/+eZDnTsXLE4pGUEGT JpOxWUeUnk6cYYyQFUAm5iEAjnKEk6Yu9OxsLXX34dNa/QnrzYl7VZl+EMw/X9VtpQwI0E 2y5dt10ILQcmspv2LPnxpFswBGfnU1zmCx5pRvxIieUsIei5Hb1VlHdJPSf01g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753822785; a=rsa-sha256; cv=none; b=b54cn0/x2/KMRtDfUzxFy0NcZrB69WQdrjSO+Hc8bEdOERp6/NwiAW85Yo+ROUyA0bjki1 bU/Jwf8fauR9SIgKvKmOUHpLi3cDsO2D3cnJ8owvFYLWVqNxslwb2/Ohrp9GiJPtFOG364 vaTjBnoksFtFLi8RvBqS0KP8NSdC096A2RRgfNwTNZ95TF20/Gb3OgWUxNwr+dughRNLr4 YozKdcymqeLAPbjLREsKXUncXDfYWzr4QVp62jDhq37G1QJIb5l4U4qxUQzNm+tGPAN/VA kSWd7Nz4b1QgOt0JlLq7GEli4L1gHP8x6YtTsHOstvjo7IdvJOTNx3HQUKx7+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 4bs75F0F2yznZ8; Tue, 29 Jul 2025 20:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TKxi4x060890; Tue, 29 Jul 2025 20:59:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TKxiDp060887; Tue, 29 Jul 2025 20:59:44 GMT (envelope-from git) Date: Tue, 29 Jul 2025 20:59:44 GMT Message-Id: <202507292059.56TKxiDp060887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: da1255560f36 - main - makefs: clean up warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da1255560f36d6cacda82fa94c3ba94c12d25050 Auto-Submitted: auto-generated The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=da1255560f36d6cacda82fa94c3ba94c12d25050 commit da1255560f36d6cacda82fa94c3ba94c12d25050 Author: Toomas Soome AuthorDate: 2025-07-22 16:03:19 +0000 Commit: Toomas Soome CommitDate: 2025-07-29 20:59:06 +0000 makefs: clean up warnings zfs/fs.c: zfs/objset.c: zfs/vdev.c: zfs/zap.c: Add include sys/param.h dsl_dir_alloc() needs to set parent = NULL to silence warning about 'parent' may be used uninitialized. Warning is given because we break the loop when nextdir == NULL and parent was not previously set. (it should not happen, but compiler does not know that). zap_add() and zap_fat_write_array_chunk() takes uint8_t *, use type cast. zap_fat_write_array_chunk() should check sz for 0 to avoid use of uninitialized pointer. unchecked function returns. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D51592 --- usr.sbin/makefs/zfs/dsl.c | 25 +++++++++++++------------ usr.sbin/makefs/zfs/fs.c | 3 ++- usr.sbin/makefs/zfs/objset.c | 1 + usr.sbin/makefs/zfs/vdev.c | 1 + usr.sbin/makefs/zfs/zap.c | 13 ++++++++----- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/usr.sbin/makefs/zfs/dsl.c b/usr.sbin/makefs/zfs/dsl.c index 8a8cee7c82b2..1977521d7f92 100644 --- a/usr.sbin/makefs/zfs/dsl.c +++ b/usr.sbin/makefs/zfs/dsl.c @@ -119,7 +119,7 @@ dsl_dir_get_mountpoint(zfs_opt_t *zfs, zfs_dsl_dir_t *dir) if (nvlist_find_string(pdir->propsnv, "mountpoint", &tmp) == 0) { - easprintf(&mountpoint, "%s%s%s", tmp, + (void)easprintf(&mountpoint, "%s%s%s", tmp, tmp[strlen(tmp) - 1] == '/' ? "" : "/", origmountpoint); free(tmp); @@ -127,7 +127,7 @@ dsl_dir_get_mountpoint(zfs_opt_t *zfs, zfs_dsl_dir_t *dir) break; } - easprintf(&mountpoint, "%s/%s", pdir->name, + (void)easprintf(&mountpoint, "%s/%s", pdir->name, origmountpoint); free(origmountpoint); } @@ -175,22 +175,22 @@ dsl_dir_set_prop(zfs_opt_t *zfs, zfs_dsl_dir_t *dir, const char *key, "the root path `%s'", val, zfs->rootpath); } } - nvlist_add_string(nvl, key, val); + (void)nvlist_add_string(nvl, key, val); } else if (strcmp(key, "atime") == 0 || strcmp(key, "exec") == 0 || strcmp(key, "setuid") == 0) { if (strcmp(val, "on") == 0) - nvlist_add_uint64(nvl, key, 1); + (void)nvlist_add_uint64(nvl, key, 1); else if (strcmp(val, "off") == 0) - nvlist_add_uint64(nvl, key, 0); + (void)nvlist_add_uint64(nvl, key, 0); else errx(1, "invalid value `%s' for %s", val, key); } else if (strcmp(key, "canmount") == 0) { if (strcmp(val, "noauto") == 0) - nvlist_add_uint64(nvl, key, 2); + (void)nvlist_add_uint64(nvl, key, 2); else if (strcmp(val, "on") == 0) - nvlist_add_uint64(nvl, key, 1); + (void)nvlist_add_uint64(nvl, key, 1); else if (strcmp(val, "off") == 0) - nvlist_add_uint64(nvl, key, 0); + (void)nvlist_add_uint64(nvl, key, 0); else errx(1, "invalid value `%s' for %s", val, key); } else if (strcmp(key, "compression") == 0) { @@ -237,7 +237,7 @@ dsl_metadir_alloc(zfs_opt_t *zfs, const char *name) zfs_dsl_dir_t *dir; char *path; - easprintf(&path, "%s/%s", zfs->poolname, name); + (void)easprintf(&path, "%s/%s", zfs->poolname, name); dir = dsl_dir_alloc(zfs, path); free(path); return (dir); @@ -322,11 +322,11 @@ dsl_init(zfs_opt_t *zfs) * user didn't override the defaults. */ if (nvpair_find(zfs->rootdsldir->propsnv, "compression") == NULL) { - nvlist_add_uint64(zfs->rootdsldir->propsnv, "compression", - ZIO_COMPRESS_OFF); + (void)nvlist_add_uint64(zfs->rootdsldir->propsnv, + "compression", ZIO_COMPRESS_OFF); } if (nvpair_find(zfs->rootdsldir->propsnv, "mountpoint") == NULL) { - nvlist_add_string(zfs->rootdsldir->propsnv, "mountpoint", + (void)nvlist_add_string(zfs->rootdsldir->propsnv, "mountpoint", zfs->rootpath); } } @@ -431,6 +431,7 @@ dsl_dir_alloc(zfs_opt_t *zfs, const char *name) STAILQ_INIT(&l); STAILQ_INSERT_HEAD(&l, zfs->rootdsldir, next); origname = dirname = nextdir = estrdup(name); + parent = NULL; for (lp = &l;; lp = &parent->children) { dirname = strsep(&nextdir, "/"); if (nextdir == NULL) diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c index 073dce3ce697..0194089a357d 100644 --- a/usr.sbin/makefs/zfs/fs.c +++ b/usr.sbin/makefs/zfs/fs.c @@ -28,6 +28,7 @@ * SUCH DAMAGE. */ +#include #include #include @@ -734,7 +735,7 @@ fs_add_zpl_attr_layout(zfs_zap_t *zap, unsigned int index, assert(sizeof(layout[0]) == 2); - snprintf(ti, sizeof(ti), "%u", index); + (void)snprintf(ti, sizeof(ti), "%u", index); zap_add(zap, ti, sizeof(sa_attr_type_t), sacnt, (const uint8_t *)layout); } diff --git a/usr.sbin/makefs/zfs/objset.c b/usr.sbin/makefs/zfs/objset.c index 6be732db477a..f47953ac4339 100644 --- a/usr.sbin/makefs/zfs/objset.c +++ b/usr.sbin/makefs/zfs/objset.c @@ -28,6 +28,7 @@ * SUCH DAMAGE. */ +#include #include #include #include diff --git a/usr.sbin/makefs/zfs/vdev.c b/usr.sbin/makefs/zfs/vdev.c index ef9e681af2da..afcce402cb13 100644 --- a/usr.sbin/makefs/zfs/vdev.c +++ b/usr.sbin/makefs/zfs/vdev.c @@ -28,6 +28,7 @@ * SUCH DAMAGE. */ +#include #include #include #include diff --git a/usr.sbin/makefs/zfs/zap.c b/usr.sbin/makefs/zfs/zap.c index decf5fc6a473..316d1446cecf 100644 --- a/usr.sbin/makefs/zfs/zap.c +++ b/usr.sbin/makefs/zfs/zap.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include @@ -172,14 +172,14 @@ zap_add_uint64_self(zfs_zap_t *zap, uint64_t val) { char name[32]; - snprintf(name, sizeof(name), "%jx", (uintmax_t)val); + (void)snprintf(name, sizeof(name), "%jx", (uintmax_t)val); zap_add(zap, name, sizeof(uint64_t), 1, (uint8_t *)&val); } void zap_add_string(zfs_zap_t *zap, const char *name, const char *val) { - zap_add(zap, name, 1, strlen(val) + 1, val); + zap_add(zap, name, 1, strlen(val) + 1, (const uint8_t *)val); } bool @@ -221,7 +221,8 @@ zap_micro_write(zfs_opt_t *zfs, zfs_zap_t *zap) STAILQ_FOREACH(ent, &zap->kvps, next) { memcpy(&ment->mze_value, ent->valp, ent->intsz * ent->intcnt); ment->mze_cd = cd++; - strlcpy(ment->mze_name, ent->name, sizeof(ment->mze_name)); + (void)strlcpy(ment->mze_name, ent->name, + sizeof(ment->mze_name)); ment++; } @@ -247,6 +248,7 @@ zap_fat_write_array_chunk(zap_leaf_t *l, uint16_t li, size_t sz, struct zap_leaf_array *la; assert(sz <= ZAP_MAXVALUELEN); + assert(sz > 0); for (uint16_t n, resid = sz; resid > 0; resid -= n, val += n, li++) { n = MIN(resid, ZAP_LEAF_ARRAY_BYTES); @@ -503,7 +505,8 @@ zap_fat_write(zfs_opt_t *zfs, zfs_zap_t *zap) le->le_value_intlen = ent->intsz; le->le_value_numints = ent->intcnt; le->le_hash = ent->hash; - zap_fat_write_array_chunk(&l, *lptr + 1, namelen, ent->name); + zap_fat_write_array_chunk(&l, *lptr + 1, namelen, + (uint8_t *)ent->name); zap_fat_write_array_chunk(&l, *lptr + 1 + nnamechunks, ent->intcnt * ent->intsz, ent->valp); } From nobody Tue Jul 29 21:01:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs77l1mJhz63Plc; Tue, 29 Jul 2025 21:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs77l0DwYz43t4; Tue, 29 Jul 2025 21:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753822915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wboaQW3rf2UNKnMRZ7VzPrXqKdlDq6hfBarZYqSgntY=; b=ZcRiIYyDVZjsuDtsEGlbI9E4UtbGlyX/crM4WsqZK3pDI5UoyNS2XTTzsdjCCKa/LfdErK wAjxYwIbPBRhrTpc4LdwkUHB+TqoZUSfv3xquuac+Sk3hkXNJBEwijWIUCZpMw22UFZQQL qN1J2gGfi1bUKdY1amsuRzDtd6eSOOosmhUCZia2EsMa7Ei8KW9KgzJ7d+DIquLlvX8E9s vb7Sl4nxXlJY5xE02XobutwQTGm09znb1Xm7ZdPzAmD3/Y7uSxdkwjpkqVWQ4ldhNxEN6C FodkR7PuPuy0wDvgLbUEPccekD/HuEXqDZmluYeelQLeC8vi8HCfecV04oj/Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753822915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wboaQW3rf2UNKnMRZ7VzPrXqKdlDq6hfBarZYqSgntY=; b=qiK6dQSw87FOus6Nfq6DPOpkTeErEcT1cA3Ud3RggbMbR/NbbZNOJARW02RAnCpvST/CB5 VON+s2GlTNl3wwlFIdbAwaZofOBV6mDP84SxAxUv0VYz0aHlvmPTsa5OVCawu3YKggrxht vjBT3fe93/6l0FFIR+MpLtsVwx5KP+I9xGr3Ge0+yDrb8mc1stMKlAbQABBior/mgYLOxy MQH+3WI5A7S2AOn1DGatO02oA/M5TB1GBMoZrKxikIMKYDYXyQOtJ2nE7GtOXbDhp+tHqX HV/JmuttQnqTPDyxsGlaAPUW06J4bV8vGgSkm9tO2PpJFOrx0VdDbbl8HNhklQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753822915; a=rsa-sha256; cv=none; b=EUjDukviFskCtwRW/WCb9qNkqaYRc3ddmLlqMJs8DBZoIRu9Phz28Gi0jaZPtfYNASUMOm 3w3qvWiAGrfK28OmdApqluGdN/XwDl8L9xIL6saIkeR24DNg+t7GR9Ftf1NnTgt0tn+8Nd 0YWmPc8clrlol+fNYC5NWxPrDG3X6G4DF8dmX7Lom3Rt5ks05WiyarQCJKUyhuF06UeApe LuwDlyZzoeXGQbZU1FB2td9FvGxJhwuAJMZhAe3FZ8FOS50/892IniXTA0Rz3HAGdWbnms 7N4B1xjzXyqhatXRxlpw68wA1SeWRRnxWtnLGvmBbLD4ly7epTvtpZBiX66qvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs77k6RyjznxF; Tue, 29 Jul 2025 21:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TL1sre075534; Tue, 29 Jul 2025 21:01:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TL1stQ075531; Tue, 29 Jul 2025 21:01:54 GMT (envelope-from git) Date: Tue, 29 Jul 2025 21:01:54 GMT Message-Id: <202507292101.56TL1stQ075531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 507f8523f5f6 - main - makefs: zfs dataset mountpoints are considered non-empty List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 507f8523f5f6795ad40dc6c13c84e480925f48c0 Auto-Submitted: auto-generated The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=507f8523f5f6795ad40dc6c13c84e480925f48c0 commit 507f8523f5f6795ad40dc6c13c84e480925f48c0 Author: Toomas Soome AuthorDate: 2025-07-25 21:01:46 +0000 Commit: Toomas Soome CommitDate: 2025-07-29 21:01:26 +0000 makefs: zfs dataset mountpoints are considered non-empty The dataset mountpoints get link count and size calculated by content of dataset root directory, but this will break libzfs dir_is_empty_stat() test. For fix, we need to check if the directory is mountpoint for dataset, and calculate the link count and size accordingly. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D51593 --- usr.sbin/makefs/zfs/fs.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/usr.sbin/makefs/zfs/fs.c b/usr.sbin/makefs/zfs/fs.c index 0194089a357d..75f6e30e1500 100644 --- a/usr.sbin/makefs/zfs/fs.c +++ b/usr.sbin/makefs/zfs/fs.c @@ -384,22 +384,34 @@ fs_populate_sattrs(struct fs_populate_arg *arg, const fsnode *cur, links = 1; /* .. */ objsize = 1; /* .. */ - /* - * The size of a ZPL directory is the number of entries - * (including "." and ".."), and the link count is the number of - * entries which are directories (including "." and ".."). - */ - for (fsnode *c = fsnode_isroot(cur) ? cur->next : cur->child; - c != NULL; c = c->next) { - switch (c->type) { - case S_IFDIR: - links++; - /* FALLTHROUGH */ - case S_IFREG: - case S_IFLNK: - objsize++; - break; + if ((cur->inode->flags & FI_ROOT) == 0 ) { + /* + * The size of a ZPL directory is the number of entries + * (including "." and ".."), and the link count is the + * number of entries which are directories + * (including "." and ".."). + */ + for (fsnode *c = + fsnode_isroot(cur) ? cur->next : cur->child; + c != NULL; c = c->next) { + switch (c->type) { + case S_IFDIR: + links++; + /* FALLTHROUGH */ + case S_IFREG: + case S_IFLNK: + objsize++; + break; + } } + } else { + /* + * Root directory children do belong to + * different dataset and this directory is + * empty in the current objset. + */ + links++; /* . */ + objsize++; /* . */ } /* The root directory is its own parent. */ From nobody Tue Jul 29 22:16:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs8pH1951z63Sl2; Tue, 29 Jul 2025 22:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs8pH0pxNz4DHB; Tue, 29 Jul 2025 22:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PXfU16+nFtzRDYT1TTH1wMPzBBt9lqXTMXZvWRsNKnU=; b=o3OFlmqkgqeL8zwSATsjkjBiYot0AJdmEd+uRZ40azkFQgXttTN7OxLBykiZ5G3zFZVmxj c+g6R2rDa1JtjbF+WTv6JIpFEhYnQPRPnnT0r6gCFsGy9o444qw++Bqt8zhJLOZCyFg6fL NbCYNKRuxF9bmSsUjs8ZDY99d1zICIBR/M/FwKZd4gGEQpTUlxWe5x3/+AljhscVqPCGJP RQqr1l7pBSzXC2KKQYosYCSx99Uhev3+L+/4zi8XQ71uCGSiohy3VBDe3L3IxWHrTYWBON d7nZ765Iq4ayJCFuPyOFhhjuMpKd7+jgNVjtUXFKycdF6q66+ek8dxZRTMK6hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PXfU16+nFtzRDYT1TTH1wMPzBBt9lqXTMXZvWRsNKnU=; b=rFEbRgpHmTRmQZNwgh5qVpcohCk95V7/kdrHioZqHYmnCmthaEv0IH+Lxw4ucIsbpGq850 bOG76XEmQ9ECUQp22Ao035XzRytjrlPL3cAVUvgACEbxLnb++4lrOOWaHTfDtHiccQmm9n e4sr8ULyBaBxhpXr/8pM+uUzeYnV3B+LWjDycFbj71gG2AhKmYGQ4hNwuO+vN1f6MPhzQt v5h6Sp9s17P5t4qulKPFpYSmw7nvsxhHdMfTnbR00k5tiHco9ZMHzP16vtMSXnGslkvEOw U4wJIBan6u0QQBD53TjCNBnoA4ZNmLrdnmDCrnKin2SsHDUHo1fwm/COWoJ3rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753827415; a=rsa-sha256; cv=none; b=ncWyn2gy6YY2CdByQyu4DmfsCvkxB8+BsuTGmKZCbigJzCo/em/abbeWV0dRK4EVZPU0lj lDjQHlvWwekShRX80VfIL44uN2v9Udat3z+i8BUPa6x2898dCpMvjDixZJZWcwROqR9eGa CGaONQdUxkwRkNUixmcvA8Obn3Htg5nKJQWX+kOvrjCC3ZnscUcXQJgUfp79C38cOkse0O DXaglWszqsTC7e8NUEqQMi4TEMYDBuQchxgrFhWbSlmvc3goBoJKQNaSNNfjyi62J4eNgd uG4VKZ4ya0AY8Kdc6S7HIlQ0ABe4kwpniyBP3f2arAPmA8IyOVPf8YHzS40mDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs8pH0L9Nzq6m; Tue, 29 Jul 2025 22:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TMGse2009192; Tue, 29 Jul 2025 22:16:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TMGsMv009189; Tue, 29 Jul 2025 22:16:54 GMT (envelope-from git) Date: Tue, 29 Jul 2025 22:16:54 GMT Message-Id: <202507292216.56TMGsMv009189@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: 08ad5c42343b - stable/14 - rtlbtfw(8): Add support for firmware file format V2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 08ad5c42343b3ac15fa4169ac801e52e2de87135 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=08ad5c42343b3ac15fa4169ac801e52e2de87135 commit 08ad5c42343b3ac15fa4169ac801e52e2de87135 Author: Vladimir Kondratyev AuthorDate: 2025-05-14 01:09:40 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-07-29 22:11:43 +0000 rtlbtfw(8): Add support for firmware file format V2 As Realtek changed format of the firmware files for recent adaptors. Sponsored by: Future Crew, LLC MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D50082 (cherry picked from commit b87a926098b291e2baf45ffc13c076ba0b0f0d74) --- usr.sbin/bluetooth/rtlbtfw/main.c | 19 +++- usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c | 195 ++++++++++++++++++++++++++++++++-- usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h | 53 ++++++++- usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.c | 35 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.h | 13 +++ 5 files changed, 302 insertions(+), 13 deletions(-) diff --git a/usr.sbin/bluetooth/rtlbtfw/main.c b/usr.sbin/bluetooth/rtlbtfw/main.c index e0445726c3a2..700b9b43bafa 100644 --- a/usr.sbin/bluetooth/rtlbtfw/main.c +++ b/usr.sbin/bluetooth/rtlbtfw/main.c @@ -76,7 +76,6 @@ static struct rtlbt_devid rtlbt_list[] = { { .vendor_id = 0x04ca, .product_id = 0x4006 }, { .vendor_id = 0x0cb8, .product_id = 0xc549 }, -#ifdef RTLBTFW_SUPPORTS_FW_V2 /* Realtek 8852CE Bluetooth devices */ { .vendor_id = 0x04ca, .product_id = 0x4007 }, { .vendor_id = 0x04c5, .product_id = 0x1675 }, @@ -84,7 +83,6 @@ static struct rtlbt_devid rtlbt_list[] = { { .vendor_id = 0x13d3, .product_id = 0x3587 }, { .vendor_id = 0x13d3, .product_id = 0x3586 }, { .vendor_id = 0x13d3, .product_id = 0x3592 }, -#endif /* Realtek 8852BE Bluetooth devices */ { .vendor_id = 0x0cb8, .product_id = 0xc559 }, @@ -312,6 +310,7 @@ main(int argc, char *argv[]) char *firmware_dir = NULL; char *firmware_path = NULL; char *config_path = NULL; + const char *fw_suffix; int retcode = 1; const struct rtlbt_id_table *ic; uint8_t rom_version; @@ -410,7 +409,8 @@ main(int argc, char *argv[]) if (firmware_dir == NULL) firmware_dir = strdup(_DEFAULT_RTLBT_FIRMWARE_PATH); - firmware_path = rtlbt_get_fwname(ic->fw_name, firmware_dir, "_fw.bin"); + fw_suffix = ic->fw_suffix == NULL ? "_fw.bin" : ic->fw_suffix; + firmware_path = rtlbt_get_fwname(ic->fw_name, firmware_dir, fw_suffix); if (firmware_path == NULL) goto shutdown; @@ -449,7 +449,18 @@ main(int argc, char *argv[]) rtlbt_debug("rom_version = %d", rom_version); /* Load in the firmware */ - r = rtlbt_parse_fwfile_v1(&fw, rom_version); + if (fw_type == RTLBT_FW_TYPE_V2) { + uint8_t key_id, reg_val[2]; + r = rtlbt_read_reg16(hdl, RTLBT_SEC_PROJ, reg_val); + if (r < 0) { + rtlbt_err("rtlbt_read_reg16() failed code %d", r); + goto shutdown; + } + key_id = reg_val[0]; + rtlbt_debug("key_id = %d", key_id); + r = rtlbt_parse_fwfile_v2(&fw, rom_version, key_id); + } else + r = rtlbt_parse_fwfile_v1(&fw, rom_version); if (r < 0) { rtlbt_err("Parseing firmware file failed"); goto shutdown; diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c index bb3d20d79527..c58a8feb41a4 100644 --- a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c @@ -105,20 +105,19 @@ static const struct rtlbt_id_table rtlbt_ic_id_table[] = { .hci_version = 0xb, .flags = RTLBT_IC_FLAG_MSFT, .fw_name = "rtl8852bu", -#ifdef RTLBTFW_SUPPORTS_FW_V2 }, { /* 8852C */ .lmp_subversion = RTLBT_ROM_LMP_8852A, .hci_revision = 0xc, .hci_version = 0xc, .flags = RTLBT_IC_FLAG_MSFT, .fw_name = "rtl8852cu", + .fw_suffix = "_fw_v2.bin", }, { /* 8851B */ .lmp_subversion = RTLBT_ROM_LMP_8851B, .hci_revision = 0xb, .hci_version = 0xc, .flags = RTLBT_IC_FLAG_MSFT, .fw_name = "rtl8851bu", -#endif }, }; @@ -144,10 +143,8 @@ static const uint16_t project_ids[] = { /* Signatures */ static const uint8_t fw_header_sig_v1[8] = {0x52, 0x65, 0x61, 0x6C, 0x74, 0x65, 0x63, 0x68}; /* Realtech */ -#ifdef RTLBTFW_SUPPORTS_FW_V2 static const uint8_t fw_header_sig_v2[8] = {0x52, 0x54, 0x42, 0x54, 0x43, 0x6F, 0x72, 0x65}; /* RTBTCore */ -#endif static const uint8_t fw_ext_sig[4] = {0x51, 0x04, 0xFD, 0x77}; int @@ -260,12 +257,10 @@ rtlbt_get_fw_type(struct rtlbt_firmware *fw, uint16_t *fw_lmp_subversion) fw_type = RTLBT_FW_TYPE_V1; fw_header_len = sizeof(struct rtlbt_fw_header_v1); } else -#ifdef RTLBTFW_SUPPORTS_FW_V2 if (memcmp(fw->buf, fw_header_sig_v2, sizeof(fw_header_sig_v2)) == 0) { fw_type = RTLBT_FW_TYPE_V2; fw_header_len = sizeof(struct rtlbt_fw_header_v2); } else -#endif return (RTLBT_FW_TYPE_UNKNOWN); if (fw->len < fw_header_len + sizeof(fw_ext_sig) + 4) { @@ -367,6 +362,194 @@ rtlbt_parse_fwfile_v1(struct rtlbt_firmware *fw, uint8_t rom_version) return (0); } +static void * +rtlbt_iov_fetch(struct rtlbt_iov *iov, uint32_t len) +{ + void *data = NULL; + + if (iov->len >= len) { + data = iov->data; + iov->data += len; + iov->len -= len; + } + + return (data); +} + +static int +rtlbt_patch_entry_cmp(struct rtlbt_patch_entry *a, struct rtlbt_patch_entry *b, + void *thunk __unused) +{ + return ((a->prio > b->prio) - (a->prio < b->prio)); +} + +static int +rtlbt_parse_section(struct rtlbt_patch_list *patch_list, uint32_t opcode, + uint8_t *data, uint32_t len, uint8_t rom_version, uint8_t key_id) +{ + struct rtlbt_sec_hdr *hdr; + struct rtlbt_patch_entry *entry; + struct rtlbt_subsec_hdr *subsec_hdr; + struct rtlbt_subsec_security_hdr *subsec_security_hdr; + uint16_t num_subsecs; + uint8_t *subsec_data; + uint32_t subsec_len; + int i, sec_len = 0; + struct rtlbt_iov iov = { + .data = data, + .len = len, + }; + + hdr = rtlbt_iov_fetch(&iov, sizeof(*hdr)); + if (hdr == NULL) { + errno = EINVAL; + return (-1); + } + num_subsecs = le16toh(hdr->num); + + for (i = 0; i < num_subsecs; i++) { + subsec_hdr = rtlbt_iov_fetch(&iov, sizeof(*subsec_hdr)); + if (subsec_hdr == NULL) + break; + subsec_len = le32toh(subsec_hdr->len); + + rtlbt_debug("subsection, eco 0x%02x, prio 0x%02x, len 0x%x", + subsec_hdr->eco, subsec_hdr->prio, subsec_len); + + subsec_data = rtlbt_iov_fetch(&iov, subsec_len); + if (subsec_data == NULL) + break; + + if (subsec_hdr->eco == rom_version + 1) { + if (opcode == RTLBT_PATCH_SECURITY_HEADER) { + subsec_security_hdr = (void *)subsec_hdr; + if (subsec_security_hdr->key_id == key_id) + break; + continue; + } + + entry = calloc(1, sizeof(*entry)); + if (entry == NULL) { + errno = ENOMEM; + return (-1); + } + *entry = (struct rtlbt_patch_entry) { + .opcode = opcode, + .len = subsec_len, + .prio = subsec_hdr->prio, + .data = subsec_data, + }; + SLIST_INSERT_HEAD(patch_list, entry, next); + sec_len += subsec_len; + } + } + + return (sec_len); +} + +int +rtlbt_parse_fwfile_v2(struct rtlbt_firmware *fw, uint8_t rom_version, + uint8_t key_id) +{ + struct rtlbt_fw_header_v2 *hdr; + struct rtlbt_section *section; + struct rtlbt_patch_entry *entry; + uint32_t num_sections; + uint32_t section_len; + uint32_t opcode; + int seclen, len = 0, patch_len = 0; + uint32_t i; + uint8_t *section_data, *patch_buf; + struct rtlbt_patch_list patch_list = + SLIST_HEAD_INITIALIZER(patch_list); + struct rtlbt_iov iov = { + .data = fw->buf, + .len = fw->len - 7, + }; + + hdr = rtlbt_iov_fetch(&iov, sizeof(*hdr)); + if (hdr == NULL) { + errno = EINVAL; + return (-1); + } + num_sections = le32toh(hdr->num_sections); + + rtlbt_debug("FW version %02x%02x%02x%02x-%02x%02x%02x%02x", + hdr->fw_version[0], hdr->fw_version[1], + hdr->fw_version[2], hdr->fw_version[3], + hdr->fw_version[4], hdr->fw_version[5], + hdr->fw_version[6], hdr->fw_version[7]); + + for (i = 0; i < num_sections; i++) { + section = rtlbt_iov_fetch(&iov, sizeof(*section)); + if (section == NULL) + break; + section_len = le32toh(section->len); + opcode = le32toh(section->opcode); + + rtlbt_debug("section, opcode 0x%08x", section->opcode); + + section_data = rtlbt_iov_fetch(&iov, section_len); + if (section_data == NULL) + break; + + seclen = 0; + switch (opcode) { + case RTLBT_PATCH_SECURITY_HEADER: + if (key_id == 0) + break; + /* FALLTHROUGH */ + case RTLBT_PATCH_SNIPPETS: + case RTLBT_PATCH_DUMMY_HEADER: + seclen = rtlbt_parse_section(&patch_list, opcode, + section_data, section_len, rom_version, key_id); + break; + default: + break; + } + if (seclen < 0) { + rtlbt_err("Section parse (0x%08x) failed. err %d", + opcode, errno); + return (-1); + } + len += seclen; + } + + if (len == 0) { + errno = ENOMSG; + return (-1); + } + + patch_buf = calloc(1, len); + if (patch_buf == NULL) { + errno = ENOMEM; + return (-1); + } + + SLIST_MERGESORT(&patch_list, NULL, + rtlbt_patch_entry_cmp, rtlbt_patch_entry, next); + while (!SLIST_EMPTY(&patch_list)) { + entry = SLIST_FIRST(&patch_list); + rtlbt_debug("opcode 0x%08x, addr 0x%p, len 0x%x", + entry->opcode, entry->data, entry->len); + memcpy(patch_buf + patch_len, entry->data, entry->len); + patch_len += entry->len; + SLIST_REMOVE_HEAD(&patch_list, next); + free(entry); + } + + if (patch_len == 0) { + errno = EPERM; + return (-1); + } + + free(fw->buf); + fw->buf = patch_buf; + fw->len = patch_len; + + return (0); +} + int rtlbt_append_fwfile(struct rtlbt_firmware *fw, struct rtlbt_firmware *opt) { diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h index 340abacba759..48b30cb2289b 100644 --- a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h @@ -30,7 +30,8 @@ #ifndef __RTLBT_FW_H__ #define __RTLBT_FW_H__ -#include +#include +#include #define RTLBT_ROM_LMP_8703B 0x8703 #define RTLBT_ROM_LMP_8723A 0x1200 @@ -41,12 +42,14 @@ #define RTLBT_ROM_LMP_8852A 0x8852 #define RTLBT_ROM_LMP_8851B 0x8851 +#define RTLBT_PATCH_SNIPPETS 0x01 +#define RTLBT_PATCH_DUMMY_HEADER 0x02 +#define RTLBT_PATCH_SECURITY_HEADER 0x03 + enum rtlbt_fw_type { RTLBT_FW_TYPE_UNKNOWN, RTLBT_FW_TYPE_V1, -#ifdef RTLBTFW_SUPPORTS_FW_V2 RTLBT_FW_TYPE_V2, -#endif }; struct rtlbt_id_table { @@ -58,6 +61,7 @@ struct rtlbt_id_table { #define RTLBT_IC_FLAG_CONFIG (1 << 1) #define RTLBT_IC_FLAG_MSFT (2 << 1) const char *fw_name; + const char *fw_suffix; }; struct rtlbt_firmware { @@ -66,6 +70,21 @@ struct rtlbt_firmware { unsigned char *buf; }; +SLIST_HEAD(rtlbt_patch_list, rtlbt_patch_entry); + +struct rtlbt_patch_entry { + SLIST_ENTRY(rtlbt_patch_entry) next; + uint32_t opcode; + uint32_t len; + uint8_t prio; + uint8_t *data; +}; + +struct rtlbt_iov { + uint8_t *data; + uint32_t len; +}; + struct rtlbt_fw_header_v1 { uint8_t signature[8]; uint32_t fw_version; @@ -78,6 +97,32 @@ struct rtlbt_fw_header_v2 { uint32_t num_sections; } __attribute__ ((packed)); +struct rtlbt_section { + uint32_t opcode; + uint32_t len; + uint8_t data[]; +} __attribute__ ((packed)); + +struct rtlbt_sec_hdr { + uint16_t num; + uint16_t reserved; +} __attribute__ ((packed)); + +struct rtlbt_subsec_hdr { + uint8_t eco; + uint8_t prio; + uint8_t cb[2]; + uint32_t len; +} __attribute__ ((packed)); + +struct rtlbt_subsec_security_hdr { + uint8_t eco; + uint8_t prio; + uint8_t key_id; + uint8_t reserved; + uint32_t len; +} __attribute__ ((packed)); + int rtlbt_fw_read(struct rtlbt_firmware *fw, const char *fwname); void rtlbt_fw_free(struct rtlbt_firmware *fw); char *rtlbt_get_fwname(const char *fw_name, const char *prefix, @@ -87,6 +132,8 @@ const struct rtlbt_id_table *rtlbt_get_ic(uint16_t lmp_subversion, enum rtlbt_fw_type rtlbt_get_fw_type(struct rtlbt_firmware *fw, uint16_t *fw_lmp_subversion); int rtlbt_parse_fwfile_v1(struct rtlbt_firmware *fw, uint8_t rom_version); +int rtlbt_parse_fwfile_v2(struct rtlbt_firmware *fw, uint8_t rom_version, + uint8_t reg_id); int rtlbt_append_fwfile(struct rtlbt_firmware *fw, struct rtlbt_firmware *opt); #endif diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.c b/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.c index 21f2c3e2804f..82e22d406ea9 100644 --- a/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.c +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.c @@ -178,6 +178,41 @@ rtlbt_read_rom_ver(struct libusb_device_handle *hdl, uint8_t *ver) return (0); } +int +rtlbt_read_reg16(struct libusb_device_handle *hdl, + struct rtlbt_vendor_cmd *vcmd, uint8_t *resp) +{ + int ret, transferred; + struct rtlbt_hci_event_cmd_compl *event; + uint8_t cmd_buf[offsetof(struct rtlbt_hci_cmd, data) + sizeof(*vcmd)]; + struct rtlbt_hci_cmd *cmd = (struct rtlbt_hci_cmd *)cmd_buf; + cmd->opcode = htole16(0xfc61); + cmd->length = sizeof(struct rtlbt_vendor_cmd); + memcpy(cmd->data, vcmd, sizeof(struct rtlbt_vendor_cmd)); + uint8_t buf[RTLBT_HCI_EVT_COMPL_SIZE(struct rtlbt_vendor_rp)]; + + memset(buf, 0, sizeof(buf)); + + ret = rtlbt_hci_command(hdl, + cmd, + buf, + sizeof(buf), + &transferred, + RTLBT_HCI_CMD_TIMEOUT); + + if (ret < 0 || transferred != sizeof(buf)) { + rtlbt_debug("Can't read reg16: code=%d, size=%d", + ret, + transferred); + return (-1); + } + + event = (struct rtlbt_hci_event_cmd_compl *)buf; + memcpy(resp, &(((struct rtlbt_vendor_rp *)event->data)->data), 2); + + return (0); +} + int rtlbt_load_fwfile(struct libusb_device_handle *hdl, const struct rtlbt_firmware *fw) diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.h b/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.h index bc7c9fee3f57..a7200a440272 100644 --- a/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.h +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.h @@ -95,9 +95,22 @@ struct rtlbt_hci_dl_rp { uint8_t index; } __attribute__ ((packed)); +/* Vendor USB request payload */ +struct rtlbt_vendor_cmd { + uint8_t data[5]; +} __attribute__ ((packed)); +#define RTLBT_SEC_PROJ (&(struct rtlbt_vendor_cmd) {{0x10, 0xA4, 0x0D, 0x00, 0xb0}}) + +struct rtlbt_vendor_rp { + uint8_t status; + uint8_t data[2]; +}; + int rtlbt_read_local_ver(struct libusb_device_handle *hdl, ng_hci_read_local_ver_rp *ver); int rtlbt_read_rom_ver(struct libusb_device_handle *hdl, uint8_t *ver); +int rtlbt_read_reg16(struct libusb_device_handle *hdl, + struct rtlbt_vendor_cmd *cmd, uint8_t *resp); int rtlbt_load_fwfile(struct libusb_device_handle *hdl, const struct rtlbt_firmware *fw); From nobody Tue Jul 29 22:16:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs8pJ319lz63SQd; Tue, 29 Jul 2025 22:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs8pJ1yQLz4DBg; Tue, 29 Jul 2025 22:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=01B3KpSbt0R9kf9Lxe9zh5QVCEZzVuAQpy1sPDJ8d28=; b=g7XLJn6H1EdSbiqd8laKnSyunod64P9r4z06cErh9/qlG93NfUT21mbSWS54FjkLbrxZOi wnWigD3L15gJi+s+DkpH25Txi3gMP8127oucpVwSyP7n1AL7GqYKkTNbA4LEgX0ucpViPQ gBSAgrVBBZd8D9WUvuOywf4X9gtEb5H9cUd4zEb+ShR9uTkmf/TticCTk3sTBzFZQAZl3e qg/d1Kn5hiUD34ZYtubroVRDz9CoreuZ0YZKeiyChEbXXiz2Y5DUrJuWa7UQ0zd8fGbAEE P+EdJ6zndrkhbOlPWewCueupaTxuvrs3Dd92K9ZRRk0at+6l++cBlh4rRwkcSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=01B3KpSbt0R9kf9Lxe9zh5QVCEZzVuAQpy1sPDJ8d28=; b=N/OkrmtuZ5KShlwhJYBHNY3nJbENK0EB2LxD5wUVLxucWTyE8Cpdt9tF464n1TBquT8bGP KCwF5bf4wLuoadP1SbNmQkxxx3ZsT2/CzrWs+IlRmlAoJ2TogYr5ObvivokSKu1QKE3rUJ NgmMsm/M2QMNvBGWvIZyf1vGuM/ccnO1pQbcqiMTxtsZcwkC6W0x1ssz37mpiWsOFLgJbP Fypk753WSA5ontCzdxbpdesxGdAWQ24MJ8jdNQ3L/q4r5zPf9brD4auqeW98fmRJMMzUX7 FAdFrB5diTarYW1fGsFvjgVbqAbVxBZFoYLMOqFgW5evtycA4Y4nvEfSLfXdCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753827416; a=rsa-sha256; cv=none; b=ZuNKJr/bv4wEgIm2uhCK3kIhIn+Dpt9tYmeo/AlABu+EIcxNATJTXojf0AicBTm6+w3tbT NHYV+TlYDnbOuxmwQxr/4hQDEzpcWgVnwcaYfFZq+JWyRIbK5QIxLbdSmThpQaqs2XXGCo JLXI5lQVJ1FWsi09AaS9QzQZizPv2/mq4md50WTBUQpQc+IjgecEvRFIK5oQzaMtgQNJ3h uMgp49s4MoYFw3R3R0Aq9Y5gDEC6684CHjLL7ayhKyUcWLb+ZfF6zM5S/aqtPx9f1YeABk QvitBCWvCx5+qN+5JEyopgino085htUEMMmgU73tpxafL7Qe2fcEOOd09axXug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs8pJ1HnGzq6q; Tue, 29 Jul 2025 22:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TMGuPX009236; Tue, 29 Jul 2025 22:16:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TMGugU009231; Tue, 29 Jul 2025 22:16:56 GMT (envelope-from git) Date: Tue, 29 Jul 2025 22:16:56 GMT Message-Id: <202507292216.56TMGugU009231@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: 2100a0fecec7 - stable/14 - rtlbtfw(8): Sync device VID/PID list with Linux 6.15-rc4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2100a0fecec7710debf59ef4e7ddbc28abb7397c Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=2100a0fecec7710debf59ef4e7ddbc28abb7397c commit 2100a0fecec7710debf59ef4e7ddbc28abb7397c Author: Vladimir Kondratyev AuthorDate: 2025-05-14 14:38:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-07-29 22:11:58 +0000 rtlbtfw(8): Sync device VID/PID list with Linux 6.15-rc4 Sponsored by: Future Crew, LLC MFC after: 1 month (cherry picked from commit 3e72d0b40040f94c4b99ab9dfa0a0e1b62dff397) --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c | 20 ++++++++ usr.sbin/bluetooth/rtlbtfw/main.c | 20 ++++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c | 14 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h | 1 + usr.sbin/bluetooth/rtlbtfw/rtlbtfw.conf | 66 ++++++++++++++++++++++++- 5 files changed, 119 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c index c3fb98b46e6a..0181a67ac604 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c @@ -84,6 +84,9 @@ const STRUCT_USB_HOST_ID ubt_rtl_devs[] = /* Realtek 8822CU Bluetooth devices */ { USB_VPI(0x13d3, 0x3549, 0) }, + /* Realtek 8851BE Bluetooth devices */ + { USB_VPI(0x13d3, 0x3600, 0) }, + /* Realtek 8852AE Bluetooth devices */ { USB_VPI(0x0bda, 0x2852, 0) }, { USB_VPI(0x0bda, 0xc852, 0) }, @@ -100,11 +103,28 @@ const STRUCT_USB_HOST_ID ubt_rtl_devs[] = { USB_VPI(0x13d3, 0x3587, 0) }, { USB_VPI(0x13d3, 0x3586, 0) }, { USB_VPI(0x13d3, 0x3592, 0) }, + { USB_VPI(0x0489, 0xe122, 0) }, /* Realtek 8852BE Bluetooth devices */ { USB_VPI(0x0cb8, 0xc559, 0) }, + { USB_VPI(0x0bda, 0x4853, 0) }, { USB_VPI(0x0bda, 0x887b, 0) }, + { USB_VPI(0x0bda, 0xb85b, 0) }, + { USB_VPI(0x13d3, 0x3570, 0) }, { USB_VPI(0x13d3, 0x3571, 0) }, + { USB_VPI(0x13d3, 0x3572, 0) }, + { USB_VPI(0x13d3, 0x3591, 0) }, + { USB_VPI(0x0489, 0xe123, 0) }, + { USB_VPI(0x0489, 0xe125, 0) }, + + /* Realtek 8852BT/8852BE-VT Bluetooth devices */ + { USB_VPI(0x0bda, 0x8520, 0) }, + + /* Realtek 8922AE Bluetooth devices */ + { USB_VPI(0x0bda, 0x8922, 0) }, + { USB_VPI(0x13d3, 0x3617, 0) }, + { USB_VPI(0x13d3, 0x3616, 0) }, + { USB_VPI(0x0489, 0xe130, 0) }, /* Realtek 8723AE Bluetooth devices */ { USB_VPI(0x0930, 0x021d, 0) }, diff --git a/usr.sbin/bluetooth/rtlbtfw/main.c b/usr.sbin/bluetooth/rtlbtfw/main.c index 700b9b43bafa..e87a98036265 100644 --- a/usr.sbin/bluetooth/rtlbtfw/main.c +++ b/usr.sbin/bluetooth/rtlbtfw/main.c @@ -67,6 +67,9 @@ static struct rtlbt_devid rtlbt_list[] = { /* Realtek 8822CU Bluetooth devices */ { .vendor_id = 0x13d3, .product_id = 0x3549 }, + /* Realtek 8851BE Bluetooth devices */ + { .vendor_id = 0x13d3, .product_id = 0x3600 }, + /* Realtek 8852AE Bluetooth devices */ { .vendor_id = 0x0bda, .product_id = 0x2852 }, { .vendor_id = 0x0bda, .product_id = 0xc852 }, @@ -83,11 +86,28 @@ static struct rtlbt_devid rtlbt_list[] = { { .vendor_id = 0x13d3, .product_id = 0x3587 }, { .vendor_id = 0x13d3, .product_id = 0x3586 }, { .vendor_id = 0x13d3, .product_id = 0x3592 }, + { .vendor_id = 0x0489, .product_id = 0xe122 }, /* Realtek 8852BE Bluetooth devices */ { .vendor_id = 0x0cb8, .product_id = 0xc559 }, + { .vendor_id = 0x0bda, .product_id = 0x4853 }, { .vendor_id = 0x0bda, .product_id = 0x887b }, + { .vendor_id = 0x0bda, .product_id = 0xb85b }, + { .vendor_id = 0x13d3, .product_id = 0x3570 }, { .vendor_id = 0x13d3, .product_id = 0x3571 }, + { .vendor_id = 0x13d3, .product_id = 0x3572 }, + { .vendor_id = 0x13d3, .product_id = 0x3591 }, + { .vendor_id = 0x0489, .product_id = 0xe123 }, + { .vendor_id = 0x0489, .product_id = 0xe125 }, + + /* Realtek 8852BT/8852BE-VT Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0x8520 }, + + /* Realtek 8922AE Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0x8922 }, + { .vendor_id = 0x13d3, .product_id = 0x3617 }, + { .vendor_id = 0x13d3, .product_id = 0x3616 }, + { .vendor_id = 0x0489, .product_id = 0xe130 }, /* Realtek 8723AE Bluetooth devices */ { .vendor_id = 0x0930, .product_id = 0x021d }, diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c index c58a8feb41a4..d7e9f2f939c6 100644 --- a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c @@ -118,6 +118,18 @@ static const struct rtlbt_id_table rtlbt_ic_id_table[] = { .hci_version = 0xc, .flags = RTLBT_IC_FLAG_MSFT, .fw_name = "rtl8851bu", + }, { /* 8922A */ + .lmp_subversion = RTLBT_ROM_LMP_8922A, + .hci_revision = 0xa, + .hci_version = 0xc, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8922au", + }, { /* 8852BT/8852BE-VT */ + .lmp_subversion = RTLBT_ROM_LMP_8852A, + .hci_revision = 0x87, + .hci_version = 0xc, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8852btu", }, }; @@ -138,6 +150,8 @@ static const uint16_t project_ids[] = { [ 25 ] = RTLBT_ROM_LMP_8852A, /* 8852CU */ [ 33 ] = RTLBT_ROM_LMP_8822B, /* 8822EU */ [ 36 ] = RTLBT_ROM_LMP_8851B, /* 8851BU */ + [ 44 ] = RTLBT_ROM_LMP_8922A, /* 8922A */ + [ 47 ] = RTLBT_ROM_LMP_8852A, /* 8852BT */ }; /* Signatures */ diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h index 48b30cb2289b..e9af6c93950e 100644 --- a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h @@ -41,6 +41,7 @@ #define RTLBT_ROM_LMP_8822B 0x8822 #define RTLBT_ROM_LMP_8852A 0x8852 #define RTLBT_ROM_LMP_8851B 0x8851 +#define RTLBT_ROM_LMP_8922A 0x8922 #define RTLBT_PATCH_SNIPPETS 0x01 #define RTLBT_PATCH_DUMMY_HEADER 0x02 diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbtfw.conf b/usr.sbin/bluetooth/rtlbtfw/rtlbtfw.conf index d45ba0bd92c4..61ae53db8f39 100644 --- a/usr.sbin/bluetooth/rtlbtfw/rtlbtfw.conf +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbtfw.conf @@ -46,6 +46,16 @@ notify 100 { action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; }; +# Realtek 8851BE Bluetooth devices +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x13d3"; + match "product" "0x3600"; + action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; +}; + # Realtek 8852AE Bluetooth devices notify 100 { match "system" "USB"; @@ -113,6 +123,14 @@ notify 100 { match "product" "(0x3587|0x3586|0x3592)"; action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; }; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0489"; + match "product" "0xe122"; + action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; +}; # Realtek 8852BE Bluetooth devices notify 100 { @@ -128,7 +146,43 @@ notify 100 { match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x0bda"; - match "product" "0x887b"; + match "product" "(0x4853|0x887b|0xb85b)"; + action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; +}; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x13d3"; + match "product" "(0x3570|0x3571|0x3572|0x3591)"; + action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; +}; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0489"; + match "product" "(0xe123|0xe125)"; + action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; +}; + +# Realtek 8852BT/8852BE-VT Bluetooth devices +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0bda"; + match "product" "0x8520"; + action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; +}; + +# Realtek 8922AE Bluetooth devices +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0bda"; + match "product" "0x8922"; action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; }; notify 100 { @@ -136,7 +190,15 @@ notify 100 { match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x13d3"; - match "product" "0x3571"; + match "product" "(0x3617|0x3616)"; + action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; +}; +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0489"; + match "product" "0xe130"; action "/usr/sbin/rtlbtfw -d $cdev -f /usr/local/share/rtlbt-firmware"; }; From nobody Tue Jul 29 22:16:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs8pK53F7z63Sch; Tue, 29 Jul 2025 22:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs8pK2jjWz4Crr; Tue, 29 Jul 2025 22:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/e48a99xTXKtznJRvSzVGro8CEIdDZMM0svA7Qo8eTw=; b=V0dqhxTtEQ/dxICCyywnjNMQdXjR/49otIDL4WvtkZLpyBOEp2/hxKOMPs5su7QPLx14bq aOdKthy65Brvmq64IC/yhcoDiYZSX8nZtDkrr6Kk6Cz/Vg+tTWCHxgUySxl9MsauTT8dim JbThjJU8NuNcv+SlnCgzDhUDOZj0+RSSQU/ansm0J1ChG6N3T0bME11x1vCDY6dAURpSJr TNuRgEwNP1CWe6hsoqTdc5WdQQY4hv3YhR0uUARUexCSUjqUykobG7SyQfHg3tgqLum8yZ o1vC/+lXUglX/UtHP7+5BPU+B2DbKIA6PAEJz64hiJrJjunFdHy5PdnRwKGcNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/e48a99xTXKtznJRvSzVGro8CEIdDZMM0svA7Qo8eTw=; b=U683tMiL5xasQstkbHzhDgJbDHruHMx6pq95M820KZfhyY9myzPrR8+5ORyx7dqm8JR/zQ G1o0u907yodilRdsnUzZyI8nhvkit44wAFxUfbOVoMq42FIv2ZEXA/eP1UMq2oNJUZvh+7 uOovaF0nXr5gqbS9ofxnJlJoeKVEVWUCGJvc1QFpZZFfmLwz4C5CnhTpMeQdq5GAKd2UeU 0wF4HiYq2D/P8M48aTPJGyglPmhrccMHBiYwSrsXko/Za1SQGxqEqXWvaEfXgBq6fCOQi7 YuJehdNEiumVaGGuHpaVRE0STmO+kWWrpV8vlco25KAsMKZnZg+C6wEPIuLVNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753827417; a=rsa-sha256; cv=none; b=nwC04uSXjVC/nI73DW9TpOe3DmM2jA/qmdXPh1XQCGXMQrKE9fOpCC3Cl/jMoa7pDhQFut fEH4K/V3aJK9DJtpqtglxfpCApfHDAoc1crFjOmNi6JF1PKI8tMg1wrehH9y+v2c+DFzl+ 4Ser6joeWeX4thpvfULp8LawMpmuv3koEQQoa8I9dfuYng0Y2Csf+EKSnXE1ZwRGvPjckf uwnI+IIi9LFChm8xxA3vp/lhTx4+V856xOBP5ljju04ehyjwTrEbCZAS2nZ5j+kWJ494Vc Y7I1zlN4hhkQUtNrswDtyxFbTyvQwLG5pXQTIYY50CtU0NIJb6iju1Gz3WcbFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs8pK1wzzzqMx; Tue, 29 Jul 2025 22:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TMGv2k009279; Tue, 29 Jul 2025 22:16:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TMGv28009276; Tue, 29 Jul 2025 22:16:57 GMT (envelope-from git) Date: Tue, 29 Jul 2025 22:16:57 GMT Message-Id: <202507292216.56TMGv28009276@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: 6296dd08ae52 - stable/14 - Added identifiers for additional PS4 DualShock controller variants List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 6296dd08ae52b01ed681381df6f6c8f60e724467 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6296dd08ae52b01ed681381df6f6c8f60e724467 commit 6296dd08ae52b01ed681381df6f6c8f60e724467 Author: Kevin Reinholz AuthorDate: 2025-05-14 01:09:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-07-29 22:12:43 +0000 Added identifiers for additional PS4 DualShock controller variants PR: 285215 MFC after: 1 week (cherry picked from commit d4147ad1a2b9d6e7a862a63894da604c61721786) --- sys/dev/hid/ps4dshock.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/dev/hid/ps4dshock.c b/sys/dev/hid/ps4dshock.c index 537f70cadec0..d3c6b3eeadf9 100644 --- a/sys/dev/hid/ps4dshock.c +++ b/sys/dev/hid/ps4dshock.c @@ -771,18 +771,34 @@ static const struct hidmap_item ps4dsmtp_map[] = { static const struct hid_device_id ps4dshock_devs[] = { { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x9cc), HID_TLC(HUP_GENERIC_DESKTOP, HUG_GAME_PAD) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x5c4), + HID_TLC(HUP_GENERIC_DESKTOP, HUG_GAME_PAD) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0xba0), + HID_TLC(HUP_GENERIC_DESKTOP, HUG_GAME_PAD) }, }; static const struct hid_device_id ps4dsacc_devs[] = { { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x9cc), HID_TLC(HUP_GENERIC_DESKTOP, HUG_MULTIAXIS_CNTROLLER) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x5c4), + HID_TLC(HUP_GENERIC_DESKTOP, HUG_MULTIAXIS_CNTROLLER) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0xba0), + HID_TLC(HUP_GENERIC_DESKTOP, HUG_MULTIAXIS_CNTROLLER) }, }; static const struct hid_device_id ps4dshead_devs[] = { { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x9cc), HID_TLC(HUP_CONSUMER, HUC_HEADPHONE) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x5c4), + HID_TLC(HUP_CONSUMER, HUC_HEADPHONE) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0xba0), + HID_TLC(HUP_CONSUMER, HUC_HEADPHONE) }, }; static const struct hid_device_id ps4dsmtp_devs[] = { { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x9cc), HID_TLC(HUP_DIGITIZERS, HUD_TOUCHPAD) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0x5c4), + HID_TLC(HUP_DIGITIZERS, HUD_TOUCHPAD) }, + { HID_BVP(BUS_USB, USB_VENDOR_SONY, 0xba0), + HID_TLC(HUP_DIGITIZERS, HUD_TOUCHPAD) }, }; static int From nobody Tue Jul 29 22:16:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs8pL4rx6z63SKq; Tue, 29 Jul 2025 22:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs8pL3F1sz4Cvj; Tue, 29 Jul 2025 22:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7kyi02tRPiXDnH2/EPNM3OME91kyo86qJK9p0zIC0Yg=; b=vZp+XgvSQzF1BFxxCZjKf3uYcgMJXlixLKfEKHMse8wL8IisWdI1iiG0+OdY6g6xruhlU5 lUUIJeEnXAzuQJOqJE7ZfNfPc3FPbK0JmS3XDZyet3roahvvHnIpJPhVetH+DaJd7qieZM 1v4sCy6ZmuEhvcDBVt9JylzMgptPd1fTLiCSf+VUJS5sSb/iOaObebqCsxyc/09mNxS+HH yelDYmxI3ww/Mlo+VRDUw0qEKV/ZVmdarXrSEK92sqNssAb1pXp/qodtJ0SsQTK9sgmK+D BiKBW0WH0SgDNv5B7vXoWdURbejFtmAplTASTuNeNesK5GS8G5r0qWKQP8JBOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7kyi02tRPiXDnH2/EPNM3OME91kyo86qJK9p0zIC0Yg=; b=wosXFpdPedc7DfP6lWQU4W3zDLo8zXlOgIDn2VhdOISHxDCl0whoWSp1RBEEJWTInL1H70 WqT7FaFPhf4sc0vgMmsz5sOP6h7ZEPmmqMNARlBeu9nBv3CeiQkwH6V32y5Ij6akj3bFsC ihlTYHDRpL9rwlXXMZxFw75kjCRayVygyMC8ZEIkWpS+RooCd7FVszOHUJfSLWrMM6Bsce 5oJMIsk6iB46IbTAZlnUGzM3dp8UyEMfglYud5SrRpYR0SC9EddnPSt3L+vosFuAvQRCPI W6zQVG6koeLmhE9CnDLmGojiQRQZWnrm4dly1oXgaOFr1zYSNjt8I9L1/KSPtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753827418; a=rsa-sha256; cv=none; b=L0OqjN8kQsWo+CnhtB+NF1/oK0BIPOgBh0m7qja7WMAPMHAoelCcmaAT8yLlRbQa936vAM a7c1MQZUXCysx8/T6eLBmZXhoEljnYMDSKDUHKtKtPRTXoDwoEr2PG9A9Bmbb7wH0txL3R WvBYPuB99xmiB2fuxA+/beE/9CQVkBMGCrfrgdLzJnXiZqFVPJwGI/AFBjf+PFnV3RD2fD XVhbOenQyuD/np3ckeIwcLsxvLs6Ri3c3UoW3qnyc/JObEdW7SOadu4CBBC3oKGPZSRaeS DvU91gQjCrBHrEZOiouHVmMuRBSvcpdxB7NlSlzX/BCf4J+QeASoaOkYecLPwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs8pL2r0VzqPB; Tue, 29 Jul 2025 22:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TMGw8Q009314; Tue, 29 Jul 2025 22:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TMGwGQ009311; Tue, 29 Jul 2025 22:16:58 GMT (envelope-from git) Date: Tue, 29 Jul 2025 22:16:58 GMT Message-Id: <202507292216.56TMGwGQ009311@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: 6a11b6aed8a9 - stable/14 - psm(4): Add kqueue support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a11b6aed8a9d4dee44a151317e3c8fd0d7d6763 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6a11b6aed8a9d4dee44a151317e3c8fd0d7d6763 commit 6a11b6aed8a9d4dee44a151317e3c8fd0d7d6763 Author: Vladimir Kondratyev AuthorDate: 2025-06-26 21:27:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-07-29 22:13:32 +0000 psm(4): Add kqueue support MFC after: 2 weeks (cherry picked from commit b93063c84e4e792ede844d30452d82c4fe12bdd2) --- sys/dev/atkbdc/psm.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 318112e2e3e5..6b6a24ba7f31 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -598,6 +598,7 @@ static d_read_t psmread; static d_write_t psmwrite; static d_ioctl_t psmioctl; static d_poll_t psmpoll; +static d_kqfilter_t psmkqfilter; static int psmopen(struct psm_softc *); static int psmclose(struct psm_softc *); @@ -750,6 +751,7 @@ static struct cdevsw psm_cdevsw = { .d_write = psmwrite, .d_ioctl = psmioctl, .d_poll = psmpoll, + .d_kqfilter = psmkqfilter, .d_name = PSM_DRIVER_NAME, }; @@ -1946,6 +1948,7 @@ psmattach(device_t dev) sc->state = PSM_VALID; callout_init(&sc->callout, 0); callout_init(&sc->softcallout, 0); + knlist_init_mtx(&sc->rsel.si_note, &Giant); /* Setup our interrupt handler */ rid = KBDC_RID_AUX; @@ -2057,6 +2060,8 @@ psmdetach(device_t dev) destroy_dev(sc->cdev); destroy_dev(sc->bdev); + knlist_clear(&sc->rsel.si_note, 1); + knlist_destroy(&sc->rsel.si_note); callout_drain(&sc->callout); callout_drain(&sc->softcallout); @@ -5212,6 +5217,7 @@ next: wakeup(sc); } selwakeuppri(&sc->rsel, PZERO); + KNOTE_LOCKED(&sc->rsel.si_note, 0); if (sc->async != NULL) { pgsigio(&sc->async, SIGIO, 0); } @@ -5249,6 +5255,45 @@ psmpoll(struct cdev *dev, int events, struct thread *td) return (revents); } +static void +psmfilter_detach(struct knote *kn) +{ + struct psm_softc *sc = kn->kn_hook; + + knlist_remove(&sc->rsel.si_note, kn, 0); +} + +static int +psmfilter(struct knote *kn, long hint) +{ + struct psm_softc *sc = kn->kn_hook; + + GIANT_REQUIRED; + + return (sc->queue.count != 0 ? 1 : 0); +} + +static const struct filterops psmfiltops = { + .f_isfd = 1, + .f_detach = psmfilter_detach, + .f_event = psmfilter, +}; + +static int +psmkqfilter(struct cdev *dev, struct knote *kn) +{ + struct psm_softc *sc = dev->si_drv1; + + if (kn->kn_filter != EVFILT_READ) + return(EOPNOTSUPP); + + kn->kn_fop = &psmfiltops; + kn->kn_hook = sc; + knlist_add(&sc->rsel.si_note, kn, 1); + + return (0); +} + /* vendor/model specific routines */ static int mouse_id_proc1(KBDC kbdc, int res, int scale, int *status) From nobody Tue Jul 29 22:19:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bs8sg5GSRz63SlC; Tue, 29 Jul 2025 22: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bs8sg4Y3Cz4F50; Tue, 29 Jul 2025 22: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=1753827591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cxlLlH09Zb4tvsnumT951YgkqEGUCifyQ0voOr4txII=; b=eqwT0n/SN0pEjX7QOhX77EwsXPfe0tUHUIDua/6FekAOYv2l8FFHvwCskwEQfQcSlpOBYJ Qrv/+wL2dhe5eqIZND//pIZV9Vq8uzsV7M3T8y9R2FoQbflRI9JUyQ43Pq0w9fyiHaOU+B 8Kj3oCHC9D/1yhQBOlJ3OQt/xLrSk1pYK6eGqq3qYEL5+l5hOVHhk8lAaTOAT7ltajcma/ C0lE5VnZLr6qX/fcH4PgpBV489Np+Z4ZNSFql7n9gOKJg9GfcYkGrCVDydCkZP6jmlt/Kc koAlDjeiY5S3Kzt4qSXXm7X47hRBYFJXLOC3eOuvOHRNPVQuaal6aL9gRhyItw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753827591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cxlLlH09Zb4tvsnumT951YgkqEGUCifyQ0voOr4txII=; b=j1/FLlTgiGGNwaNTI72kVIUYw7aaHCoepnZtNsEeu3FZb21YXkRgKhqrpuZK8qyMyxcV9a 5CDJ3IbHaVwcbrFaVtm90Wni3SuaMOFtvARCKG/PZJhVRMgUlczYP+Fm5Rp45Lye4yl97b yoUaqmdlUXl1L0pUJa8ogRiHa+A5/ZUcInru3UpF8vKFOvW/MRkjZDSnmICposv507B9nG NTwWxwyoQB2cPpVx//tu9pMo3ImGEWIhcgvblPQ6Amr3B4rQcSvgMkqs6JcRz5i9WNssB/ /w7xE778j9qi9QNBYzmdkPbTEYUQwdJXQhm4xlhQjFZCo2wLDm370XYb5D7Sqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753827591; a=rsa-sha256; cv=none; b=Y3eTmGXc2L53VkLCBBDDmKI/8Kk8FW5Mkd0nd6vt5GolnVt34LpHmWZhLd15eJLys1EwPO vfK/cTlea8t5NhbA0xTESrrBKpLoI22EdzPbt3g2utEls6zN59/bkdJCfIs7c4WoeMzJZF G08QY7h4J6MR4sLgyyWTjiDZcWKo2GJEqXZqn6ivbZUQuZU2rRGrl26x6KARbuYFdgakrf ZUvs9JAVvNvk1yKCkudJaPCxJCi1jw3Wp/zcAWi3UXwpe6yGicieD3ke0BRnqw0ske8T1B w5V+qYUkRrk9Kpm3M+wuEuqYTMNNMKiBp1ZYDM41DdemuMFBodB0vGQIrG85XQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bs8sg3xGCzqN1; Tue, 29 Jul 2025 22:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TMJpqb010295; Tue, 29 Jul 2025 22:19:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TMJpai010292; Tue, 29 Jul 2025 22:19:51 GMT (envelope-from git) Date: Tue, 29 Jul 2025 22:19:51 GMT Message-Id: <202507292219.56TMJpai010292@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: 8f6769b82a2a - stable/14 - file: Fix the !CAPABILITIES build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8f6769b82a2a071cf07080b6d77639e919efbbcf Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8f6769b82a2a071cf07080b6d77639e919efbbcf commit 8f6769b82a2a071cf07080b6d77639e919efbbcf Author: Mark Johnston AuthorDate: 2025-06-29 16:56:59 +0000 Commit: Mark Johnston CommitDate: 2025-07-29 22:19:17 +0000 file: Fix the !CAPABILITIES build Reported by: Ian FREISLICH Fixes: f35525ff2053 ("file: Add a fd flag with O_RESOLVE_BENEATH semantics") (cherry picked from commit 6783dfb10637100067520bd6d9804e154cfee7ee) --- sys/kern/kern_descrip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index d84c97669320..0e6af0f5deff 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2966,7 +2966,7 @@ fget_cap(struct thread *td, int fd, const cap_rights_t *needrightsp, uint8_t *flagsp, struct file **fpp, struct filecaps *havecapsp) { int error; - error = fget_unlocked(td, fd, needrightsp, flagsp, fpp); + error = fget_unlocked_flags(td, fd, needrightsp, flagsp, fpp); if (havecapsp != NULL && error == 0) filecaps_fill(havecapsp); @@ -3143,7 +3143,6 @@ fgetvp_lookup_smr(struct nameidata *ndp, struct vnode **vpp, int *flagsp) flags = fp->f_flag & FSEARCH; flags |= (fde->fde_flags & UF_RESOLVE_BENEATH) != 0 ? O_RESOLVE_BENEATH : 0; - *fsearch = ((fp->f_flag & FSEARCH) != 0); vp = fp->f_vnode; if (__predict_false(vp == NULL || vp->v_type != VDIR)) { return (EAGAIN); From nobody Tue Jul 29 23:35:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsBY648jDz62mkf; Tue, 29 Jul 2025 23:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsBY625z4z4LxT; Tue, 29 Jul 2025 23: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=1753832138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/FOI3ybJFBmv/IZZ+2JFbRnSvI4g15qIisvSY3neKg=; b=VzehjToBnkFaPXiT9qs9JeAyEcfbD/vLz26czliHNiHHoODI/sDurXQBQSgCWTQGTrubz2 QvTLlnjDF5dZHJjZ6JuTAT4SomUqC2LVCMIK3w4GSXaqoSMJ4E7p2NumGnnEgTpyoCB/U/ rfx5/TSeSwRss5lIohJRU4bE6xXmtMofTi8m0DcX41FEyPHPei9Fv7lG2kpgK9vEXEluI8 VbTJS/e0HJ2Tp/XKtantwWd5vVAmzLJJptjBs8Wuo7XL1zofa3XzqVuJuFBfVDtdtxp4Nl +nFhLwiYod0EDsKpRHU82UzsNqQeKfghsC1wgZnU35uRxRa1EpTMZorG28+gPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753832138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/FOI3ybJFBmv/IZZ+2JFbRnSvI4g15qIisvSY3neKg=; b=HUfLZ4XS3HQmQynpCVjjPBSWosmIG8ncs7GXBjGQfzgJP1mXMmUeTUEyddDuOmvOkCpaD7 GLMUvWiiLb7H0qCPsCS+lAGPftMjyLWrATGUFk6HDGBal47ka7yBTdGvMYnuI405o8u4II v9aL9eMMHPZY36xg41rTaeyE1jXBTZ2iRUQw5P/5kM9farebPLtpK3LL6iwxt5RjdS2+tp 5hb0FRwvF9RYzq9GrGEf+BTWhqH+zWdbDcsZIPY6hds1wll1FRaLLc7U6+W2CQt0gK4+W/ 71vFJRVjWlG+bCOkl8++IPfSvMbcTEvYq3D+IaatAqZgPQDDmx5wZ6foFmv2hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753832138; a=rsa-sha256; cv=none; b=M4Exq1qAAnihF5FsNUsHAF6QdEwbkMiYFMNZU2BATK7cueO+KxRWe4SnuXe/scaPFKbLdV ipNRWPUM4eRdCm+jno+lpNTa8DH35K0SsvpRxPZ2h6cVh0Rka+HPYw/BpoxsgM54Uro3DB dEgcW91r6eV3apgc8BxouBGfI5Jun/MtQBndWaYD3Xeq53vN50CcHNxO0dloNXzxaJZlbU xHuQP3M21CQ532iBemRirjnTgR1nI4GmG4ikyqosFbsSuCcvi924zj8TD+6IL3b9Z97b4Y 80DuWXqCzpv8qLqmS+uSPXni7SBAlkQ49IfQm7yxrLpRqb1ST1+/0KvL5A1G9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsBY60nkPzsDF; Tue, 29 Jul 2025 23:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TNZcNP058695; Tue, 29 Jul 2025 23:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TNZcC8058692; Tue, 29 Jul 2025 23:35:38 GMT (envelope-from git) Date: Tue, 29 Jul 2025 23:35:38 GMT Message-Id: <202507292335.56TNZcC8058692@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: a0041aee49be - main - kern/kern_thread.c: fix typo in comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0041aee49bebd306179382658bcf965e6db5aef Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a0041aee49bebd306179382658bcf965e6db5aef commit a0041aee49bebd306179382658bcf965e6db5aef Author: Konstantin Belousov AuthorDate: 2025-07-29 23:32:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-29 23:32:24 +0000 kern/kern_thread.c: fix typo in comment Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/kern/kern_thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index f853af193016..50b040132396 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -571,7 +571,7 @@ threadinit(void) /* * Thread structures are specially aligned so that (at least) the - * 5 lower bits of a pointer to 'struct thead' must be 0. These bits + * 5 lower bits of a pointer to 'struct thread' must be 0. These bits * are used by synchronization primitives to store flags in pointers to * such structures. */ From nobody Tue Jul 29 23:35:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsBY75NbLz62nGY; Tue, 29 Jul 2025 23:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsBY72n8lz4MMV; Tue, 29 Jul 2025 23:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753832139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9EH9Mk+Wj3dryIUxFjI07qZ40QW0H+F6GMmwp8Bro0=; b=e8PrgCuFLxIvVEMUJoJzGZqdBAnKVKhPtHoCf22ioE8a3Dmrsz28G0fCcYuQrnivVzH8DG 2OqSGBIRhX3Uv7kzCPCWi4xGHZ3CgmK47+EWjnQx4H6H0jVSAWKV/tvrWu1ZQFzFNmX6+C xsfNrmO7Knnodp5VQfoAr7NXKrRAWF6fSUCvF1wR+cVFUDjpqon6TJFnXBcyxUzNkHwixd YbFueTMZI7w2Dgr2ZGz4gkAHQYxANwCHH8sw8miZ6HCv/ZnSy/YLnPoG5oWeRbjTsHKSww i1tiR3s/yZimb/tpJ/tLABO34wtT7iOht/YbYTCPet7Ny+OHX5BnmEv7YKl15Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753832139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9EH9Mk+Wj3dryIUxFjI07qZ40QW0H+F6GMmwp8Bro0=; b=MprjnKKWQ8+E5PEekNY9wbx6pl648ndlMJ9jBqqHiZPKa88eaqnEubqCEwX9jyTJb5I7di vuiLfXzIc2l7uId/UJPgYOjIfidJh2HK+YcLDZwMIWUu1/ijdY0FYisd6UMMyCFZWFab7K iJzAjal533QvFYAwcm6Ms7nyis6VHuPSYrPSA1/GVmad0zQHvSgD9Wr5wNIIcM2ApwekuK iNM3i5r65iyPt22ACzZblJVT+sXOG38rhOzMYhStt5SbdiE7mnYt1edhcHNfcOdjhlpnbR ItInXcvFhJkN3ULYX//z1owCo6Onk/OXVQCxTe/wwtXlTia09zdh70TPnPx7BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753832139; a=rsa-sha256; cv=none; b=EgE+1ukeBfiATisjigRPBBgoo0dO4b9rORMoi/AP9jVdR579UTA0d8Su1dmtyd41boefo2 N8MGAEhvEKSEDunuzPdv4H6TjDSdI9gYIrdTkyZBw6/oIh9Ls9V9uBEdbtjavnbvLQ6+lq tyr3F12yrOVBQcXFPOEoaoQ1R94bVLyGmGVKxWgv/LIU611qAyuuxJiUnL7yDPtz4t8fR5 /soTAmSTyRjkPxKNUA/JOYjmsctFRpzwJZs/yU6nq9TZM5QbrnaVrvAvCx7Hx+yHt1pAzj DNKp53hhduNeeemPfL5yacLV3TdFp6/2Y1hGVi2iGuCTwbPpZ7JD4Ss2rW8EDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsBY72KT6zrfj; Tue, 29 Jul 2025 23:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56TNZdkT058729; Tue, 29 Jul 2025 23:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56TNZdYX058726; Tue, 29 Jul 2025 23:35:39 GMT (envelope-from git) Date: Tue, 29 Jul 2025 23:35:39 GMT Message-Id: <202507292335.56TNZdYX058726@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: b87013fe70c0 - main - libthr: fix typo in comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b87013fe70c051278e67d103d93c5292721cbcba Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b87013fe70c051278e67d103d93c5292721cbcba commit b87013fe70c051278e67d103d93c5292721cbcba Author: Konstantin Belousov AuthorDate: 2025-07-29 23:33:04 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-29 23:33:04 +0000 libthr: fix typo in comment Sponsored by: The FreeBSD Foundation MFC after: 3 days --- lib/libthr/thread/thr_getthreadid_np.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_getthreadid_np.c b/lib/libthr/thread/thr_getthreadid_np.c index ade332519dfb..ffecd0bc7ea9 100644 --- a/lib/libthr/thread/thr_getthreadid_np.c +++ b/lib/libthr/thread/thr_getthreadid_np.c @@ -36,7 +36,7 @@ __weak_reference(_thr_getthreadid_np, _pthread_getthreadid_np); __weak_reference(_thr_getthreadid_np, pthread_getthreadid_np); /* - * Provide the equivelant to AIX pthread_getthreadid_np() function. + * Provide the equivalent to AIX pthread_getthreadid_np() function. */ int _thr_getthreadid_np(void) From nobody Wed Jul 30 03:48:46 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsJ9B5MJ3z6339B; Wed, 30 Jul 2025 03:48:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsJ9B4WmLz3dn8; Wed, 30 Jul 2025 03:48:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753847326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uY/osSOZUhLPSeNQkNNnxTZsvjIDj4LbJrMWYJpPTJM=; b=rx2T8h3ZDAKr74frIpmEfoUrmNQWRo3XrPmaq4tQZiXIgI1VXARjwyJcNiwpTYmI9NiUCH Two5CfOazmg/s0FXTxp8LJ/mS38KrByhqaxoJexqTFLxaAmnJTURrDWaYARBioAFyUxjZw 6zGN2MSRmdrkCTeE6/H0WSSg98IYHr44mBu+OEqMdU/S3/OrSkPuIOwBfyRnAtrW5BaNIG sSnKh3jaCuPJNAmkuzuEhdMTV8z/QQrpEAmQJqEhCw7kON/U/MD+x62H2QmKcmXQnIIbSb GpyXqzDdNs2mGgQ47qoprUkIx0JHyKexYolOEEPBuT1lEz/QvWk6q3EVtjHY6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753847326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uY/osSOZUhLPSeNQkNNnxTZsvjIDj4LbJrMWYJpPTJM=; b=dtOanIlZiQ6JsxsG0GiESF8j8FbgYrRD8sKHxi4O8/GhBJgE8l3DqhKmC54D9VqQ9BqgAW XisMIix5pcJExbZdNdWEe3nhy+sLOUO15NBTf7I+rzsukg/tvOHrydipBlFx7n5E+d5lfg 9iPa0TVxKky8MRiPXdUTjulQHCPb9yPE2KavkHTgD4rjpUrNyLNKbmRDJxUubJLcNG71Uh p0BXPH9+m225kjZcuE1sxomSdDE2OC7Cf/2jYB73+8Dd18xAMW90dxAWkDWcsWB4OVqfwN ga+Y5GE8FLxX+T8ztafgNT161808oWMdvb9bY+jB2c43hYuKqMTub4PvoaslNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753847326; a=rsa-sha256; cv=none; b=ijGh9xKQanCDzPxEt9mRPnQZta8xR9T8xBUDHR/GLzB4cvAy/wRNiahYzUqw7xJqvBoz/K cynVfbrjREL8A9aRzFgkZlEzk6h1N6B/coGQ65EYVSEi+6fOSbClBF/svF2h0xlDRLh5Lg A9BNQkElaKJw3MMoXxrrHaTlw+gAgagHkyxk4A+NZOgE0HK+x2rS6N/MN1k2mixRf6TOHZ CbHP8KC07H1s1JSwlWhM4RlIr+A/9aeXr/3QKU4+fviE6mfrZfcPunmDGuxaYJESEsombj eJerxTo/6uwMLhnj5Td9Jm4Xfjo+eaehFtQ7XAbaFp5BC9QME03dfIPiQJlMZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsJ9B3jZQz110t; Wed, 30 Jul 2025 03:48:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U3mk3Q030329; Wed, 30 Jul 2025 03:48:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U3mkop030326; Wed, 30 Jul 2025 03:48:46 GMT (envelope-from git) Date: Wed, 30 Jul 2025 03:48:46 GMT Message-Id: <202507300348.56U3mkop030326@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: 7fc218b30b80 - main - find: Put back clearing the NOSTAT bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7fc218b30b809559e16ce4709c4c4b071056c306 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7fc218b30b809559e16ce4709c4c4b071056c306 commit 7fc218b30b809559e16ce4709c4c4b071056c306 Author: Warner Losh AuthorDate: 2025-07-29 19:17:50 +0000 Commit: Warner Losh CommitDate: 2025-07-30 03:47:55 +0000 find: Put back clearing the NOSTAT bit In fd186cd16eaf I read the condition backwards. We want to stat all the time until we can implement something to do it more inteligently as Jiles suggested in the review. Fixes: fd186cd16eaf Noticed by: des Sponsored by: Netflix --- usr.bin/find/function.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 11455b395022..b260a71ef4a9 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1449,11 +1449,12 @@ c_printf(OPTION *option, char ***argvp) { PLAN *new; - isoutput = 1; /* * XXX We could scan the format looking for stat-dependent formats, and - * turn off the stat if there's none: `%p`/`%f`/`%h` don't need a stat. + * turn off the nostat bit for trival cases: `%p`/`%f`/`%h`. */ + isoutput = 1; + ftsoptions &= ~FTS_NOSTAT; new = palloc(option); new->c_data = nextarg(option, argvp); From nobody Wed Jul 30 09:31:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsRn83n91z63PyD; Wed, 30 Jul 2025 09:31:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsRn831Fyz46Bx; Wed, 30 Jul 2025 09:31:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753867916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pip+AjgLGal9WVLQ4EIrEBf8SB/uyS0uOIIkwabNsu4=; b=hn+uedkCu/mlxKGVKXzhfDT8YuyD7ZF4oTEUvxsnD80nm8ZZlC36NbpiO4gvQkRDCO+PfK Js8YqgT03LqntSz78LRySMfZTPtNF+7u3hyJBUiv/+LwxajQBVvDaKUtBOjZszBqCO8Sly hc4mnGrYSkH2LsbMp0u/Ksd1/C3xdq+u2d8iASRox8gS+btfsgQzl1EapsPdPcbuhsJ3+v ir18lyU6hHeQ+jxMahKqcqSGMN6vv58pGsfXbuOhJUJrVOahNfoOgyIH76ByAslOfU+sGx cp/V4JfCZX8wnVeJGdQ9QFILWd+1bfo2TI1Y9EPn0bcnOCAiRGzqEYi6mCkSEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753867916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pip+AjgLGal9WVLQ4EIrEBf8SB/uyS0uOIIkwabNsu4=; b=SLqY8Na/2Y2Qrlb8AO5XYuExMoDQdmsUUzMb8aBNMK/pedkqNmVe99Ur/cqZB8y+1Gx6yg cY9d+Ma7qnqAdw1NifyI6E4H7Rn/aP65RjNRlDc0Tbtjq3iGNlZJ6hRdUvirSqwuC9snZo SavLrmhfqEqb4kyrUCee7bPjZuIn7rCBCGNwBlYt1C39d8eSUJkM/XpI+TOQZ7b4GvQGGU bGPXE5GqJi18hbgrirgsVUCt3b7FsE1BL+y0KKmzBCCyu7rywQcrQliWcI0p5HG39pWr7t g0RHuQsL4w4aAmp5dWN73bEF56ukah6/GNVF0biJ2eEjEN+riWVGHGrnRcS5cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753867916; a=rsa-sha256; cv=none; b=kNmTSRZYHv3mbN3p//B5EK2bfxrLCdB59jAOh5V40vVuCxq5+VTwJcEtgWuUJt0N4gr4tf W6iRCskApR/KAmTsVtLp49RCzKJ/sguPWua6gAyf8P6Rhhsc5gXh9MjZywL9D29XripGMs hsS5mu0oVWipcaK10UKp/8jrUp50+ICCXoxIjCYG8uOUMgAgv4lgpHi8PzWDRplAVa9KNU YcUBzpinVQbuzpbUBYpPg1PG8wb3elh9h3TiGCsZvQuj3ZRhc4qq4onK+xuStqF8VNjCVf F/1w+r0V1Jyuxho3hhZr/FeIWoYNKuu8El9sfVlDnoDGWoNy7Tsg4czlbJLh7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsRn82KwMz19G4; Wed, 30 Jul 2025 09:31:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U9Vuf6083287; Wed, 30 Jul 2025 09:31:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U9Vu8Q083284; Wed, 30 Jul 2025 09:31:56 GMT (envelope-from git) Date: Wed, 30 Jul 2025 09:31:56 GMT Message-Id: <202507300931.56U9Vu8Q083284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 14598537acec - main - db/hash.c: Allow O_WRONLY in dbm_open List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14598537acecb512432e33e001762c912cc25799 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=14598537acecb512432e33e001762c912cc25799 commit 14598537acecb512432e33e001762c912cc25799 Author: Bojan Novković AuthorDate: 2025-07-25 09:01:52 +0000 Commit: Bojan Novković CommitDate: 2025-07-30 09:31:16 +0000 db/hash.c: Allow O_WRONLY in dbm_open The dbm(3) manpage explicitly states that O_WRONLY is not allowed in dbm_open, but a more recent comment in ` __hash_open` suggests otherwise. Furthermore, POSIX.1 allows O_WRONLY in dbm_open and states that the underlying file must be opened for both reading and writing. Fix this by correcting the O_WRONLY check and moving it further into the function to make sure that the original flags are stored in hashp. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51514 --- lib/libc/db/hash/hash.c | 15 +++--- lib/libc/db/man/dbm.3 | 5 +- lib/libc/db/man/dbopen.3 | 5 +- lib/libc/tests/db/Makefile | 1 + lib/libc/tests/db/dbm_open_test.c | 23 ++++++--- lib/libc/tests/db/dbm_perm_test.c | 98 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 126 insertions(+), 21 deletions(-) diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index cc96fb5ce326..1eb01ee0f0c5 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -99,11 +99,6 @@ __hash_open(const char *file, int flags, int mode, DB *dbp; int bpages, hdrsize, new_table, nsegs, save_errno; - if ((flags & O_ACCMODE) == O_WRONLY) { - errno = EINVAL; - return (NULL); - } - if (!(hashp = (HTAB *)calloc(1, sizeof(HTAB)))) return (NULL); hashp->fp = -1; @@ -115,6 +110,10 @@ __hash_open(const char *file, int flags, int mode, * we can check accesses. */ hashp->flags = flags; + if ((flags & O_ACCMODE) == O_WRONLY) { + flags &= ~O_WRONLY; + flags |= O_RDWR; + } if (file) { if ((hashp->fp = _open(file, flags | O_CLOEXEC, mode)) == -1) @@ -180,7 +179,7 @@ __hash_open(const char *file, int flags, int mode, __buf_init(hashp, DEF_BUFSIZE); hashp->new_file = new_table; - hashp->save_file = file && (hashp->flags & O_RDWR); + hashp->save_file = file && (flags & O_RDWR); hashp->cbucket = -1; if (!(dbp = (DB *)malloc(sizeof(DB)))) { save_errno = errno; @@ -524,6 +523,10 @@ hash_get(const DB *dbp, const DBT *key, DBT *data, u_int32_t flag) hashp->error = errno = EINVAL; return (ERROR); } + if ((hashp->flags & O_ACCMODE) == O_WRONLY) { + hashp->error = errno = EPERM; + return (ERROR); + } return (hash_access(hashp, HASH_GET, (DBT *)key, data)); } diff --git a/lib/libc/db/man/dbm.3 b/lib/libc/db/man/dbm.3 index c5a83c7acef4..30787600ad2d 100644 --- a/lib/libc/db/man/dbm.3 +++ b/lib/libc/db/man/dbm.3 @@ -13,7 +13,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 2, 2022 +.Dd July 25, 2025 .Dt DBM 3 .Os .Sh NAME @@ -99,9 +99,6 @@ is a typical value for .Li 0660 is a typical value for .Fa mode . -.Dv O_WRONLY -is not allowed in -.Fa flags . The pointer returned by .Fn dbm_open identifies the database and is the diff --git a/lib/libc/db/man/dbopen.3 b/lib/libc/db/man/dbopen.3 index 64cef88506d8..7fe515f17849 100644 --- a/lib/libc/db/man/dbopen.3 +++ b/lib/libc/db/man/dbopen.3 @@ -76,13 +76,10 @@ are as specified to the .Xr open 2 routine, however, only the .Dv O_CREAT , O_EXCL , O_EXLOCK , O_NOFOLLOW , O_NONBLOCK , -.Dv O_RDONLY , O_RDWR , O_SHLOCK , O_SYNC +.Dv O_RDONLY , O_RDWR , O_SHLOCK , O_SYNC, O_WRONLY, and .Dv O_TRUNC flags are meaningful. -(Note, opening a database file -.Dv O_WRONLY -is not possible.) .\"Three additional options may be specified by .\".Em or Ns 'ing .\"them into the diff --git a/lib/libc/tests/db/Makefile b/lib/libc/tests/db/Makefile index 54b38b94a581..cc181cc81160 100644 --- a/lib/libc/tests/db/Makefile +++ b/lib/libc/tests/db/Makefile @@ -8,6 +8,7 @@ PROGS+= h_lfsr ${PACKAGE}FILES+= README ATF_TESTS_C+= dbm_open_test +ATF_TESTS_C+= dbm_perm_test NETBSD_ATF_TESTS_C+= db_hash_seq_test NETBSD_ATF_TESTS_SH+= db_test diff --git a/lib/libc/tests/db/dbm_open_test.c b/lib/libc/tests/db/dbm_open_test.c index 18d398e16b2a..8a3e888bf72c 100644 --- a/lib/libc/tests/db/dbm_open_test.c +++ b/lib/libc/tests/db/dbm_open_test.c @@ -4,14 +4,15 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include - #include #include #include #include +static const char *path = "tmp"; +static const char *dbname = "tmp.db"; + ATF_TC(dbm_open_missing_test); ATF_TC_HEAD(dbm_open_missing_test, tc) { @@ -21,23 +22,31 @@ ATF_TC_HEAD(dbm_open_missing_test, tc) ATF_TC_BODY(dbm_open_missing_test, tc) { - const char *path = "tmp"; - const char *dbname = "tmp.db"; /* * POSIX.1 specifies that a missing database file should * always get created if O_CREAT is present, except when * O_EXCL is specified as well. */ - ATF_CHECK(dbm_open(path, O_RDONLY, _PROT_ALL) == NULL); + ATF_CHECK(dbm_open(path, O_RDONLY, 0755) == NULL); + ATF_REQUIRE(!atf_utils_file_exists(dbname)); + ATF_CHECK(dbm_open(path, O_RDONLY | O_CREAT, 0755) != NULL); + ATF_REQUIRE(atf_utils_file_exists(dbname)); + ATF_CHECK(dbm_open(path, O_RDONLY | O_CREAT | O_EXCL, 0755) == NULL); +} + +ATF_TC_WITHOUT_HEAD(dbm_open_wronly_test); +ATF_TC_BODY(dbm_open_wronly_test, tc) +{ + ATF_CHECK(dbm_open(path, O_WRONLY, 0755) == NULL); ATF_REQUIRE(!atf_utils_file_exists(dbname)); - ATF_CHECK(dbm_open(path, O_RDONLY | O_CREAT, _PROT_ALL) != NULL); + ATF_CHECK(dbm_open(path, O_WRONLY | O_CREAT, 0755) != NULL); ATF_REQUIRE(atf_utils_file_exists(dbname)); - ATF_CHECK(dbm_open(path, O_RDONLY | O_CREAT | O_EXCL, _PROT_ALL) == NULL); } ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, dbm_open_missing_test); + ATF_TP_ADD_TC(tp, dbm_open_wronly_test); return (atf_no_error()); } diff --git a/lib/libc/tests/db/dbm_perm_test.c b/lib/libc/tests/db/dbm_perm_test.c new file mode 100644 index 000000000000..c07210292014 --- /dev/null +++ b/lib/libc/tests/db/dbm_perm_test.c @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include + +#include + +static const char *path = "tmp"; +static const char *dbname = "tmp.db"; + +static void +create_db(void) +{ + DB *db; + datum data, key; + + data.dptr = "bar"; + data.dsize = strlen("bar"); + key.dptr = "foo"; + key.dsize = strlen("foo"); + + db = dbm_open(path, O_RDWR | O_CREAT, 0755); + ATF_CHECK(db != NULL); + ATF_REQUIRE(atf_utils_file_exists(dbname)); + ATF_REQUIRE(dbm_store(db, key, data, DBM_INSERT) != -1); + dbm_close(db); +} + +ATF_TC_WITHOUT_HEAD(dbm_rdonly_test); +ATF_TC_BODY(dbm_rdonly_test, tc) +{ + DB *db; + datum data, key; + + bzero(&data, sizeof(data)); + key.dptr = "foo"; + key.dsize = strlen("foo"); + create_db(); + + db = dbm_open(path, O_RDONLY, 0755); + data = dbm_fetch(db, key); + ATF_REQUIRE(data.dptr != NULL); + ATF_REQUIRE(strncmp((const char*)data.dptr, "bar", data.dsize) == 0); + ATF_REQUIRE(dbm_store(db, key, data, DBM_REPLACE) == -1); + ATF_REQUIRE(errno == EPERM); +} + +ATF_TC_WITHOUT_HEAD(dbm_wronly_test); +ATF_TC_BODY(dbm_wronly_test, tc) +{ + DB *db; + datum data, key; + + key.dptr = "foo"; + key.dsize = strlen("foo"); + data.dptr = "baz"; + data.dsize = strlen("baz"); + create_db(); + + db = dbm_open(path, O_WRONLY, 0755); + data = dbm_fetch(db, key); + ATF_REQUIRE(data.dptr == NULL); + ATF_REQUIRE(errno == EPERM); + ATF_REQUIRE(dbm_store(db, key, data, DBM_REPLACE) != -1); +} + +ATF_TC_WITHOUT_HEAD(dbm_rdwr_test); +ATF_TC_BODY(dbm_rdwr_test, tc) +{ + DB *db; + datum data, key; + + key.dptr = "foo"; + key.dsize = strlen("foo"); + create_db(); + + db = dbm_open(path, O_RDWR, 0755); + data = dbm_fetch(db, key); + ATF_REQUIRE(data.dptr != NULL); + data.dptr = "baz"; + data.dsize = strlen("baz"); + ATF_REQUIRE(dbm_store(db, key, data, DBM_REPLACE) != -1); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, dbm_rdonly_test); + ATF_TP_ADD_TC(tp, dbm_wronly_test); + ATF_TP_ADD_TC(tp, dbm_rdwr_test); + + return (atf_no_error()); +} From nobody Wed Jul 30 09:36:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsRtv2273z63Qb1; Wed, 30 Jul 2025 09:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsRtv1C6wz46vB; Wed, 30 Jul 2025 09:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lpwVOomgU62B7wwiH1W3s1cbB7NrpvCbCznvj5uFFzU=; b=U38ACmGDYpySgnDM3+PbnSPOQvxCV8MCiieUz9mGAWIqrnEEV2pHrxrXc6t+SaBWvZdJMv 96ci6UTup90qKEsE749JhfzdfnfBgnYt8VpXRaIdFbi6uA4vh7QBX2gUPpCaL9k5uXhHx9 7v8ieoK492ucNGi45mT3lQp32G/7JyVEx6NOE10i4lPVW4GhYS5g3m0sV9/wHbKUsbnu74 vywoYOo5u9Oii65OVDbKpn0SEnZ9uz/7CHNxGOjepiIiq3t6vJMaiBWIKcYT0RQVk6Ywf4 S7/pVuUJ4P3bQJwAjRzsOgWqHUE5VFAYnrInLr7O2/ehednFWji1RKPfNcY1KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lpwVOomgU62B7wwiH1W3s1cbB7NrpvCbCznvj5uFFzU=; b=Ret5YVxDw9msbM+efA9yK/BlgfX8vsnD38sHXDOYWT8BuSiZ8+nAAsPlPDkJPkeaPVPzrS C1k6bwT6wdOUO9J86DeOAmwZslBzvcF9UTInzDe1avVYoG6z4co1rUmaBNGtruadHRuU3A eE5jDvs1SSbUl6ioGem6G4P1q6E6LuksKHXWik3+kceDtwUR0O4VdF/0yBJVLlZqoq4JqL iwisONbODPSN61zOR2uzbZ10SKAO8AQwCAJqUPZ1538ODL23THwnpn5tY7Cc1ILwYNYOdU Hh6JcUggna3cWReLp19orOzFGlwSn9CPaXGXKNr4/rw34vZ9rwstX9BqvMRl7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753868215; a=rsa-sha256; cv=none; b=ghP8+7gl3tenYquxgpm9C3zB4ueXFqlNm6elB0HPkyM5NDrA6KnhERXSxtHNL9Oc7ouoVa rz2bxmUqAk5KGhJ8TqeLtIVAoWf5rrDQsVWDwVerwF704nCOsMyFvd/yPo2yN1OLLXK09K LQFS2K8+mRBoieK0lcXCZ+v7tLRelgFe/1xZPdYBFcl4pjtFqpcMmKG9nKTDBX8hQUnHE/ bReY5jP2R1IM6XGBDEjH/iKNG3LOolXAEElvhcp+SWoHaupbQ2oLxYI8IEQp92DOmq1gsn sp+SjBH5BhpTHv50YjB9oJEdbULZorVcSJc2tNfDIPCcEtjOGhQEL7YsKNwEWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsRtv0pFwz18Wc; Wed, 30 Jul 2025 09:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U9atR1087495; Wed, 30 Jul 2025 09:36:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U9atQY087492; Wed, 30 Jul 2025 09:36:55 GMT (envelope-from git) Date: Wed, 30 Jul 2025 09:36:55 GMT Message-Id: <202507300936.56U9atQY087492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 8679496e454e - stable/14 - dtrace.1: Mention providers in SEE ALSO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8679496e454e88031f0c37a67f934130e3d84cb4 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=8679496e454e88031f0c37a67f934130e3d84cb4 commit 8679496e454e88031f0c37a67f934130e3d84cb4 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-06-14 17:24:03 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-30 09:36:01 +0000 dtrace.1: Mention providers in SEE ALSO Reviewed by: bnovkov, christos, markj Approved by: bnovkov (mentor), christos (mentor), markj (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50852 (cherry picked from commit 177471148a6111537e84912fb9a033b6ac5ecb17) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index ab8c672a95a1..1836707d72df 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2023 +.Dd June 14, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -1221,6 +1221,17 @@ Invalid command line options or arguments were specified. .El .Sh SEE ALSO .Xr cpp 1 , +.Xr dtrace_audit 4 , +.Xr dtrace_io 4 , +.Xr dtrace_ip 4 , +.Xr dtrace_kinst 4 , +.Xr dtrace_lockstat 4 , +.Xr dtrace_proc 4 , +.Xr dtrace_sched 4 , +.Xr dtrace_sctp 4 , +.Xr dtrace_tcp 4 , +.Xr dtrace_udp 4 , +.Xr dtrace_udplite 4 , .Xr elf 5 , .Xr SDT 9 .Rs From nobody Wed Jul 30 09:36:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsRtw3vDvz63QZ3; Wed, 30 Jul 2025 09:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsRtw2WCjz46pv; Wed, 30 Jul 2025 09:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t5I+HBJyRvTRVCrBDQYk85k04gZq+1OXgQRBuCFcZuc=; b=pu7iI8f2DtKUdlnnBNZKHKOpAdvF5aop1BgaZ0ASg10WRCYyqLiEJ8NzEZp1KeGtBHlAUU viRW7eNRXkDA277MYG6Ohj5bLshe+PP9N0aJBf8EUaN0jL+EhlGmNJYTVVIp+5f0clZsjP EORblgrrkLfSLDG1tRLmZsWr18/jEpstVPBFpOA6jhmGKaNQ7QkhTFUCG9HQpRnXwdsxjU ItPMzCzFNgaXfssHaHnKeWFSbp1sKlD+9skn4M+wVauFRcfSygEHR/AOlfJPhOPqTROHKx kinkkNSuG5/NWXG8uIPNhsVPpByFhNUzFZd0CHb4CxUlzuJHA7K/XkDEMNlvBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t5I+HBJyRvTRVCrBDQYk85k04gZq+1OXgQRBuCFcZuc=; b=iWa6RypQK50TN27Z6xwr1xWoUQNXJPwbbEXGuLf70ccqzXB+CmkKvvuqb75mgKwtpHbjQd SZAHX7DSycqrHkFKASKKbtM5nFRtiSAXz2dsMGhGPx6kiSAL+eBZJYDW7VQFd+3CnSeRSm 720LjtfbT5cbwYwgUy1Vss4C2kUXP13OFPfPWYwdqny9PMdFwRKhZeUuU6M39YVmspNXiW LolZCWI1er7sXWdg5FK2Y4+h+PLuGz2yGBzbUbjEoyrZerZ5H7th9/3nuAiT6r02oDH7AO yKWlv2vzfAsB6P2XI0fDEPPMjR7yBQI6Tq36W0wZylB6Dn7M4K7L05bGf73Cww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753868216; a=rsa-sha256; cv=none; b=H3l3McLRqTcdBGmxKh8fN5AgtKIW2o0E3/78vskqn/BCTKqpDEdQzHqCPDYHcV7NdU2Dch pv4qVTwrzxigi1FySW8WvNRq1GFBrNRgMYf6JWZ3Oofl+SpLzo6cQQ4TsMJY2y1ejXj6N6 ZQH/o7i66FTHoQY/7i5NXGmbrTM9Y2cpEIn6ihiMV24I1Hk+EEADP0LRWHzM0FI9/h/vEU j19JYU6U/Sk5rReWscQpxvk/RzXiRkx1l4NEDDbEfHuqgw8LFwmxUfQmdo6U2qKIKK/a85 j1+3LRMvOCiZ5w45cApAMFXyyyn9Z9pbpKjdlNifBZeOLZ254tdA963VFeaugQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsRtw1qMJz19R1; Wed, 30 Jul 2025 09:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U9aulq087530; Wed, 30 Jul 2025 09:36:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U9aujh087527; Wed, 30 Jul 2025 09:36:56 GMT (envelope-from git) Date: Wed, 30 Jul 2025 09:36:56 GMT Message-Id: <202507300936.56U9aujh087527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 0c91fa982437 - stable/14 - dtrace_fbt.4: Document the DTrace fbt provider List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0c91fa982437417e09218ad8c2428aff29d9c5bd Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=0c91fa982437417e09218ad8c2428aff29d9c5bd commit 0c91fa982437417e09218ad8c2428aff29d9c5bd Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-06-14 19:26:48 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-30 09:36:44 +0000 dtrace_fbt.4: Document the DTrace fbt provider Reported by: markj Reviewed by: christos, markj (earlier version), ziaee Obtained from: Mark Johnston, DTrace, FreeBSD Journal, May 2014 Obtained from: https://wiki.freebsd.org/DTrace/One-Liners MFC after: 2 weeks Relnotes: yes (cherry picked from commit 9388c2887817d7162ebb356b39aa9b4ab67a8c00) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 5 + share/man/man4/Makefile | 1 + share/man/man4/dtrace_fbt.4 | 332 +++++++++++++++++++++++++++ share/man/man4/dtrace_kinst.4 | 12 +- 4 files changed, 346 insertions(+), 4 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 1836707d72df..9cb6e9dd276f 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,11 @@ .\" .\" $FreeBSD$ .\" +<<<<<<< HEAD .Dd June 14, 2025 +======= +.Dd July 16, 2025 +>>>>>>> 9388c2887817 (dtrace_fbt.4: Document the DTrace fbt provider) .Dt DTRACE 1 .Os .Sh NAME @@ -1222,6 +1226,7 @@ Invalid command line options or arguments were specified. .Sh SEE ALSO .Xr cpp 1 , .Xr dtrace_audit 4 , +.Xr dtrace_fbt 4 , .Xr dtrace_io 4 , .Xr dtrace_ip 4 , .Xr dtrace_kinst 4 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 48fead7c6287..f5eca038e800 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -940,6 +940,7 @@ _ccd.4= ccd.4 .if ${MK_CDDL} != "no" _dtrace_provs= dtrace_audit.4 \ + dtrace_fbt.4 \ dtrace_io.4 \ dtrace_ip.4 \ dtrace_kinst.4 \ diff --git a/share/man/man4/dtrace_fbt.4 b/share/man/man4/dtrace_fbt.4 new file mode 100644 index 000000000000..3e35bb8c5bbc --- /dev/null +++ b/share/man/man4/dtrace_fbt.4 @@ -0,0 +1,332 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 16, 2025 +.Dt DTRACE_FBT 4 +.Os +.Sh NAME +.Nm dtrace_fbt +.Nd a DTrace provider for dynamic kernel tracing based on function boundaries +.Sh SYNOPSIS +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +.Sh DESCRIPTION +The Function Boundary Tracing +.Pq Nm fbt +provider instruments the entry and return of almost every kernel function +corresponding to an +.Xr elf 5 +symbol in the kernel and loaded kernel modules. +.Pp +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +fires whenever the +.Ar function +is called. +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +fires when the +.Ar function +returns. +.Pp +The +.Ar module +in the probe description is either the name of the loaded kernel module +or +.Ql kernel +for functions compiled into the kernel. +.Ss Function Boundary Instrumentation +The +.Nm fbt +will always instrument a function's entry, but +its return will be intsrumented so long as it can find a +.Ql ret +instruction. +.Pp +In some cases, +.Nm fbt +cannot instrument a function's entry and/or return. +Refer to subsection +.Sx Frame Pointer +for more details. +.Ss Probe Arguments +The arguments of the entry probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +are the arguments of the traced function call. +.Bl -column -offset indent "Entry Probe Argument" "Definition" +.It Sy Entry Probe Argument Ta Sy Definition +.It Fa args[0] Ta Function's first argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft size_t Fa size +.It Fa args[1] Ta Function's second argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft struct malloc_type Fa *type +.It Fa args[2] Ta Function's third argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft int Fa flags +.It Fa ... Ta ... +.El +.Pp +The arguments of the return probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +are +.Fa args[0] +.Po +the offset of the firing return instruction within the function; +useful to tell apart two different return statements in a single function +.Pc +and +.Fa args[1] +.Pq the return value, if any . +.Bl -column -offset indent "Return Probe Argument" "Definition" +.It Sy Return Probe Argument Ta Sy Definition +.It Fa args[0] Ta Offset of the traced return instruction +.It Fa args[1] Ta Function's return value +.Po e.g., a kernel virtual address if returning from a successful +.Xr malloc 9 +.Pc +.El +.Pp +Subsection +.Sx Example 2 : Getting Details About Probe's Arguments +shows how to get probe's argument count and types directly with +.Xr dtrace 1 +without having to resort to the reading function's source code +or documentation. +.Sh EXAMPLES +.Ss Example 1 : Listing Available FBT Probes +The following example shows how to list all the available +.Nm fbt +probes. +.Bd -literal -offset 2n +# dtrace -l -P fbt + ID PROVIDER MODULE FUNCTION NAME +[...] +31868 fbt kernel hammer_time entry +31869 fbt kernel hammer_time return +[...] +.Ed +.Pp +Since +.Fn hammer_time +is a part of the kernel and not a separate loaded module, the +.Ar module +column displays +.Ql kernel . +.Ss Example 2 : Getting Details About Probe's Arguments +The following example shows how to generate a program stability report of +.Xr malloc 9 Ap s +entry and return probes. +Those reports are useful to view +the probe's number of arguments and their types. +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:entry +[...] + Argument Types + args[0]: size_t + args[1]: struct malloc_type * + args[2]: int +.Ed +.Pp +The count and types of +.Nm fbt Ns Cm \&::malloc:entry +arguments +match the function signature of +.Xr malloc 9 : +.Va args[0] +is +.Ft size_t , +.Va args[1] +is +.Ft "struct malloc_type *" , +and +.Va "args[2]" +is +.Ft int . +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:return +[...] + Argument Types + args[0]: int + args[1]: void * +.Ed +.Pp +The +.Cm return +probe reports two arguments and their types: +the return instruction offset +.Pq the usual Ft int +and the function's return value, which in this case is +.Ft void * , +as +.Xr malloc 9 +returns a kernel virtual address. +.Ss Example 3 : Counting Kernel Slab Memory Allocation by Function +.Bd -literal -offset 2n +# dtrace -n 'fbt::kmem*:entry { @[probefunc] = count(); }' +dtrace: description 'fbt::kmem*:entry ' matched 47 probes +^C + kmem_alloc_contig 1 + kmem_alloc_contig_domainset 1 + kmem_cache_reap_active 1 + kmem_alloc_contig_pages 2 + kmem_free 2 + kmem_std_destructor 19 + kmem_std_constructor 26 + kmem_cache_free 151 + kmem_cache_alloc 181 +.Ed +.Ss Example 4 : Counting Kernel Slab Memory Allocation by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::kmem*:entry { @[caller] = count(); } END { printa("%40a %@16d\en", @); }' +^C + kernel`contigmalloc+0x33 1 + kernel`free+0xd3 1 + kernel`kmem_alloc_contig+0x29 1 +kernel`kmem_alloc_contig_domainset+0x19a 1 + zfs.ko`arc_reap_cb_check+0x16 1 +.Ed +.Ss Example 5 : Counting Kernel malloc()'s by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[caller] = count(); } END { printa("%45a %@16d\en", @); }' +^C + kernel`devclass_get_devices+0xa8 1 + kernel`sys_ioctl+0xb7 1 + dtrace.ko`dtrace_ioctl+0x15c1 1 + dtrace.ko`dtrace_ioctl+0x972 2 + dtrace.ko`dtrace_dof_create+0x35 2 + kernel`kern_poll_kfds+0x2f0 4 + kernel`kern_poll_kfds+0x28a 19 +.Ed +.Ss Example 6 : Counting Kernel malloc()'s by Kernel Stack Trace +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[stack()] = count(); }' +^C + dtrace.ko`dtrace_dof_create+0x35 + dtrace.ko`dtrace_ioctl+0x827 + kernel`devfs_ioctl+0xd1 + kernel`VOP_IOCTL_APV+0x2a + kernel`vn_ioctl+0xb6 + kernel`devfs_ioctl_f+0x1e + kernel`kern_ioctl+0x286 + kernel`sys_ioctl+0x12f + kernel`amd64_syscall+0x169 + kernel`0xffffffff81092b0b + 2 +.Ed +.Ss Example 7 : Summarizing vmem_alloc()'s by Arena Name and Size Distribution +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::vmem_alloc:entry { @[args[0]->vm_name] = quantize(arg1); }' +^C + + kernel arena dom + value ------------- Distribution ------------- count + 2048 | 0 + 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4 + 8192 |@@@@@@@@@@@@@ 2 + 16384 | 0 +.Ed +.Ss Example 8 : Measuring Total Time Spent Executing a Function +This DTrace script measures the total time spent in +.Fn vm_page* +kernel functions. +The +.Fn quantize +aggregation organizes the measurements into power-of-two buckets, +providing a time distribution in nanoseconds for each function. +.Bd -literal -offset 2n +fbt::vm_page*:entry { + self->start = timestamp; +} + +fbt::vm_page*:return /self->start/ { + @[probefunc] = quantize(timestamp - self->start); + self->start = 0; +} +.Ed +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr dtrace_kinst 4 , +.Xr tracing 7 +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%P pp. 898\(en903 +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter fbt Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-fbt.html#chp-fbt +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh CAVEATS +.Ss Stability and Portability +.Nm fbt +probes are by definition tightly coupled to kernel code; if the code underlying +a script changes, the script may fail to run or may produce incorrect results. +Scripts written for one version of +.Fx +might not work on others, +and almost certainly will not work on other operating systems. +.Pp +Individual +.Nm fbt +probes often do not correspond nicely to logical system events. +For example, consider a DTrace script which prints the destination +address of every IP packet as the kernel hands them over +to the network card driver (NIC). +An +.Nm fbt Ns -based +implementation of such a script is a discouragingly difficult task: +it involves instrumenting at least four different functions in different parts +of the IPv4 and IPv6 code. +At the same time, with the +.Xr dtrace_ip 4 +provider the script is a simple one-liner: +.Dl dtrace -n 'ip:::send {printf("%s", args[2]->ip_daddr);}' +.Pp +Make sure to review available +.Xr dtrace 1 +providers first +before implementing a custom script with the +.Nm fbt +provider. +If none of the DTrace providers offer the desired probes, +consider adding new statically-defined tracing probes +.Pq Xr SDT 9 . +.Ss Frame Pointer +Inline functions are not instrumentable by +.Nm fbt +as they lack a frame pointer. +A developer might explicitly disable inlining by adding the +.Ql __noinline +attribute to a function definition, +but of course this requires a recompilation of the kernel. +Building the kernel with +.Fl fno-omit-frame-pointer +is another way of preserving frame pointers. +Note, that sometimes compilers will omit the frame pointer in leaf functions, +even when configured with +.Fl fno-omit-frame-pointer . +.Pp +Function returns via a tail call are also not instrumentable by +.Nm fbt . +As a result, +a function might have an entry probe +and a mix of instrumented and uninstrumentable returns. +.Pp +Use +.Xr dtrace_kinst 4 +to trace arbitrary instructions inside kernel functions +and work around some of the +limitations +of +.Nm fbt . +.Ss Tracing DTrace +The +.Nm fbt +provider cannot attach to functions inside DTrace provider kernel modules. diff --git a/share/man/man4/dtrace_kinst.4 b/share/man/man4/dtrace_kinst.4 index 9debbc1bd106..c2187689749b 100644 --- a/share/man/man4/dtrace_kinst.4 +++ b/share/man/man4/dtrace_kinst.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 27, 2023 +.Dd July 16, 2025 .Dt DTRACE_KINST 4 .Os .Sh NAME @@ -43,10 +43,13 @@ creates probes on-demand, meaning it searches for and parses the function's instructions each time .Xr dtrace 1 is run, and not at module load time. -This is in contrast to FBT's load-time parsing, since +This is in contrast to +.Xr dtrace_fbt 4 Ap s +load-time parsing, since .Nm kinst can potentially create thousands of probes for just a single function, instead -of up to two (entry and return) in the case of FBT. +of up to two (entry and return) in the case of +.Xr dtrace_fbt 4 . A result of this is that .Cm dtrace -l -P kinst will not match any probes. @@ -79,7 +82,8 @@ Trace all instructions in # dtrace -n 'kinst::amd64_syscall:' .Ed .Sh SEE ALSO -.Xr dtrace 1 +.Xr dtrace 1 , +.Xr dtrace_fbt 4 .Sh HISTORY The .Nm kinst From nobody Wed Jul 30 09:42:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsS0q23xjz63QxR; Wed, 30 Jul 2025 09:42:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsS0q14MKz47Pk; Wed, 30 Jul 2025 09:42:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2jSOHjYpS+pAIVHHqIQq5FgsfQPvy2LC0BtEB5qNJq8=; b=jprAV9aXiGzkqZDDLAfU2Kx+tWMLeLKt+gJTeJycG0VIIt0Ph1Rhg6hLi6oib7J/jpwL7+ mkcsGKlpeqfrf9kl33NFQ8xtbfz9lngQDG05d6la3dDr+Q6wlYVOOtQPHeMuEQsXCcDCp7 A2nB4oxk6uz+mGF2hum2uGYgwfpNLRA/kGPdKU+8IIsxQtWQQPCKzOXPIZdrfA3uVfAtL7 rF4If132OLUodnvFCnhI/0VmmCK6ku6eUYCSkqujNt+FpuEqv4KpuWoeTugqpzXtk5gUN6 gyyMjXZL9BTxsQVdT2yJ3JzVaWyUcQ9w9PlL5rLleDMhAIf+c33Ms9mWiPLnuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2jSOHjYpS+pAIVHHqIQq5FgsfQPvy2LC0BtEB5qNJq8=; b=MDNYR8JWVp581rrlyXseNI00Hrg7U1WaCnOEr5NlnpRxESfOB74600LfN9NkirW0YQKijz jWVFj6HXWvXOlwOTe9srg85ETLDoFZX5WwLtg9xWGh/FBo1IHL9XsEofNMBgvrg4lo0++m 3orKkUl9wR6c9sORMU9ScaALZngdDzfsCvqHi4UEnmoFJD9rhQfz/cXxroVPw2kKEjDZov 5DsHVX+HRkRUZCP/HJJOYyJ16Zm/iY3Xvze94WEs1TvoTwTq9UzIfTeqHKg+pHYbTQw2CA ZphcjKHoYPH3I2Wi7V/iaQXMCBcTbaYMTmBzj4zNfGObwFiTat1FHp5bxMZNNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753868523; a=rsa-sha256; cv=none; b=CbbAuZ7pfUdmX18dOLQvjXTNB0KnnhuyNf5ifzBQypUc+byIykUi4KNFij/cTGKiiqqods A3oSL9Z5pcL+I7k6ZvWrea8gY/uUmfDDa0TrpzkCEeydvTVDfJJ28xVRxTi0S6EyjFEc4P zAr5Xlonb/VjChk1bhcFesNUvi8eLt1n9HMYGLt46Lc+sL95AJf4v/GjUXKvUGWNZrCYK7 ORYNuLhv43vBPffc6ubHfhuejUnSz/dk3sk9/XgPf2+OXJvZMp0i+UanSR/tCrPr4EuDCY QW1Dxj16Otki04jPTvTVU+KAXAZdDt7mzhe9gslZZTmNbqTuBcBshAReqD8Tlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsS0q0Y2pz19RN; Wed, 30 Jul 2025 09:42:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U9g2cv004565; Wed, 30 Jul 2025 09:42:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U9g2Kk004562; Wed, 30 Jul 2025 09:42:02 GMT (envelope-from git) Date: Wed, 30 Jul 2025 09:42:02 GMT Message-Id: <202507300942.56U9g2Kk004562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 683f161bd5be - stable/13 - dtrace.1: Mention providers in SEE ALSO List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 683f161bd5bee181308a86cec6b1a1d4f3ad0f1e Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=683f161bd5bee181308a86cec6b1a1d4f3ad0f1e commit 683f161bd5bee181308a86cec6b1a1d4f3ad0f1e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-06-14 17:24:03 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-30 09:39:16 +0000 dtrace.1: Mention providers in SEE ALSO Reviewed by: bnovkov, christos, markj Approved by: bnovkov (mentor), christos (mentor), markj (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50852 (cherry picked from commit 177471148a6111537e84912fb9a033b6ac5ecb17) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index d1e7ebad189b..e09c89cd64d2 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -18,7 +18,7 @@ .\" CDDL HEADER END .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. .\" -.Dd September 7, 2021 +.Dd June 14, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -808,6 +808,16 @@ utility first appeared in .Fx 7.1 . .Sh SEE ALSO .Xr cpp 1 , +.Xr dtrace_audit 4 , +.Xr dtrace_io 4 , +.Xr dtrace_ip 4 , +.Xr dtrace_lockstat 4 , +.Xr dtrace_proc 4 , +.Xr dtrace_sched 4 , +.Xr dtrace_sctp 4 , +.Xr dtrace_tcp 4 , +.Xr dtrace_udp 4 , +.Xr dtrace_udplite 4 , .Xr elf 5 , .Xr SDT 9 .Rs From nobody Wed Jul 30 09:42:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsS0r2rq8z63QfN; Wed, 30 Jul 2025 09:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsS0r1gBZz47Pl; Wed, 30 Jul 2025 09:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nhg8NoDkzLBZ+KW/hubSn4opgu7/r3zT0Yf/BtYIm4U=; b=agJnwJp0w4eWGYB98Lralql8TB9FzxtTXoIPPMa0b3lWmT9l5ktiNtlFSu/Y/NBL/PvArD uI63fhpgFU0suL1MI4mgsWv+tbw7IHUjmxqygvafKbp6SHypmjL66aQbNL1rU4F3A12urC 3yhZi7zhpERu3Q/Mcv7E+/ecNGKsv7SAZ692QMGwgS978p6RcYN7UBRnRELKJEOg9YnFwc 2xvWChpkgbB/VTDesuuFQicq8NoS2SwqIp5qQ6WF8wkwjRHvHGpWmqJELVquR7NbLkffd0 OOX0bcFWa1cYNnD17eJbKiBrHgs92CF5kQGLIk5uD6EwffdrnmBCPqVZNP4sLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753868524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nhg8NoDkzLBZ+KW/hubSn4opgu7/r3zT0Yf/BtYIm4U=; b=TM+wZKdqEAM5RgRso1LtuVvUcrEuSMJyJS57Iw2xoxrOXoE6PXD156N1vCOiMfZj52x2rq 0v2HKCeRbBYN9Ym+Vv4I3BOLrXinf/BA3G+pcCEcUVKMxa/FZbQWP2ivK1sOkcfHrG6BQt ILiHhO8nCFwaAzeB0jeWLdFz9bnHHMrE1vZFjhdGRqc1kMAumisevc9nh1C2dK1AkslIGi Iz9tfzC5kKZxYNRMmAJkAdUDqUdcaMVPpedt2LoPjf64g48AtcQKyb0CeyJh3/VY/B/xf8 uGtTU4B158mi29YwvKuKRBzvk/tq8VmEhBUPIssUtigsQnrZpRuOz/NqFMjeXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753868524; a=rsa-sha256; cv=none; b=Vx5yaSLHPSQAsIhxs4IZnU+EqkhA+furtVSLj9/w4B9GjWOwyWTZAzJNtqtlLbuudhUrpk jieoRIOujESt2AH6GLmfKfePFiRwvmtDcQBVzJQTiSlJP4QdFbyYWifahSS1V/xoOaGPNy /3/ZE2ssqJEfsAd81CL32XZjM9X3iZPL+wzifW9zlSQGMol8MaUPbb53vLrHmOPKyVuxQS NP6gayke48LX3xDgMTuDjTf4KdpCVqS3WSJqr8JEVYBy07CGfr67XCBHg0xoEPFd5w/8Nu 7qRufYMpjPCUUD2hSrA7iB5VzkUYYyYpJAUhzqOgEjTtvoIV/75ABAZgqr5CRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsS0r1Cy3z19jd; Wed, 30 Jul 2025 09:42:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U9g4W5004607; Wed, 30 Jul 2025 09:42:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U9g4YN004604; Wed, 30 Jul 2025 09:42:04 GMT (envelope-from git) Date: Wed, 30 Jul 2025 09:42:04 GMT Message-Id: <202507300942.56U9g4YN004604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2dded8fb5b25 - stable/13 - dtrace_fbt.4: Document the DTrace fbt provider List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2dded8fb5b25cb70629d49fecc540ef175a4fff6 Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=2dded8fb5b25cb70629d49fecc540ef175a4fff6 commit 2dded8fb5b25cb70629d49fecc540ef175a4fff6 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-06-14 19:26:48 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-30 09:41:09 +0000 dtrace_fbt.4: Document the DTrace fbt provider Reported by: markj Reviewed by: christos, markj (earlier version), ziaee Obtained from: Mark Johnston, DTrace, FreeBSD Journal, May 2014 Obtained from: https://wiki.freebsd.org/DTrace/One-Liners MFC after: 2 weeks Relnotes: yes (cherry picked from commit 9388c2887817d7162ebb356b39aa9b4ab67a8c00) Do not mention dtrace_kinst(4) as it is not available on FreeBSD 13. --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 7 + share/man/man4/Makefile | 1 + share/man/man4/dtrace_fbt.4 | 323 +++++++++++++++++++++++++++ 3 files changed, 331 insertions(+) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index e09c89cd64d2..9b6eb03226a9 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -18,7 +18,13 @@ .\" CDDL HEADER END .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. .\" +<<<<<<< HEAD .Dd June 14, 2025 +======= +.\" $FreeBSD$ +.\" +.Dd July 16, 2025 +>>>>>>> 9388c2887817 (dtrace_fbt.4: Document the DTrace fbt provider) .Dt DTRACE 1 .Os .Sh NAME @@ -809,6 +815,7 @@ utility first appeared in .Sh SEE ALSO .Xr cpp 1 , .Xr dtrace_audit 4 , +.Xr dtrace_fbt 4 , .Xr dtrace_io 4 , .Xr dtrace_ip 4 , .Xr dtrace_lockstat 4 , diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 8802e5fc35d6..5f576c391086 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -960,6 +960,7 @@ _ccd.4= ccd.4 .if ${MK_CDDL} != "no" _dtrace_provs= dtrace_audit.4 \ + dtrace_fbt.4 \ dtrace_io.4 \ dtrace_ip.4 \ dtrace_lockstat.4 \ diff --git a/share/man/man4/dtrace_fbt.4 b/share/man/man4/dtrace_fbt.4 new file mode 100644 index 000000000000..fc55846f2d0b --- /dev/null +++ b/share/man/man4/dtrace_fbt.4 @@ -0,0 +1,323 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.Dd July 16, 2025 +.Dt DTRACE_FBT 4 +.Os +.Sh NAME +.Nm dtrace_fbt +.Nd a DTrace provider for dynamic kernel tracing based on function boundaries +.Sh SYNOPSIS +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +.Sh DESCRIPTION +The Function Boundary Tracing +.Pq Nm fbt +provider instruments the entry and return of almost every kernel function +corresponding to an +.Xr elf 5 +symbol in the kernel and loaded kernel modules. +.Pp +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +fires whenever the +.Ar function +is called. +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +fires when the +.Ar function +returns. +.Pp +The +.Ar module +in the probe description is either the name of the loaded kernel module +or +.Ql kernel +for functions compiled into the kernel. +.Ss Function Boundary Instrumentation +The +.Nm fbt +will always instrument a function's entry, but +its return will be intsrumented so long as it can find a +.Ql ret +instruction. +.Pp +In some cases, +.Nm fbt +cannot instrument a function's entry and/or return. +Refer to subsection +.Sx Frame Pointer +for more details. +.Ss Probe Arguments +The arguments of the entry probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry +are the arguments of the traced function call. +.Bl -column -offset indent "Entry Probe Argument" "Definition" +.It Sy Entry Probe Argument Ta Sy Definition +.It Fa args[0] Ta Function's first argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft size_t Fa size +.It Fa args[1] Ta Function's second argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft struct malloc_type Fa *type +.It Fa args[2] Ta Function's third argument, typed +.Pq e.g., Xr malloc 9 Ap s Ft int Fa flags +.It Fa ... Ta ... +.El +.Pp +The arguments of the return probe +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return +are +.Fa args[0] +.Po +the offset of the firing return instruction within the function; +useful to tell apart two different return statements in a single function +.Pc +and +.Fa args[1] +.Pq the return value, if any . +.Bl -column -offset indent "Return Probe Argument" "Definition" +.It Sy Return Probe Argument Ta Sy Definition +.It Fa args[0] Ta Offset of the traced return instruction +.It Fa args[1] Ta Function's return value +.Po e.g., a kernel virtual address if returning from a successful +.Xr malloc 9 +.Pc +.El +.Pp +Subsection +.Sx Example 2 : Getting Details About Probe's Arguments +shows how to get probe's argument count and types directly with +.Xr dtrace 1 +without having to resort to the reading function's source code +or documentation. +.Sh EXAMPLES +.Ss Example 1 : Listing Available FBT Probes +The following example shows how to list all the available +.Nm fbt +probes. +.Bd -literal -offset 2n +# dtrace -l -P fbt + ID PROVIDER MODULE FUNCTION NAME +[...] +31868 fbt kernel hammer_time entry +31869 fbt kernel hammer_time return +[...] +.Ed +.Pp +Since +.Fn hammer_time +is a part of the kernel and not a separate loaded module, the +.Ar module +column displays +.Ql kernel . +.Ss Example 2 : Getting Details About Probe's Arguments +The following example shows how to generate a program stability report of +.Xr malloc 9 Ap s +entry and return probes. +Those reports are useful to view +the probe's number of arguments and their types. +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:entry +[...] + Argument Types + args[0]: size_t + args[1]: struct malloc_type * + args[2]: int +.Ed +.Pp +The count and types of +.Nm fbt Ns Cm \&::malloc:entry +arguments +match the function signature of +.Xr malloc 9 : +.Va args[0] +is +.Ft size_t , +.Va args[1] +is +.Ft "struct malloc_type *" , +and +.Va "args[2]" +is +.Ft int . +.Bd -literal -offset 2n +# dtrace -l -v -n fbt::malloc:return +[...] + Argument Types + args[0]: int + args[1]: void * +.Ed +.Pp +The +.Cm return +probe reports two arguments and their types: +the return instruction offset +.Pq the usual Ft int +and the function's return value, which in this case is +.Ft void * , +as +.Xr malloc 9 +returns a kernel virtual address. +.Ss Example 3 : Counting Kernel Slab Memory Allocation by Function +.Bd -literal -offset 2n +# dtrace -n 'fbt::kmem*:entry { @[probefunc] = count(); }' +dtrace: description 'fbt::kmem*:entry ' matched 47 probes +^C + kmem_alloc_contig 1 + kmem_alloc_contig_domainset 1 + kmem_cache_reap_active 1 + kmem_alloc_contig_pages 2 + kmem_free 2 + kmem_std_destructor 19 + kmem_std_constructor 26 + kmem_cache_free 151 + kmem_cache_alloc 181 +.Ed +.Ss Example 4 : Counting Kernel Slab Memory Allocation by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::kmem*:entry { @[caller] = count(); } END { printa("%40a %@16d\en", @); }' +^C + kernel`contigmalloc+0x33 1 + kernel`free+0xd3 1 + kernel`kmem_alloc_contig+0x29 1 +kernel`kmem_alloc_contig_domainset+0x19a 1 + zfs.ko`arc_reap_cb_check+0x16 1 +.Ed +.Ss Example 5 : Counting Kernel malloc()'s by Calling Function +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[caller] = count(); } END { printa("%45a %@16d\en", @); }' +^C + kernel`devclass_get_devices+0xa8 1 + kernel`sys_ioctl+0xb7 1 + dtrace.ko`dtrace_ioctl+0x15c1 1 + dtrace.ko`dtrace_ioctl+0x972 2 + dtrace.ko`dtrace_dof_create+0x35 2 + kernel`kern_poll_kfds+0x2f0 4 + kernel`kern_poll_kfds+0x28a 19 +.Ed +.Ss Example 6 : Counting Kernel malloc()'s by Kernel Stack Trace +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::malloc:entry { @[stack()] = count(); }' +^C + dtrace.ko`dtrace_dof_create+0x35 + dtrace.ko`dtrace_ioctl+0x827 + kernel`devfs_ioctl+0xd1 + kernel`VOP_IOCTL_APV+0x2a + kernel`vn_ioctl+0xb6 + kernel`devfs_ioctl_f+0x1e + kernel`kern_ioctl+0x286 + kernel`sys_ioctl+0x12f + kernel`amd64_syscall+0x169 + kernel`0xffffffff81092b0b + 2 +.Ed +.Ss Example 7 : Summarizing vmem_alloc()'s by Arena Name and Size Distribution +.Bd -literal -offset 2n +# dtrace -q -n 'fbt::vmem_alloc:entry { @[args[0]->vm_name] = quantize(arg1); }' +^C + + kernel arena dom + value ------------- Distribution ------------- count + 2048 | 0 + 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4 + 8192 |@@@@@@@@@@@@@ 2 + 16384 | 0 +.Ed +.Ss Example 8 : Measuring Total Time Spent Executing a Function +This DTrace script measures the total time spent in +.Fn vm_page* +kernel functions. +The +.Fn quantize +aggregation organizes the measurements into power-of-two buckets, +providing a time distribution in nanoseconds for each function. +.Bd -literal -offset 2n +fbt::vm_page*:entry { + self->start = timestamp; +} + +fbt::vm_page*:return /self->start/ { + @[probefunc] = quantize(timestamp - self->start); + self->start = 0; +} +.Ed +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr tracing 7 +.Rs +.%A Brendan Gregg +.%A Jim Mauro +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD +.%I Prentice Hall +.%P pp. 898\(en903 +.%D 2011 +.%U https://www.brendangregg.com/dtracebook/ +.Re +.Rs +.%B The illumos Dynamic Tracing Guide +.%O Chapter fbt Provider +.%D 2008 +.%U https://illumos.org/books/dtrace/chp-fbt.html#chp-fbt +.Re +.Sh AUTHORS +This manual page was written by +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . +.Sh CAVEATS +.Ss Stability and Portability +.Nm fbt +probes are by definition tightly coupled to kernel code; if the code underlying +a script changes, the script may fail to run or may produce incorrect results. +Scripts written for one version of +.Fx +might not work on others, +and almost certainly will not work on other operating systems. +.Pp +Individual +.Nm fbt +probes often do not correspond nicely to logical system events. +For example, consider a DTrace script which prints the destination +address of every IP packet as the kernel hands them over +to the network card driver (NIC). +An +.Nm fbt Ns -based +implementation of such a script is a discouragingly difficult task: +it involves instrumenting at least four different functions in different parts +of the IPv4 and IPv6 code. +At the same time, with the +.Xr dtrace_ip 4 +provider the script is a simple one-liner: +.Dl dtrace -n 'ip:::send {printf("%s", args[2]->ip_daddr);}' +.Pp +Make sure to review available +.Xr dtrace 1 +providers first +before implementing a custom script with the +.Nm fbt +provider. +If none of the DTrace providers offer the desired probes, +consider adding new statically-defined tracing probes +.Pq Xr SDT 9 . +.Ss Frame Pointer +Inline functions are not instrumentable by +.Nm fbt +as they lack a frame pointer. +A developer might explicitly disable inlining by adding the +.Ql __noinline +attribute to a function definition, +but of course this requires a recompilation of the kernel. +Building the kernel with +.Fl fno-omit-frame-pointer +is another way of preserving frame pointers. +Note, that sometimes compilers will omit the frame pointer in leaf functions, +even when configured with +.Fl fno-omit-frame-pointer . +.Pp +Function returns via a tail call are also not instrumentable by +.Nm fbt . +As a result, +a function might have an entry probe +and a mix of instrumented and uninstrumentable returns. +.Ss Tracing DTrace +The +.Nm fbt +provider cannot attach to functions inside DTrace provider kernel modules. From nobody Wed Jul 30 09:55:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsSJX4yJGz63RSx; Wed, 30 Jul 2025 09:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsSJX2XbNz499F; Wed, 30 Jul 2025 09:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753869340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=inM0EbDDz7hXWkxhI13nO/jpZKU5FCfFXnBzeqcv+WQ=; b=ddXqnPolq8NJzB6E5XkLR5Gc+xkG9jeO63KGgNBzgWe53LacJ9sKaYbzwcmt9SYYqIx6rb NwK2Mvub+6zO6A1x3i4TDmO4xKhKDPcqhoUNEYYRmlzQsGo1IyNTB3hnTO1DKFrxJyxIQL R9MeENsvjcnhXOyUYulIZpNy4Nduw1FQ0T9dJu2tbeWMhWancTd3SWYqCLT4lrIBEIMnrG P4vxnxlhkLkrMMle7KyPAnparCUoJLvZlBpW0WFne71lehHisV30jRg9dqIsinVGYDFXw6 VosL/Yu6jDbJSeS08L1lLYs+lGHyjKLOSRAkGNvKOb2dnTguo632tgb7OLCSrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753869340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=inM0EbDDz7hXWkxhI13nO/jpZKU5FCfFXnBzeqcv+WQ=; b=Q+pIe3GexapRMCpZcM84BC1oGnGj6/nCD+zuvQuM5SneENWrA/3hTtXSqD2/nyJxRd7AC9 U+uXY5IwBVks6oRTIH6bdJbIqwawJ34SwjimJNHJHEjzQ4OtKdBk++f4fJVbsI7wDDy7AW 0nWowAWS8CLk20frQ+reF4t+gV+LhjEK6yOlE2qTLq1thf6wCbDp+q3tCMTjt8Llz/SPnF DIZjQvpfyA2YiaG97xAAKY1rc/oYjQVP4MylcSUfI48/i19sI+TMT1Acha/sQmajAq2sqO 9+QSVCsBcTVOC/6+0EFvVcnoUZurNi16h/O4K7vf7qVVhO1RAZ6mzywVSlikSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753869340; a=rsa-sha256; cv=none; b=erl+BSH+fFMqPdZx7B/2dLcYNc7IRucnVFrQW1ZIEOKIZgj8yKYG5GunCHCILpZgRis90r 1CFPWBPdESUpw1+FPU7pRd4dfpNoWeYEUF+v5fVSBvuqknYqVHt2qEMgFySDUonnWVqlRf 54YO3tQFP43J4OdiqQ6chZop1cbutv0bmuZgfntz+eI6Msa+q/kWaDt1GBxiTA4KRAiVx1 MbgPXXPvm3oPbqsqQEsoC98JaWCmise7oNzXUtZJeAKw58ajsaiz41Ic3+jFDVxc5yu2Qw pF3Io1jE2PTaOPabj8gFD88mtoWqZiytmtg1oVFnocwxTMkitinn6W6UyXEO+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsSJX24ycz19sS; Wed, 30 Jul 2025 09:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U9tebP024704; Wed, 30 Jul 2025 09:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U9teRe024701; Wed, 30 Jul 2025 09:55:40 GMT (envelope-from git) Date: Wed, 30 Jul 2025 09:55:40 GMT Message-Id: <202507300955.56U9teRe024701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 943ad2ce5988 - stable/14 - rc: Use check_jail to check values of security.jail MIBs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 943ad2ce59887a63182e5e26ea6962e978ac59bd Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=943ad2ce59887a63182e5e26ea6962e978ac59bd commit 943ad2ce59887a63182e5e26ea6962e978ac59bd Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 16:20:32 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-30 09:55:24 +0000 rc: Use check_jail to check values of security.jail MIBs PR: 282404 Reviewed by: markj, netchild Approved by: markj (mentor) MFC after: 2 weeks Event: Berlin Hackathon 202507 Differential Revision: https://reviews.freebsd.org/D47329 (cherry picked from commit 46f18ecf8d3cdda1cd433841c44a4c1268ab9721) --- libexec/rc/rc | 4 ++-- libexec/rc/rc.d/hostname | 4 ++-- libexec/rc/rc.d/routing | 2 +- libexec/rc/rc.d/zfs | 8 ++++---- libexec/rc/rc.d/zfsbe | 2 +- libexec/rc/rc.shutdown | 4 ++-- libexec/rc/rc.subr | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 462967703d60..ae1b24a6f36d 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -78,9 +78,9 @@ load_rc_config trap "_rc_conf_loaded=false; load_rc_config" ALRM skip="-s nostart" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then skip="$skip -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then skip="$skip -s nojailvnet" fi fi diff --git a/libexec/rc/rc.d/hostname b/libexec/rc/rc.d/hostname index f6ac95c9c888..8c3fb23edd71 100755 --- a/libexec/rc/rc.d/hostname +++ b/libexec/rc/rc.d/hostname @@ -42,8 +42,8 @@ hostname_start() # If we are not inside a jail, set the host name. # If we are inside a jail, set the host name if it is permitted. # - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then - if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then + if check_jail jailed; then + if ! check_jail set_hostname_allowed; then return fi else diff --git a/libexec/rc/rc.d/routing b/libexec/rc/rc.d/routing index d7113eb90722..89a5620fb5df 100755 --- a/libexec/rc/rc.d/routing +++ b/libexec/rc/rc.d/routing @@ -331,7 +331,7 @@ _check_dynamicrouting() # copied from /etc/rc skip="-s nostart" - if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then skip="$skip -s nojail" fi [ -n "$local_startup" ] && find_local_scripts_new diff --git a/libexec/rc/rc.d/zfs b/libexec/rc/rc.d/zfs index d7c5b20ee6d1..1e887c67f804 100755 --- a/libexec/rc/rc.d/zfs +++ b/libexec/rc/rc.d/zfs @@ -18,7 +18,7 @@ required_modules="zfs" zfs_start_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs mount -a fi } @@ -34,7 +34,7 @@ zfs_start_main() zfs_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_start_jail else zfs_start_main @@ -54,7 +54,7 @@ zfs_poststart() zfs_stop_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs unmount -a fi } @@ -67,7 +67,7 @@ zfs_stop_main() zfs_stop() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_stop_jail else zfs_stop_main diff --git a/libexec/rc/rc.d/zfsbe b/libexec/rc/rc.d/zfsbe index 31b0a180800f..5154a35377d0 100755 --- a/libexec/rc/rc.d/zfsbe +++ b/libexec/rc/rc.d/zfsbe @@ -64,7 +64,7 @@ activate_bootonce() be_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then : else mount -p | while read _dev _mp _type _rest; do diff --git a/libexec/rc/rc.shutdown b/libexec/rc/rc.shutdown index 18f67f5ca124..3dfd7a7e0936 100644 --- a/libexec/rc/rc.shutdown +++ b/libexec/rc/rc.shutdown @@ -83,9 +83,9 @@ fi # and perform the operation # rcorder_opts="-k shutdown" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then rcorder_opts="$rcorder_opts -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then rcorder_opts="$rcorder_opts -s nojailvnet" fi fi diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 61c10370250e..75110a0313cd 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1314,7 +1314,7 @@ $_cpusetcmd $command $rc_flags $command_args" start) # We cannot use protect(1) inside jails. if [ -n "$_oomprotect" ] && [ -f "${PROTECT}" ] && - [ "$(sysctl -n security.jail.jailed)" -eq 0 ]; then + ! check_jail jailed; then [ -z "${rc_pid}" ] && eval $_pidcmd case $_oomprotect in [Aa][Ll][Ll]) From nobody Wed Jul 30 09:55:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsSJd1Lpbz63RWK; Wed, 30 Jul 2025 09:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsSJc5dDTz49cN; Wed, 30 Jul 2025 09:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753869344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMp8ydcQZSIH5Qiqlc0dYP/uV4DsTSsVs6FsGMiZNXk=; b=DotsFnl88GVWQYyNhWPoYmyjxhcM/PuRLzaSkwaNKwv8fs7h0XQujaHXkIgYfxLrJe0Ov1 Qte5YlcvkqWyaj39b7Y2jYBu3ITMubZKY5/zLabOnT83Ks9DjvTBEXhnZAsOMsiKJsnWOI v+FKOrH15d3yYvelGBJEbu98hzS0n2fXmDTCCPqZWojVEBd+UO2yb4lSBf1h8Sp26i3C1T 5N5hlomvu3Mc4HiqtwpZ90VnCw5kMeMFlbBVsXHjk++O5NWce3vvx9xQbJzIoxu3eKvyLe huC38HtFlvVaBMZGI+mj0ulj1UqCXjLzq6cxN6IcyEX3ZQ7bVLzUDPVsnl2x1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753869344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMp8ydcQZSIH5Qiqlc0dYP/uV4DsTSsVs6FsGMiZNXk=; b=V3G/ygyEc/i7qlHxebFUZz/ZX/IHGRZXhnx3I3HhU0/kh2y24HjUvPrrzKWAqesZyd/HKS 8bpYNwylPc5QxcvZcxn9XkV9sU0HJQfoX8vjAdW9+R8hldHYltKfXxOZI5qY2A1bVCN8E7 N52FLGQaS5uID1HeIqwty6vF5YqzOE+KmoCdryUI9Y7XE0o3QU+iiCgwcX8kGQ5mC8wN80 K7hAoqQPJsH9cksZ8Mt+oMPNZM7bfufzIs1PXD6ncwvvb07ylYDsZ2SK55fjShTVaxjc8M 62s/E01WfSCNLKTc1/kGizb4u3/zQmphiBqTPpWCt8PBEfYTn7vu749pyVD1Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753869344; a=rsa-sha256; cv=none; b=oodc3TUlDe21UJujC/o8L5tfu3ECSfJX2rf3wScsvH/Mv9MUlwuI0kyXgEVj2f6EAaOx/i 1TcQVOac4BJ+T7GWKY7qxNLL8lx3J/fBCBrqO/SzpaJHU49BxEayAf698Ij/pKECWIvl0H F9R8NTo9ibzcFHDtqTvte4gOZt0piw6OBjtmpK/IsM4rJXGt1rRLPOlhwUv8AxEA+yRxuL KwGofPdT+yfU4Z8N2PFCI7NRTp87nRiuIu6gKJQzV9/LyNyz569o45ZMgkIcTemVCbM0W5 dNP4bvu0TJ7df6QKr0recyhueyFhV7UPj+b8ALLIAG0vFxP0hlvP4Ode8zRYtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsSJc51z7z19pt; Wed, 30 Jul 2025 09:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56U9ti6F024853; Wed, 30 Jul 2025 09:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56U9tiox024850; Wed, 30 Jul 2025 09:55:44 GMT (envelope-from git) Date: Wed, 30 Jul 2025 09:55:44 GMT Message-Id: <202507300955.56U9tiox024850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 7ee04c7b17d1 - stable/13 - rc: Use check_jail to check values of security.jail MIBs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ee04c7b17d15e2296b796e1657b0b152eba9d4c Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=7ee04c7b17d15e2296b796e1657b0b152eba9d4c commit 7ee04c7b17d15e2296b796e1657b0b152eba9d4c Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-12 16:20:32 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-07-30 09:55:30 +0000 rc: Use check_jail to check values of security.jail MIBs PR: 282404 Reviewed by: markj, netchild Approved by: markj (mentor) MFC after: 2 weeks Event: Berlin Hackathon 202507 Differential Revision: https://reviews.freebsd.org/D47329 (cherry picked from commit 46f18ecf8d3cdda1cd433841c44a4c1268ab9721) --- libexec/rc/rc | 4 ++-- libexec/rc/rc.d/hostname | 4 ++-- libexec/rc/rc.d/routing | 2 +- libexec/rc/rc.d/zfs | 8 ++++---- libexec/rc/rc.d/zfsbe | 2 +- libexec/rc/rc.shutdown | 4 ++-- libexec/rc/rc.subr | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libexec/rc/rc b/libexec/rc/rc index 7b750606022b..ab4a86c8e6b1 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -78,9 +78,9 @@ load_rc_config trap "_rc_conf_loaded=false; load_rc_config" ALRM skip="-s nostart" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then skip="$skip -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then skip="$skip -s nojailvnet" fi fi diff --git a/libexec/rc/rc.d/hostname b/libexec/rc/rc.d/hostname index f6ac95c9c888..8c3fb23edd71 100755 --- a/libexec/rc/rc.d/hostname +++ b/libexec/rc/rc.d/hostname @@ -42,8 +42,8 @@ hostname_start() # If we are not inside a jail, set the host name. # If we are inside a jail, set the host name if it is permitted. # - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then - if [ `$SYSCTL_N security.jail.set_hostname_allowed` -eq 0 ]; then + if check_jail jailed; then + if ! check_jail set_hostname_allowed; then return fi else diff --git a/libexec/rc/rc.d/routing b/libexec/rc/rc.d/routing index 9b906f69b354..a10b15958613 100755 --- a/libexec/rc/rc.d/routing +++ b/libexec/rc/rc.d/routing @@ -331,7 +331,7 @@ _check_dynamicrouting() # copied from /etc/rc skip="-s nostart" - if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then skip="$skip -s nojail" fi [ -n "$local_startup" ] && find_local_scripts_new diff --git a/libexec/rc/rc.d/zfs b/libexec/rc/rc.d/zfs index d7c5b20ee6d1..1e887c67f804 100755 --- a/libexec/rc/rc.d/zfs +++ b/libexec/rc/rc.d/zfs @@ -18,7 +18,7 @@ required_modules="zfs" zfs_start_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs mount -a fi } @@ -34,7 +34,7 @@ zfs_start_main() zfs_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_start_jail else zfs_start_main @@ -54,7 +54,7 @@ zfs_poststart() zfs_stop_jail() { - if [ `$SYSCTL_N security.jail.mount_allowed` -eq 1 ]; then + if check_jail mount_allowed; then zfs unmount -a fi } @@ -67,7 +67,7 @@ zfs_stop_main() zfs_stop() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then zfs_stop_jail else zfs_stop_main diff --git a/libexec/rc/rc.d/zfsbe b/libexec/rc/rc.d/zfsbe index 216eb828e13c..1b4752f56c80 100755 --- a/libexec/rc/rc.d/zfsbe +++ b/libexec/rc/rc.d/zfsbe @@ -64,7 +64,7 @@ activate_bootonce() be_start() { - if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + if check_jail jailed; then : else mount -p | while read _dev _mp _type _rest; do diff --git a/libexec/rc/rc.shutdown b/libexec/rc/rc.shutdown index 18f67f5ca124..3dfd7a7e0936 100644 --- a/libexec/rc/rc.shutdown +++ b/libexec/rc/rc.shutdown @@ -83,9 +83,9 @@ fi # and perform the operation # rcorder_opts="-k shutdown" -if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then +if check_jail jailed; then rcorder_opts="$rcorder_opts -s nojail" - if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then + if ! check_jail vnet; then rcorder_opts="$rcorder_opts -s nojailvnet" fi fi diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 6a10dcc8e01f..eaaa3c778bff 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1294,7 +1294,7 @@ $command $rc_flags $command_args" start) # We cannot use protect(1) inside jails. if [ -n "$_oomprotect" ] && [ -f "${PROTECT}" ] && - [ "$(sysctl -n security.jail.jailed)" -eq 0 ]; then + ! check_jail jailed; then [ -z "${rc_pid}" ] && eval $_pidcmd case $_oomprotect in [Aa][Ll][Ll]) From nobody Wed Jul 30 12:29:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsWkN3zqLz63YSJ; Wed, 30 Jul 2025 12:29:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsWkN2y3Kz3R5k; Wed, 30 Jul 2025 12:29:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753878588; 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=3i+giKXQlqAMj0jz4PA/ozbXDTP2flcoBpjLZbcNtjk=; b=ET9hsC0Whahj+AXDdFhfUjx6TRp/ar+ByO4yisBFUp5KWJpjnlKpKQplUYyiHizw/bOC3v KiQ0nH1UoeM+5w0jZ8gDTD2cGk2L7FrhJZxAOhyhqMD4l8YkX2d0WZ6vL1oNHxzzBuZWLA lmkvUQiNIglCZNVANWit9EbdpF3rordh8hcV89Zn/5w4CXWwCmvKoZjd142rPFrjfVoefI oIJg/sybSvkHDERiC5DCIJUVp89EjmoRoEBIIES0wY8z0GIEZDyAgRR3D8YujqIEw+u+ZI hK0RxO54IFaybspfeLjWnLZqjzK1VWXl1lBlO5SJEySBthgv58BcWPNOw+Kczw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753878588; 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=3i+giKXQlqAMj0jz4PA/ozbXDTP2flcoBpjLZbcNtjk=; b=XJ0W5rx7SKfdxWN+mPrIwnWq7rtyOysmPjvJkgY14i0XrmlLdx8FROSa5koi4vDQMMUf2w pllpGCqMMgmnuRQwAKejzimrCZLxrJ81X3ylec5waNotvsm/2Ik0fE5IeIhZrNW3flMf0/ XpAMaKjPgsqDvp5enW13WvzytI1bDuCHvYy5pKLm9HKeyrKI9GHW/oA0rzp7eaqWGpJsYu PDFwZ66aFNOLqjo/ZWZet8XuMqJ5iHfxgly8Y2hhuWRBMF2WhDW9xdJCcvw92VByUMWKq/ X7zRIQMItEMBQjgrEz1dioLzqxrQO7gedNzJudp7oBSC5DKBfaKSOt3eRtSDNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753878588; a=rsa-sha256; cv=none; b=vAXBSpd2A0V5pWvX9xs/wN9P16gK2fy+3f+3lR0vtRDfuUTuqnnbEvFdfOxp8jt/n+31t9 QC3rDSrLIlf6r5wb65PLKIMHzTiKUyZ7nSTAEufBSpBMxywZM2zgJ+AkFKfQIvFLfJDYP9 9GKQX01YBFfijdclkn/KAwkZg8gr9Fs29FJCXnt/P3scHskLN8fea9cvW5S9JrgXEt2mOX /tzfVHfFkMptEiuHO+BhyW+Z6kqoQ8cEDyYNigjzOsTp6i5EOGrNGVJ8bqY111M+k+hxQv ogmORIaxm9vmb1egdKLtUlGulVsAcvHkYODTh0fyp7c1y+Gen/h+bNB6kJjTpw== 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 "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bsWkN13X9zyNF; Wed, 30 Jul 2025 12:29:48 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id CA65949F2B; Wed, 30 Jul 2025 14:29:43 +0200 (CEST) From: Kristof Provost To: Mark Johnston , Hareshx Sankar Raj Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ded037e65e52 - main - qat: driver updates to improve code and fix bugs Date: Wed, 30 Jul 2025 14:29:37 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: <9DB885DF-8BDD-451F-B928-0C10E881C4CF@FreeBSD.org> In-Reply-To: <202506061357.556Dv9Zc084087@gitrepo.freebsd.org> References: <202506061357.556Dv9Zc084087@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_B08AB6DB-7748-4F2A-B2B9-63ABCCFE9199_=" --=_MailMate_B08AB6DB-7748-4F2A-B2B9-63ABCCFE9199_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 6 Jun 2025, at 15:57, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3Dded037e65e5239671b1292ec987a2= e0894b217b5 > > commit ded037e65e5239671b1292ec987a2e0894b217b5 > Author: Hareshx Sankar Raj > AuthorDate: 2025-05-07 09:38:21 +0000 > Commit: Mark Johnston > CommitDate: 2025-06-06 13:43:54 +0000 > > qat: driver updates to improve code and fix bugs > > Bug fixes and improvements are done for the qat code base > to improve code quality. > > Reviewed by: markj, ziaee > MFC after: 2 weeks > Sponsored by: Intel Corporation > Differential Revision: https://reviews.freebsd.org/D50379 > --- =E2=80=A6 > diff --git a/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h = > b/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h > index bfc5db1f5e5c..cddfc3f84853 100644 > --- a/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h > +++ b/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h > @@ -1,11 +1,11 @@ > /* SPDX-License-Identifier: BSD-3-Clause */ > -/* Copyright(c) 2007-2022 Intel Corporation */ > +/* Copyright(c) 2007-2025 Intel Corporation */ > #ifndef ADF_C3XXX_HW_DATA_H_ > #define ADF_C3XXX_HW_DATA_H_ > > /* PCIe configuration space */ > -#define ADF_C3XXX_PMISC_BAR 0 > -#define ADF_C3XXX_ETR_BAR 1 > +#define ADF_C3XXX_PMISC_BAR 1 > +#define ADF_C3XXX_ETR_BAR 2 > #define ADF_C3XXX_RX_RINGS_OFFSET 8 > #define ADF_C3XXX_TX_RINGS_MASK 0xFF > #define ADF_C3XXX_MAX_ACCELERATORS 3 We=E2=80=99re seeing panics loading the QAT driver on Atom Processor C300= 0 = (with pfSense). I believe this change is the trigger. This causes us to look for the ETR registers in the third BAR, but there = are only two on that hardware: # pciconf -l -b -vV pci0:1:0:0 none0@pci0:1:0:0: class=3D0x0b4000 rev=3D0x11 hdr=3D0x00 vendor=3D0x8086= = device=3D0x19e2 subvendor=3D0x8086 subdevice=3D0x19e2 vendor =3D 'Intel Corporation' device =3D 'Atom Processor C3000 Series QuickAssist Technology' class =3D processor bar [18] =3D type Memory, range 64, base 0x80700000, size 262144, = enabled bar [20] =3D type Memory, range 64, base 0x80740000, size 262144, = enabled That produces this backtrace: Fatal trap 12: page fault while in kernel mode cpuid =3D 1; apic id =3D 18 fault virtual address =3D 0x10 fault code =3D supervisor read data, page not present instruction pointer =3D 0x20:0xffffffff83c4c25a stack pointer =3D 0x28:0xfffffe00681c26b0 frame pointer =3D 0x28:0xfffffe00681c26b0 code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags =3D interrupt enabled, resume, IOPL =3D 0 current process =3D 3075 (kldload) rdi: 0000000000000000 rsi: 0000000000000000 rdx: 0000000000000000 rcx: 0000000000000000 r8: fffffe00681c2715 r9: 000000000000000a rax: 00000000000001ff rbx: 0000000000000000 rbp: fffffe00681c26b0 r10: 0000000000000000 r11: 0000000000000001 r12: 0000000000000000 r13: fffff80003a1a000 r14: 0000000000000000 r15: 0000000000000008 trap number =3D 12 panic: page fault cpuid =3D 1 time =3D 1753859856 KDB: enter: panic [ thread pid 3075 tid 100160 ] Stopped at kdb_enter+0x33: movq $0,0x1b55532(%rip) db> bt Tracing pid 3075 tid 100160 td 0xfffff80100d4a780 kdb_enter() at kdb_enter+0x33/frame 0xfffffe00681c2530 panic() at panic+0x43/frame 0xfffffe00681c2590 trap_pfault() at trap_pfault+0x3c9/frame 0xfffffe00681c25e0 calltrap() at calltrap+0x8/frame 0xfffffe00681c25e0 --- trap 0xc, rip =3D 0xffffffff83c4c25a, rsp =3D 0xfffffe00681c26b0, rb= p =3D = 0xfffffe00681c26b0 --- write_csr_ring_config() at write_csr_ring_config+0xa/frame = 0xfffffe00681c26b0 adf_init_etr_data() at adf_init_etr_data+0x36a/frame 0xfffffe00681c2840 adf_dev_init() at adf_dev_init+0xc1/frame 0xfffffe00681c28f0 adf_attach() at adf_attach+0x4e1/frame 0xfffffe00681c2950 device_attach() at device_attach+0x43d/frame 0xfffffe00681c29a0 pci_driver_added() at pci_driver_added+0xf2/frame 0xfffffe00681c29e0 devclass_driver_added() at devclass_driver_added+0x29/frame = 0xfffffe00681c2a10 devclass_add_driver() at devclass_add_driver+0x11e/frame = 0xfffffe00681c2a50 module_register_init() at module_register_init+0x85/frame = 0xfffffe00681c2a80 linker_load_module() at linker_load_module+0xc0f/frame = 0xfffffe00681c2d80 kern_kldload() at kern_kldload+0x165/frame 0xfffffe00681c2dd0 sys_kldload() at sys_kldload+0x59/frame 0xfffffe00681c2e00 amd64_syscall() at amd64_syscall+0x126/frame 0xfffffe00681c2f30 fast_syscall_common() at fast_syscall_common+0xf8/frame = 0xfffffe00681c2f30 --More-- Because we=E2=80=99ve tried to use a pci_bars[2] entry with virt_addr =3D= =3D 0 = (because it=E2=80=99s outside of the BARs we set up). Reverting just the above hunk of the patch fixes the panic for us. Best regards, Kristof --=_MailMate_B08AB6DB-7748-4F2A-B2B9-63ABCCFE9199_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 6 Jun 2025, at 15:57, Mark Johnston wrote:

The branch main has been updated by markj:

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

commit ded037e65e5239671b1292ec987a2e0894b217b5
Author: Hareshx Sankar Raj hareshx.sankar.raj@intel.com
AuthorDate: 2025-05-07 09:38:21 +0000
Commit: Mark Johnston markj@Free= BSD.org
CommitDate: 2025-06-06 13:43:54 +0000

qa=
t: driver updates to improve code and fix bugs

Bug fixes and improvements are done for the qat code base
to improve code quality.

Reviewed by:    markj, ziaee
MFC after:      2 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D50379

=E2=80=A6

diff --git a/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_da= ta.h b/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h
index bfc5db1f5e5c..cddfc3f84853 100644
--- a/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h
+++ b/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h
@@ -1,11 +1,11 @@
/* SPDX-License-Identifier: BSD-3-Clause /
-/
Copyright(c) 2007-2022 Intel Corporation /
+/
Copyright(c) 2007-2025 Intel Corporation */
#ifndef ADF_C3XXX_HW_DATA_H_
#define ADF_C3XXX_HW_DATA_H_

/* PCIe configuration space */
-#define ADF_C3XXX_PMISC_BAR 0
-#define ADF_C3XXX_ETR_BAR 1
+#define ADF_C3XXX_PMISC_BAR 1
+#define ADF_C3XXX_ETR_BAR 2
#define ADF_C3XXX_RX_RINGS_OFFSET 8
#define ADF_C3XXX_TX_RINGS_MASK 0xFF
#define ADF_C3XXX_MAX_ACCELERATORS 3

We=E2=80=99re seeing panics loading the QAT driver on Ato= m Processor C3000 (with pfSense).

I believe this change is the trigger.
This causes us to look for the ETR registers in the third BAR, but there = are only two on that hardware:

# =
pciconf -l -b -vV pci0:1:0:0
none0@pci0:1:0:0:	class=3D0x0b4000 rev=3D0x11 hdr=3D0x00 vendor=3D0x8086 =
device=3D0x19e2 subvendor=3D0x8086 subdevice=3D0x19e2
    vendor     =3D 'Intel Corporation'
    device     =3D 'Atom Processor C3000 Series QuickAssist Technology'
    class      =3D processor
    bar   [18] =3D type Memory, range 64, base 0x80700000, size 262144, e=
nabled
    bar   [20] =3D type Memory, range 64, base 0x80740000, size 262144, e=
nabled

That produces this backtrace:

Fa=
tal trap 12: page fault while in kernel mode
cpuid =3D 1; apic id =3D 18
fault virtual address	=3D 0x10
fault code		=3D supervisor read data, page not present
instruction pointer	=3D 0x20:0xffffffff83c4c25a
stack pointer	        =3D 0x28:0xfffffe00681c26b0
frame pointer	        =3D 0x28:0xfffffe00681c26b0
code segment		=3D base 0x0, limit 0xfffff, type 0x1b
			=3D DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags	=3D interrupt enabled, resume, IOPL =3D 0
current process		=3D 3075 (kldload)
rdi: 0000000000000000 rsi: 0000000000000000 rdx: 0000000000000000
rcx: 0000000000000000  r8: fffffe00681c2715  r9: 000000000000000a
rax: 00000000000001ff rbx: 0000000000000000 rbp: fffffe00681c26b0
r10: 0000000000000000 r11: 0000000000000001 r12: 0000000000000000
r13: fffff80003a1a000 r14: 0000000000000000 r15: 0000000000000008
trap number		=3D 12
panic: page fault
cpuid =3D 1
time =3D 1753859856
KDB: enter: panic
[ thread pid 3075 tid 100160 ]
Stopped at      kdb_enter+0x33: movq    $0,0x1b55532(%rip)
db> bt
Tracing pid 3075 tid 100160 td 0xfffff80100d4a780
kdb_enter() at kdb_enter+0x33/frame 0xfffffe00681c2530
panic() at panic+0x43/frame 0xfffffe00681c2590
trap_pfault() at trap_pfault+0x3c9/frame 0xfffffe00681c25e0
calltrap() at calltrap+0x8/frame 0xfffffe00681c25e0
--- trap 0xc, rip =3D 0xffffffff83c4c25a, rsp =3D 0xfffffe00681c26b0, rbp=
 =3D 0xfffffe00681c26b0 ---
write_csr_ring_config() at write_csr_ring_config+0xa/frame 0xfffffe00681c=
26b0
adf_init_etr_data() at adf_init_etr_data+0x36a/frame 0xfffffe00681c2840
adf_dev_init() at adf_dev_init+0xc1/frame 0xfffffe00681c28f0
adf_attach() at adf_attach+0x4e1/frame 0xfffffe00681c2950
device_attach() at device_attach+0x43d/frame 0xfffffe00681c29a0
pci_driver_added() at pci_driver_added+0xf2/frame 0xfffffe00681c29e0
devclass_driver_added() at devclass_driver_added+0x29/frame 0xfffffe00681=
c2a10
devclass_add_driver() at devclass_add_driver+0x11e/frame 0xfffffe00681c2a=
50
module_register_init() at module_register_init+0x85/frame 0xfffffe00681c2=
a80
linker_load_module() at linker_load_module+0xc0f/frame 0xfffffe00681c2d80=

kern_kldload() at kern_kldload+0x165/frame 0xfffffe00681c2dd0
sys_kldload() at sys_kldload+0x59/frame 0xfffffe00681c2e00
amd64_syscall() at amd64_syscall+0x126/frame 0xfffffe00681c2f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe00681c2f3=
0
--More--

Because we=E2=80=99ve tried to use a pci_bars[2] entry wi= th virt_addr =3D=3D 0 (because it=E2=80=99s outside of the BARs we set up= ).

Reverting just the above hunk of the patch fixes the pani= c for us.

Best regards,
Kristof

--=_MailMate_B08AB6DB-7748-4F2A-B2B9-63ABCCFE9199_=-- From nobody Wed Jul 30 14:22:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsZDG07B5z63dd2; Wed, 30 Jul 2025 14:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsZDF6Kfhz3dbl; Wed, 30 Jul 2025 14:22:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753885341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xkkx7aHH+aAX1LGXZceHrkkyzlW+iFPL7+l0jThVWr8=; b=rO+QF4PppXpHLaLN5DZJOmQyXEyToKTpdaP/OYO13QQCXkbRg3H4pt3BF8viFF0Y8XpCrn aB+OvPaiLubVgJficdLHb7u+o7VFRyvXnG53bKinkH7FCSPXSTYBjcDyLnMrtL9LQBjTtr 7PZwpDttYL0HcS0P/XFL4brWRq18tGw9yYhpbaIx/O0PJ6lXxAHeLm9tLd9QmjD8lxCd0p WECXBUivLYOVQHWkL/ayLVLOTEtH4kVfvyGmb79NOgSLLZcybGNb2D2BIMCwctTA00bzoD U7n88DmqFpZNGHU0n3Y4ey7MWaE/rdYkRQyM9CrAQrxO0D2mNrjFCR6Q6aQuWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753885341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xkkx7aHH+aAX1LGXZceHrkkyzlW+iFPL7+l0jThVWr8=; b=ZDTDIQ4KoPiZG9Aqr6PxcQAvUeW4O7LidJ5GmM7Gh762i7xDRw4qiGtcmYfQjV1ZWUYxUI qyoCS8crUNT5V70rqUC18WzvClazXTk5vcbEe4zYvUIvRBrP44o6NhZfiIA+Err+zZqFTB qjiJ+/7x7lsgNGdituPzMh7H+jmZZhRw1qCK+6GHCkbp1siyzwXVfxNTCLoV9OJR6WtV+U 25FDw/qckkQbgkT90bcxUeA4lfoyXwzT33wuNhxqOhxCHy+ZaugS5HlASvRaku4x15miA7 2kadMwrU7UVRb3BSWyKC1Sz16CXT9eW8B0SA/wUxzD3H43Ybk8GSwf8RclYHtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753885341; a=rsa-sha256; cv=none; b=gjrFg7NY18cqUQX1w15O7nJR32UKf03YKsEclezWyJ/7Qg8c0BR9o09s7a1JcpzdF3E090 Gpfi7yqcyURkO/BkpcqlBF9rGYjGZCJA3+2qYz3KPfkANx2UiL1DyiG2euk5ra9b/lIr3U HGH+JiL1DBpgi/bsvK7XDTyCtOZTLYO6LdYZkNrNnGAv8qaw14riDn9DXlvFPkZJNsf/HH N+cxdQDDU8bjw+kUhZJ0GspAawTBKXUHh6NA+LM5t4VCLzPL+9Ptr3W1m4r4q8t0klLTnD +pcI86A1JlugqA0Rudr6SttUrpPw3QZ3GtOnuuwEmRSvgfrG9ILuif5wkKi0OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsZDF5wMvz505; Wed, 30 Jul 2025 14:22:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UEMLMs031515; Wed, 30 Jul 2025 14:22:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UEMLeE031512; Wed, 30 Jul 2025 14:22:21 GMT (envelope-from git) Date: Wed, 30 Jul 2025 14:22:21 GMT Message-Id: <202507301422.56UEMLeE031512@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: 852615204860 - main - ping: Remove unnecessary compiler flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85261520486045a4bf20a9e8d4e9fcc8c0c9fabe Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=85261520486045a4bf20a9e8d4e9fcc8c0c9fabe commit 85261520486045a4bf20a9e8d4e9fcc8c0c9fabe Author: Dag-Erling Smørgrav AuthorDate: 2025-07-30 14:18:57 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-30 14:19:34 +0000 ping: Remove unnecessary compiler flag This reverts commit 55e0aefae688075718e212594e823fe5fbfba4bf. --- sbin/ping/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile index b4e3f115b245..30c68cbaba52 100644 --- a/sbin/ping/Makefile +++ b/sbin/ping/Makefile @@ -32,8 +32,6 @@ CFLAGS+=-DWITH_CASPER CFLAGS+=-DIPSEC LIBADD+= ipsec -CFLAGS+= -Wno-error=unused-but-set-variable - HAS_TESTS= SUBDIR.${MK_TESTS}+= tests From nobody Wed Jul 30 14:30:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsZQR2cPgz63fRv; Wed, 30 Jul 2025 14:31:11 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsZQQ4hcLz3dsY; Wed, 30 Jul 2025 14:31:10 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; none Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 1FB65A64805; Wed, 30 Jul 2025 14:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zabbadoz.net; s=20240622; t=1753885853; bh=fuOXdTig2fgeHq/0+uVbrrvtAlMWa7Ldn+/SP+KG5l0=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=ZbLfZRDhbMthEeSZWSQn4dDbL64V29rkfUS7wBEl3Z22cLRSAZO4TgxyYpS2bA/rA TEWEQSe1D2xxNDDs3XM5jrzNte2CxePODn5DIrE081srJELRrF8gto843M/InLCYAw jDEIp06wOQAY5pGqbhChtNHaqO0UVlCTniOeDQGYsvo6vEIkrniwP/oH/d7ThHO+Xf R9tjQKbI0+p5sZvopfKwkacwoC+7QbZDJlcLOURqkX6fRfKIIetce4fvJS1apVkPdb qu3mGgLYWMdfu/5BHw1rc6cLMqOZQdTXYHzQ787f8YUYhh4Kypje25dP+aPypphPgS kIypNrs7oQLLwJB6/wnwokxKxXdlHnsKoTRKo2vo88Gxl2pmL8VxfcTss6MjJstIiN iFJ9GFIk97zQsDtj0fEKsns6sShZMtGOdn4VQp01LS8x37AOOCMK2E3ZLZwJmnauau Thtiwpx/ROiuCBDPtv9TH8sTP0fx2PcYQkXjTvK01CCAL77Y+niQM36eyD7PyEc8Tu 3Vmi3VqviwNAQnd211MjUtO9WpJ1cPeA3uGuRHn10D1XjiEGy32atyC6PguAlpuoET U2LGrg1BznMFkxjLhAWa/c9FB3sZOnNu58csNKCjly3RBPODxQzaoDSoFPBPMpgsPJ YnYTAh7q47gbqGJVIdn6EMvc= Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E0FDD2D029E1; Wed, 30 Jul 2025 14:30:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id ht_BDd-ezCGn; Wed, 30 Jul 2025 14:30:55 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:a66b:b6ff:fe40:39a9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 301292D029D8; Wed, 30 Jul 2025 14:30:54 +0000 (UTC) Date: Wed, 30 Jul 2025 14:30:54 +0000 (UTC) From: "Bjoern A. Zeeb" To: Mateusz Piotrowski <0mp@FreeBSD.org> cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 0c91fa982437 - stable/14 - dtrace_fbt.4: Document the DTrace fbt provider In-Reply-To: <202507300936.56U9aujh087527@gitrepo.freebsd.org> Message-ID: References: <202507300936.56U9aujh087527@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4bsZQQ4hcLz3dsY X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3320, ipnet:2003::/19, country:DE] On Wed, 30 Jul 2025, Mateusz Piotrowski wrote: > The branch stable/14 has been updated by 0mp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0c91fa982437417e09218ad8c2428aff29d9c5bd > > commit 0c91fa982437417e09218ad8c2428aff29d9c5bd > Author: Mateusz Piotrowski <0mp@FreeBSD.org> > AuthorDate: 2025-06-14 19:26:48 +0000 > Commit: Mateusz Piotrowski <0mp@FreeBSD.org> > CommitDate: 2025-07-30 09:36:44 +0000 > > dtrace_fbt.4: Document the DTrace fbt provider > > Reported by: markj > Reviewed by: christos, markj (earlier version), ziaee > Obtained from: Mark Johnston, DTrace, FreeBSD Journal, May 2014 > Obtained from: https://wiki.freebsd.org/DTrace/One-Liners > MFC after: 2 weeks > Relnotes: yes > > (cherry picked from commit 9388c2887817d7162ebb356b39aa9b4ab67a8c00) > --- > cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 5 + > share/man/man4/Makefile | 1 + > share/man/man4/dtrace_fbt.4 | 332 +++++++++++++++++++++++++++ > share/man/man4/dtrace_kinst.4 | 12 +- > 4 files changed, 346 insertions(+), 4 deletions(-) > > diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > index 1836707d72df..9cb6e9dd276f 100644 > --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > @@ -20,7 +20,11 @@ > .\" > .\" $FreeBSD$ > .\" > +<<<<<<< HEAD > .Dd June 14, 2025 > +======= > +.Dd July 16, 2025 > +>>>>>>> 9388c2887817 (dtrace_fbt.4: Document the DTrace fbt provider) This merge conflict wasn't resolved? > .Dt DTRACE 1 > .Os > .Sh NAME > @@ -1222,6 +1226,7 @@ Invalid command line options or arguments were specified. > .Sh SEE ALSO > .Xr cpp 1 , > .Xr dtrace_audit 4 , > +.Xr dtrace_fbt 4 , > .Xr dtrace_io 4 , > .Xr dtrace_ip 4 , > .Xr dtrace_kinst 4 , > diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > index 48fead7c6287..f5eca038e800 100644 > --- a/share/man/man4/Makefile > +++ b/share/man/man4/Makefile > @@ -940,6 +940,7 @@ _ccd.4= ccd.4 > > .if ${MK_CDDL} != "no" > _dtrace_provs= dtrace_audit.4 \ > + dtrace_fbt.4 \ > dtrace_io.4 \ > dtrace_ip.4 \ > dtrace_kinst.4 \ > diff --git a/share/man/man4/dtrace_fbt.4 b/share/man/man4/dtrace_fbt.4 > new file mode 100644 > index 000000000000..3e35bb8c5bbc > --- /dev/null > +++ b/share/man/man4/dtrace_fbt.4 > @@ -0,0 +1,332 @@ > +.\" > +.\" SPDX-License-Identifier: BSD-2-Clause > +.\" > +.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org> > +.\" > +.Dd July 16, 2025 > +.Dt DTRACE_FBT 4 > +.Os > +.Sh NAME > +.Nm dtrace_fbt > +.Nd a DTrace provider for dynamic kernel tracing based on function boundaries > +.Sh SYNOPSIS > +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry > +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return > +.Sh DESCRIPTION > +The Function Boundary Tracing > +.Pq Nm fbt > +provider instruments the entry and return of almost every kernel function > +corresponding to an > +.Xr elf 5 > +symbol in the kernel and loaded kernel modules. > +.Pp > +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry > +fires whenever the > +.Ar function > +is called. > +.Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return > +fires when the > +.Ar function > +returns. > +.Pp > +The > +.Ar module > +in the probe description is either the name of the loaded kernel module > +or > +.Ql kernel > +for functions compiled into the kernel. > +.Ss Function Boundary Instrumentation > +The > +.Nm fbt > +will always instrument a function's entry, but > +its return will be intsrumented so long as it can find a > +.Ql ret > +instruction. > +.Pp > +In some cases, > +.Nm fbt > +cannot instrument a function's entry and/or return. > +Refer to subsection > +.Sx Frame Pointer > +for more details. > +.Ss Probe Arguments > +The arguments of the entry probe > +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry > +are the arguments of the traced function call. > +.Bl -column -offset indent "Entry Probe Argument" "Definition" > +.It Sy Entry Probe Argument Ta Sy Definition > +.It Fa args[0] Ta Function's first argument, typed > +.Pq e.g., Xr malloc 9 Ap s Ft size_t Fa size > +.It Fa args[1] Ta Function's second argument, typed > +.Pq e.g., Xr malloc 9 Ap s Ft struct malloc_type Fa *type > +.It Fa args[2] Ta Function's third argument, typed > +.Pq e.g., Xr malloc 9 Ap s Ft int Fa flags > +.It Fa ... Ta ... > +.El > +.Pp > +The arguments of the return probe > +.Pq Nm fbt Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return > +are > +.Fa args[0] > +.Po > +the offset of the firing return instruction within the function; > +useful to tell apart two different return statements in a single function > +.Pc > +and > +.Fa args[1] > +.Pq the return value, if any . > +.Bl -column -offset indent "Return Probe Argument" "Definition" > +.It Sy Return Probe Argument Ta Sy Definition > +.It Fa args[0] Ta Offset of the traced return instruction > +.It Fa args[1] Ta Function's return value > +.Po e.g., a kernel virtual address if returning from a successful > +.Xr malloc 9 > +.Pc > +.El > +.Pp > +Subsection > +.Sx Example 2 : Getting Details About Probe's Arguments > +shows how to get probe's argument count and types directly with > +.Xr dtrace 1 > +without having to resort to the reading function's source code > +or documentation. > +.Sh EXAMPLES > +.Ss Example 1 : Listing Available FBT Probes > +The following example shows how to list all the available > +.Nm fbt > +probes. > +.Bd -literal -offset 2n > +# dtrace -l -P fbt > + ID PROVIDER MODULE FUNCTION NAME > +[...] > +31868 fbt kernel hammer_time entry > +31869 fbt kernel hammer_time return > +[...] > +.Ed > +.Pp > +Since > +.Fn hammer_time > +is a part of the kernel and not a separate loaded module, the > +.Ar module > +column displays > +.Ql kernel . > +.Ss Example 2 : Getting Details About Probe's Arguments > +The following example shows how to generate a program stability report of > +.Xr malloc 9 Ap s > +entry and return probes. > +Those reports are useful to view > +the probe's number of arguments and their types. > +.Bd -literal -offset 2n > +# dtrace -l -v -n fbt::malloc:entry > +[...] > + Argument Types > + args[0]: size_t > + args[1]: struct malloc_type * > + args[2]: int > +.Ed > +.Pp > +The count and types of > +.Nm fbt Ns Cm \&::malloc:entry > +arguments > +match the function signature of > +.Xr malloc 9 : > +.Va args[0] > +is > +.Ft size_t , > +.Va args[1] > +is > +.Ft "struct malloc_type *" , > +and > +.Va "args[2]" > +is > +.Ft int . > +.Bd -literal -offset 2n > +# dtrace -l -v -n fbt::malloc:return > +[...] > + Argument Types > + args[0]: int > + args[1]: void * > +.Ed > +.Pp > +The > +.Cm return > +probe reports two arguments and their types: > +the return instruction offset > +.Pq the usual Ft int > +and the function's return value, which in this case is > +.Ft void * , > +as > +.Xr malloc 9 > +returns a kernel virtual address. > +.Ss Example 3 : Counting Kernel Slab Memory Allocation by Function > +.Bd -literal -offset 2n > +# dtrace -n 'fbt::kmem*:entry { @[probefunc] = count(); }' > +dtrace: description 'fbt::kmem*:entry ' matched 47 probes > +^C > + kmem_alloc_contig 1 > + kmem_alloc_contig_domainset 1 > + kmem_cache_reap_active 1 > + kmem_alloc_contig_pages 2 > + kmem_free 2 > + kmem_std_destructor 19 > + kmem_std_constructor 26 > + kmem_cache_free 151 > + kmem_cache_alloc 181 > +.Ed > +.Ss Example 4 : Counting Kernel Slab Memory Allocation by Calling Function > +.Bd -literal -offset 2n > +# dtrace -q -n 'fbt::kmem*:entry { @[caller] = count(); } END { printa("%40a %@16d\en", @); }' > +^C > + kernel`contigmalloc+0x33 1 > + kernel`free+0xd3 1 > + kernel`kmem_alloc_contig+0x29 1 > +kernel`kmem_alloc_contig_domainset+0x19a 1 > + zfs.ko`arc_reap_cb_check+0x16 1 > +.Ed > +.Ss Example 5 : Counting Kernel malloc()'s by Calling Function > +.Bd -literal -offset 2n > +# dtrace -q -n 'fbt::malloc:entry { @[caller] = count(); } END { printa("%45a %@16d\en", @); }' > +^C > + kernel`devclass_get_devices+0xa8 1 > + kernel`sys_ioctl+0xb7 1 > + dtrace.ko`dtrace_ioctl+0x15c1 1 > + dtrace.ko`dtrace_ioctl+0x972 2 > + dtrace.ko`dtrace_dof_create+0x35 2 > + kernel`kern_poll_kfds+0x2f0 4 > + kernel`kern_poll_kfds+0x28a 19 > +.Ed > +.Ss Example 6 : Counting Kernel malloc()'s by Kernel Stack Trace > +.Bd -literal -offset 2n > +# dtrace -q -n 'fbt::malloc:entry { @[stack()] = count(); }' > +^C > + dtrace.ko`dtrace_dof_create+0x35 > + dtrace.ko`dtrace_ioctl+0x827 > + kernel`devfs_ioctl+0xd1 > + kernel`VOP_IOCTL_APV+0x2a > + kernel`vn_ioctl+0xb6 > + kernel`devfs_ioctl_f+0x1e > + kernel`kern_ioctl+0x286 > + kernel`sys_ioctl+0x12f > + kernel`amd64_syscall+0x169 > + kernel`0xffffffff81092b0b > + 2 > +.Ed > +.Ss Example 7 : Summarizing vmem_alloc()'s by Arena Name and Size Distribution > +.Bd -literal -offset 2n > +# dtrace -q -n 'fbt::vmem_alloc:entry { @[args[0]->vm_name] = quantize(arg1); }' > +^C > + > + kernel arena dom > + value ------------- Distribution ------------- count > + 2048 | 0 > + 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4 > + 8192 |@@@@@@@@@@@@@ 2 > + 16384 | 0 > +.Ed > +.Ss Example 8 : Measuring Total Time Spent Executing a Function > +This DTrace script measures the total time spent in > +.Fn vm_page* > +kernel functions. > +The > +.Fn quantize > +aggregation organizes the measurements into power-of-two buckets, > +providing a time distribution in nanoseconds for each function. > +.Bd -literal -offset 2n > +fbt::vm_page*:entry { > + self->start = timestamp; > +} > + > +fbt::vm_page*:return /self->start/ { > + @[probefunc] = quantize(timestamp - self->start); > + self->start = 0; > +} > +.Ed > +.Sh SEE ALSO > +.Xr dtrace 1 , > +.Xr dtrace_kinst 4 , > +.Xr tracing 7 > +.Rs > +.%A Brendan Gregg > +.%A Jim Mauro > +.%B DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD > +.%I Prentice Hall > +.%P pp. 898\(en903 > +.%D 2011 > +.%U https://www.brendangregg.com/dtracebook/ > +.Re > +.Rs > +.%B The illumos Dynamic Tracing Guide > +.%O Chapter fbt Provider > +.%D 2008 > +.%U https://illumos.org/books/dtrace/chp-fbt.html#chp-fbt > +.Re > +.Sh AUTHORS > +This manual page was written by > +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org . > +.Sh CAVEATS > +.Ss Stability and Portability > +.Nm fbt > +probes are by definition tightly coupled to kernel code; if the code underlying > +a script changes, the script may fail to run or may produce incorrect results. > +Scripts written for one version of > +.Fx > +might not work on others, > +and almost certainly will not work on other operating systems. > +.Pp > +Individual > +.Nm fbt > +probes often do not correspond nicely to logical system events. > +For example, consider a DTrace script which prints the destination > +address of every IP packet as the kernel hands them over > +to the network card driver (NIC). > +An > +.Nm fbt Ns -based > +implementation of such a script is a discouragingly difficult task: > +it involves instrumenting at least four different functions in different parts > +of the IPv4 and IPv6 code. > +At the same time, with the > +.Xr dtrace_ip 4 > +provider the script is a simple one-liner: > +.Dl dtrace -n 'ip:::send {printf("%s", args[2]->ip_daddr);}' > +.Pp > +Make sure to review available > +.Xr dtrace 1 > +providers first > +before implementing a custom script with the > +.Nm fbt > +provider. > +If none of the DTrace providers offer the desired probes, > +consider adding new statically-defined tracing probes > +.Pq Xr SDT 9 . > +.Ss Frame Pointer > +Inline functions are not instrumentable by > +.Nm fbt > +as they lack a frame pointer. > +A developer might explicitly disable inlining by adding the > +.Ql __noinline > +attribute to a function definition, > +but of course this requires a recompilation of the kernel. > +Building the kernel with > +.Fl fno-omit-frame-pointer > +is another way of preserving frame pointers. > +Note, that sometimes compilers will omit the frame pointer in leaf functions, > +even when configured with > +.Fl fno-omit-frame-pointer . > +.Pp > +Function returns via a tail call are also not instrumentable by > +.Nm fbt . > +As a result, > +a function might have an entry probe > +and a mix of instrumented and uninstrumentable returns. > +.Pp > +Use > +.Xr dtrace_kinst 4 > +to trace arbitrary instructions inside kernel functions > +and work around some of the > +limitations > +of > +.Nm fbt . > +.Ss Tracing DTrace > +The > +.Nm fbt > +provider cannot attach to functions inside DTrace provider kernel modules. > diff --git a/share/man/man4/dtrace_kinst.4 b/share/man/man4/dtrace_kinst.4 > index 9debbc1bd106..c2187689749b 100644 > --- a/share/man/man4/dtrace_kinst.4 > +++ b/share/man/man4/dtrace_kinst.4 > @@ -22,7 +22,7 @@ > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > .\" SUCH DAMAGE. > .\" > -.Dd February 27, 2023 > +.Dd July 16, 2025 > .Dt DTRACE_KINST 4 > .Os > .Sh NAME > @@ -43,10 +43,13 @@ creates probes on-demand, meaning it searches for and parses the function's > instructions each time > .Xr dtrace 1 > is run, and not at module load time. > -This is in contrast to FBT's load-time parsing, since > +This is in contrast to > +.Xr dtrace_fbt 4 Ap s > +load-time parsing, since > .Nm kinst > can potentially create thousands of probes for just a single function, instead > -of up to two (entry and return) in the case of FBT. > +of up to two (entry and return) in the case of > +.Xr dtrace_fbt 4 . > A result of this is that > .Cm dtrace -l -P kinst > will not match any probes. > @@ -79,7 +82,8 @@ Trace all instructions in > # dtrace -n 'kinst::amd64_syscall:' > .Ed > .Sh SEE ALSO > -.Xr dtrace 1 > +.Xr dtrace 1 , > +.Xr dtrace_fbt 4 > .Sh HISTORY > The > .Nm kinst > -- Bjoern A. Zeeb r15:7 From nobody Wed Jul 30 15:31:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsblp4QDBz63hkK; Wed, 30 Jul 2025 15:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsblp2rVTz3kfR; Wed, 30 Jul 2025 15:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753889478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNHEe0x6oFaw2YOCE57iYVR+acp0H3qPmb0XohFGJOk=; b=KJdCwpI8r5tZ97ixI7Tniioi9UXanzlKEDWOPzdZz23GuUim63iPLFERSt/mPP06odp5hb memLVqm0WGcjt/Cd3o6MwsKk5u1NY0MgzPg4PlHbRnkuGLuyE0gnWbuNoMBOVkyjmY5Sz/ 2T2RrjHFM+usLlhhYIbYZQ1zsX6fOMZlxUlAydIwuYHyARojwzWDICCxWprEIxXmEa5xId L187bUhQdN/gBhrf4L5xHtn5GT5tVvZn14j80BrSOlsXvQGVooraq4vMVI50v4SGvIECND fdiOoDJ4nEl9fEc6zho/MsQ9PhzjR1k4LhbOSxJN1U+HyKLlIgtfK+ORwmb+Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753889478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NNHEe0x6oFaw2YOCE57iYVR+acp0H3qPmb0XohFGJOk=; b=pc5RKz4+TEm8ZpocIMU4QN29RKpS/5lMwMsrlO9Vu8JSFNvgFALFh4SyCjGjhq7WfZff97 3uwQ7eRPF90+IbbLRu8VP11a2nZlkjPs+LzcyEX3EkIShEzhPJUPbU7qHdBIqiR9nkIJUk fiR12B8Mk89OwAdoYPhyT5O9D7jKGUksp4DcggbRIrwO7PnLreCJAZnwZlSHil6EdeI0LW YflveMGQ4nK3Lhsc6IQIAHqHmCsi9TSYC8EYEvaQ3FWJuf60CWmN64MeE2m92z/1x335kd 83pLdc3gKQwkpfft0+9gVdu6kpOChs8eiaSxXjlndigwvbQ6M/hId3GmF4w7sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753889478; a=rsa-sha256; cv=none; b=AV2PmWM9ABdP6iYrafcba7YaaNaPwurwYvjWIi+SjuT5xkXxQTTu6dm+4TwAz4haPZYgTv 74mQpE5Nb66WenukPfkbQP95AHe4dyJNQ5gA7upLqA+qc7rALK9OAlYQxS2D87IfbRCiPt YLLaLGZ89rSUk/LMErBqm3ucNEUypuxRH28Sd0QFevlGcV1rGEXynDDmPD4NCAo/iqPxGy sugSjio1DJFnvorqZKlktxHWgPjNs2zM2jFQ+q1uHYKFEEjPYPLMPHDlsuRXw+s+OmLp4E Yt+9RihcvXxWHTZDf2eyun8cbQ2AfByyxzmHIBrG26LrD9tLDRIUD61GqfSUbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsblp2CBkz6q6; Wed, 30 Jul 2025 15:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UFVImc058455; Wed, 30 Jul 2025 15:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UFVIGE058452; Wed, 30 Jul 2025 15:31:18 GMT (envelope-from git) Date: Wed, 30 Jul 2025 15:31:18 GMT Message-Id: <202507301531.56UFVIGE058452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: 0d9aa2a441db - main - recoverdisk(1): Change time variables to time_t to compile on i386 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d9aa2a441db26c590bcdda67dd0f2470f2aa2e7 Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=0d9aa2a441db26c590bcdda67dd0f2470f2aa2e7 commit 0d9aa2a441db26c590bcdda67dd0f2470f2aa2e7 Author: Poul-Henning Kamp AuthorDate: 2025-07-30 15:28:02 +0000 Commit: Poul-Henning Kamp CommitDate: 2025-07-30 15:28:02 +0000 recoverdisk(1): Change time variables to time_t to compile on i386 Reported by: fluffy PR: 288550 --- sbin/recoverdisk/recoverdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/recoverdisk/recoverdisk.c b/sbin/recoverdisk/recoverdisk.c index e1b283e54a93..f13a1f211863 100644 --- a/sbin/recoverdisk/recoverdisk.c +++ b/sbin/recoverdisk/recoverdisk.c @@ -715,7 +715,7 @@ main(int argc, char * const argv[]) int64_t sz; int error; time_t t_now, t_report, t_save; - unsigned snapshot = 60, unsaved; + time_t snapshot = 60, unsaved; setbuf(stdout, NULL); setbuf(stderr, NULL); From nobody Wed Jul 30 17:36:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsfXl54Xxz62pMp; Wed, 30 Jul 2025 17:36:55 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsfXk3zl0z3v4Z; Wed, 30 Jul 2025 17:36:54 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=clkRI+Pa; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::52c as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-60bfcada295so9729a12.1; Wed, 30 Jul 2025 10:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753897008; x=1754501808; 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=1O9V2ZXJpiDvLtiYOkcHyp2VpS6nH9DIQK3XDv+pveM=; b=clkRI+PaGKgrXvT6qGrNQr3To5xnBC0C8XsP1Xo8KyliC2QMdmyeSwXjQ7trYiz2pS 59SDmziD3Ulh5thd94heKCDXvJkwpejNLe6fCc6LOKa9Ga02pgiRg/5/D8jU2e3EwAKU QS115XxBwLJ9/3Wd6QwKjF01mxKvI51alvYttY0IiNi63G0QXl+Wu0hXO23AETkCnTsf yvq7ItS3y4BUHlN3lBgp+6iN/172aeE2owBMsxE89HJsT5ndxQsdR3MnKjUkznvRj/jZ 7VBAHWZsxV2EAaaDVj8JcblXnkgz9RPqgMENrfCFHHlQmIdQtBbLaNWubzw45hF6XFJY GT+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753897008; x=1754501808; 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=1O9V2ZXJpiDvLtiYOkcHyp2VpS6nH9DIQK3XDv+pveM=; b=bJBh6k7a9O2rFPuqzYRHMiu+tB20kVkONCGLSedYyXNHdubo6Yai5ZA7I+G6FwnaPm /DFmU/IlmtLuZx1NOZKlQzrjn0zVorVcM18Oww9X2duD1O6MH3TxKlqJY2K9hE+YuZox s/+xpSbYz6VLfZkxe23ShzSDUo4ujwT/tVVstBsi81JHOEJeAv9UL3L3Wbl6dxeX5Mbc XYDQ4QoNKU9k5USuoWTCCZECRXEH1QPW+tqeN+hlgIMvXroe0/JhbZOR4NAKZyQMHoeQ FxhbbGaljlAYaOkwWsPLSVg3uQo0m8jlNacClUYXZNaBB5CAbisq8OX+6g06PL/AeBb4 Sagw== X-Forwarded-Encrypted: i=1; AJvYcCVI8gxafWUvqcffMy3QtD0mGCX8Ez2bh5cgyZoMgGK+nL76dc05Yqac7WIGRoJ2OZOrxGyVbThhb25wyMTXUlVOThOF1cY=@freebsd.org, AJvYcCVPe9CKM48cTng5L40xGD7BdwDqtTzpTONo3thk6QY1iVTgLntNSiSo5OywCZoHNJ1lMgPUA3cnu9Fm9cadoEU=@freebsd.org, AJvYcCVgziFnBMwSQy/nXV8yNPvWUf9ElqSxHGXT4GXVFJS/wh6xUaF20cntOgmRJ6dF/WftCQ==@freebsd.org, AJvYcCVmlq3rcoKcu1mI7unBjd6mrgd7KDUneE0REUKHCNHkiR7xLN0xO8OhlEFyQqv4qRkxwEfxiilX@freebsd.org, AJvYcCWiq62s6ZGKNycP4hEr7XeLX8bvjZ0RAk96kg+acqI25K/FCC6nZwEf9NfH6UQZffhRFfvCza+CtEYsb0Vu1xljhg2Mgg==@freebsd.org X-Gm-Message-State: AOJu0YwxPFCYKkHWW4z/3aYDIPBBev7LXGEfYyDfQTIAOebDDRyROJK/ PyWqP9DXPxgpEIMYYjyFK3GtmwA6EMQEulGUBmX4CwETsH6vjsIDddyItstDrACHP6nvJ64IAN7 D58M5Fcm0BImwxKg+WhEUvBcmOLc8lA== X-Gm-Gg: ASbGncvWpbkA1cH20Q5Kcp6O6vgZIlAwBN4Uq64ufilnhiW4VlTcLbAMtPrX1EJ/+gQ tRXU9Cx3Ut+sSd91FWUpj7U5px6Ojqf4Ls7OlSTYlyWgsPlcRn5b7OOlkdG59JBT4RR4GfheYg4 bxbHRhXfSy5it1swa85kT5gaUJW0ueFlMxXWNVE2fiVTBHsgI/RCIsdMVNc+L53UvYTJHAnZdS2 6/TT8s4uwp/JtwREiaoBkElnp3EXnxfUoIfvQ== X-Google-Smtp-Source: AGHT+IGCTcVcxROpJotGsjlK81aeBx7mTsZE5U7WaX2WTTIF+JO+u2tdJZC/i7A4Jm+H21uPZrBui48mP+bR0OfBO50= X-Received: by 2002:a05:6402:308d:b0:608:f493:871c with SMTP id 4fb4d7f45d1cf-61586f12252mr3466408a12.14.1753897007849; Wed, 30 Jul 2025 10:36:47 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Wed, 30 Jul 2025 10:36:36 -0700 X-Gm-Features: Ac12FXxtmqDl-TyfirfyXO0tbBQWAynfayVPtp-duqGPAWupDJNDVxVru28pJSk Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Benjamin Kaduk Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "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-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TAGGED_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_SEVEN(0.00)[8]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52c:from] X-Rspamd-Queue-Id: 4bsfXk3zl0z3v4Z X-Spamd-Bar: --- On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk = wrote: > > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk wrote: >> >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context() API = that does a lot of the work of getting useful bits out of an established GS= S security context. >> > > > > > And a bit more context on what is going on here and why kgssapi has to ca= re: > The GSS-API (RFC 2743) is all about a way to "establish a security contex= t" (i.e., do crypto negotiation, authentication, sometimes authorization, e= tc.) between two entities, the initiator and the acceprot, and then exchang= ing protected messages between the two (which can be either encrypted or ju= st integrity protection tags for otherweise cleartext data); later extensio= ns included the ability to produce identical PRF output on both parties, et= c.. The details are "mechanism-specific", and for this purpose we're exclu= sively talking about the krb5 mechanism. The steps to establish the securi= ty context are complicated and sometimes fiddly, and in the general case ca= n require a large number of round-trips between the initiator and acceptor = before the security context is established. The individual message-protect= ion parts are comparatively simple and amendable to implementation in the k= ernel for processing efficiency. > RFC 2743 also defines functions for GSS_Export_sec_context() and GSS_Impo= rt_sec_context(), that are designed essentially to pass information about a= n established security context from one process to another on the same mach= ine (which are presumably using the same implementation and version of the = implementation), so the contents of the exported blob are opaque and implem= entation-specific. We are abusing that mechanism to export information abo= ut the security context that gssd has established and feed that information= into the kernel implementation of the per-message processing routines. At= present, this necessarily entails knowing the details of the implementatio= n-specific opaque blob that is the "export sec context token", which is wha= t the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get the in= formation we want without breaking the abstraction barrier, such as via the= gss_krb5_export_lucid_sec_context() API, we are in a more robust posture o= verall and somewhat future-proofed against future evolution by MIT krb5. > (I note that recent Heimdal versions seem to also expose a gss_krb5_expor= t_lucid_sec_context() API, so part of the problem is just that the Heimdal = in base is so old.) Well, here's some "not so good" news... I've been trying to use gss_inquire_sec_context_by_oid(..) with the oid for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. It kept failing. The problem seems to be that "gctx->proto =3D=3D 4" in make_external_lucid_= ctx_v1() function. This function only knows about the 0 and 1 setting for gctx->prot= o. Any ideas, rick > > -Ben From nobody Wed Jul 30 18:06:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsgCK5yBDz62rw9; Wed, 30 Jul 2025 18:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsgCK26Tfz42pp; Wed, 30 Jul 2025 18:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753898813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7anN9R+8o36+BmtUu2yBhQeUrZ6ftmGICkqw/UOWsjg=; b=Xd6WXskN5G7cNQJV8VdXHYep77YFl0UTig/fd1Qz/wbyO06sKZerOfZlZF9dC7hwSpPMZd /gddHA64qyx//l6Z5YAv5VSrJ3pTCAZTd1Z2RAJJw22jpKpT9/mhVJRlpu3Y5EstgRqqIk 7/j/EOUyVu5AHMtM1v9pxwWqfl0KB5IV2hp9W+nvZsbZqFn/PfMJ6HnULWPUF+QVM3Cyhj PGQvSRvQOE3ByM+Un4W9hPGbkKmlS6tbOL+N6JJB6MSkgesnbLdL6q37sYLuk/azDgCR3y 8VD7P7ndmW60JHdiLMzGjQcT2vYyRmE9IirFwKLUrxyasCcuAOqPKPHjRpEf+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753898813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7anN9R+8o36+BmtUu2yBhQeUrZ6ftmGICkqw/UOWsjg=; b=ZcAF9aarCGFlV74MatKEZdzEZrSEIV0mBKzefUbn/a7X4iJeJneEdiyMvoCetQYaIyXWJ+ dyOOYVb1jRmRMIowXFwKF4ji9pAype8ZV7CW6m3lVaBx5u3wvGSPprspGrLRVsZjv1fDJZ kWnTWY8uNvrcwMX99kzWWWgdOtnLzs9xF6GNexPjP+kWy4Vu89yeeeg9UB7eVkG0qCt0rG rc2p10/PqfiDaFJBQT+eCEYvCeicBj3lU/i8GDt8aGGyRg3Q4/Vstyn8o7eykLemp+clWL QOQ+/7uUgZ8D4MsoG4OHy/BFBbv0biMkSI1LwYY1/vD74rqV1LMs3euJQySTJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753898813; a=rsa-sha256; cv=none; b=xc4K/olIMipA3Wm6QUVqJ2PrQzxt66ZfSE7oe57sCkSQNEREMvwg3+GD9311RG5vS5XDxx bne4ctMgLBSD1QUC1N9DQiRI91orumBb36OGhW+mqiqfblpqFLligOP5WqOyJDthiMLx+Z xx0SG/bPeiZ4eILORn7hhmj8MOSGMiP+/3Bw5OspP1/C/C/wFr4BW9EPzqZHgzYPCTXXLd w7XmxdIGBav2DDU7MgUzlQd7OsYx0a+EceTPXlrC4unL0relA/aFkVILNF40UQYQ9bdKu+ hdyBuJF6ZE3FTt1chAAexRmLYQGKtN13vQAHTjIOFadqmmCzDuTDygHKoyB6HA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsgCJ6C3KzBRs; Wed, 30 Jul 2025 18:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UI6qCH046914; Wed, 30 Jul 2025 18:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UI6q2G046911; Wed, 30 Jul 2025 18:06:52 GMT (envelope-from git) Date: Wed, 30 Jul 2025 18:06:52 GMT Message-Id: <202507301806.56UI6q2G046911@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: 185bd9cf2199 - stable/14 - dtrace.1: Resolve merge conflict List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 185bd9cf219999a38093e853bfda8ed1ca21fc5b Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=185bd9cf219999a38093e853bfda8ed1ca21fc5b commit 185bd9cf219999a38093e853bfda8ed1ca21fc5b Author: Ed Maste AuthorDate: 2025-07-30 18:05:29 +0000 Commit: Ed Maste CommitDate: 2025-07-30 18:06:38 +0000 dtrace.1: Resolve merge conflict PR: 288556 Fixes: 0c91fa982437 ("dtrace_fbt.4: Document the DTrace fbt provider") --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 9cb6e9dd276f..0603a32da5e2 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,11 +20,7 @@ .\" .\" $FreeBSD$ .\" -<<<<<<< HEAD -.Dd June 14, 2025 -======= .Dd July 16, 2025 ->>>>>>> 9388c2887817 (dtrace_fbt.4: Document the DTrace fbt provider) .Dt DTRACE 1 .Os .Sh NAME From nobody Wed Jul 30 18:32:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsgmP1939z62tWF; Wed, 30 Jul 2025 18:32:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsgmN2TZpz3CjH; Wed, 30 Jul 2025 18:32:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753900324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QAlGPu2SaEl9G0IA24RuKQQu/MN2y3FWfs7kEBxHKTI=; b=n9rVik51nXB3rM9fi0L+rv92M+7GFpfaWWnKiZhWwcL+tWxn2exnBj+/q2UplWbC4KGSUF apcpNiSnE3KwSYC1S5T4uzfOzm+jjn5dk8er6jLdxqfTkPtz7trboXk7gD8eE2TO9X6tea 1SzstpcA+fJIFpWKokKYKM0K5Z+3Qy+VxMfGy/APEyLYfThY+aP68fAFMPd9Fbp5fgjy1Y vSX+D58thTDyiEtHJNf1qgM2c3ySbol5HZ694eTf1w1iRD00B0uIRdoLNOqKYeeYchQlWL jwhCrr9fkbnVOK/YEZSOe+ArD+DbzJqPlvUW1Ch2YXnmDQvi6XpMfs7so0eFzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753900324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QAlGPu2SaEl9G0IA24RuKQQu/MN2y3FWfs7kEBxHKTI=; b=V9ZcTsuYWPtYEWg10oQ1yhZxZSMKfrcJqiRNgwRqHHGh9tftwN1W78r3QnqpUcAT3HR05L w2H9DcfiofZYNYn8Q5vWeG5LYdnqvL1NgCInjA+EGHnwF3DJ+ld+ltCYkW4vK+fxv1ZYQU LxfkappEzBHZ4gkAMQAj5rE+YdPk0Q2AyKEnwjFon6LhwZ4Pp6ZMUlMywzcddj+i+cqYla c3w9Un84aOf/BjlIhyYBJnGcU0/lBAl2I4Yc1cvGK2iv04c8kGXSl6Pziztbc1d8njLBJH rC59nqPt637QebaZKD0qLDBqxYVrWsdkRpPTIrPglrg8jgsnaYk39JzfGFNeiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753900324; a=rsa-sha256; cv=none; b=m9DZ69/7ShXPLmudlf0bN4KKzib7np2GmBabXQvQqOBH4/fe95ZFsiLDH7vybXS2h9B/OP dyj28XsxXkm8wcFDDvyfvo8/0comhIpgQotn9/oE7sseY4WHB0ZZAKlT8HO/tKon9HxIiE hIx8AnAQwLZDyc7RqNHZsG8/uMmCZQzHLaN3luJzCFV7LBpHqCIDwwY6ylK6zzqztR44wr +8q1shpicnFGncjbws/42n5zxqTdML7ZO/8KLGk4eiZFC+w1a8CYFyaIVZOC250bJEvD7l vLhN3It1sQKJ6YAgkIrn/RIlua8pwCD93+zwenWOfdZ8ltHkCFPKpGzWeNFwhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsgmN1tq3zBx9; Wed, 30 Jul 2025 18:32:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UIW4D3001812; Wed, 30 Jul 2025 18:32:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UIW42x001809; Wed, 30 Jul 2025 18:32:04 GMT (envelope-from git) Date: Wed, 30 Jul 2025 18:32:04 GMT Message-Id: <202507301832.56UIW42x001809@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: 74072e9f16c1 - main - usbhid: Enable by 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 74072e9f16c17c5f1eaf3bc1df4b166a8b2c292c Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=74072e9f16c17c5f1eaf3bc1df4b166a8b2c292c commit 74072e9f16c17c5f1eaf3bc1df4b166a8b2c292c Author: Ed Maste AuthorDate: 2025-05-20 15:27:26 +0000 Commit: Ed Maste CommitDate: 2025-07-30 18:31:54 +0000 usbhid: Enable by default Co-authored-by: Emmanuel Vadot Reviewed by: bapt, wulf Relnotes: Yes Sponsored by: Beckhoff Automation GmbH & Co. KG Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45659 --- UPDATING | 10 ++++++++++ share/man/man4/usbhid.4 | 4 ++-- sys/dev/usb/input/usbhid.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/UPDATING b/UPDATING index 5fb9574dfb0f..541bdf7ee7c7 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250730: + The usbhid(4) USB HID driver is now enabled by default, and will be + used in preference to other USB HID drivers like ukbd(4), ums(4), and + uhid(4). Work on a FIDO/U2F driver and moused(8) is in progress. + The default is being switched now so that we can find and fix any + additional issues prior to FreeBSD 15.0. + + To revert to the previous USB HID driver behavior, set the loader + tunable hw.usb.usbhid_enable=0. + 20250727: bmake (i.e., /usr/bin/make and /usr/share/mk) has moved to a new package, FreeBSD-bmake. If you use pkgbase and you need make, you diff --git a/share/man/man4/usbhid.4 b/share/man/man4/usbhid.4 index 5109bbe72de6..e5ba370cd025 100644 --- a/share/man/man4/usbhid.4 +++ b/share/man/man4/usbhid.4 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 12, 2021 +.Dd July 30, 2025 .Dt USBHID 4 .Os .Sh NAME @@ -60,7 +60,7 @@ and make its priority greater than other USB HID drivers, such as .Xr ums 4 , and .Xr uhid 4 . -Default is 0. +Default is 1. .El .Bl -tag -width indent .It Va hw.usb.usbhid.debug diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index 3bb7d5e594e3..df810012b3f8 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -76,7 +76,7 @@ #include "hid_if.h" static SYSCTL_NODE(_hw_usb, OID_AUTO, usbhid, CTLFLAG_RW, 0, "USB usbhid"); -static int usbhid_enable = 0; +static int usbhid_enable = 1; SYSCTL_INT(_hw_usb_usbhid, OID_AUTO, enable, CTLFLAG_RWTUN, &usbhid_enable, 0, "Enable usbhid and prefer it to other USB HID drivers"); #ifdef USB_DEBUG From nobody Wed Jul 30 18:39:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsgwd0rV1z62tX0; Wed, 30 Jul 2025 18:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsgwd00YTz3DQM; Wed, 30 Jul 2025 18:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753900753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NfTgaIrdmMTb6Zem789cQtE9zBezRA32ZF8Q4rLveTE=; b=YCuYLwLAYFioPEnx7AVxLdbOLcePLpHMeRk8OPtIX/uVL30V6jxE/BJRnJVInXuFN/XOSA stZKzezmWXf8HIrYsRjwRMj2elDwKG4ImHTpcq4V6m++Ug+/E38fjjuIcBhOJTuaJIpZKF PnnDzm0+Y131erkXAKV8aHyUbwA0lD0HwfnB3F97la2MSLmuh7R8Zkos6Ls3nAD3WqVk6V TksF8DIihyZlZXByrD/bLDFzZbsSpItrLDykYOYJngl6eUTmppmc5yswKEyFWulH0Fp2In uNs/veFmK1FMjoHyo1QyGFJPSCmx+QdUSA06m0MADuL1X+JZTembVJbmweaPog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753900753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NfTgaIrdmMTb6Zem789cQtE9zBezRA32ZF8Q4rLveTE=; b=vkGfacGTF5wP0Aadhm9gLj2nY2KYxg0wvXgsxpiyVuvYJ/kldc+5RtrPqWDvTR1+32qJOC 5sWpzKmj+Is3/3hA2DkG9j2aLXUykVXe0vcpi+BhUmP+9iPfR0jcLxqpL8FnHxj6ovKznV 6IRLCeX/vUf8w6EHiADHRIQGqmKywwuJBPEvhfnlXUn3ffD1LL1X8I2yaA0V0CbL93IPrB tw2fJIFyfQP1sAQlFaUkhwHcHPYqM495PGncXOTY4zdVpO15d24RZVdF5aNbHEupwQqyTd BVQVqAkuziHmaBQW/bCAm9/6yqM2D9ccufqi57AxfN/VzEXZ5lj7y/ltI12WOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753900753; a=rsa-sha256; cv=none; b=b9cpXSvDfXmAsAtXHTf0NKhqf2tOpLpWmoXnlff/7NITaOS3QT38wQQZ7qZuHGL3KjzpOd iU+PCi/FZjy4XH2JGFl6UdiIvSbYWWc/KY14/ZrlE5rU1XiDGwJoaSDd/o92kJ60FySflZ cqy60KUl6jmP+Xt+YEi7nv2msZZjDP6uePfe8jAyqD1EagnviWccGmgq27mlCph1mEoeh0 0aVt+l1zMFcW1QK38/Lo8UfDFqVfYg0u1y5l0Cr+K+6KH1xfr5yOxIgr5mSK8gjuGUYkS2 RBXMTMGrMDSSFUcwu2TQHchRbsrP27RYWcFkfIXoRwW73Yhg9KtgSrtsVVRWRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsgwc6VrczCXp; Wed, 30 Jul 2025 18:39:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UIdCGP004355; Wed, 30 Jul 2025 18:39:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UIdChV004352; Wed, 30 Jul 2025 18:39:12 GMT (envelope-from git) Date: Wed, 30 Jul 2025 18:39:12 GMT Message-Id: <202507301839.56UIdChV004352@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: 525795cde28b - stable/14 - bsdinstall: Emit a warning if the system has too little 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 525795cde28bbbc0aba3e5f359dfc877b9f248d1 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=525795cde28bbbc0aba3e5f359dfc877b9f248d1 commit 525795cde28bbbc0aba3e5f359dfc877b9f248d1 Author: Ed Maste AuthorDate: 2025-06-19 19:48:14 +0000 Commit: Ed Maste CommitDate: 2025-07-30 18:06:38 +0000 bsdinstall: Emit a warning if the system has too little memory PR: 251993 Reviewed by: adrian Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50944 (cherry picked from commit eb5884c564ae0e37df1d8a3fc5704ab6b2fa07d0) --- usr.sbin/bsdinstall/scripts/auto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index ab0191feea17..5375b73e57d4 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -178,6 +178,14 @@ environment_save rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC +# With pkgbase, pkg OOM has been observed with QEMU-default 128 MiB memory size. +# Ensure we have at least about 256 MiB (with an allowance for rounding etc.). +physmem=$(($(sysctl -n hw.physmem) / 1048576)) +if [ $physmem -lt 200 ]; then + bsddialog --backtitle "$OSNAME Installer" --title "Warning" \ + --msgbox "Insufficient physical memory (${physmem} MiB) detected. At least 256 MiB is recommended. The installer or installed system may not function correctly." 0 0 +fi + [ -f /usr/libexec/bsdinstall/local.pre-everything ] && f_dprintf "Running local.pre-everything" && sh /usr/libexec/bsdinstall/local.pre-everything "$BSDINSTALL_CHROOT" trap true SIGINT # This section is optional From nobody Wed Jul 30 18:47:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsh6h23xyz62tyX; Wed, 30 Jul 2025 18:47:56 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsh6g5W6jz3FSl; Wed, 30 Jul 2025 18:47:55 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3e3f6ae4d08so293035ab.1; Wed, 30 Jul 2025 11:47:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753901275; x=1754506075; 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=rJWMg91mZv2nRfRHG+ZNoX8Yhk56BVxlRkVdjF4TcCQ=; b=q9iu9Mvu60bVWSOd8uSR+m+sxn/0thiBUPI842xtoAt8HhugfeQCXtGVqRxS3w0or0 UBtzLb5flcxr0vu9K0wzxoAbOhNDc1a8I4fcjWdk1uf1TJgfn7xxK1ySWeuO7XAIXP4n q17qjbMSaHJAYQK2Unu5BcAm2ue8Q4vebg5zj7oU1FgXJbla66uXwbFn8JTA7kxxAF3c sp8szU0eXVp3QkM5J0r0O3S4VHbET1BAQHs786MAk2qEGQOUHM5GIl5D+O2B8lGw2I4N dFHM0mK5xcVH5RcZ6Sw1p7n63zQtgXAsHifqaxVvzz8LInyEHpxrTBGKwF5JfzgkM/9x yiUA== X-Forwarded-Encrypted: i=1; AJvYcCWXD4cW4onQSl0awIew912QiWvhoq8Zq3uR5To6s6aVEcmMmSmGsyzTukr42EMlSlYPB0EQtLGXOdrOLUBB71vEGUlC@freebsd.org, AJvYcCWaVunFJm89+SlkJsuHHe1bDs3arJvisg1wjzm+pjwU28WgYYe/Ca45v4VgN1d9g/VhSAJPDcKAjqEnwo6xJ34=@freebsd.org, AJvYcCX6nL84wFTLis1YVeJL8zw0RovFTj4L2nXAnwHpr93ZT6QgnaZiw4V323C7j6i8NdPIEmj/IyjxNxj7/nbHQIIcONw7dQgdtEhI@freebsd.org X-Gm-Message-State: AOJu0Yz2WA0n8WKc/pOI0p7Ziw3XlPuyPvqtuxpNf3hz889V1pRRftMq QiTAFnlRTC7o7dJNkaMzS4X7FtfzlkMov63NZUwXUYhI4a+5FwUqCSbOVNcxK92/HKVZqM/LIdY 0A4g7WuI3b4P8cmIPUxI+XOrN97m5Xrw93vou X-Gm-Gg: ASbGncs30VNXwmXpOTg8VY62FME4X1NySjtt4ZbteWppGyfgjp4N+SWONAI4b8IrO81 ry8C1UqYEkew5I7mY5HNtArc8BwvVP9zrKx8tGNn/xh8kZoem0RALT0mSRiB8aKyVyjfMSiEPrP LbsdrN8Xar6Tw5b/LYQ/OfDVW+XSnZjVaYrbI355iPByU3bBON2/mSHFyajmY3QMjrC5wRGmVXh Lc+USo= X-Google-Smtp-Source: AGHT+IHQpxAVUD4u6ECRLJJOQQif+OBRprL1Mz+rFPQGdKBkotx5SUoihug9eT0FJ1ftEDmhqoZKyYDxDT5hh+aWYgY= X-Received: by 2002:a05:6e02:4506:10b0:3e3:b35a:e8ff with SMTP id e9e14a558f8ab-3e3e930b406mr86164035ab.6.1753901274462; Wed, 30 Jul 2025 11:47:54 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507300936.56U9aujh087527@gitrepo.freebsd.org> In-Reply-To: From: Ed Maste Date: Wed, 30 Jul 2025 14:47:43 -0400 X-Gm-Features: Ac12FXwAz1DZWT0ePWPnrPhDmDSIHCeUyPD8tkiaaiI0CvXjZKn4VxzKL9JTe5k Message-ID: Subject: Re: git: 0c91fa982437 - stable/14 - dtrace_fbt.4: Document the DTrace fbt provider To: "Bjoern A. Zeeb" Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4bsh6g5W6jz3FSl X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Wed, 30 Jul 2025 at 10:31, Bjoern A. Zeeb wrote: > > On Wed, 30 Jul 2025, Mateusz Piotrowski wrote: > > > The branch stable/14 has been updated by 0mp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=0c91fa982437417e09218ad8c2428aff29d9c5bd > > > > commit 0c91fa982437417e09218ad8c2428aff29d9c5bd > > Author: Mateusz Piotrowski <0mp@FreeBSD.org> > > AuthorDate: 2025-06-14 19:26:48 +0000 > > Commit: Mateusz Piotrowski <0mp@FreeBSD.org> > > CommitDate: 2025-07-30 09:36:44 +0000 > > > > dtrace_fbt.4: Document the DTrace fbt provider > > > > Reported by: markj > > Reviewed by: christos, markj (earlier version), ziaee > > Obtained from: Mark Johnston, DTrace, FreeBSD Journal, May 2014 > > Obtained from: https://wiki.freebsd.org/DTrace/One-Liners > > MFC after: 2 weeks > > Relnotes: yes > > > > (cherry picked from commit 9388c2887817d7162ebb356b39aa9b4ab67a8c00) > > --- > > cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 5 + > > share/man/man4/Makefile | 1 + > > share/man/man4/dtrace_fbt.4 | 332 +++++++++++++++++++++++++++ > > share/man/man4/dtrace_kinst.4 | 12 +- > > 4 files changed, 346 insertions(+), 4 deletions(-) > > > > diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > > index 1836707d72df..9cb6e9dd276f 100644 > > --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > > +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > > @@ -20,7 +20,11 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > +<<<<<<< HEAD > > .Dd June 14, 2025 > > +======= > > +.Dd July 16, 2025 > > +>>>>>>> 9388c2887817 (dtrace_fbt.4: Document the DTrace fbt provider) > > > This merge conflict wasn't resolved? Someone submitted a PR for it and I've fixed it now. From nobody Wed Jul 30 20:21:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bskBs3F9dz630DN; Wed, 30 Jul 2025 20:21:41 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bskBs1rrbz3S4h; Wed, 30 Jul 2025 20:21:41 +0000 (UTC) (envelope-from rpokala@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753906901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hnHx4hswra/VtlqfbF6JEeep9tjwLVY8IN8eibjCbtk=; b=LqshndovbByo1drpbNskWO0N7fYb1l4/f9ptMUVoeQUhgw2NeDntjD2XDx0qJyHryxBQjY nfHFLrGBaFb2U2x14qB4mLPjf6yuik/C+mcL1eaOhJvb54jtSL4VtNcV7oq0K+IBcUH3mt 7Pn94VoO6petMaMkk+YlnQ9x+ZOg5pM/kBGSkzKzGPuFoRcUcDR27NnwoIDWhnCpfqxa/S IxSerO8cEMfYr7mvky/K8vjsnDPc9fScXbr7BbLIbXLtTEnekexuyydhOMwi97JFd8/gt7 6dy9hImM0jJMHQsLJi9O5SA5+w/a5jUUwsL1tR/E+1ARPippe5jMDuyFJg5M5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753906901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hnHx4hswra/VtlqfbF6JEeep9tjwLVY8IN8eibjCbtk=; b=N2drSir/OVliaUeAoqd54bYJOorOMCXME+Cx/7q0PPJlCqNkXue+Dlzrh4xbfXze8IC2xj 0OIZQnKLGHPm85ggtUB2H9M5HBoMK4l9fGUeHP69eNeSavM8sW1uATsnwggdFyNhcjWWMz JIrg3FQOzVJGEo6yNWQZTD6Ap+KeXclsjvtZvXSkaR/AZnW1fKMmzDVtRIboEtqIbeGT8n Ym0L50yW8J6QfOcKhps6IuFv42StKrq0uPuubiM6SPcrHvaNLsXBqPd49AsjDcWlq2FhZP krzerf8hOV7LedG+CM/nubuMLYKGAn2JfUdHtIt04Wqol04l/SIeidETZxSUCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753906901; a=rsa-sha256; cv=none; b=AI0kT1yRUOR8uWI3at3yh74RoGXKxaD3oWKyTRJ5bz+nfrJAmbtuGQ7J5Lkv9OGFhAtT2z pp8B6YQFvdXK5BOHhvx+u299QSubyXQ5zzMHEJX5N3OmaaGjtBCAPA4cGLUuqjWAdvnXXa r7mDJVwk7z8sUMvNR32cpJeTYdwgArgFNPdCTyEbtuBP7rZX7Xs1Ixa0S7bwBGTVAp0YJf vuxiVPGxP9bzpJxbbW0zkWZCJoSfGLvkg1LjKQm++hrQTeI9FXgReTM8G7r21lqAKCVeCz 3t/zzaZ79D2UbhngvJyhMmFSGXRcmkEOF9KB8IBGuC8m3rQdN77xrqHB8+RcfA== Received: from [172.17.5.122] (unknown [204.148.112.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bskBr2Mvvz1874; Wed, 30 Jul 2025 20:21:40 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.99.25072013 Date: Wed, 30 Jul 2025 13:21:35 -0700 Subject: Re: 0c91fa982437 - stable/14 - dtrace_fbt.4: Document the DTrace fbt provider From: Ravi Pokala To: Ed Maste , "Bjoern A. Zeeb" CC: Mateusz Piotrowski <0mp@freebsd.org>, , , Message-ID: <3EA9D815-0483-4A2A-A568-00023FB66744@panasas.com> Thread-Topic: 0c91fa982437 - stable/14 - dtrace_fbt.4: Document the DTrace fbt provider References: <202507300936.56U9aujh087527@gitrepo.freebsd.org> In-Reply-To: List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable I think the same mis-merge went into stable/13 as well... -Ravi =EF=BB=BF-----Original Message----- From: > on behalf of Ed Maste > Date: Wednesday, July 30, 2025 at 11:47 To: "Bjoern A. Zeeb" > Cc: Mateusz Piotrowski <0mp@freebsd.org >, >, >, > Subject: Re: git: 0c91fa982437 - stable/14 - dtrace_fbt.4: Document the DTr= ace fbt provider On Wed, 30 Jul 2025 at 10:31, Bjoern A. Zeeb > wr= ote: > > On Wed, 30 Jul 2025, Mateusz Piotrowski wrote: > > > The branch stable/14 has been updated by 0mp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D0c91fa982437417e09218ad8c2= 428aff29d9c5bd > > > > commit 0c91fa982437417e09218ad8c2428aff29d9c5bd > > Author: Mateusz Piotrowski <0mp@FreeBSD.org > > > AuthorDate: 2025-06-14 19:26:48 +0000 > > Commit: Mateusz Piotrowski <0mp@FreeBSD.org > > > CommitDate: 2025-07-30 09:36:44 +0000 > > > > dtrace_fbt.4: Document the DTrace fbt provider > > > > Reported by: markj > > Reviewed by: christos, markj (earlier version), ziaee > > Obtained from: Mark Johnston, DTrace, FreeBSD Journal, May 2014 > > Obtained from: https://wiki.freebsd.org/DTrace/One-Liners > > MFC after: 2 weeks > > Relnotes: yes > > > > (cherry picked from commit 9388c2887817d7162ebb356b39aa9b4ab67a8c00) > > --- > > cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 5 + > > share/man/man4/Makefile | 1 + > > share/man/man4/dtrace_fbt.4 | 332 +++++++++++++++++++++++++++ > > share/man/man4/dtrace_kinst.4 | 12 +- > > 4 files changed, 346 insertions(+), 4 deletions(-) > > > > diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contri= b/opensolaris/cmd/dtrace/dtrace.1 > > index 1836707d72df..9cb6e9dd276f 100644 > > --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > > +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 > > @@ -20,7 +20,11 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > +<<<<<<< HEAD > > .Dd June 14, 2025 > > +=3D=3D=3D=3D=3D=3D=3D > > +.Dd July 16, 2025 > > +>>>>>>> 9388c2887817 (dtrace_fbt.4: Document the DTrace fbt provider) > > > This merge conflict wasn't resolved? Someone submitted a PR for it and I've fixed it now. From nobody Wed Jul 30 20:27:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bskKr2Hc9z630wt; Wed, 30 Jul 2025 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bskKr1tlHz3S9k; Wed, 30 Jul 2025 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753907264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cIOEDPdZ07+pLfOsAWQIhLG4VQwCmrKFlE2XVCGV+Zc=; b=gxzwGZrZbLNrxx8tf5Rhpe1kGVHm948wQH/fefxOGrPHft95oiNtca+deVSfdG/NFlarO+ IYCh0A+Jq3cr50GeCXujp8S8C2t19wxZ9uReplaSEvBHEcRxupAc6//OPNIOWwb3ok66im a1gGAggXZXVXk2uDFTclzpiWm+uiJBlrUUdUhE3rbV8rBpTpWwhZBqnuhPvU9kerq12PBl U0AV+uI15XJP91YRJNfJQwMKrk7UVc9SwIHt5wtBlwsMMVjbl3wHG8WbSs7Ih7OXQ1IOOE x2MltKMnfpSkknBL4emhh8FkI9ed2Fq1E7ZfeDQGHwJ18XyeP9E3oGK3AAUiww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753907264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cIOEDPdZ07+pLfOsAWQIhLG4VQwCmrKFlE2XVCGV+Zc=; b=VCB/f604fgrj1oyJbiG+y5m2X13+JNtDCqlGm/WTro5l/lCGuR/2LdjALm14STtIenrlAy hwcJYK7xwaqLJZmRHV6ffpCAnrAcERc9TAY6VIduBM9SWewdguQhN0/oZ8m7AFf19iSIZh AG0KEpvX1rxxzkqEyh8/UWZn6Svpj88/fNvf4whUL/pDlefmhQyhW2B08W0AJB4KcGu9S6 ZuuSRpKFedN6J4ETDJiU8qWf3Va37v0KPOR77Jf/Bd6iidCt2NoOQZLEvBkzJ27XqqB1Ew aTDqgO84wa+s33UXJOPUw4esxPayEPjfrkLzy0IWKxGv+5gyzKqU+6V6XhOlVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753907264; a=rsa-sha256; cv=none; b=iq4i/moGeMeTsPeVTR5cEqG4q1B/gdGOjK/RlBKmENQ1b25o3ttgf3Uc+SxJy1qstCmJfX czZY9X4u2NXfHLTfjSKdYh/plLZUnJpJsub8dDB0ZT7JbL5VLgwYoSMqagpOAiqTW41+sh JwZOHKkZl524mddRMF2s2X6B8gwBp6uxuH8vqgDUljYckfRtEpZ5rAQROdO0/saElq+Kwu A1p1slAyiWiJtGT3yxylT6MqUfIdVDMAa05lsKquI/0U+yaiOnAXIX/kkxeJMBa/bZatTS cjSDx1KmYmi7zA1xdJJ+P1zJ0Lc17i7UFkkAo+9Px+rGP1i7bjWaFLvreTgk4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bskKr0zXvzX1l; Wed, 30 Jul 2025 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UKRhUw011318; Wed, 30 Jul 2025 20:27:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UKRhb5011315; Wed, 30 Jul 2025 20:27:43 GMT (envelope-from git) Date: Wed, 30 Jul 2025 20:27:43 GMT Message-Id: <202507302027.56UKRhb5011315@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: 7b35b4d19630 - main - sockstat: add libxo support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b35b4d196309baf579571e1c1a433a4000d74c9 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=7b35b4d196309baf579571e1c1a433a4000d74c9 commit 7b35b4d196309baf579571e1c1a433a4000d74c9 Author: Damin Rido AuthorDate: 2025-07-16 17:20:15 +0000 Commit: Alan Somers CommitDate: 2025-07-30 20:27:14 +0000 sockstat: add libxo support Sponsored by: Google, LLC (GSoC 2025) MFC after: 2 weeks Reviewed by: asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/1770 Relnotes: yes --- usr.bin/sockstat/Makefile | 2 +- usr.bin/sockstat/sockstat.1 | 17 +- usr.bin/sockstat/sockstat.c | 467 +++++++++++++++++++++++++++----------------- 3 files changed, 306 insertions(+), 180 deletions(-) diff --git a/usr.bin/sockstat/Makefile b/usr.bin/sockstat/Makefile index 188432dfc27e..7254511f21c6 100644 --- a/usr.bin/sockstat/Makefile +++ b/usr.bin/sockstat/Makefile @@ -2,7 +2,7 @@ PROG= sockstat -LIBADD= jail +LIBADD= jail xo .if ${MK_CASPER} != "no" LIBADD+= casper diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index 4832a09764fd..091911cd0879 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 30, 2025 +.Dd July 17, 2025 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -33,6 +33,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl 46ACcfIiLlnqSsUuvw .Op Fl j Ar jail .Op Fl p Ar ports @@ -46,6 +47,13 @@ domain sockets. .Pp The following options are available: .Bl -tag -width Fl +.It Fl -libxo +Generate output via +.Xr libxo 3 +in a selection of different human and machine readable formats. +See +.Xr xo_options 7 +for details on command line arguments. .It Fl 4 Show .Dv AF_INET @@ -229,6 +237,11 @@ Show TCP IPv6 sockets which are listening and connected (default): .Bd -literal -offset indent $ sockstat -6 -P tcp .Ed +.Pp +Show all sockets in JSON format with neat alignment: +.Bd -literal -offset indent +$ sockstat --libxo json,pretty +.Ed .Sh SEE ALSO .Xr fstat 1 , .Xr netstat 1 , @@ -237,6 +250,8 @@ $ sockstat -6 -P tcp .Xr inet 4 , .Xr inet6 4 , .Xr protocols 5 +.Xr libxo 3 , +.Xr xo_options 7 .Sh HISTORY The .Nm diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index d0540c54a1aa..7355eaa272a0 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -55,7 +55,6 @@ #include #include -#include #include #include #include @@ -67,6 +66,7 @@ #include #include #include +#include #include #include @@ -74,6 +74,7 @@ #include #include +#define SOCKSTAT_XO_VERSION "1" #define sstosin(ss) ((struct sockaddr_in *)(ss)) #define sstosin6(ss) ((struct sockaddr_in6 *)(ss)) #define sstosun(ss) ((struct sockaddr_un *)(ss)) @@ -197,7 +198,7 @@ static bool _check_ksize(size_t received_size, size_t expected_size, const char *struct_name) { if (received_size != expected_size) { - warnx("%s size mismatch: expected %zd, received %zd", + xo_warnx("%s size mismatch: expected %zd, received %zd", struct_name, expected_size, received_size); return false; } @@ -209,7 +210,7 @@ static void _enforce_ksize(size_t received_size, size_t expected_size, const char *struct_name) { if (received_size != expected_size) { - errx(1, "fatal: struct %s size mismatch: expected %zd, received %zd", + xo_errx(1, "fatal: struct %s size mismatch: expected %zd, received %zd", struct_name, expected_size, received_size); } } @@ -227,7 +228,7 @@ get_proto_type(const char *proto) else pent = getprotobyname(proto); if (pent == NULL) { - warn("cap_getprotobyname"); + xo_warn("cap_getprotobyname"); return (-1); } return (pent->p_proto); @@ -248,7 +249,7 @@ init_protos(int num) } if ((protos = malloc(sizeof(int) * proto_count)) == NULL) - err(1, "malloc"); + xo_err(1, "malloc"); numprotos = proto_count; } @@ -282,17 +283,17 @@ parse_ports(const char *portspec) if (ports == NULL) if ((ports = calloc(65536 / INT_BIT, sizeof(int))) == NULL) - err(1, "calloc()"); + xo_err(1, "calloc()"); p = portspec; while (*p != '\0') { if (!isdigit(*p)) - errx(1, "syntax error in port range"); + xo_errx(1, "syntax error in port range"); for (q = p; *q != '\0' && isdigit(*q); ++q) /* nothing */ ; for (port = 0; p < q; ++p) port = port * 10 + digittoint(*p); if (port < 0 || port > 65535) - errx(1, "invalid port number"); + xo_errx(1, "invalid port number"); SET_PORT(port); switch (*p) { case '-': @@ -310,7 +311,7 @@ parse_ports(const char *portspec) for (end = 0; p < q; ++p) end = end * 10 + digittoint(*p); if (end < port || end > 65535) - errx(1, "invalid port number"); + xo_errx(1, "invalid port number"); while (port++ < end) SET_PORT(port); if (*p == ',') @@ -395,15 +396,15 @@ gather_sctp(void) varname = "net.inet.sctp.assoclist"; if (cap_sysctlbyname(capsysctl, varname, 0, &len, 0, 0) < 0) { if (errno != ENOENT) - err(1, "cap_sysctlbyname()"); + xo_err(1, "cap_sysctlbyname()"); return; } if ((buf = (char *)malloc(len)) == NULL) { - err(1, "malloc()"); + xo_err(1, "malloc()"); return; } if (cap_sysctlbyname(capsysctl, varname, buf, &len, 0, 0) < 0) { - err(1, "cap_sysctlbyname()"); + xo_err(1, "cap_sysctlbyname()"); free(buf); return; } @@ -411,7 +412,7 @@ gather_sctp(void) offset = sizeof(struct xsctp_inpcb); while ((offset < len) && (xinpcb->last == 0)) { if ((sock = calloc(1, sizeof *sock)) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; @@ -439,7 +440,7 @@ gather_sctp(void) if (xladdr->last == 1) break; if ((laddr = calloc(1, sizeof(struct addr))) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); switch (xladdr->address.sa.sa_family) { case AF_INET: #define __IN_IS_ADDR_LOOPBACK(pina) \ @@ -461,7 +462,7 @@ gather_sctp(void) htons(xinpcb->local_port)); break; default: - errx(1, "address family %d not supported", + xo_errx(1, "address family %d not supported", xladdr->address.sa.sa_family); } laddr->next = NULL; @@ -474,7 +475,7 @@ gather_sctp(void) if (sock->laddr == NULL) { if ((sock->laddr = calloc(1, sizeof(struct addr))) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); sock->laddr->address.ss_family = sock->family; if (sock->family == AF_INET) sock->laddr->address.ss_len = @@ -485,7 +486,7 @@ gather_sctp(void) local_all_loopback = 0; } if ((sock->faddr = calloc(1, sizeof(struct addr))) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); sock->faddr->address.ss_family = sock->family; if (sock->family == AF_INET) sock->faddr->address.ss_len = @@ -512,7 +513,7 @@ gather_sctp(void) no_stcb = 0; if (opt_c) { if ((sock = calloc(1, sizeof *sock)) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); sock->socket = xinpcb->socket; sock->proto = IPPROTO_SCTP; sock->protoname = "sctp"; @@ -542,7 +543,7 @@ gather_sctp(void) continue; laddr = calloc(1, sizeof(struct addr)); if (laddr == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); switch (xladdr->address.sa.sa_family) { case AF_INET: #define __IN_IS_ADDR_LOOPBACK(pina) \ @@ -564,7 +565,7 @@ gather_sctp(void) htons(xstcb->local_port)); break; default: - errx(1, + xo_errx(1, "address family %d not supported", xladdr->address.sa.sa_family); } @@ -587,7 +588,7 @@ gather_sctp(void) continue; faddr = calloc(1, sizeof(struct addr)); if (faddr == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); switch (xraddr->address.sa.sa_family) { case AF_INET: #define __IN_IS_ADDR_LOOPBACK(pina) \ @@ -609,7 +610,7 @@ gather_sctp(void) htons(xstcb->remote_port)); break; default: - errx(1, + xo_errx(1, "address family %d not supported", xraddr->address.sa.sa_family); } @@ -673,7 +674,7 @@ gather_inet(int proto) protoname = "div"; break; default: - errx(1, "protocol %d not supported", proto); + xo_errx(1, "protocol %d not supported", proto); } buf = NULL; @@ -682,7 +683,7 @@ gather_inet(int proto) do { for (;;) { if ((buf = realloc(buf, bufsize)) == NULL) - err(1, "realloc()"); + xo_err(1, "realloc()"); len = bufsize; if (cap_sysctlbyname(capsysctl, varname, buf, &len, NULL, 0) == 0) @@ -690,7 +691,7 @@ gather_inet(int proto) if (errno == ENOENT) goto out; if (errno != ENOMEM || len != bufsize) - err(1, "cap_sysctlbyname()"); + xo_err(1, "cap_sysctlbyname()"); bufsize *= 2; } xig = (struct xinpgen *)buf; @@ -701,7 +702,7 @@ gather_inet(int proto) } while (xig->xig_gen != exig->xig_gen && retry--); if (xig->xig_gen != exig->xig_gen && opt_v) - warnx("warning: data may be inconsistent"); + xo_warnx("warning: data may be inconsistent"); for (;;) { xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len); @@ -722,7 +723,7 @@ gather_inet(int proto) goto out; break; default: - errx(1, "protocol %d not supported", proto); + xo_errx(1, "protocol %d not supported", proto); } so = &xip->xi_socket; if ((xip->inp_vflag & vflag) == 0) @@ -748,15 +749,15 @@ gather_inet(int proto) continue; } else { if (opt_v) - warnx("invalid vflag 0x%x", xip->inp_vflag); + xo_warnx("invalid vflag 0x%x", xip->inp_vflag); continue; } if ((sock = calloc(1, sizeof(*sock))) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); if ((laddr = calloc(1, sizeof *laddr)) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); if ((faddr = calloc(1, sizeof *faddr)) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); sock->socket = so->xso_so; sock->pcb = so->so_pcb; sock->splice_socket = so->so_splice_so; @@ -822,7 +823,9 @@ gather_unix(int proto) break; case SOCK_SEQPACKET: varname = "net.local.seqpacket.pcblist"; - protoname = "seqpac"; + protoname = (xo_get_style(NULL) == XO_STYLE_TEXT) + ? "seqpac" + : "seqpacket"; break; default: abort(); @@ -833,13 +836,13 @@ gather_unix(int proto) do { for (;;) { if ((buf = realloc(buf, bufsize)) == NULL) - err(1, "realloc()"); + xo_err(1, "realloc()"); len = bufsize; if (cap_sysctlbyname(capsysctl, varname, buf, &len, NULL, 0) == 0) break; if (errno != ENOMEM || len != bufsize) - err(1, "cap_sysctlbyname()"); + xo_err(1, "cap_sysctlbyname()"); bufsize *= 2; } xug = (struct xunpgen *)buf; @@ -851,7 +854,7 @@ gather_unix(int proto) } while (xug->xug_gen != exug->xug_gen && retry--); if (xug->xug_gen != exug->xug_gen && opt_v) - warnx("warning: data may be inconsistent"); + xo_warnx("warning: data may be inconsistent"); for (;;) { xug = (struct xunpgen *)(void *)((char *)xug + xug->xug_len); @@ -864,11 +867,11 @@ gather_unix(int proto) (xup->unp_conn != 0 && !opt_c)) continue; if ((sock = calloc(1, sizeof(*sock))) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); if ((laddr = calloc(1, sizeof *laddr)) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); if ((faddr = calloc(1, sizeof *faddr)) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); sock->socket = xup->xu_socket.xso_so; sock->pcb = xup->xu_unpp; sock->proto = proto; @@ -899,21 +902,21 @@ getfiles(void) olen = len = sizeof(*xfiles); if ((xfiles = malloc(len)) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); while (cap_sysctlbyname(capsysctl, "kern.file", xfiles, &len, 0, 0) == -1) { if (errno != ENOMEM || len != olen) - err(1, "cap_sysctlbyname()"); + xo_err(1, "cap_sysctlbyname()"); olen = len *= 2; if ((xfiles = realloc(xfiles, len)) == NULL) - err(1, "realloc()"); + xo_err(1, "realloc()"); } if (len > 0) enforce_ksize(xfiles->xf_size, struct xfile); nfiles = len / sizeof(*xfiles); if ((files = malloc(nfiles * sizeof(struct file))) == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); for (int i = 0; i < nfiles; i++) { files[i].xf_data = xfiles[i].xf_data; @@ -932,6 +935,7 @@ formataddr(struct sockaddr_storage *ss, char *buf, size_t bufsize) struct sockaddr_un *sun; char addrstr[NI_MAXHOST] = { '\0', '\0' }; int error, off, port = 0; + const bool is_text_style = (xo_get_style(NULL) == XO_STYLE_TEXT); switch (ss->ss_family) { case AF_INET: @@ -947,6 +951,11 @@ formataddr(struct sockaddr_storage *ss, char *buf, size_t bufsize) case AF_UNIX: sun = sstosun(ss); off = (int)((char *)&sun->sun_path - (char *)sun); + if (!is_text_style) { + xo_emit("{:path/%.*s}", sun->sun_len - off, + sun->sun_path); + return 0; + } return snprintf(buf, bufsize, "%.*s", sun->sun_len - off, sun->sun_path); } @@ -954,7 +963,12 @@ formataddr(struct sockaddr_storage *ss, char *buf, size_t bufsize) error = cap_getnameinfo(capnet, sstosa(ss), ss->ss_len, addrstr, sizeof(addrstr), NULL, 0, NI_NUMERICHOST); if (error) - errx(1, "cap_getnameinfo()"); + xo_errx(1, "cap_getnameinfo()"); + } + if (!is_text_style) { + xo_emit("{:address/%s}", addrstr); + xo_emit("{:port/%d}", port); + return 0; } if (port == 0) return snprintf(buf, bufsize, "%s:*", addrstr); @@ -977,7 +991,7 @@ getprocname(pid_t pid) == -1) { /* Do not warn if the process exits before we get its name. */ if (errno != ESRCH) - warn("cap_sysctl()"); + xo_warn("cap_sysctl()"); return ("??"); } return (proc.ki_comm); @@ -999,7 +1013,7 @@ getprocjid(pid_t pid) == -1) { /* Do not warn if the process exits before we get its jid. */ if (errno != ESRCH) - warn("cap_sysctl()"); + xo_warn("cap_sysctl()"); return (-1); } return (proc.ki_jid); @@ -1099,13 +1113,15 @@ format_unix_faddr(struct addr *faddr, char *buf, size_t bufsize) { #define SAFESIZE (buf == NULL ? 0 : bufsize - pos) size_t pos = 0; - /* Remote peer we connect(2) to, if any. */ + const bool is_text_style = (xo_get_style(NULL) == XO_STYLE_TEXT); if (faddr->conn != 0) { + /* Remote peer we connect(2) to, if any. */ struct sock *p; - pos += strlcpy(SAFEBUF, "-> ", SAFESIZE); + if (is_text_style) + pos += strlcpy(SAFEBUF, "-> ", SAFESIZE); p = RB_FIND(pcbs_t, &pcbs, &(struct sock){ .pcb = faddr->conn }); - if (__predict_false(p == NULL)) { + if (__predict_false(p == NULL) && is_text_style) { /* XXGL: can this happen at all? */ pos += snprintf(SAFEBUF, SAFESIZE, "??"); } else if (p->laddr->address.ss_len == 0) { @@ -1114,34 +1130,52 @@ format_unix_faddr(struct addr *faddr, char *buf, size_t bufsize) { &(struct file){ .xf_data = p->socket }); if (f != NULL) { - pos += snprintf(SAFEBUF, SAFESIZE, "[%lu %d]", - (u_long)f->xf_pid, f->xf_fd); + if (is_text_style) { + pos += snprintf(SAFEBUF, SAFESIZE, + "[%lu %d]", (u_long)f->xf_pid, + f->xf_fd); + } else { + xo_open_list("connections"); + xo_open_instance("connections"); + xo_emit("{:pid/%lu}", (u_long)f->xf_pid); + xo_emit("{:fd/%d}", f->xf_fd); + xo_close_instance("connections"); + xo_close_list("connections"); + } } } else pos += formataddr(&p->laddr->address, SAFEBUF, SAFESIZE); - } - /* Remote peer(s) connect(2)ed to us, if any. */ - if (faddr->firstref != 0) { + } else if (faddr->firstref != 0) { + /* Remote peer(s) connect(2)ed to us, if any. */ struct sock *p; struct file *f; kvaddr_t ref = faddr->firstref; bool fref = true; - pos += snprintf(SAFEBUF, SAFESIZE, " <- "); - + if (is_text_style) + pos += snprintf(SAFEBUF, SAFESIZE, " <- "); + xo_open_list("connections"); while ((p = RB_FIND(pcbs_t, &pcbs, &(struct sock){ .pcb = ref })) != 0) { f = RB_FIND(files_t, &ftree, &(struct file){ .xf_data = p->socket }); if (f != NULL) { - pos += snprintf(SAFEBUF, SAFESIZE, - "%s[%lu %d]", fref ? "" : ",", - (u_long)f->xf_pid, f->xf_fd); + if (is_text_style) { + pos += snprintf(SAFEBUF, SAFESIZE, + "%s[%lu %d]", fref ? "" : ",", + (u_long)f->xf_pid, f->xf_fd); + } else { + xo_open_instance("connections"); + xo_emit("{:pid/%lu}", (u_long)f->xf_pid); + xo_emit("{:fd/%d}", f->xf_fd); + xo_close_instance("connections"); + } } ref = p->faddr->nextref; fref = false; } + xo_close_list("connections"); } return pos; } @@ -1183,7 +1217,7 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) while (laddr != NULL || faddr != NULL) { if (opt_w && s->family == AF_UNIX) { if ((laddr == NULL) || (faddr == NULL)) - errx(1, "laddr = %p or faddr = %p is NULL", + xo_errx(1, "laddr = %p or faddr = %p is NULL", (void *)laddr, (void *)faddr); if (laddr->address.ss_len > 0) len = formataddr(&laddr->address, NULL, 0); @@ -1298,6 +1332,7 @@ calculate_column_widths(struct col_widths *cw) struct sock *s; struct passwd *pwd; + cap_setpassent(cappwd, 1); for (xf = files, n = 0; n < nfiles; ++n, ++xf) { if (xf->xf_data == 0) continue; @@ -1345,65 +1380,104 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) laddr = s->laddr; faddr = s->faddr; first = true; + const bool is_text_style = (xo_get_style(NULL) == XO_STYLE_TEXT); snprintf(buf, bufsize, "%s%s%s", s->protoname, s->vflag & INP_IPV4 ? "4" : "", s->vflag & INP_IPV6 ? "6" : ""); - printf(" %-*s", cw->proto, buf); + xo_emit(" {:proto/%-*s}", cw->proto, buf); while (laddr != NULL || faddr != NULL) { if (s->family == AF_UNIX) { if ((laddr == NULL) || (faddr == NULL)) - errx(1, "laddr = %p or faddr = %p is NULL", + xo_errx(1, "laddr = %p or faddr = %p is NULL", (void *)laddr, (void *)faddr); - if (laddr->address.ss_len > 0) + if (laddr->address.ss_len > 0) { + xo_open_container("local"); formataddr(&laddr->address, buf, bufsize); - else if (laddr->address.ss_len == 0 && faddr->conn == 0) - strlcpy(buf, "(not connected)", bufsize); - else - strlcpy(buf, "??", bufsize); - printf(" %-*.*s", cw->local_addr, cw->local_addr, buf); - if (format_unix_faddr(faddr, buf, bufsize) == 0) - strlcpy(buf, "??", bufsize); - printf(" %-*.*s", cw->foreign_addr, - cw->foreign_addr, buf); + if (is_text_style) { + xo_emit(" {:/%-*.*s}", cw->local_addr, + cw->local_addr, buf); + } + xo_close_container("local"); + } else if (laddr->address.ss_len == 0 && + faddr->conn == 0 && is_text_style) { + xo_emit(" {:/%-*.*s}", cw->local_addr, + cw->local_addr, "(not connected)"); + } else if (is_text_style) { + xo_emit(" {:/%-*.*s}", cw->local_addr, + cw->local_addr, "??"); + } + if (faddr->conn != 0 || faddr->firstref != 0) { + xo_open_container("foreign"); + int len = format_unix_faddr(faddr, buf, + bufsize); + if (len == 0 && is_text_style) + xo_emit(" {:/%-*s}", + cw->foreign_addr, "??"); + else if (is_text_style) + xo_emit(" {:/%-*.*s}", cw->foreign_addr, + cw->foreign_addr, buf); + xo_close_container("foreign"); + } else if (is_text_style) + xo_emit(" {:/%-*s}", cw->foreign_addr, "??"); } else { - if (laddr != NULL) + if (laddr != NULL) { + xo_open_container("local"); formataddr(&laddr->address, buf, bufsize); - else - strlcpy(buf, "??", bufsize); - printf(" %-*.*s", cw->local_addr, cw->local_addr, buf); - if (faddr != NULL) + if (is_text_style) { + xo_emit(" {:/%-*.*s}", cw->local_addr, + cw->local_addr, buf); + } + xo_close_container("local"); + } else if (is_text_style) + xo_emit(" {:/%-*.*s}", cw->local_addr, + cw->local_addr, "??"); + if (faddr != NULL) { + xo_open_container("foreign"); formataddr(&faddr->address, buf, bufsize); - else - strlcpy(buf, "??", bufsize); - printf(" %-*.*s", cw->foreign_addr, - cw->foreign_addr, buf); + if (is_text_style) { + xo_emit(" {:/%-*.*s}", cw->foreign_addr, + cw->foreign_addr, buf); + } + xo_close_container("foreign"); + } else if (is_text_style) { + xo_emit(" {:/%-*.*s}", cw->foreign_addr, + cw->foreign_addr, "??"); + } + } + if (opt_A) { + snprintf(buf, bufsize, "%#*" PRIx64, + cw->pcb_kva, s->pcb); + xo_emit(" {:pcb-kva/%s}", buf); } - if (opt_A) - printf(" %#*" PRIx64, cw->pcb_kva, s->pcb); if (opt_f) - printf(" %*d", cw->fib, s->fibnum); + xo_emit(" {:fib/%*d}", cw->fib, s->fibnum); if (opt_I) { if (s->splice_socket != 0) { struct sock *sp; sp = RB_FIND(socks_t, &socks, &(struct sock) { .socket = s->splice_socket }); - if (sp != NULL) + if (sp != NULL) { + xo_open_container("splice"); formataddr(&sp->laddr->address, buf, bufsize); - else + xo_close_container("splice"); + } else if (is_text_style) strlcpy(buf, "??", bufsize); - } else + } else if (is_text_style) strlcpy(buf, "??", bufsize); - printf(" %-*s", cw->splice_address, buf); + if (is_text_style) + xo_emit(" {:/%-*s}", cw->splice_address, buf); } if (opt_i) { if (s->proto == IPPROTO_TCP || s->proto == IPPROTO_UDP) - printf(" %*" PRIu64, cw->inp_gencnt, + { + snprintf(buf, bufsize, "%" PRIu64, s->inp_gencnt); - else - printf(" %*s", cw->inp_gencnt, "??"); + xo_emit(" {:id/%*s}", cw->inp_gencnt, buf); + } else if (is_text_style) + xo_emit(" {:/%*s}", cw->inp_gencnt, "??"); } if (opt_U) { if (faddr != NULL && @@ -1414,10 +1488,10 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) (s->proto == IPPROTO_TCP && s->state != TCPS_CLOSED && s->state != TCPS_LISTEN))) { - printf(" %*u", cw->encaps, + xo_emit(" {:encaps/%*u}", cw->encaps, ntohs(faddr->encaps_port)); - } else - printf(" %*s", cw->encaps, "??"); + } else if (is_text_style) + xo_emit(" {:/%*s}", cw->encaps, "??"); } if (opt_s) { if (faddr != NULL && @@ -1425,10 +1499,10 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) s->state != SCTP_CLOSED && s->state != SCTP_BOUND && s->state != SCTP_LISTEN) { - printf(" %-*s", cw->path_state, + xo_emit(" {:path-state/%-*s}", cw->path_state, sctp_path_state(faddr->state)); - } else - printf(" %-*s", cw->path_state, "??"); + } else if (is_text_style) + xo_emit(" {:/%-*s}", cw->path_state, "??"); } if (first) { if (opt_s) { @@ -1436,47 +1510,52 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) s->proto == IPPROTO_TCP) { switch (s->proto) { case IPPROTO_SCTP: - printf(" %-*s", cw->conn_state, - sctp_conn_state(s->state)); + xo_emit(" {:path-state/%-*s}", + cw->path_state, + sctp_path_state( + faddr->state)); break; case IPPROTO_TCP: if (s->state >= 0 && s->state < TCP_NSTATES) - printf(" %-*s", - cw->conn_state, - tcpstates[s->state]); - else - printf(" %-*s", - cw->conn_state, "??"); + xo_emit(" {:conn-state/%-*s}", + cw->conn_state, + tcpstates[s->state]); + else if (is_text_style) + xo_emit(" {:/%-*s}", + cw->conn_state, "??"); break; } - } else - printf(" %-*s", cw->conn_state, "??"); + } else if (is_text_style) + xo_emit(" {:/%-*s}", + cw->conn_state, "??"); } if (opt_S) { if (s->proto == IPPROTO_TCP) - printf(" %-*s", cw->stack, s->stack); - else - printf(" %-*s", cw->stack, "??"); + xo_emit(" {:stack/%-*s}", + cw->stack, s->stack); + else if (is_text_style) + xo_emit(" {:/%-*s}", + cw->stack, "??"); } if (opt_C) { if (s->proto == IPPROTO_TCP) - printf(" %-*s", cw->cc, s->cc); - else - printf(" %-*s", cw->cc, "??"); + xo_emit(" {:cc/%-*s}", cw->cc, s->cc); + else if (is_text_style) + xo_emit(" {:/%-*s}", cw->cc, "??"); } } if (laddr != NULL) laddr = laddr->next; if (faddr != NULL) faddr = faddr->next; - if (laddr != NULL || faddr != NULL) - printf("%-*s %-*s %-*s %-*s %-*s", cw->user, "", - cw->command, "", cw->pid, "", cw->fd, "", - cw->proto, ""); + if (is_text_style && (laddr != NULL || faddr != NULL)) + xo_emit("{:/%-*s} {:/%-*s} {:/%*s} {:/%*s}", + cw->user, "??", cw->command, "??", + cw->pid, "??", cw->fd, "??"); first = false; } - printf("\n"); + xo_emit("\n"); } static void @@ -1490,56 +1569,63 @@ display(void) const size_t bufsize = 512; void *buf; if ((buf = (char *)malloc(bufsize)) == NULL) { - err(1, "malloc()"); + xo_err(1, "malloc()"); return; } - cw = (struct col_widths) { - .user = strlen("USER"), - .command = 10, - .pid = strlen("PID"), - .fd = strlen("FD"), - .proto = strlen("PROTO"), - .local_addr = opt_w ? strlen("LOCAL ADDRESS") : 21, - .foreign_addr = opt_w ? strlen("FOREIGN ADDRESS") : 21, - .pcb_kva = 18, - .fib = strlen("FIB"), - .splice_address = strlen("SPLICE ADDRESS"), - .inp_gencnt = strlen("ID"), - .encaps = strlen("ENCAPS"), - .path_state = strlen("PATH STATE"), - .conn_state = strlen("CONN STATE"), - .stack = strlen("STACK"), - .cc = strlen("CC"), - }; - calculate_column_widths(&cw); + if (xo_get_style(NULL) == XO_STYLE_TEXT) { + cw = (struct col_widths) { + .user = strlen("USER"), + .command = 10, + .pid = strlen("PID"), + .fd = strlen("FD"), + .proto = strlen("PROTO"), + .local_addr = opt_w ? strlen("LOCAL ADDRESS") : 21, + .foreign_addr = opt_w ? strlen("FOREIGN ADDRESS") : 21, + .pcb_kva = 18, + .fib = strlen("FIB"), + .splice_address = strlen("SPLICE ADDRESS"), + .inp_gencnt = strlen("ID"), + .encaps = strlen("ENCAPS"), + .path_state = strlen("PATH STATE"), + .conn_state = strlen("CONN STATE"), + .stack = strlen("STACK"), + .cc = strlen("CC"), + }; + calculate_column_widths(&cw); + } else + memset(&cw, 0, sizeof(cw)); + xo_set_version(SOCKSTAT_XO_VERSION); + xo_open_container("sockstat"); + xo_open_list("socket"); if (!opt_q) { - printf("%-*s %-*s %*s %*s %-*s %-*s %-*s", - cw.user, "USER", cw.command, "COMMAND", - cw.pid, "PID", cw.fd, "FD", cw.proto, "PROTO", - cw.local_addr, "LOCAL ADDRESS", - cw.foreign_addr,"FOREIGN ADDRESS"); + xo_emit("{T:/%-*s} {T:/%-*s} {T:/%*s} {T:/%*s} {T:/%-*s} " + "{T:/%-*s} {T:/%-*s}", cw.user, "USER", cw.command, + "COMMAND", cw.pid, "PID", cw.fd, "FD", cw.proto, + "PROTO", cw.local_addr, "LOCAL ADDRESS", + cw.foreign_addr, "FOREIGN ADDRESS"); if (opt_A) - printf(" %-*s", cw.pcb_kva, "PCB KVA"); + xo_emit(" {T:/%-*s}", cw.pcb_kva, "PCB KVA"); if (opt_f) /* RT_MAXFIBS is 65535. */ - printf(" %*s", cw.fib, "FIB"); + xo_emit(" {T:/%*s}", cw.fib, "FIB"); if (opt_I) - printf(" %-*s", cw.splice_address, "SPLICE ADDRESS"); + xo_emit(" {T:/%-*s}", cw.splice_address, + "SPLICE ADDRESS"); if (opt_i) - printf(" %*s", cw.inp_gencnt, "ID"); + xo_emit(" {T:/%*s}", cw.inp_gencnt, "ID"); if (opt_U) - printf(" %*s", cw.encaps, "ENCAPS"); + xo_emit(" {T:/%*s}", cw.encaps, "ENCAPS"); if (opt_s) { - printf(" %-*s", cw.path_state, "PATH STATE"); - printf(" %-*s", cw.conn_state, "CONN STATE"); + xo_emit(" {T:/%-*s}", cw.path_state, "PATH STATE"); + xo_emit(" {T:/%-*s}", cw.conn_state, "CONN STATE"); } if (opt_S) - printf(" %-*s", cw.stack, "STACK"); + xo_emit(" {T:/%-*s}", cw.stack, "STACK"); if (opt_C) - printf(" %-*s", cw.cc, "CC"); - printf("\n"); + xo_emit(" {T:/%-*s}", cw.cc, "CC"); + xo_emit("\n"); } cap_setpassent(cappwd, 1); for (xf = files, n = 0; n < nfiles; ++n, ++xf) { @@ -1550,17 +1636,24 @@ display(void) s = RB_FIND(socks_t, &socks, &(struct sock){ .socket = xf->xf_data}); if (s != NULL && check_ports(s)) { + xo_open_instance("socket"); s->shown = 1; if (opt_n || (pwd = cap_getpwuid(cappwd, xf->xf_uid)) == NULL) - printf("%-*lu", cw.user, (u_long)xf->xf_uid); + xo_emit("{:user/%-*lu}", cw.user, + (u_long)xf->xf_uid); + else + xo_emit("{:user/%-*s}", cw.user, pwd->pw_name); + if (xo_get_style(NULL) == XO_STYLE_TEXT) + xo_emit(" {:/%-*.10s}", cw.command, + getprocname(xf->xf_pid)); else - printf("%-*s", cw.user, pwd->pw_name); - printf(" %-*.*s", cw.command, cw.command, - getprocname(xf->xf_pid)); - printf(" %*lu", cw.pid, (u_long)xf->xf_pid); - printf(" %*d", cw.fd, xf->xf_fd); + xo_emit(" {:command/%-*s}", cw.command, + getprocname(xf->xf_pid)); + xo_emit(" {:pid/%*lu}", cw.pid, (u_long)xf->xf_pid); + xo_emit(" {:fd/%*d}", cw.fd, xf->xf_fd); display_sock(s, &cw, buf, bufsize); + xo_close_instance("socket"); } } if (opt_j >= 0) @@ -1568,20 +1661,33 @@ display(void) SLIST_FOREACH(s, &nosocks, socket_list) { if (!check_ports(s)) continue; - printf("%-*s %-*s %*s %*s", cw.user, "??", cw.command, "??", - cw.pid, "??", cw.fd, "??"); + xo_open_instance("socket"); + if (xo_get_style(NULL) == XO_STYLE_TEXT) + xo_emit("{:/%-*s} {:/%-*s} {:/%*s} {:/%*s}", + cw.user, "??", cw.command, "??", + cw.pid, "??", cw.fd, "??"); display_sock(s, &cw, buf, bufsize); + xo_close_instance("socket"); } RB_FOREACH(s, socks_t, &socks) { if (s->shown) continue; if (!check_ports(s)) continue; - printf("%-*s %-*s %*s %*s", cw.user, "??", cw.command, "??", - cw.pid, "??", cw.fd, "??"); + xo_open_instance("socket"); + if (xo_get_style(NULL) == XO_STYLE_TEXT) + xo_emit("{:/%-*s} {:/%-*s} {:/%*s} {:/%*s}", + cw.user, "??", cw.command, "??", + cw.pid, "??", cw.fd, "??"); display_sock(s, &cw, buf, bufsize); + xo_close_instance("socket"); } + xo_close_list("socket"); + xo_close_container("sockstat"); *** 103 LINES SKIPPED *** From nobody Wed Jul 30 21:23:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bslYg58n8z633Sg; Wed, 30 Jul 2025 21:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bslYg3yjGz3ZWr; Wed, 30 Jul 2025 21:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753910583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VuHGXK/SAJFprZoCAE4eufFc5CjDbuXXV3s5nQmbxtU=; b=SM5aZv8t0jNNYBQVuXaglPkp1cyBct/ULqkxfDHskdD92u7B/sRiPL42t43rkecmy9eNAe Bwc27CuWIJ1ycEZtylNE7Z3dL3gII97u5GK49a9XIiqNfis/+64gOqnMljFEdZhA2m0+hx RESQgLnHdibk14NfmpNKjpz1pyLg+5r2Bd7P64dpETvW6LyskQ0k+K7LYHRG4zd8rkVfRC o4BVR1HngnVV4O5PHJU+dufFRccQImr8wSpZpmSCifI6smOig1jGjWq4ALKe13reBF3Tn8 6bo2v/wuoOpMrUXD2wCF2GKOIGm3zR0mPJLDgLy+6ms1QVDObtyNDz8a2vfOpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753910583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VuHGXK/SAJFprZoCAE4eufFc5CjDbuXXV3s5nQmbxtU=; b=ZmFhSg+WLwdCLtDkAT7HvWFa4elCP1PaqSHDNE+Gofzaqri77c3iYFD3b7APhhFnrn+Cf2 i/namrSoGEikQqt8IvQhq55f8kZE/Ho1FLrrZHodRJ/s/wLtNw2IBgMi9+zNOW3wayxcM/ ECN6WSjGaSy3XhtLrOkWR20Bwge76wHST4iHO5S3foj+0kDexy7NyzuiE2mMFNYJuGB28b uLtCFcKm7p382GnnUQvC9iL4/RVzjBwQS8WFuJnnD75PdG88ZXQEW3btoyAvbDn/JYX29T j154YYPp9kldGB4s0uouEr2S+AJ8IEVHc8YhSE/GGy1/QcFf6VZvroTNDQp93g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753910583; a=rsa-sha256; cv=none; b=c6iyQ09S4YAD1t6dH8yaPAucY3zBou671gl4j2D/XaeKehU34RJDDe0ep5OmE/hH/Y3vVX ty8j0cKjeiRdy/3PsrLCnoMyptQ7DBnSXcbZbCGA8Y3XJc8sZ+5E2/MNwWiPHwPrwOqm5R UqSl0hov+ptXXMl17wXaUW0q4QgOk3dwvcv8tHgGjCi+v3FNFJWzVTeNPkGeXjoE+df7dK q19MiZz48CdHmnqgkf/nXVKUn/hzzx7C1O86Ig7v3cbqKcFRhns2X2Ehdl2xN2kN8NcHl7 Vc0Gx7G9TLDbz6pGhBcRPQbsUht3vB2njLhh6dQRyl2rPPodm4V7BqUHkpxFsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bslYg3081zZKP; Wed, 30 Jul 2025 21:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ULN3pc023339; Wed, 30 Jul 2025 21:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ULN3oJ023336; Wed, 30 Jul 2025 21:23:03 GMT (envelope-from git) Date: Wed, 30 Jul 2025 21:23:03 GMT Message-Id: <202507302123.56ULN3oJ023336@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: bf426b859bda - main - vt: Remove FONT specification from INDEX files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf426b859bda58a1d6598bb9516ffc6692b2502f Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bf426b859bda58a1d6598bb9516ffc6692b2502f commit bf426b859bda58a1d6598bb9516ffc6692b2502f Author: Ed Maste AuthorDate: 2025-07-30 20:10:44 +0000 Commit: Ed Maste CommitDate: 2025-07-30 21:22:41 +0000 vt: Remove FONT specification from INDEX files There is no reason to change the font in order to select a keymap or a font. This was done in the syscons(4) era to ensure that a font with the appropriate character set was used for kbdmap or vidfont's localized menu, but vt is always UTF-8 and this is no longer necessary. PR: 235565 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51640 --- share/vt/fonts/INDEX.fonts | 8 -------- share/vt/keymaps/INDEX.keymaps | 8 -------- 2 files changed, 16 deletions(-) diff --git a/share/vt/fonts/INDEX.fonts b/share/vt/fonts/INDEX.fonts index 8a36ccfbf211..dee9e855c42e 100644 --- a/share/vt/fonts/INDEX.fonts +++ b/share/vt/fonts/INDEX.fonts @@ -25,14 +25,6 @@ MENU:da:Vælg skrifttypen til din terminal MENU:de:Wählen Sie Ihre Schrift MENU:fr:Choisissez votre fonte écran -# -# The font definition for "en" is the fall-back font for -# all languages. -# Add language specific font definitions only where required! -# -FONT:en:vgarom-8x14.fnt -# - gallant.fnt:en:Gallant Character set, 12x22 gallant.fnt:da:Gallant-tegnsæt, 12x22 gallant.fnt:de:Gallant Zeichensatz, 12x22 diff --git a/share/vt/keymaps/INDEX.keymaps b/share/vt/keymaps/INDEX.keymaps index 2b1db8528e85..fd00d0e71c87 100644 --- a/share/vt/keymaps/INDEX.keymaps +++ b/share/vt/keymaps/INDEX.keymaps @@ -33,14 +33,6 @@ MENU:el:Επιλέξτε το πληκτρολόγιο της κονσόλας MENU:hy:Ընտրեք ստեղնաշարի դասավորությունը MENU:tr:Klavye düzeninizi seçiniz -# -# The font definition for "en" is the fall-back font for -# all languages. -# Add language specific font definitions only where required! -# -FONT:en:vgarom-8x16.hex - -# am.kbd:en:Armenian phonetic layout am.kbd:da:Armensk fonetisk layout am.kbd:de:Armenische phonetische Tastenbelegung From nobody Wed Jul 30 21:27:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bslfb006hz633WL; Wed, 30 Jul 2025 21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bslfZ6CH9z3bNl; Wed, 30 Jul 2025 21:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753910838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/gPsotj40Am+PmSARfh9mNVkcQBiEj5d9Cwa90aZyo=; b=DVoUqz7yHYtx8xxydUcUkj0v4XvFpjaR8WIRZTjjDSuEHxGJqzh5OQ8HdU0NyEVMIcWsbQ XOz3teifo5Ri46Z87ZwAw4fiEVFRcFuAqJmpwsEtZu/rDJbx0y2IUfkfhOV7/wf6b17lgh i6IVaH3aDxZepvCOM3salGsmOoAGbDGw3WHCU9XA8bPK+nclkQ0TskNRlLqcd/m0MvXL8q db6CwSLsJSAbiDKFNbG/56RqMcpOV92Dzpv7R/+HJ9JhQxk+REtYZCkENmPEQiKFlnrBdB ztetSuBfp7xP0BV+wOQIP8Mnh5iCgdNGISJxXg8F2xAePn5V0LMI6oELqlC+fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753910838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/gPsotj40Am+PmSARfh9mNVkcQBiEj5d9Cwa90aZyo=; b=d8t411RjRZLZYUFugNGTJHMvqaBWQJ+rCriSZfE4ZFp/bPH882j/l2TCY61nuuVft6FdrQ 8zzUfnglR2T3TZm57ODGRcTHQ0uG+AKpi0zKNN+OAHY4lI10yO/x0GGNjfm6BgadHmGDOU kn8q/eugHYBprGi4i/K/FPlijK2YRVGB9HmCkloXJ5g/dKasyDOrE+Nkac1o3cCZfrFbTa 3VIucxcYNeSw4+8xFOmSmKzM2DdXy///3IyfGCLeJYoYyM5EJ8g5aesfen/6gK8hYPik7t hfmBb6osYyv7YSOz65TxCx9PjFV78FpuXnfkwDKc2ximLoYtP+q/yX5t7jKgQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753910838; a=rsa-sha256; cv=none; b=NWLxNfcajeJoDtUyPdlsEB0bBIhjk5XlgpaM14y5QBKhdF54rFsqiA9X5C1/8x2h4j3w5Z HRH4eWOPJQ4o99+chZAu66S73OqJEEm+y162LKD4cNAqF/MD3mdPM1AnFxAwWdWIVpBzCG LxRBqOXlYxn1AimPqNqCLqTZuhw/D6G+1qexGOiyuD/llCYoCu4jDNUd7qv5Fz9JHaBsCN S212PYeHDtfn/aRdREHbF1W2miUDsiIT/o+8tI/Yr9yUG5xagsPxAa3k/vN1uFW4dObHFu EQnRyQA+XQVWlIigo+oLbGRpbvwgH5uVtICjw/mvC5pOWrdDY+HVW464iVWfuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bslfZ4RbqzZGw; Wed, 30 Jul 2025 21:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ULRIVI024748; Wed, 30 Jul 2025 21:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ULRIMp024745; Wed, 30 Jul 2025 21:27:18 GMT (envelope-from git) Date: Wed, 30 Jul 2025 21:27:18 GMT Message-Id: <202507302127.56ULRIMp024745@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: 6f4de208edde - main - ufs: change isrmdir type to bool or u_int as appropriate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f4de208eddec8556da1beba6e732f8abbbd8d8e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6f4de208eddec8556da1beba6e732f8abbbd8d8e commit 6f4de208eddec8556da1beba6e732f8abbbd8d8e Author: Konstantin Belousov AuthorDate: 2025-07-29 13:35:17 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-30 21:27:12 +0000 ufs: change isrmdir type to bool or u_int as appropriate Use bool for isrmdir argument to ufs_dirremove()/softdep_setup_remove()/newdirrem(), where it is used as bool. Use u_int for isrmdir argument to ufs_dirrewrite()/softdep_setup_directory_change() where it is 0/1/ino. Without the change to unsigned, the if (isrmdir > 1) test is broken on volumes with many inodes. Use newparent instead of isrmdir for the argument name in this case. Reviewed by: markj, olce Tested by: pho Fixes: 610319c766e941de96e52f2d28fea9f8cfc51aeb Fixes: 98eb6f0eaa50d8bd9a6794f0a9da2eddeae5bcd8 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51617 --- sys/ufs/ffs/ffs_softdep.c | 20 ++++++++++---------- sys/ufs/ufs/ufs_extern.h | 8 ++++---- sys/ufs/ufs/ufs_lookup.c | 7 ++++--- sys/ufs/ufs/ufs_vnops.c | 8 ++++---- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 3f4aec02ba49..67cd6fb4b738 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -274,7 +274,7 @@ void softdep_setup_remove(struct buf *bp, struct inode *dp, struct inode *ip, - int isrmdir) + bool isrmdir) { panic("softdep_setup_remove called"); @@ -285,7 +285,7 @@ softdep_setup_directory_change(struct buf *bp, struct inode *dp, struct inode *ip, ino_t newinum, - int isrmdir) + u_int newparent) { panic("softdep_setup_directory_change called"); @@ -765,7 +765,7 @@ static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *); static void handle_workitem_freefile(struct freefile *); static int handle_workitem_remove(struct dirrem *, int); static struct dirrem *newdirrem(struct buf *, struct inode *, - struct inode *, int, struct dirrem **); + struct inode *, bool, struct dirrem **); static struct indirdep *indirdep_lookup(struct mount *, struct inode *, struct buf *); static void cancel_indirdep(struct indirdep *, struct buf *, @@ -9169,7 +9169,7 @@ softdep_setup_remove( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir) /* indicates if doing RMDIR */ + bool isrmdir) /* indicates if doing RMDIR */ { struct dirrem *dirrem, *prevdirrem; struct inodedep *inodedep; @@ -9361,7 +9361,7 @@ newdirrem( struct buf *bp, /* buffer containing directory block */ struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ - int isrmdir, /* indicates if doing RMDIR */ + bool isrmdir, /* indicates if doing RMDIR */ struct dirrem **prevdirremp) /* previously referenced inode, if any */ { int offset; @@ -9490,7 +9490,7 @@ newdirrem( dirrem->dm_state |= COMPLETE; cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref); #ifdef INVARIANTS - if (isrmdir == 0) { + if (!isrmdir) { struct worklist *wk; LIST_FOREACH(wk, &dirrem->dm_jwork, wk_list) @@ -9525,7 +9525,7 @@ softdep_setup_directory_change( struct inode *dp, /* inode for the directory being modified */ struct inode *ip, /* inode for directory entry being removed */ ino_t newinum, /* new inode number for changed entry */ - int isrmdir) /* indicates if doing RMDIR */ + u_int newparent) /* indicates if doing RMDIR */ { int offset; struct diradd *dap = NULL; @@ -9558,10 +9558,10 @@ softdep_setup_directory_change( /* * Allocate a new dirrem and ACQUIRE_LOCK. */ - dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem); + dirrem = newdirrem(bp, dp, ip, newparent != 0, &prevdirrem); pagedep = dirrem->dm_pagedep; /* - * The possible values for isrmdir: + * The possible values for newparent: * 0 - non-directory file rename * 1 - directory rename within same directory * inum - directory rename to new directory of given inode number @@ -9572,7 +9572,7 @@ softdep_setup_directory_change( * the DIRCHG flag to tell handle_workitem_remove to skip the * followup dirrem. */ - if (isrmdir > 1) + if (newparent > 1) dirrem->dm_state |= DIRCHG; /* diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h index ccd9046a5fa8..111fb1cb40b3 100644 --- a/sys/ufs/ufs/ufs_extern.h +++ b/sys/ufs/ufs/ufs_extern.h @@ -66,8 +66,8 @@ void ufs_makedirentry(struct inode *, struct componentname *, struct direct *); int ufs_direnter(struct vnode *, struct vnode *, struct direct *, struct componentname *, struct buf *); -int ufs_dirremove(struct vnode *, struct inode *, int, int); -int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int); +int ufs_dirremove(struct vnode *, struct inode *, int, bool); +int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, u_int); int ufs_lookup_ino(struct vnode *, struct vnode **, struct componentname *, ino_t *); int ufs_getlbns(struct vnode *, ufs2_daddr_t, struct indir *, int *); @@ -93,9 +93,9 @@ int softdep_setup_directory_add(struct buf *, struct inode *, off_t, ino_t, struct buf *, int); void softdep_change_directoryentry_offset(struct buf *, struct inode *, caddr_t, caddr_t, caddr_t, int); -void softdep_setup_remove(struct buf *,struct inode *, struct inode *, int); +void softdep_setup_remove(struct buf *,struct inode *, struct inode *, bool); void softdep_setup_directory_change(struct buf *, struct inode *, - struct inode *, ino_t, int); + struct inode *, ino_t, u_int); void softdep_change_linkcnt(struct inode *); int softdep_slowdown(struct vnode *); void softdep_setup_create(struct inode *, struct inode *); diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 3f9c95e934fc..fd0539c40c0d 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1101,7 +1101,7 @@ ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, * to the size of the previous entry. */ int -ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) +ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, bool isrmdir) { struct inode *dp; struct direct *ep, *rep; @@ -1224,7 +1224,7 @@ out: */ int ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, - int isrmdir) + u_int newparent) { struct buf *bp; struct direct *ep; @@ -1267,7 +1267,8 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, if (!OFSFMT(vdp)) ep->d_type = newtype; if (DOINGSOFTDEP(vdp)) { - softdep_setup_directory_change(bp, dp, oip, newinum, isrmdir); + softdep_setup_directory_change(bp, dp, oip, newinum, + newparent); bdwrite(bp); } else { if (DOINGASYNC(vdp)) { diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index b7453db9013c..ee2188baf28d 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1051,7 +1051,7 @@ ufs_remove( #ifdef UFS_GJOURNAL ufs_gjournal_orphan(vp); #endif - error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, 0); + error = ufs_dirremove(dvp, ip, ap->a_cnp->cn_flags, false); if (ip->i_nlink <= 0) vp->v_vflag |= VV_NOSYNC; if (IS_SNAPSHOT(ip)) { @@ -1209,7 +1209,7 @@ ufs_whiteout( #endif cnp->cn_flags &= ~DOWHITEOUT; - error = ufs_dirremove(dvp, NULL, cnp->cn_flags, 0); + error = ufs_dirremove(dvp, NULL, cnp->cn_flags, false); break; default: panic("ufs_whiteout: unknown op"); @@ -1728,7 +1728,7 @@ relock: "rename: missing .. entry"); cache_purge(fdvp); } - error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, 0); + error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, false); /* * The kern_renameat() looks up the fvp using the DELETE flag, which * causes the removal of the name cache entry for fvp. @@ -2309,7 +2309,7 @@ ufs_rmdir( ip->i_effnlink--; if (DOINGSOFTDEP(vp)) softdep_setup_rmdir(dp, ip); - error = ufs_dirremove(dvp, ip, cnp->cn_flags, 1); + error = ufs_dirremove(dvp, ip, cnp->cn_flags, true); if (error) { dp->i_effnlink++; ip->i_effnlink++; From nobody Wed Jul 30 21:27:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bslfb6Lq2z633Zk; Wed, 30 Jul 2025 21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bslfb5L60z3bNm; Wed, 30 Jul 2025 21: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=1753910839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DSkValREaAmuoGKB0f3gzj4FGkw5NguQnMqnjbIc/BM=; b=dx2OR3SN7z8cjjGUHOX94TCXZleOqiJEfdJPyB0LscDuCneNBTK8f5Myb5tM6AjtLEp1uW YjUJ6i/aAwWMQBPFbAPiaOiO4JWT3JFD9ePFo+yMb5P0NP+35QKe5AmuRcHZ8+QPc3BamD icTh1sPF64NW3pIH0HJWvQ2aAwGMEOcmVEp5XGzAnI1OaxBR2Jjl3u8hx4f/uoBp/z+yBt pdcaaTcAZ5WzWXTBqiFAJ5LrHAvUbbI8soWvGimJLB8h+KKw4m/6inuwByw5y94n/XS9dl oeDpzuyWwwD4KM69qoakK1Dk/UH7J7rvpqYJi/YgDLPKp08prZQW4buw0SZNFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753910839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DSkValREaAmuoGKB0f3gzj4FGkw5NguQnMqnjbIc/BM=; b=bLilNLpXOcYSisN/Zf245sABc3bllu+Cc1YsvXWEeaY7YK+cE4bD7ZayD/dd7eOmzcdsyL LEoAkat2E6qApkOrVdoSTMMkY/bvTboKaK6hRcqg/WQKNT2LyObvmJENIyfkeojDobobCC VO0C41uStg2YKHvh9KWxmOwWsvkTC7SYKbunniqLOjDUvvR4Y9VIxg1TOxB3d6w7C+QA8u tyFlkzXPLulaupKk+ZW9Lmr5En/CClQb/eeLk7f20P69NLph8QuP00RpUD4BgKNByW0Y6P 0l8VljEcYxe2p2otSXQfEMjgHYq2wHJsJDpoD/krVa9opzjqKBNounnaVah9CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753910839; a=rsa-sha256; cv=none; b=T4ZpbGWpOFhQssZY5/eJdp7lMworV/wsp2EmChXtmZkTwQPbKzq3G6BcOej3yQe3alRggW BST5hXdySwEeeqWBPTiy4hq6lj3nMT5h/hscfLzEh0cYg1DQ/uXHTxTkOZBactq5yWYCsj qgttBYbZHVlFDZEcG8dtjx1p/uhehYNaVv6dR+VU/plCt/wiwQ6U0ihHGzU6UviUWrnK8k vgm6e702g4LxDd/gmavNMMHO+UqCFiFzyLJtVblXYLu1kFA9EWzrQs50ErgNQIRMUn6ryN sWttC58XIUtuzjG4YjkFFdrJepmrDD0+QQHx9W8pYfJwWXmPQxCeVv/sly1zyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bslfb4D99zYkv; Wed, 30 Jul 2025 21:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56ULRJgl024782; Wed, 30 Jul 2025 21:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56ULRJgG024779; Wed, 30 Jul 2025 21:27:19 GMT (envelope-from git) Date: Wed, 30 Jul 2025 21:27:19 GMT Message-Id: <202507302127.56ULRJgG024779@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: 2e3fa9395fc6 - main - swapongeom: destroy consumer/close vnode in case swaponsomething failed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2e3fa9395fc67e7369fda8d8b5c6613142d2a57d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2e3fa9395fc67e7369fda8d8b5c6613142d2a57d commit 2e3fa9395fc67e7369fda8d8b5c6613142d2a57d Author: Konstantin Belousov AuthorDate: 2025-07-30 15:00:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-07-30 21:27:12 +0000 swapongeom: destroy consumer/close vnode in case swaponsomething failed Fixes: aa42e4984997c9d3aa5d30534bdaf760e613e97b Reported and tested by: olivier Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51636 --- sys/vm/swap_pager.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 327cac661044..c01b9e45a32b 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -3278,6 +3278,7 @@ swapongeom_locked(struct cdev *dev, struct vnode *vp) cp->index = 1; /* Number of active I/Os, plus one for being active. */ cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; g_attach(cp, pp); + /* * XXX: Every time you think you can improve the margin for * footshooting, somebody depends on the ability to do so: @@ -3285,15 +3286,19 @@ swapongeom_locked(struct cdev *dev, struct vnode *vp) * set an exclusive count :-( */ error = g_access(cp, 1, 1, 0); + + if (error == 0) { + nblks = pp->mediasize / DEV_BSIZE; + error = swaponsomething(vp, cp, nblks, swapgeom_strategy, + swapgeom_close, dev2udev(dev), + (pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 ? SW_UNMAPPED : 0); + if (error != 0) + g_access(cp, -1, -1, 0); + } if (error != 0) { g_detach(cp); g_destroy_consumer(cp); - return (error); } - nblks = pp->mediasize / DEV_BSIZE; - error = swaponsomething(vp, cp, nblks, swapgeom_strategy, - swapgeom_close, dev2udev(dev), - (pp->flags & G_PF_ACCEPT_UNMAPPED) != 0 ? SW_UNMAPPED : 0); return (error); } @@ -3385,6 +3390,8 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks) error = swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close, NODEV, 0); + if (error != 0) + VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); return (error); } From nobody Wed Jul 30 22:32:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsn5b1sPzz637G1; Wed, 30 Jul 2025 22:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsn5b0V9bz3kK0; Wed, 30 Jul 2025 22:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753914739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QlWe9z3WUOQugdG2IxP+zkFNw3/wQErG4rcNJofakIA=; b=Ull5ApWhPCaTfK+WZsqrC1nNVmoKnbqTRM4StmoNDWfjKlL9yX6CIg4YXlAYIpRZFKFO8Y Tiz4SF5X7ibPTuhuVlhLZ1oyNBjrZIC5OhdS2KunFLeBM2+nvbAo3n3vujnZYVpwtwUW5g CHEsNxGfCbBY7/biFanfSe+WgPzwEpYugghd1IDngHl4YMTBsEwxkXcQ79e6ltMEmcjnb1 nHdmJa1CbE2chNhyet7nkTBOz8w5JQ8eMz99nn+JfUWJwtMM4mbZdo74V1JSaLrurzrGe8 vPYDb1rR8EZV1ySc4rRw8jnnS/DKRB0QcTjO6CBBEYPgMYglX4IMrnFrDHeWqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753914739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QlWe9z3WUOQugdG2IxP+zkFNw3/wQErG4rcNJofakIA=; b=Bg0Wj/xBk3JZrF531BMMpPQVzOlDIXxk1iDC0GnJ5nYAm2euHt1MmLQNUqAA0YcctsnC6S 42CKUKY5xBXfWVJCFrYxOWINKs//YdpBRw4U/IAtMjqAEUiegqpTxEQyslR542xtIQsFHt LERS8GKB4uS2Oqa5IN46bJUg7TVw3ZRSlgZTsmmP04P5VfFPJNhF+vNOHOeQ+p21ixgsLJ QFBFQQI19tb0tuh1N1TcglKZrJIEibRVr0wGxZxZ48fnMZ8VOIWcIjm/pv/wPBYEkKunN4 y3pITL0InuB1dgKq157H4JhCY4kSKZdk4Il7lhDStunTbFZwRdYLqNE2GeXPdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753914739; a=rsa-sha256; cv=none; b=OEDFNyKetF572LcZpnk0vIcp75uGRvrnXYZOCFhhlQwI+lqnThMl97woxRSvWdijG+5t8a fHsYTGvjIF2INtJ/PwLDqGp1MHuv1Ic4zjehaQokcP92sunk2v/o+godJ/nzl4Z0KYXPKh l2VdjiyOtVVPAd6OFo2FvDDfIPjMyPZ2hzv7qlb6c6qFc02ltytyTaabRJTqzLMZYvnICW cl9LA7vH14vijZ4I7SF2V2/b/WEnqRfvs8Jx2yhBUnO01r7xq8LeVo3aJR5HS052lt93Cg YQT2pd3BDPGFnpSAP5LTLqyweeKvh26DazZ30d/z5gq+UfYPPKfxRXB40gvemw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsn5Z70Bfzc0r; Wed, 30 Jul 2025 22:32:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UMWIR4051078; Wed, 30 Jul 2025 22:32:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UMWICL051076; Wed, 30 Jul 2025 22:32:18 GMT (envelope-from git) Date: Wed, 30 Jul 2025 22:32:18 GMT Message-Id: <202507302232.56UMWICL051076@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: 3b3a28975820 - main - syslogd: Fix function return test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 3b3a28975820b302a8bb8c69ef96a38d8a7c7aed Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3b3a28975820b302a8bb8c69ef96a38d8a7c7aed commit 3b3a28975820b302a8bb8c69ef96a38d8a7c7aed Author: Nathan Huff AuthorDate: 2025-07-29 21:58:30 +0000 Commit: Ed Maste CommitDate: 2025-07-30 22:32:05 +0000 syslogd: Fix function return test Looks like during the capsicum setup the return value for cap_syslogd is checked twice rather than checking the return value of cap_net after initializing the casper service. Signed-off-by: Nathan Huff Fixes: 897240c7d666 ("syslogd: Enter capability mode") Pull-request: https://github.com/freebsd/freebsd-src/pull/1796 --- usr.sbin/syslogd/syslogd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 726cedc17b1d..fe7427130b78 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -2571,7 +2571,7 @@ syslogd_cap_enter(void) if (cap_syslogd == NULL) err(1, "Failed to open the syslogd.casper libcasper service"); cap_net = cap_service_open(cap_casper, "system.net"); - if (cap_syslogd == NULL) + if (cap_net == NULL) err(1, "Failed to open the system.net libcasper service"); cap_close(cap_casper); limit = cap_net_limit_init(cap_net, From nobody Wed Jul 30 22:57:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsnfl4l4dz637rm; Wed, 30 Jul 2025 22:57: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsnfl45x4z3mJg; Wed, 30 Jul 2025 22:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753916255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NJQ9Pkie3vqA/Q2EV3T077b8k+r3CyAOLJ0mmScslIw=; b=kaPc4cFTlu6eyNRF0VBToqYKAhsP8KvtG3fl/YGnYDhMSAM0xuE+6bCN94VgH3p9vp04+8 WmN3YAfEACXinU5C0DGwCEZkZG7HsTO2Gdurn5ZKy2bKbL2OXavt0eCs2M3jNgs9iWQkp8 hWnYVS661GGmGUCLnVVsBHD8ZC5iJo8hrQgEwrzyGGQuDjATreMU95Ugo4SYd4/8GLrkt9 Gf01seguaSZPWEOE0iRZ/OVLZCNy1p7LnvXLekJsahUfC5HffPnkcKRZp+gMnWdKipO2pK xBCs6BI5ehnCFIbJ+OhQWyv0fnSUBPNdeX7/ON6IRiYBhX2McqCCZOVAS/Sn6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753916255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NJQ9Pkie3vqA/Q2EV3T077b8k+r3CyAOLJ0mmScslIw=; b=NyoXjWWewMKGUi+ZmhC0F9U3nwwRWFndmAW4KpQp8Y7kpLrwKG8UU8ygCWEabmsnHS8VnC QFcHHyT2FjttRdXNMPimy/UPyIqEkIQtSpr6B1EVxbN/UbdWMZS5REDLHH1oKGCDPhBLcv +jO61BjEnwL6Q/EEuUYwWqOVnxEDeFlwK/zl843d2diUX7sN+yXauOZvNNnSNdaars2yjt 3CsVtHaiKvAqaa9dt0FGJKf2wGucm0fdFliPPg4Ryxkdq4E3hZLt7/9b4+CdzbOwJYv6Fe loWjmLRi4wy0SaQU0uyaUeid2IFGbOiTYZpeuhVMhCV3QHLQORPuSSp3352zfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753916255; a=rsa-sha256; cv=none; b=Gbir3yJJb9/9VhfHY+fhBUJlb4PWuidUbIr3Vub4c+RLQbtj2CVOPRrV5IrdWp0MVATCEm hSxiJBQrgsUNCFkf5fAJrDxMtzbN4ASZbMQBU3yZqSE1wZ+CVyiogjWO4EFIxJywrZGK/R zE6AE8JobPRk5D+5hQmZ9jwKSP/zs6t8ZxSPT9kocDv2cogRDPMEEjTMWHhYgYNIs7UN8T bdRA/e2xfL2H6RwTufFoRqijZJ1kQLGTFLNdIVg/e3iH3ZJ/+dcCCC1Mgs3iDuhL9BgGIF E2Uwzh2iBCFH3u27tqCS/p0ZgKttc8k8aHEElQUf8EmSsrSz2WqaFxDHmFxEeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsnfl3hl1zcxf; Wed, 30 Jul 2025 22:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56UMvZBG093766; Wed, 30 Jul 2025 22:57:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56UMvZZn093763; Wed, 30 Jul 2025 22:57:35 GMT (envelope-from git) Date: Wed, 30 Jul 2025 22:57:35 GMT Message-Id: <202507302257.56UMvZZn093763@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: 6fa24b29d8ff - main - release, bsdinstall: include FreeBSD-kernel-man package List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 6fa24b29d8ff9af93cd249520b648cc745b1ef60 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6fa24b29d8ff9af93cd249520b648cc745b1ef60 commit 6fa24b29d8ff9af93cd249520b648cc745b1ef60 Author: Isaac Freund AuthorDate: 2025-07-25 11:31:59 +0000 Commit: Ed Maste CommitDate: 2025-07-30 22:57:17 +0000 release, bsdinstall: include FreeBSD-kernel-man package This package has been newly split off during man page reorganization and should be considered part of the "base" component rather than being ignored. Update pkgbase release and bsdinstall scripts for this change. Reviewed by: ivy Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51519 --- release/scripts/pkgbase-stage.lua | 4 +++- usr.sbin/bsdinstall/scripts/pkgbase.in | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/release/scripts/pkgbase-stage.lua b/release/scripts/pkgbase-stage.lua index 01eec8c44e49..1b48b4faede3 100755 --- a/release/scripts/pkgbase-stage.lua +++ b/release/scripts/pkgbase-stage.lua @@ -46,7 +46,9 @@ local function select_packages(pkg, media, all_libcompats) table.insert(components["src"], package) elseif package == "FreeBSD-tests" or package:match("^FreeBSD%-tests%-.*") then table.insert(components["tests"], package) - elseif package:match("^FreeBSD%-kernel%-.*") then + elseif package:match("^FreeBSD%-kernel%-.*") and + package ~= "FreeBSD-kernel-man" + then -- Kernels other than FreeBSD-kernel-generic are ignored if package == "FreeBSD-kernel-generic" then table.insert(components["kernel"], package) diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in index cf8e84de6923..d123394c170e 100755 --- a/usr.sbin/bsdinstall/scripts/pkgbase.in +++ b/usr.sbin/bsdinstall/scripts/pkgbase.in @@ -165,7 +165,9 @@ local function select_packages(pkg, options) table.insert(components["src"], package) elseif package == "FreeBSD-tests" or package:match("^FreeBSD%-tests%-.*") then table.insert(components["tests"], package) - elseif package:match("^FreeBSD%-kernel%-.*") then + elseif package:match("^FreeBSD%-kernel%-.*") and + package ~= "FreeBSD-kernel-man" + then -- Kernels other than FreeBSD-kernel-generic are ignored if package == "FreeBSD-kernel-generic" then table.insert(components["kernel"], package) From nobody Thu Jul 31 00:07:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsqCp6zBJz63CJs; Thu, 31 Jul 2025 00:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsqCp6DrCz3rlb; Thu, 31 Jul 2025 00:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753920470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYgs40vz4pgrbHrHJsVOt5PhoeTVbGPUtI1WSiRChvk=; b=IKBUD9NZoZOu9uZ9YocmeuAtAoj9PRgkG2NA/F6F9hWG0Ekc0Ox367eEIXkCYD7pfaW41I FjtepLrOClz9NCetMblPl6BsfELzS0Ggonqk4rT4arA/74VZDE/C6lVeZAhUWTV0cmRW/5 w2ERrKhWaY+T9y0cJLJdcTdV30nHEdt9PHOcLBkaUmOb9Rns98N0O+flRPA1t9O7my7/6l GH5zZK4TXC/J4bNre1i2bu2FRgPlxXJaAqKO4jHtI1kx3kmjYWPFFCYpr4lq3IIsp1iUDW ZdTDp27Q/9rSLFOY8QwZch12Soy0fkm8xbGy+s9UrsFDg9j4ZxgBuMY6ufDJ8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753920470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYgs40vz4pgrbHrHJsVOt5PhoeTVbGPUtI1WSiRChvk=; b=PSfkP8qVEf/GZ8Scwnt8GfDaJpIyexebHHmDvsu6VHotXJrIHeOE8xe/ejjW3KzktCOnq9 WSZB8fDUe47CdKXQ8scMqb5F0UyadJoKX9DWyb4evTzZIdbVg0oeuUzXogDpczcjXdZgR9 mXzugTsK71cy/p7/WxStr9gNFSu01h1OHkwtXmIZG9bCN/Kv+Pr6RQksk3QhG8YO1W/0hJ tlfanZ2GxiH6bMdN5qF05kshK2+p5Xb7z5Lg4c8O3IuPTXA+ldKvGenHHhd3gBfVHtSn7k +eX3gAJmnWU6WZiHqIBPh0Dv7q0fYF5hJCbglRCutwN1ON7+PFsfmkw6DC1pzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753920470; a=rsa-sha256; cv=none; b=sUhk8RN4QDZXutByUN6WCyeOwAZpTK4bfkTW5l6f10xP7Cf8s1umvFCDOWsqkQlZQVP1Wb OKNKfZuaZ2nCcECpN/sx3AN6aE4zwAVVowE9Xvc/E7/VZZtOfE6MFYvMw8zDb/0z9Hg7bK rNkP6u220xt32a2X6szgir59TEd/p0r7PgTElGqQ1pHmUYrzs/5km4n+7b3Sfdp9X5MDUc vYc6zbLd8MFeb73OB2rwJlZ09E0xe1vSfqDuN3ewIKFIl4DUsy+3FUaILkobXc8Halm0NH RPTtucAgQTFbGdq3AcZsA9p6DdgkNU0Q8L2mInqEBh9reWIxSMrTMZYNp4XQ1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsqCp57gwzf05; Thu, 31 Jul 2025 00:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V07oNB026198; Thu, 31 Jul 2025 00:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V07o5E026195; Thu, 31 Jul 2025 00:07:50 GMT (envelope-from git) Date: Thu, 31 Jul 2025 00:07:50 GMT Message-Id: <202507310007.56V07o5E026195@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: fd05ce71c736 - stable/13 - dtrace.1: Resolve merge conflict List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: fd05ce71c736143f0b3f569765f5374956ce8c10 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fd05ce71c736143f0b3f569765f5374956ce8c10 commit fd05ce71c736143f0b3f569765f5374956ce8c10 Author: Ed Maste AuthorDate: 2025-07-30 18:05:29 +0000 Commit: Ed Maste CommitDate: 2025-07-31 00:06:49 +0000 dtrace.1: Resolve merge conflict PR: 288556 Fixes: 0c91fa982437 ("dtrace_fbt.4: Document the DTrace fbt provider") (cherry picked from commit 185bd9cf219999a38093e853bfda8ed1ca21fc5b) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 9b6eb03226a9..853538949a4d 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -18,13 +18,9 @@ .\" CDDL HEADER END .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved. .\" -<<<<<<< HEAD -.Dd June 14, 2025 -======= .\" $FreeBSD$ .\" .Dd July 16, 2025 ->>>>>>> 9388c2887817 (dtrace_fbt.4: Document the DTrace fbt provider) .Dt DTRACE 1 .Os .Sh NAME From nobody Thu Jul 31 00:08:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsqF01VVhz63CJx; Thu, 31 Jul 2025 00:08:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsqDz6YTNz3sY9; Thu, 31 Jul 2025 00:08:51 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3de2b02c69eso1192095ab.1; Wed, 30 Jul 2025 17:08:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753920530; x=1754525330; 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=u/q7PSNGxc867O01OUPsMxEIugiBpn7vdc2tRsNj/do=; b=uEEeBk9SceyZrClldL4/wbJoJWyKjEGIgy7kEn6nBAcPelDuTPGb/lZ8mX69hHixu0 zFWhxZ9YTCMTdE/6eToklzoFSyMBJeA+fdvgSgkGkF7fyzqFAwHCPPLOz1I+btiBehly 9Gejm6awscLbNxI+hsm6YFIyvH2fM21p0OmlbnnoUxjX4ty2w0wTJeLrb95adurPL5FZ IP9zx5y7MbkULZqjCzwBGXmJGfZ96cyb2aU6tKFFY//VsOyDk7VEFc8FLSXf4JAHqPDk vYU6QZv5LTWi7L5NAnpKFWMDjRIywn4NL1tZ/jZ3xWAHtBU3h7/Wgjo/mJHlOHVMIksn VxOA== X-Forwarded-Encrypted: i=1; AJvYcCUDYJpWXtHZSxr3p3cGKmcmNiLRqrZkgxriEb0cqo4jX1g+7utD0c4xRD2jIaKMC2edh4TS70uPN6FU+1TrJxs=@freebsd.org, AJvYcCUvfSwLE0tV4kk4LIPNBJ17NhTKj5McFsribVOSquZUclOu5qYX7iQFchDxWKaccsrDJa/9kPkJmw9HzqxQat1X9Q2WbIChNNhk@freebsd.org, AJvYcCV66fiy/NojnqX3Wx5jO63CTMHW/BR36HvtK7+F4YxS6JjCArJrmjTgU7H/AT8Hmr3XWJb0O5Mg0J8w/7g7ENh6i0xIog==@freebsd.org, AJvYcCXwp4cAc6FMLDfwrtcL/XolfKmNnCu5sKd+LaM8RsMGxhfMPacyA8CZv1tIZNSJLp0zaPo=@freebsd.org X-Gm-Message-State: AOJu0YxnI22wDMx6Zcg/kyzje4HdER3PBMOY4fiJcpxo2EX1oRWwwOQx 4NATwM8twQORFTUFzMxI/waf4DKBjNsiT+AZyiaA6rQ6GRRSs09RhmMccWLlUbewiHtXBy5bXvG zlVuNjYu4u0u0wqA0dHKoss2tq/I/mxRHgQ== X-Gm-Gg: ASbGnctxLE+xrQr+OZlBmPXIQS1ZwhNy/KokfGXDsGaRxDj22bsQ9hPmq22QYOzcJDa xgVcHmq0dH0tBGN0W9wV8Nyo7IfNrHN5BzbQkD4QE1xIKT8YP5qRlfB/f1Phx6Q7/EH/aEwdKi2 JJmwvtEbRAOFQd1nhHKHeVMbZt8O4Z9ay0YLI+wy+53kgUh4h8s9U61MPKScJtCcqhKNXbiZxpl V7gc7ds4h4zS+U0qwZwOa0NsvRDqihRwl7VrrkCfg== X-Google-Smtp-Source: AGHT+IFJNUQYefuXXlv+o0gQRlZ4TRoYxcjkbYjlOIZklJ6XJOLrL73CdRWl+BC5UZfuJHZpsWowKGKIBjJR885Z11g= X-Received: by 2002:a05:6e02:1aa1:b0:3e3:d499:73f with SMTP id e9e14a558f8ab-3e3f62af9a7mr101972415ab.18.1753920530189; Wed, 30 Jul 2025 17:08:50 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507300936.56U9aujh087527@gitrepo.freebsd.org> <3EA9D815-0483-4A2A-A568-00023FB66744@panasas.com> In-Reply-To: <3EA9D815-0483-4A2A-A568-00023FB66744@panasas.com> From: Ed Maste Date: Wed, 30 Jul 2025 20:08:38 -0400 X-Gm-Features: Ac12FXx1xP8n9utfeAAS0vZOVdZ6OiXbr1gAWZf-6JLA5Ihy1jhYpN9PT9uPELE Message-ID: Subject: Re: 0c91fa982437 - stable/14 - dtrace_fbt.4: Document the DTrace fbt provider To: Ravi Pokala Cc: "Bjoern A. Zeeb" , Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4bsqDz6YTNz3sY9 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On Wed, 30 Jul 2025 at 16:21, Ravi Pokala wrote: > > I think the same mis-merge went into stable/13 as well... Ah, thanks for the note - merged the fix from stable/14 there. From nobody Thu Jul 31 00:24:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsqb10PPSz63Cgc; Thu, 31 Jul 2025 00:24:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsqb06kmyz3tf4; Thu, 31 Jul 2025 00:24:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753921469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pA08RjHTN80kf8wve5qKfsun7q8hOxm/f8jbID8hMys=; b=n5lBPudv1G7U6Un+BF5FvG6x/i9IwsRx0NJDlHOfgVvfiU0OPMPMNG0Dj6ERbePy7ZiWjf Fp6Y39WQxnDUj0FAMvMD4XtbsuUgr1Fk7ePSZlZhErNFE4asPBXKHuS+f0yYAP7Hk3XX9V liD+crW8+rrOPxqV4T9QR2WAFLXhccaC9+9T9HjwnCoLRri7flkQa3SCgbxL5D+pBXaaKY OCbvtjhIvyY2uP6HyKgc/vHHQS6rIKlENDMfuobgI6tHY2BZnydPBA1kOAzKSptzuNSsAG u0l1pJydnW52hh3eXdknB1KLuyn6YOKkXPnY9Mbi17WNgTgQ1i6v2HYSiN3DRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753921469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pA08RjHTN80kf8wve5qKfsun7q8hOxm/f8jbID8hMys=; b=D91jCVw9QJR34prX1hGCTyNl4xT39BaaOb+d0pXOkjy9UwLmeCZUXDr0heUvnkf8nXGSPZ uERdEOUq2gx2THAj9eLZ/3Yp2bLm8hckWU5caxz1eljdWeBEmaHDluNkpiPe5f/Kp/NwXi mS7xa2iTfEYV6Bp4B3EOspcUhGg0MoLaD0aPfQkVZcut/gH5dfCYG3hN8Nd3AVmEnAZ0OB YLo1aNYg63UpvPa/ND6luTjCeelxY4KZo7uBEftCqgEYR4o2iM6BFZZEORchya9k5zTtlj tb9Rvy6+Y5vpYjcwyfsLtGHYEOdIVgLzZ/fjkKOc4qb2PxeFfoNnWLaP0tnvig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753921469; a=rsa-sha256; cv=none; b=HI7G3gIR/HbhJKGNVMYDryNBvUUctcCqcsls0PdKp22B2Rn9G1nyiUKs2HaYZXM3qxfsuf og1qgLuwkEwg1X7VritCCAXbUreBC9oDadYtCh7HRk+yycQju4khmUYI5ZPQHDIsOoQq3H InxYoJwcYJggTnwxInkoTYdRPmPd8Ab0JT1jaet+duyEoa1nKgjfLAwnXxR+PZys9gLOnE uVbYr7zNz9SUfQR5Gb+h5WWatxjYo9Qdn2q+T7alkUHrG10E3NfdPRB7HqjQj0zEA650SY F8VRN4dG/gEsVH8ZCgwnEdgd+Pew9qFZFVJIptjKHUkTRw3bLa6utHNtzgFe5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsqb0612vzffm; Thu, 31 Jul 2025 00:24:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V0OSOB062031; Thu, 31 Jul 2025 00:24:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V0OSTw062028; Thu, 31 Jul 2025 00:24:28 GMT (envelope-from git) Date: Thu, 31 Jul 2025 00:24:28 GMT Message-Id: <202507310024.56V0OSTw062028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: a01ce3b87d83 - main - swapon: Improve tests for non-standard kernel page size and small media List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a01ce3b87d83d4a2644b0d806318d09442817d3b Auto-Submitted: auto-generated The branch main has been updated by olivier: URL: https://cgit.FreeBSD.org/src/commit/?id=a01ce3b87d83d4a2644b0d806318d09442817d3b commit a01ce3b87d83d4a2644b0d806318d09442817d3b Author: Olivier Cochard AuthorDate: 2025-07-31 00:10:56 +0000 Commit: Olivier Cochard CommitDate: 2025-07-31 00:23:13 +0000 swapon: Improve tests for non-standard kernel page size and small media Add a test to verify swapon's behavior when attaching to media that's too small. This also adapts existing tests to accommodate kernel page sizes larger than the default 4KB. Approved by: kib, chs (previous version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D51641 --- sbin/swapon/tests/swapon_test.sh | 60 ++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/sbin/swapon/tests/swapon_test.sh b/sbin/swapon/tests/swapon_test.sh index b6d31ecaeed0..a04bb36cc49e 100755 --- a/sbin/swapon/tests/swapon_test.sh +++ b/sbin/swapon/tests/swapon_test.sh @@ -31,7 +31,10 @@ attach_mdX_head() attach_mdX_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo 'md31 none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md31 as swap device" -x "swapon -F fstab.out -a" } @@ -49,7 +52,10 @@ attach_dev_mdX_head() attach_dev_mdX_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md32 none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md32 as swap device" -x "swapon -F fstab.out -a" } @@ -67,7 +73,10 @@ attach_md_head() attach_md_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo 'md none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]* as swap device" -x "swapon -F fstab.out -a" } @@ -85,7 +94,10 @@ attach_dev_md_head() attach_dev_md_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]* as swap device" -x "swapon -F fstab.out -a" } @@ -103,7 +115,10 @@ attach_mdX_eli_head() attach_mdX_eli_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo 'md33.eli none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md33.eli as swap device" -x "swapon -F fstab.out -a" } @@ -121,7 +136,10 @@ attach_dev_mdX_eli_head() attach_dev_mdX_eli_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md34.eli none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md34.eli as swap device" -x "swapon -F fstab.out -a" } @@ -139,7 +157,10 @@ attach_md_eli_head() attach_md_eli_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo 'md.eli none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]*.eli as swap device" -x "swapon -F fstab.out -a" } @@ -157,7 +178,10 @@ attach_dev_md_eli_head() attach_dev_md_eli_body() { # if the swapfile is too small (like 1k) then mdconfig hangs looking up the md - atf_check -s exit:0 -x "truncate -s 10k swapfile" + # but need a swapfile bigger than one page kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize * 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" atf_check -s exit:0 -o save:fstab.out -x "echo '/dev/md.eli none swap sw,file=swapfile 0 0'" atf_check -s exit:0 -o match:"swapon: adding /dev/md[0-9][0-9]*.eli as swap device" -x "swapon -F fstab.out -a" } @@ -166,6 +190,24 @@ attach_dev_md_eli_cleanup() swapoff -F fstab.out -a } +### + +atf_test_case attach_too_small +attach_too_small_head() +{ + atf_set "descr" "should refuse to attach if smaller than one kernel page size" +} +attach_too_small_body() +{ + # Need to use smaller than kernel page size + pagesize=$(sysctl -n hw.pagesize) + minsize=$(( pagesize / 2 )) + atf_check -s exit:0 -x "truncate -s $minsize swapfile" + atf_check -s exit:0 -o save:fstab.out -x "echo 'md35 none swap sw,file=swapfile 0 0'" + atf_check -s exit:1 -e match:"swapon: /dev/md35: NSWAPDEV limit reached" -x "swapon -F fstab.out -a" + atf_check -s exit:0 -x "mdconfig -d -u 35" +} + ### atf_init_test_cases() { @@ -178,4 +220,6 @@ atf_init_test_cases() atf_add_test_case attach_dev_mdX_eli atf_add_test_case attach_md_eli atf_add_test_case attach_dev_md_eli + + atf_add_test_case attach_too_small } From nobody Thu Jul 31 03:35:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsvq202Zcz63Nb8; Thu, 31 Jul 2025 03:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsvq16LJjz3Cn9; Thu, 31 Jul 2025 03:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753932909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7w9bSXTyeph2TQbb1rxbB1oyoY1ge1iF4c5SIXHk67g=; b=SwOPZnskG1B9zMykVtOGjaXxEImdN9j5ECamGZkmMnNep4UZBM8lT92cOkiILs5WBN3uUW vEkKRXZ+R5idSJs7PT6cSqBW0fpqYFXs74l1CaGy+clarFzdGzEi6dr0R6B+jn9e1edpPf NNFaQPE/BwlxCOP7a5gW2PYu1VcWGP+uUOHLXOcr74YXWEBf7eurwXPQq+VjybZ4eoedU5 pIUEQuPMn8SPv3MMrpTRCYI3eRWrFsz9myVrrmW/jkODE3vwcvsYHM/YlUaWlLEHBuL/hZ 4JL/Z4C882R37aLZ8ti1gNAPNJI7eLpcccg5DVHSXUUI17DOJRlUjr2AW+sZcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753932909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7w9bSXTyeph2TQbb1rxbB1oyoY1ge1iF4c5SIXHk67g=; b=E4pQeZGJYn7Y8DLe5XpnONkv2X8cP7ZgTrAPgCjVIVGDz57gX4n4iw77NPpl7+T6JZ1O0L 5WtqeFiRS6v/t0DBMz7tkFC4wVYTCmX9KK84xiOF1T0lDiFZ9U0k4QOj5IJY3VY/4vkC5X ZDwKHjVKc5Rdepql8PVBw8notq09dv+f8OHrYGTtVKdw2Pj00UmmZ7p44UwRxYKUP5INeF Sj0cKp6VOjwUtXy70gUudXw7MCLKjBTuakg3VM3zLVLNxFsa6JR3acIZjRJN+o2FvSelmI KjWuBd1lVs6f5FJqMRiDwj/47v3o/mPdf4Vj7rxh20eIeTRY0giv1RKr/1Q3Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753932909; a=rsa-sha256; cv=none; b=c2CUl2dejlAZ4GOZoST0AFjrt+icj2pJ/OTvnl4rEAIy0dSkciNODzxZ38FRQlcTy3uwMX kEfFFwBZEHHBHZQ3iYZ6caU0AA0gNHdt4D86Ck1IiBJAYpo3rzeULGWYpPIPv47WEh9W0j /95zFyOPPgAB2GLJkJo4lvenso9L1WsZ4eFBTiMGQk623Zgkq8dOQIGslkCI2Bww2APXOB Qjb9X9UkklneMjfqRWG8ic8HCffgVqa2cSkCxH3NWwkVv/1zEkuQRcPP2JCJKQuwyMKX/F 1KxgIGYfgY+H3CgY/R/KQsg+qd/NeCdmsrQpI4fXwe9zVz6wEohVKaxbpgDVzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsvq15xNRzm5J; Thu, 31 Jul 2025 03:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V3Z9I6022487; Thu, 31 Jul 2025 03:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V3Z9OY022484; Thu, 31 Jul 2025 03:35:09 GMT (envelope-from git) Date: Thu, 31 Jul 2025 03:35:09 GMT Message-Id: <202507310335.56V3Z9OY022484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 147b90973b97 - main - Revert "src.opts.mk: Default LLVM_ASSERTIONS off" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 147b90973b97df902c01018a18e7f219f18c0b83 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=147b90973b97df902c01018a18e7f219f18c0b83 commit 147b90973b97df902c01018a18e7f219f18c0b83 Author: Kevin Bowling AuthorDate: 2025-07-31 03:25:39 +0000 Commit: Kevin Bowling CommitDate: 2025-07-31 03:33:52 +0000 Revert "src.opts.mk: Default LLVM_ASSERTIONS off" Enabling and disabling LLVM assertions changes the ABI. There have been multiple reports on the freebsd-current@ mailing list of broken 'cc'. Out of caution, you may wish to do a clean build while crossing this commit after building the reverted commit if you do not set LLVM_ASSERTIONS in your src.conf. Discussed with: kevans, jrtc27 This reverts commit 9b3055d0d4bcbe665d3c622c761adcc7d0a5b1c9. --- UPDATING | 5 ----- share/man/man5/src.conf.5 | 7 +++---- share/mk/src.opts.mk | 2 +- tools/build/options/WITH_LLVM_ASSERTIONS | 1 - 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/UPDATING b/UPDATING index 541bdf7ee7c7..28ff08e65ef5 100644 --- a/UPDATING +++ b/UPDATING @@ -42,11 +42,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: package, FreeBSD-bmake. If you use pkgbase and you need make, you should install this package. -20250727: - LLVM's debugging assertions are now disabled in main by default. - The WITH_LLVM_ASSERTIONS src.conf(5) knob should be used to - enable it when working on LLVM or requesting help with it. - 20250726: amd64 kernel configurations must contain "options SMP". diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index f93d3f9fc69f..a3db00aed42f 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd July 27, 2025 +.Dd July 14, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -940,9 +940,8 @@ amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le Do not build the LLD linker during the bootstrap phase of the build. To be able to build the system an alternate linker must be provided via XLD. -.It Va WITH_LLVM_ASSERTIONS -Enable debugging assertions in LLVM. -Use when working on or requesting help with LLVM components. +.It Va WITHOUT_LLVM_ASSERTIONS +Disable debugging assertions in LLVM. .It Va WITHOUT_LLVM_BINUTILS Install ELF Tool Chain's binary utilities instead of LLVM's. This includes diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 77923ae7b6d1..ef43d3c939b2 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -123,6 +123,7 @@ __DEFAULT_YES_OPTIONS = \ LEGACY_CONSOLE \ LLD \ LLD_BOOTSTRAP \ + LLVM_ASSERTIONS \ LLVM_BINUTILS \ LLVM_COV \ LLVM_CXXFILT \ @@ -209,7 +210,6 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ - LLVM_ASSERTIONS \ LLVM_FULL_DEBUGINFO \ MALLOC_PRODUCTION \ OFED_EXTRA \ diff --git a/tools/build/options/WITH_LLVM_ASSERTIONS b/tools/build/options/WITH_LLVM_ASSERTIONS index 6af75221a206..0e7fbfbda0a3 100644 --- a/tools/build/options/WITH_LLVM_ASSERTIONS +++ b/tools/build/options/WITH_LLVM_ASSERTIONS @@ -1,2 +1 @@ Enable debugging assertions in LLVM. -Use when working on or requesting help with LLVM components. From nobody Thu Jul 31 04:23:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bswvb1djLz63QBF; Thu, 31 Jul 2025 04:24:11 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bswvY68N6z3K7Y; Thu, 31 Jul 2025 04:24:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="W5+/Kx2H"; spf=pass (mx1.freebsd.org: domain of bjkfbsd@gmail.com designates 2607:f8b0:4864:20::102e as permitted sender) smtp.mailfrom=bjkfbsd@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-31ecdf5faaeso5722a91.0; Wed, 30 Jul 2025 21:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753935844; x=1754540644; 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=CcJ2apdFYpdA+awUmlzT4iZJzAUq3ten/tkzBbfzY5k=; b=W5+/Kx2HzKNqhl6i2Jm5TO7Z09wFPn3j79pr7TVuhPUNZ+VpJ44mUL+c6DqcVFEJ0t y+8qA7v1B/teF02xWdWlANINgMut+Z71GR3dRyTfAfx5TN4hHw9CGQt3PhSdN/KpxHli 4V7iQ+S88rM6cGEv1diyv87KYM0XGgGpHrjQUDPDiQts0qg335Z7WsZtrfbZax2dOKBs do16XFnuHlljO+bPVduNDPHnsK8LVibnjTddhjqHENHjW5EeiYhnKpylQm7oJHzXWkIR UQtjY7ZLUGWtsX84I1QIiU/ddBUsLQXkgLLCtd84Lv59qWRBsxSlrLayk7LWhe80sud7 e9cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753935844; x=1754540644; 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=CcJ2apdFYpdA+awUmlzT4iZJzAUq3ten/tkzBbfzY5k=; b=QO/4t4qOeoiflqhL8jHvO7lm85CM0QN0apSITOBbzlHc+PWCccvFBqR3yFKnh1Oedg RNVFgwIPPqK/VQcCH5uCUj5URXUeXjzQBmj11Dj5+0I+DrdOGYRvUZnuhMqqCs/7F5my OxQUY4FYHPawJdXrO0crmgtrZIZEIDRc9ekNGiOOsv02Obx90dLSl0owI+A/L4duQ312 2ZdI/Rs+X0XDl/hhSltGA0z0hcAnJfA0EdGSseuYCG+eAH7TroczzcLLSCUZNe+TvVTv 7ou+sFLNsNRL5aj+wu2JRv15RZYHVwRK7q3V1sm4u4Ic/NdpYraz94hYGo3KmOp5G+zb mUTg== X-Forwarded-Encrypted: i=1; AJvYcCUqwrIYplyMhXfIBmhNW2KfsXA/Pb6I/LkgyIB2Fqk0etzgcFhebzaCjf9DAPOElRjPmaVArinHYJDXdjRdAsyOnjM6Rg==@freebsd.org, AJvYcCVggVdQQMzpkctXVViiSVytQWPQEN9IhPMVq6FqnpP90AwOspS5U1ZCUj9i6prWBETvlKDesO4GoZttXkVxA/Y=@freebsd.org, AJvYcCWjIMLzldLQ5qprrhuUS/Ebb2ZMHqF1wA20etyXXIR5X0oMr+vUuujzjGPaEquJcIUC3M+iA/WF@freebsd.org, AJvYcCX2PpmdCKyXfAZjJ8ks3g8lso/XIe3HN4ml09sCDQGxQLSoqPxvUfwNbNHQ9CgbRTBhbA==@freebsd.org, AJvYcCXM2FU+Uhj1w/0o6fneQPWEDzHrb2kCSsIKQutu/2ETPJnr3g+xY2JhuQ4THvPjGmWiePXKGOXbd0cgQi5nwNOrnw4gr9A=@freebsd.org X-Gm-Message-State: AOJu0YwTU8L7Df7QfcMLTEs0KkVjYPiuFtMCs2RY7ns3Y24hT8MiLuyU XwjC2kI7tW2bCNbMYo6P3vpAjhU9b/hl2On6rdo0rUAznx3F++pfsNZDsE7OTS90jgoWFkaaxTB a6FQFAuLVLns045XcCYcjs0nCZaucK8fRIpM8 X-Gm-Gg: ASbGnctDWxVV0CAZvm/0h9pJJPdcJtZ3nbzhDCvpAZKvaDVVrcA0RJ6ZlNQhAKRWSvR rfcs5SJpS5rROSBiy1FPSfBwX8G6x65IoOuyJXl7f2rBYOkK4g5nhWzt05UQaBLV/2j84Nqia8H NolaLSH4870rbtgbMdMbxMPkchLNwG3tqiylqAm6iCyRidjI21+Z0LSX52FvTXOqSlw8UdeGKov 7zlzcc= X-Google-Smtp-Source: AGHT+IHjqiEf1stZQ4IO429gZKb2vUkM2tHQyFc7C5Doo5AbL8/WHEqhqHXdUoWrzV/xZLLHv5zvgqZ60Z1YT11tX8o= X-Received: by 2002:a17:90b:5282:b0:312:1d2d:18e2 with SMTP id 98e67ed59e1d1-31f5de5564bmr7844386a91.20.1753935843596; Wed, 30 Jul 2025 21:24:03 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Benjamin Kaduk Date: Wed, 30 Jul 2025 21:23:51 -0700 X-Gm-Features: Ac12FXzAmVZeM8B1wr6eqiBzAQ9f6O11CiKZ0E1vzEJ3AXe4_qU0tUlITrESFXs Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Rick Macklem Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="000000000000ea9e8f063b320264" X-Spamd-Result: default: False [-2.45 / 15.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.953]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; TAGGED_RCPT(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::102e:from] X-Rspamd-Queue-Id: 4bswvY68N6z3K7Y X-Spamd-Bar: -- --000000000000ea9e8f063b320264 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem wrote: > On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk wrote: > > > > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk > wrote: > >> > >> > >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context() AP= I > that does a lot of the work of getting useful bits out of an established > GSS security context. > >> > > > > > > > > > > And a bit more context on what is going on here and why kgssapi has to > care: > > The GSS-API (RFC 2743) is all about a way to "establish a security > context" (i.e., do crypto negotiation, authentication, sometimes > authorization, etc.) between two entities, the initiator and the acceprot= , > and then exchanging protected messages between the two (which can be eith= er > encrypted or just integrity protection tags for otherweise cleartext data= ); > later extensions included the ability to produce identical PRF output on > both parties, etc.. The details are "mechanism-specific", and for this > purpose we're exclusively talking about the krb5 mechanism. The steps to > establish the security context are complicated and sometimes fiddly, and = in > the general case can require a large number of round-trips between the > initiator and acceptor before the security context is established. The > individual message-protection parts are comparatively simple and amendabl= e > to implementation in the kernel for processing efficiency. > > RFC 2743 also defines functions for GSS_Export_sec_context() and > GSS_Import_sec_context(), that are designed essentially to pass informati= on > about an established security context from one process to another on the > same machine (which are presumably using the same implementation and > version of the implementation), so the contents of the exported blob are > opaque and implementation-specific. We are abusing that mechanism to > export information about the security context that gssd has established a= nd > feed that information into the kernel implementation of the per-message > processing routines. At present, this necessarily entails knowing the > details of the implementation-specific opaque blob that is the "export se= c > context token", which is what the sys/kgssapi/krb5/krb5_mech.c code is > doing. But if we can get the information we want without breaking the > abstraction barrier, such as via the gss_krb5_export_lucid_sec_context() > API, we are in a more robust posture overall and somewhat future-proofed > against future evolution by MIT krb5. > > (I note that recent Heimdal versions seem to also expose a > gss_krb5_export_lucid_sec_context() API, so part of the problem is just > that the Heimdal in base is so old.) > > Well, here's some "not so good" news... > I've been trying to use gss_inquire_sec_context_by_oid(..) with the oid > for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > It kept failing. > The problem seems to be that "gctx->proto =3D=3D 4" in > make_external_lucid_ctx_v1() > function. This function only knows about the 0 and 1 setting for > gctx->proto. > > Any ideas, rick > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is ever expected; it looks like it's supposed to just be 0 (for the legacy RFC 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence numbers for message-protection formats, etc.). So maybe it's worth posting your current WIP somewhere to take a closer look at what's going on. >From your previous message, > I am working on using gss_inquire_sec_context_by_oid(), which I think is just a front-end to gss_krb5_export_lucid_sec_context()? If that doesn't work, I'll switch to gss_krb5_export_lucid_sec_context(). (I am still waiting for the day when there is another mechanism. I have heard rumblings w.r.t. a mechanism for the Oauth stuff, but as far as I know, about all that they did was define an OID for it.) It looks like a front-end to the same core implementation at least (technically not a wrapper for the public API, though). (There are a bunch of non-krb5 mechanisms, most not in terribly widespread use.) > Btw, do you have any experience porting KDC databases from Heimdal to MIT? (At this point, Cy has done it, but after doing so, the passwords all had to be reset. He thought he had used "--decrypt" when he dumped the Heimdal KDC.) I do not have such experience, but the conventional way to do it involves an unencrypted dump (which I presume is what the aforementioned "--decrypt" does). Heimdal and MIT use (or at least used, the last time I looked) different techniques for encrypting the per-principal data in the dump file, so a trip through plaintext helps. I do remember reading about Heimdal having grown some support for the MIT database format; the commit message at https://github.com/heimdal/heimdal/commit/57f1545a46fdad9207a71903a56f3c1d1= fff3a10 is perhaps a very high-level description of what is expected to be possible= . -Ben --000000000000ea9e8f063b320264 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM = Rick Macklem <rick.macklem@gma= il.com> wrote:
On Mon, Jul 28, 2025 at = 3:32=E2=80=AFPM Benjamin Kaduk <bjkfbsd@gmail.com> wrote:
>
> On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk <bjkfbsd@gmail.com> wrote= :
>>
>>
>> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context(= ) API that does a lot of the work of getting useful bits out of an establis= hed GSS security context.
>>
>
>
>
>
> And a bit more context on what is going on here and why kgssapi has to= care:
> The GSS-API (RFC 2743) is all about a way to "establish a securit= y context" (i.e., do crypto negotiation, authentication, sometimes aut= horization, etc.) between two entities, the initiator and the acceprot, and= then exchanging protected messages between the two (which can be either en= crypted or just integrity protection tags for otherweise cleartext data); l= ater extensions included the ability to produce identical PRF output on bot= h parties, etc..=C2=A0 The details are "mechanism-specific", and = for this purpose we're exclusively talking about the krb5 mechanism.=C2= =A0 The steps to establish the security context are complicated and sometim= es fiddly, and in the general case can require a large number of round-trip= s between the initiator and acceptor before the security context is establi= shed.=C2=A0 The individual message-protection parts are comparatively simpl= e and amendable to implementation in the kernel for processing efficiency.<= br> > RFC 2743 also defines functions for GSS_Export_sec_context() and GSS_I= mport_sec_context(), that are designed essentially to pass information abou= t an established security context from one process to another on the same m= achine (which are presumably using the same implementation and version of t= he implementation), so the contents of the exported blob are opaque and imp= lementation-specific.=C2=A0 We are abusing that mechanism to export informa= tion about the security context that gssd has established and feed that inf= ormation into the kernel implementation of the per-message processing routi= nes.=C2=A0 At present, this necessarily entails knowing the details of the = implementation-specific opaque blob that is the "export sec context to= ken", which is what the sys/kgssapi/krb5/krb5_mech.c code is doing.=C2= =A0 But if we can get the information we want without breaking the abstract= ion barrier, such as via the gss_krb5_export_lucid_sec_context() API, we ar= e in a more robust posture overall and somewhat future-proofed against futu= re evolution by MIT krb5.
> (I note that recent Heimdal versions seem to also expose a gss_krb5_ex= port_lucid_sec_context() API, so part of the problem is just that the Heimd= al in base is so old.)

Well, here's some "not so good" news...
I've been trying to use gss_inquire_sec_context_by_oid(..) with the oid=
for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1.
It kept failing.
The problem seems to be that "gctx->proto =3D=3D 4" in make_ex= ternal_lucid_ctx_v1()
function. This function only knows about the 0 and 1 setting for gctx->p= roto.

Any ideas, rick



I= 9;m not seeing anything to suggest that a "gctx->proto" value = of 4 is ever expected; it looks like it's supposed to just be 0 (for th= e legacy RFC 1964 format) or 1 (for the "CFX" format of RFC 4121,= with wider sequence numbers for message-protection formats, etc.).=C2=A0 S= o maybe it's worth posting your current WIP somewhere to take a closer = look at what's going on.=C2=A0

From your previ= ous message,

> I am working on using gss_inquir= e_sec_context_by_oid(), which I think is just a front-end to gss_krb5_expor= t_lucid_sec_context()? If that doesn't work, I'll switch to gss_krb= 5_export_lucid_sec_context(). (I am still waiting for the day when there is= another mechanism. I have heard rumblings w.r.t. a mechanism for the Oauth= stuff, but as far as I know, about all that they did was define an OID for= it.)

It looks like a front-end to th= e same core implementation at least (technically not a wrapper for the publ= ic API, though).
(The= re are a bunch of non-krb5 mechanisms, most not in terribly widespread use.= )

> Btw, do you have any experience porting KDC databases from = Heimdal to MIT? (At this point, Cy has done it, but after doing so, the pas= swords all had to be reset. He thought he had used "--decrypt" wh= en he dumped the Heimdal KDC.)

I do n= ot have such experience, but the conventional way to do it involves an unen= crypted dump (which I presume is what the aforementioned "--decrypt&qu= ot; does).=C2=A0 Heimdal and MIT use (or at least used, the last time I loo= ked) different techniques for encrypting the per-principal data in the dump= file, so a trip through plaintext helps.=C2=A0 I do remember reading about= Heimdal having grown some support for the MIT database format; the commit = message at https://github.com/heimdal/heimdal/commit/57= f1545a46fdad9207a71903a56f3c1d1fff3a10 is perhaps a very high-level des= cription of what is expected to be possible.

-Ben
--000000000000ea9e8f063b320264-- From nobody Thu Jul 31 04:41:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsxHC6SMtz63RSh; Thu, 31 Jul 2025 04:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsxHC5d8Zz3LZw; Thu, 31 Jul 2025 04:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753936871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RUFggHysBZF0HFRSjrrLEx+xwqgZmddTSgnbsjuEUsI=; b=uBofPg/+icNUzwDC2E+VT3fAmWFwZPWeArN7r45HDRjxoK+9p8fbBHuanyH8TBHFqPes/U CoC4dFguic5E2pYwjMtipUC3wEqXm2geMSW7nSOwnsoQb4+UonmWRvBMNbbi7BlHkePdVi 2CUT8u7FYW7KH4NVBgr/uEZ+jGnXb9KZspOuzHzYWxoS2RfiZNiEfsZB2y8d4X959thr+k ddDU+EPw2lsY6u9TlevWxztg/mR21sQTwzA7Eq3u/1edLIjpLGxLATu53WmzYVAdFxTZQO rC9pvlIbUQyHuAYbPxxYKuv0kh5enV8A0fsHla4t9wnlJjMIj1Glsu8XDorweA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753936871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RUFggHysBZF0HFRSjrrLEx+xwqgZmddTSgnbsjuEUsI=; b=Olofy6JPuQvkD6fMUMbNPB5TFYueNlrYFIHgy290X5xUnryyNagcBl3POqoVYHYfu1Vnu+ BCYbR7TPF8kf2vwbTAcIjvOi8ufHAI2HlDIbRUAIkZFLucdUIPtwZK+BPto+Ef9oMMN88A MArkjLo24/jwu+ckciPRC1LLLVnSUnfB85tRxP0GIewtfkqo6i0lPWQUQSUI5maUiLC4we 2oFg3WxkneYFUHjYj3seFOVSeCO4RXdFLCCLggAHFdZnkficCadSedfdNJQ8Axfko3LBC9 JB0x0Zte4HGXx2W96RLBo2Jmyo1wqpwImEMtWIWKFGwNd4gzmP+8YkTLyZvzMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753936871; a=rsa-sha256; cv=none; b=tx0bKwzf3JnVqeQDoS8IwWCjdJBpiDqwcvqMU8eDVJqnnt9SjChFUoHpssFW1DDwHa5Nu1 TGCPltI9/3Vp4j7KmIdoEMLqVpQDopGInLHOnA8k7nUbXSduLRcp8eiHsUj2p+I5z/JRg4 pPc/0exHmO2inWpW95zQkia7vhTsYa7nmwSf7QX4IiyewnYcKbSp7mqh8Lv1Wm35/+VChB O1RCQV7bOCvDuSoWy9n7FaEe9nl9VHxcHpphkeGNzLOoFSCa9NPi9zLhyjb3uyhSYJTNwb s4F3nBLbSLNtYWLyHpISv3uK4l8nh8ABMYEfnJPKqJoITTh1r+BH6EL1+CpnJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsxHC4yntzmv8; Thu, 31 Jul 2025 04:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V4fB7Z047321; Thu, 31 Jul 2025 04:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V4fBAr047318; Thu, 31 Jul 2025 04:41:11 GMT (envelope-from git) Date: Thu, 31 Jul 2025 04:41:11 GMT Message-Id: <202507310441.56V4fBAr047318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: cdd97f3aacf1 - stable/14 - qlnxe: Fix advertising the IFCAP_LINKSTATE capability List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cdd97f3aacf1e509858207a0caa085b9c47e5e9e Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd97f3aacf1e509858207a0caa085b9c47e5e9e commit cdd97f3aacf1e509858207a0caa085b9c47e5e9e Author: Zhenlei Huang AuthorDate: 2025-07-22 04:11:02 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-31 04:40:23 +0000 qlnxe: Fix advertising the IFCAP_LINKSTATE capability The following up advertising of IFCAP_HWCSUM capability unconditionally overwrite IFCAP_LINKSTATE. Reviewed by: kbowling MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51450 (cherry picked from commit c18860339d5051dea99cb5cee7e322ffa5dd2a81) --- sys/dev/qlnx/qlnxe/qlnx_os.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 39ecad8ef1e1..6519c216ebf5 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2308,8 +2308,6 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) else if (device_id == QLOGIC_PCI_DEVICE_ID_1644) if_setbaudrate(ifp, IF_Gbps(100)); - if_setcapabilities(ifp, IFCAP_LINKSTATE); - if_setinitfn(ifp, qlnx_init); if_setsoftc(ifp, ha); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); @@ -2343,7 +2341,6 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) if_setcapabilities(ifp, IFCAP_HWCSUM); if_setcapabilitiesbit(ifp, IFCAP_JUMBO_MTU, 0); - if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWTAGGING, 0); if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWFILTER, 0); @@ -2352,6 +2349,7 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) if_setcapabilitiesbit(ifp, IFCAP_TSO4, 0); if_setcapabilitiesbit(ifp, IFCAP_TSO6, 0); if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); + if_setcapabilitiesbit(ifp, IFCAP_LINKSTATE, 0); if_sethwtsomax(ifp, QLNX_MAX_TSO_FRAME_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); From nobody Thu Jul 31 04:41:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsxHF1Rc5z63R1L; Thu, 31 Jul 2025 04:41: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsxHD6MZ9z3LTc; Thu, 31 Jul 2025 04:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753936872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uvDHMywJhoaYcMI1KMI15gok+MuBNTlQawhNt1PkquU=; b=NKPRG35KlLXWpJTCnQLI+PHGSJNT0Lx11RPghgnHWhcgoNwLLnAQLXhISvPvW2k076H3Ea JljJradqtStjPqoST7Cm6SbFyRPNcW1hXCpJ+wE3BgaLlZzKc4zqTmkd/SJXD+ebuntFoN ZgyyY1UDeOM+9hltnDTkrThALNSAyDTwnr3QdRVtI2rOiT9UI6C6hSz/nZEIovj+QF9eoT FHZCMBbp2BHq4i1FbjnM6ILbKCxHFVLfbghH+Bw8YEctFGEoE1JJpE1SbvCNBmf+NShfYR wvhP1ZWdcITkmtH65H56RSPRYOOKeG9UArIQ9k9rMiViuG/PgqzU63EYjPl8kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753936872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uvDHMywJhoaYcMI1KMI15gok+MuBNTlQawhNt1PkquU=; b=tQyiHRJoXYt8xGn/71Mp6UftUDtzFCUmQyzGYtKuvGtN8bXkIce9rlgLs6UiaV8z5aTpIC Cy8p+H1jg3GN5SGzXvr0FVQ8Zlr7QMaiBDTmduJFGvVeGTh1ALi75DpIKYHIQUhzsUyoIK UMaY1YhlDbUfFPKsIfzgC+tdL5g07h/D56HPCA5bLOzr6p7Deu6B4QU634NHvi9hm1BKPm Ws1cYGVFz0MA9A3Cm7MzEoPQ2O23drB+uyaNhkTETeKwrQnnsm/Sn83RIfFgYn74WHWdcL seBJz/vzwgdawQX5VZ/e7bHSDUGOVYGqH/H9SpcQ+FdelRiBCYkZsnjkiPHkTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753936872; a=rsa-sha256; cv=none; b=i7RrbkWFGhHhkrm1hWu7i2OLyv0/iOLHgCYfpJVK7KYsSIFs9oSD4u6fJJe6WID02BC3AY WI7Xh8k6CfuinXCB/v5mfsOSKtBBCrHkavLpe9G7yLQ4ynNViCvl3fbDhVIeCflMZV9bpw bMmSa9wEYjJRUzs/xAqeEJD5VTNufRvCWpaTzuMdvgBW1sdOCBZn3JRais08bPX/28qw1L HiFgsVn/wZq0Mwvj+L6zEvuik2hzLwGPHYFN03oFnHQ3q17FwfDhBBNi/96vWfQHAl/jKy YODUpMgHVLeJRUbUK4pzvqtHDOZklulAxfesnBDTf7Aut8BP6ncJMhG80+LiTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsxHD5wgmznBv; Thu, 31 Jul 2025 04:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V4fCwg047353; Thu, 31 Jul 2025 04:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V4fCwn047350; Thu, 31 Jul 2025 04:41:12 GMT (envelope-from git) Date: Thu, 31 Jul 2025 04:41:12 GMT Message-Id: <202507310441.56V4fCwn047350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: bfbb93b6de6a - stable/14 - qlnxe: Advertise the IFCAP_HWSTATS capability List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bfbb93b6de6afc8aba8df90e2a28db1c93cbd143 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bfbb93b6de6afc8aba8df90e2a28db1c93cbd143 commit bfbb93b6de6afc8aba8df90e2a28db1c93cbd143 Author: Zhenlei Huang AuthorDate: 2025-07-22 04:11:02 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-31 04:40:23 +0000 qlnxe: Advertise the IFCAP_HWSTATS capability The hardware can count statistics and the driver has already retrieved them via qlnx_get_counter(). Advertise the IFCAP_HWSTATS capability to avoid the net stack from double counting IFCOUNTER_IBYTES. Reviewed by: kbowling MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51451 (cherry picked from commit 386960a8805edc6d5ac6bb6215ad102a83314549) --- sys/dev/qlnx/qlnxe/qlnx_os.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 6519c216ebf5..1be77dcc3d37 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2350,6 +2350,7 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) if_setcapabilitiesbit(ifp, IFCAP_TSO6, 0); if_setcapabilitiesbit(ifp, IFCAP_LRO, 0); if_setcapabilitiesbit(ifp, IFCAP_LINKSTATE, 0); + if_setcapabilitiesbit(ifp, IFCAP_HWSTATS, 0); if_sethwtsomax(ifp, QLNX_MAX_TSO_FRAME_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); From nobody Thu Jul 31 04:41:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsxHh1v4Cz63RQY; Thu, 31 Jul 2025 04:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsxHh18SVz3M1Q; Thu, 31 Jul 2025 04:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753936896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjKg7vu/sqEOwPz3ZD+hhQC8qJE3CAxgcXgkPhHvd/8=; b=WXmmaDuXwk+eh4nbIwwhuNurRg3/Ihxcb6eFexdtq/eG05HXLZcBd+canbZ4MuxF56gnV6 KFTpjqkaz7x9yY1zjjb8+vGIMhA3h7RhrzGG6V2wP46hnmSUZUy9Cs8ORVBUANrF54hI1s WexLCn9vcLArnBw2lL6eJccZX/bqI2pT9otdrGQMF5HCJJRfz25RGmbPajFTS8OJxhoNz9 ZQt4EbBQEVBEvVJx8CmjhzOY5h4deepfO8F/gX3HcAIejSVDczN9c25TQaN2GH/TEm5K60 472eaFpLWF9JXxmkaB6bVYCxeRTczVtRhO//6N0YlBfXF8R3Z74LBq7fTDTVJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753936896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjKg7vu/sqEOwPz3ZD+hhQC8qJE3CAxgcXgkPhHvd/8=; b=QOiAU84Gugu8/c4YlmSEALxkM+mNu21m8l+dIMUgR/BwCoUl5D7A8+MCAcCVtaYtv5h3/v nSJqSM23o9P4qobvBf0TEIbKQKYcg3I/RYoB1zpCkkZQ+ji2DXVax/KFw91vjGjUcK7gxi r6zIRQRPLMxe/sMbF6YfQPjevlHBIQBY64AAhM8p8LPYBlx6ruqO/brUlqh9+rPGUuSXw4 60txoAV0W0kSfXH/B4CncTy0JAkbkSZMEb7TcMmj2F+yrJR4zDilwnQK2wjz8KPPLOeeo+ BqT0ttHcLemrAf1gfdZleE6VuD4TFAg5wY5WR0JyxzwfDIGGteJYpEXd3K95rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753936896; a=rsa-sha256; cv=none; b=QPg4n7Tss6unqefeEtsa0A11mBRVWGLkGB2sIjRUxNgIIlbHspgHqbPIaU6n7CwLmwAcYG IMDNmcVg2FOZBsuD1fzilIGdm1ns4KH9HI/rajJLpfZYiIx8QcBBIjo4n+wP1Ee9R88E4A +2mqfTyHWlF+JyKq2csULktSa8mQVTbAJ4XLGo8K13HzxkmIMaMnlEIq66FlijrOcOvBa+ /uMRMG3Wo7Zv9PNi6oRULXxUD8CPJjjLQ0B3bdFhKMD3IKOLsPy2koqXNajItn2BiBhoAO 8a3GBgHIMSPvi5jJwf5/hz1y+ASOAVyPUBBQBckumF4vGnJ5HVPCTFL/6KzJ6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsxHh0dKMzmsH; Thu, 31 Jul 2025 04:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V4fZMe047577; Thu, 31 Jul 2025 04:41:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V4fZi9047574; Thu, 31 Jul 2025 04:41:35 GMT (envelope-from git) Date: Thu, 31 Jul 2025 04:41:35 GMT Message-Id: <202507310441.56V4fZi9047574@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: 763a097c156f - main - loader: add nvidia modules to the loader blacklist List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 763a097c156f36830e774b3cc789f68c5d1ae601 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=763a097c156f36830e774b3cc789f68c5d1ae601 commit 763a097c156f36830e774b3cc789f68c5d1ae601 Author: Kyle Evans AuthorDate: 2025-07-31 04:41:28 +0000 Commit: Kyle Evans CommitDate: 2025-07-31 04:41:28 +0000 loader: add nvidia modules to the loader blacklist It is known that nvidia modules, like the drm modules that are already present, will panic if loaded in early boot rather than later. Pop them into our list to deny loading them if someone were to add, e.g., nvidia-modeset_load="YES", to their loader.conf. This doesn't prevent them from being loaded if one drops to the loader prompt, but it does prevent the standard user from easy foot-shooting if they find old or inaccurate information out in the wild. Reviewed by: imp, kbowling MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51644 --- stand/defaults/loader.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index f0843f3e930b..036479d22285 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -114,6 +114,7 @@ kernels_autodetect="YES" # Auto-detect kernel directories in /boot #currdev="disk1s1a" # Set the current device module_path="/boot/modules;/boot/firmware;/boot/dtb;/boot/dtb/overlays" # Set the module search path module_blacklist="drm drm2 radeonkms i915kms amdgpu if_iwlwifi if_rtw88 if_rtw89" # Loader module blacklist +module_blacklist="${module_blacklist} nvidia nvidia-drm nvidia-modeset" #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem From nobody Thu Jul 31 04:44:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsxMB3Nh3z63RJ3; Thu, 31 Jul 2025 04:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsxMB2rtnz3MS4; Thu, 31 Jul 2025 04:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753937078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWhqwJDs+odGET63mcSZHIzyslHreB0b0JZkHB+/mpY=; b=wrxDhrwfHXS9pNJ097OjFZaYbeOZVV8Q4cfpBYXB4VBbryC5wFobSJJmulMi+l7jMivsby 5sCL9SOmBxKqlQZ+FvwAThPqu8cSMC+d09iyuPZr/H50zY8TzqL/nOphqnJ0NfhgtkhTIj dh+hxeDR+GljA6ZFT9W5Qt3SgWon48Z35wgN6nnpYtIMAnCPtJVKDUIVEmd2wnzPJUkC6o Xk4757TQ/BUgZqI5BFlRim9qpTMSKf/u1HI4a77eb5Ah0qj8aBmAbRRc3bHUfDGPqPSxG1 EzyVxviS2Uy1/EleVi4spL5kgZQJUCmHISlPYg1RFqRxOkE3HBVLmYo0L5Zm2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753937078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWhqwJDs+odGET63mcSZHIzyslHreB0b0JZkHB+/mpY=; b=vDLj+Fn5yDbc1y9dgua/NaH6ziYcSqRKZVwevkEeAGHJuDmZ+1sUjZH3wXRo5HcY/jBzo4 +F/AjrzD3No8Sd7rbX24Zkz769v3OZj3Uyd62Yian/q1tLfnVlFTW7Np430/6Hr62qd9cA VGTAMFRtH6niwMmlQYjAISpM4C6zsGxTW66DTLKDOncV2XE+y3aZvcvCHJ3TPdY04bHiYQ dqB496WmvAQYSfxm3/KryISXeXaksYvKqpYBO/xie8U3Q83lfK2OvAbD1eu7m+P/vdbtsC eFbMKBrB5edV+XWMSlkMOc8SOaaUh5Vg6NQFFCCOrYDHOe29onlBFFYMmWHG8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753937078; a=rsa-sha256; cv=none; b=L7I8/s4BtlW8LEUgMSm3D73nE7BPvKxgeja7IXM+UBnGBwuU6eMU0yHm0aKxAk7MSXsqhN X6qkYySpjrZ1pL5uL/VqEsIfoRwcdKCNIPZ2cbasOiRqPwrecxUJ2UlVQvWxwzLGSP3JJB itrKPyFTpWclH9DnoLaon6pnTxYEwG82MB+Nada4QJGdroNB2JoQSmy3ExRDBVvt0Negxi mTpbqmCy0QudMdMoxuWalNUinD8/0XLFO4R0ni7YkChauE9qi4Jzv/iWRxyRZ7coH7Nvm5 cayBvXpsFX9GZ+xBWbe6Rn5+Ae40FLrh6TNrTF0ve1K65k1ElrhDYBO2h0CeMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsxMB27VbzmsW; Thu, 31 Jul 2025 04:44:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V4icdP054835; Thu, 31 Jul 2025 04:44:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V4icA3054832; Thu, 31 Jul 2025 04:44:38 GMT (envelope-from git) Date: Thu, 31 Jul 2025 04:44:38 GMT Message-Id: <202507310444.56V4icA3054832@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: be1f7435ef21 - main - kern: start tracking cr_gid outside of cr_groups[] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 commit be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 Author: Kyle Evans AuthorDate: 2025-07-31 04:44:11 +0000 Commit: Kyle Evans CommitDate: 2025-07-31 04:44:11 +0000 kern: start tracking cr_gid outside of cr_groups[] This is the (mostly) kernel side of de-conflating cr_gid and the supplemental groups. The pre-existing behavior for getgroups() and setgroups() is retained to keep the user <-> kernel boundary functionally the same while we audit use of these syscalls, but we can remove a lot of the internal special-casing just by reorganizing ucred like this. struct xucred has been altered because the cr_gid macro becomes problematic if ucred has a real cr_gid member but xucred does not. Most notably, they both also have cr_groups[] members, so the definition means that we could easily have situations where we end up using the first supplemental group as the egid in some places. We really can't change the ABI of xucred, so instead we alias the first member to the `cr_gid` name and maintain the status quo. This also fixes the Linux setgroups(2)/getgroups(2) implementation to more cleanly preserve the group set, now that we don't need to special case cr_groups[0]. __FreeBSD_version bumped for the `struct ucred` ABI break. For relnotes: downstreams and out-of-tree modules absolutely must fix any references to cr_groups[0] in their code. These are almost exclusively incorrect in the new world, and cr_gid should be used instead. There is a cr_gid macro available in earlier FreeBSD versions that can be used to avoid having version-dependant conditionals to refer to the effective group id. Surrounding code may need adjusted if it peels off the first element of cr_groups and uses the others as the supplemental groups, since the supplemental groups start at cr_groups[0] now if &cr_groups[0] != &cr_gid. Relnotes: yes (see last paragraph) Co-authored-by: olce Differential Revision: https://reviews.freebsd.org/D51489 --- share/man/man9/ucred.9 | 5 +- sys/compat/linux/linux_misc.c | 35 ++----- sys/compat/linux/linux_uid16.c | 34 ++----- sys/fs/nfs/nfs_commonport.c | 3 +- sys/fs/nfsclient/nfs_clrpcops.c | 3 +- sys/fs/nfsserver/nfs_nfsdport.c | 1 + sys/kern/kern_prot.c | 199 +++++++++++++++++++++++----------------- sys/rpc/authunix_prot.c | 6 +- sys/rpc/svc_auth.c | 5 +- sys/rpc/svc_auth_unix.c | 6 +- sys/sys/ucred.h | 26 ++++-- sys/ufs/ufs/ufs_vnops.c | 20 +--- 12 files changed, 164 insertions(+), 179 deletions(-) diff --git a/share/man/man9/ucred.9 b/share/man/man9/ucred.9 index e9fe2e1d02fc..16de37dd8b35 100644 --- a/share/man/man9/ucred.9 +++ b/share/man/man9/ucred.9 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd January 23, 2019 +.Dd July 29, 2025 .Dt UCRED 9 .Os .Sh NAME @@ -119,8 +119,7 @@ It also truncates the group list to the current maximum number of groups. No other mechanism should be used to modify the .Va cr_groups -array except for updating the primary group via assignment to -.Va cr_groups[0] . +array. .Pp The .Fn cru2x diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index b88f1451f1a2..31460819e6ab 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1030,47 +1030,32 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args) { struct ucred *newcred, *oldcred; l_gid_t *linux_gidset; - gid_t *bsd_gidset; int ngrp, error; struct proc *p; ngrp = args->gidsetsize; - if (ngrp < 0 || ngrp >= ngroups_max + 1) + if (ngrp < 0 || ngrp >= ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK); error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); if (error) goto out; newcred = crget(); - crextend(newcred, ngrp + 1); + crextend(newcred, ngrp); p = td->td_proc; PROC_LOCK(p); oldcred = p->p_ucred; crcopy(newcred, oldcred); - /* - * cr_groups[0] holds egid. Setting the whole set from - * the supplied set will cause egid to be changed too. - * Keep cr_groups[0] unchanged to prevent that. - */ - if ((error = priv_check_cred(oldcred, PRIV_CRED_SETGROUPS)) != 0) { PROC_UNLOCK(p); crfree(newcred); goto out; } - if (ngrp > 0) { - newcred->cr_ngroups = ngrp + 1; - - bsd_gidset = newcred->cr_groups; - ngrp--; - while (ngrp >= 0) { - bsd_gidset[ngrp + 1] = linux_gidset[ngrp]; - ngrp--; - } - } else - newcred->cr_ngroups = 1; + newcred->cr_ngroups = ngrp; + for (int i = 0; i < ngrp; i++) + newcred->cr_groups[i] = linux_gidset[i]; setsugid(p); proc_set_cred(p, newcred); @@ -1092,13 +1077,7 @@ linux_getgroups(struct thread *td, struct linux_getgroups_args *args) cred = td->td_ucred; bsd_gidset = cred->cr_groups; - bsd_gidsetsz = cred->cr_ngroups - 1; - - /* - * cr_groups[0] holds egid. Returning the whole set - * here will cause a duplicate. Exclude cr_groups[0] - * to prevent that. - */ + bsd_gidsetsz = cred->cr_ngroups; if ((ngrp = args->gidsetsize) == 0) { td->td_retval[0] = bsd_gidsetsz; @@ -1112,7 +1091,7 @@ linux_getgroups(struct thread *td, struct linux_getgroups_args *args) linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset), M_LINUX, M_WAITOK); while (ngrp < bsd_gidsetsz) { - linux_gidset[ngrp] = bsd_gidset[ngrp + 1]; + linux_gidset[ngrp] = bsd_gidset[ngrp]; ngrp++; } diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index a0c9f1c39198..9fe799c0b9de 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -87,12 +87,11 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args) { struct ucred *newcred, *oldcred; l_gid16_t *linux_gidset; - gid_t *bsd_gidset; int ngrp, error; struct proc *p; ngrp = args->gidsetsize; - if (ngrp < 0 || ngrp >= ngroups_max + 1) + if (ngrp < 0 || ngrp >= ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_LINUX, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); @@ -106,12 +105,6 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args) PROC_LOCK(p); oldcred = crcopysafe(p, newcred); - /* - * cr_groups[0] holds egid. Setting the whole set from - * the supplied set will cause egid to be changed too. - * Keep cr_groups[0] unchanged to prevent that. - */ - if ((error = priv_check_cred(oldcred, PRIV_CRED_SETGROUPS)) != 0) { PROC_UNLOCK(p); crfree(newcred); @@ -121,18 +114,9 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args) goto out; } - if (ngrp > 0) { - newcred->cr_ngroups = ngrp + 1; - - bsd_gidset = newcred->cr_groups; - ngrp--; - while (ngrp >= 0) { - bsd_gidset[ngrp + 1] = linux_gidset[ngrp]; - ngrp--; - } - } - else - newcred->cr_ngroups = 1; + newcred->cr_ngroups = ngrp; + for (int i = 0; i < ngrp; i++) + newcred->cr_groups[i] = linux_gidset[i]; setsugid(td->td_proc); proc_set_cred(p, newcred); @@ -155,13 +139,7 @@ linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args) cred = td->td_ucred; bsd_gidset = cred->cr_groups; - bsd_gidsetsz = cred->cr_ngroups - 1; - - /* - * cr_groups[0] holds egid. Returning the whole set - * here will cause a duplicate. Exclude cr_groups[0] - * to prevent that. - */ + bsd_gidsetsz = cred->cr_ngroups; if ((ngrp = args->gidsetsize) == 0) { td->td_retval[0] = bsd_gidsetsz; @@ -175,7 +153,7 @@ linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args) linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset), M_LINUX, M_WAITOK); while (ngrp < bsd_gidsetsz) { - linux_gidset[ngrp] = bsd_gidset[ngrp + 1]; + linux_gidset[ngrp] = bsd_gidset[ngrp]; ngrp++; } diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 222cfc03e4b3..e382b22fed74 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -380,8 +380,7 @@ newnfs_setroot(struct ucred *cred) cred->cr_uid = 0; cred->cr_gid = 0; - /* XXXKE Fix this if cr_gid gets separated out. */ - cred->cr_ngroups = 1; + cred->cr_ngroups = 0; } /* diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 36b534be531e..920fcf7b8c61 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -6934,8 +6934,7 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, tcred = NFSNEWCRED(cred); tcred->cr_uid = flp->nfsfl_ffm[mirror].user; tcred->cr_gid = flp->nfsfl_ffm[mirror].group; - /* XXXKE Fix this if cr_gid gets separated out. */ - tcred->cr_ngroups = 1; + tcred->cr_ngroups = 0; } else tcred = cred; if (rwflag == NFSV4OPEN_ACCESSREAD) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 4f0d5946d6b9..9e1a198bf34a 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3463,6 +3463,7 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexstuff *exp, NFSVNO_EXPORTANON(exp) || (nd->nd_flag & ND_AUTHNONE) != 0) { nd->nd_cred->cr_uid = credanon->cr_uid; + nd->nd_cred->cr_gid = credanon->cr_gid; /* * 'credanon' is already a 'struct ucred' that was built * internally with calls to crsetgroups_fallback(), so diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 0f0bc056cafd..48ab7c0b520b 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -99,12 +99,11 @@ static inline void groups_check_positive_len(int ngrp) { MPASS2(ngrp >= 0, "negative number of groups"); - MPASS2(ngrp != 0, "at least one group expected (effective GID)"); } static inline void groups_check_max_len(int ngrp) { - MPASS2(ngrp <= ngroups_max + 1, "too many groups"); + MPASS2(ngrp <= ngroups_max, "too many supplementary groups"); } static void groups_normalize(int *ngrp, gid_t *groups); @@ -321,10 +320,17 @@ int sys_getgroups(struct thread *td, struct getgroups_args *uap) { struct ucred *cred; + gid_t *ugidset; int ngrp, error; cred = td->td_ucred; - ngrp = cred->cr_ngroups; + + /* + * cr_gid has been moved out of cr_groups, but we'll continue exporting + * the egid as groups[0] for the time being until we audit userland for + * any surprises. + */ + ngrp = cred->cr_ngroups + 1; if (uap->gidsetsize == 0) { error = 0; @@ -333,7 +339,14 @@ sys_getgroups(struct thread *td, struct getgroups_args *uap) if (uap->gidsetsize < ngrp) return (EINVAL); - error = copyout(cred->cr_groups, uap->gidset, ngrp * sizeof(gid_t)); + ugidset = uap->gidset; + error = copyout(&cred->cr_gid, ugidset, sizeof(*ugidset)); + if (error != 0) + goto out; + + if (ngrp > 1) + error = copyout(cred->cr_groups, ugidset + 1, + (ngrp - 1) * sizeof(*ugidset)); out: td->td_retval[0] = ngrp; return (error); @@ -499,8 +512,8 @@ gidp_cmp(const void *p1, const void *p2) } /* - * Final storage for groups (including the effective GID) will be returned via - * 'groups'. '*groups' must be NULL on input, and if not equal to 'smallgroups' + * Final storage for supplementary groups will be returned via 'groups'. + * '*groups' must be NULL on input, and if not equal to 'smallgroups' * on output, must be freed (M_TEMP) *even if* an error is returned. */ static int @@ -525,15 +538,15 @@ kern_setcred_copyin_supp_groups(struct setcred *const wcred, * now, to avoid having to allocate and copy again the * supplementary groups. */ - *groups = wcred->sc_supp_groups_nb < CRED_SMALLGROUPS_NB ? - smallgroups : malloc((wcred->sc_supp_groups_nb + 1) * + *groups = wcred->sc_supp_groups_nb <= CRED_SMALLGROUPS_NB ? + smallgroups : malloc(wcred->sc_supp_groups_nb * sizeof(*groups), M_TEMP, M_WAITOK); - error = copyin(wcred->sc_supp_groups, *groups + 1, + error = copyin(wcred->sc_supp_groups, *groups, wcred->sc_supp_groups_nb * sizeof(*groups)); if (error != 0) return (error); - wcred->sc_supp_groups = *groups + 1; + wcred->sc_supp_groups = *groups; } else { wcred->sc_supp_groups_nb = 0; wcred->sc_supp_groups = NULL; @@ -652,9 +665,8 @@ sys_setcred(struct thread *td, struct setcred_args *uap) * CAUTION: This function normalizes groups in 'wcred'. * * If 'preallocated_groups' is non-NULL, it must be an already allocated array - * of size 'wcred->sc_supp_groups_nb + 1', with the supplementary groups - * starting at index 1, and 'wcred->sc_supp_groups' then must point to the first - * supplementary group. + * of size 'wcred->sc_supp_groups_nb' containing the supplementary groups, and + * 'wcred->sc_supp_groups' then must point to it. */ int kern_setcred(struct thread *const td, const u_int flags, @@ -685,13 +697,14 @@ kern_setcred(struct thread *const td, const u_int flags, return (EINVAL); if (preallocated_groups != NULL) { groups = preallocated_groups; - MPASS(preallocated_groups + 1 == wcred->sc_supp_groups); + MPASS(preallocated_groups == wcred->sc_supp_groups); } else { - groups = wcred->sc_supp_groups_nb < CRED_SMALLGROUPS_NB ? - smallgroups : - malloc((wcred->sc_supp_groups_nb + 1) * - sizeof(*groups), M_TEMP, M_WAITOK); - memcpy(groups + 1, wcred->sc_supp_groups, + if (wcred->sc_supp_groups_nb <= CRED_SMALLGROUPS_NB) + groups = smallgroups; + else + groups = malloc(wcred->sc_supp_groups_nb * + sizeof(*groups), M_TEMP, M_WAITOK); + memcpy(groups, wcred->sc_supp_groups, wcred->sc_supp_groups_nb * sizeof(*groups)); } } @@ -726,16 +739,12 @@ kern_setcred(struct thread *const td, const u_int flags, if (flags & SETCREDF_SVGID) AUDIT_ARG_SGID(wcred->sc_svgid); if (flags & SETCREDF_SUPP_GROUPS) { - int ngrp = wcred->sc_supp_groups_nb; - /* * Output the raw supplementary groups array for better * traceability. */ - AUDIT_ARG_GROUPSET(groups + 1, ngrp); - ++ngrp; - groups_normalize(&ngrp, groups); - wcred->sc_supp_groups_nb = ngrp - 1; + AUDIT_ARG_GROUPSET(groups, wcred->sc_supp_groups_nb); + groups_normalize(&wcred->sc_supp_groups_nb, groups); } /* @@ -746,7 +755,7 @@ kern_setcred(struct thread *const td, const u_int flags, new_cred = crget(); to_free_cred = new_cred; if (flags & SETCREDF_SUPP_GROUPS) - crextend(new_cred, wcred->sc_supp_groups_nb + 1); + crextend(new_cred, wcred->sc_supp_groups_nb); #ifdef MAC mac_cred_setcred_enter(); @@ -773,16 +782,11 @@ kern_setcred(struct thread *const td, const u_int flags, /* * Change groups. - * - * crsetgroups_internal() changes both the effective and supplementary - * ones. */ - if (flags & SETCREDF_SUPP_GROUPS) { - groups[0] = flags & SETCREDF_GID ? wcred->sc_gid : - new_cred->cr_gid; - crsetgroups_internal(new_cred, wcred->sc_supp_groups_nb + 1, + if (flags & SETCREDF_SUPP_GROUPS) + crsetgroups_internal(new_cred, wcred->sc_supp_groups_nb, groups); - } else if (flags & SETCREDF_GID) + if (flags & SETCREDF_GID) change_egid(new_cred, wcred->sc_gid); if (flags & SETCREDF_RGID) change_rgid(new_cred, wcred->sc_rgid); @@ -1206,6 +1210,7 @@ sys_setgroups(struct thread *td, struct setgroups_args *uap) * setgroups() differ. */ gidsetsize = uap->gidsetsize; + /* XXXKE Limit to ngroups_max when we change the userland interface. */ if (gidsetsize > ngroups_max + 1 || gidsetsize < 0) return (EINVAL); @@ -1233,29 +1238,49 @@ kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups) struct proc *p = td->td_proc; struct ucred *newcred, *oldcred; int ngrp, error; + gid_t egid; ngrp = *ngrpp; /* Sanity check size. */ + /* XXXKE Limit to ngroups_max when we change the userland interface. */ if (ngrp < 0 || ngrp > ngroups_max + 1) return (EINVAL); AUDIT_ARG_GROUPSET(groups, ngrp); + /* + * setgroups(0, NULL) is a legitimate way of clearing the groups vector + * on non-BSD systems (which generally do not have the egid in the + * groups[0]). We risk security holes when running non-BSD software if + * we do not do the same. So we allow and treat 0 for 'ngrp' specially + * below (twice). + */ if (ngrp != 0) { - /* We allow and treat 0 specially below. */ - groups_normalize(ngrpp, groups); - ngrp = *ngrpp; + /* + * To maintain userland compat for now, we use the first group + * as our egid and we'll use the rest as our supplemental + * groups. + */ + egid = groups[0]; + ngrp--; + groups++; + + groups_normalize(&ngrp, groups); + *ngrpp = ngrp; } newcred = crget(); - if (ngrp != 0) - crextend(newcred, ngrp); + crextend(newcred, ngrp); PROC_LOCK(p); oldcred = crcopysafe(p, newcred); #ifdef MAC - error = ngrp == 0 ? - /* If 'ngrp' is 0, we'll keep just the current effective GID. */ - mac_cred_check_setgroups(oldcred, 1, oldcred->cr_groups) : - mac_cred_check_setgroups(oldcred, ngrp, groups); + /* + * We pass NULL here explicitly if we don't have any supplementary + * groups mostly for the sake of normalization, but also to avoid/detect + * a situation where a MAC module has some assumption about the layout + * of `groups` matching historical behavior. + */ + error = mac_cred_check_setgroups(oldcred, ngrp, + ngrp == 0 ? NULL : groups); if (error) goto fail; #endif @@ -1264,16 +1289,14 @@ kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups) if (error) goto fail; - if (ngrp == 0) { - /* - * setgroups(0, NULL) is a legitimate way of clearing the - * groups vector on non-BSD systems (which generally do not - * have the egid in the groups[0]). We risk security holes - * when running non-BSD software if we do not do the same. - */ - newcred->cr_ngroups = 1; - } else - crsetgroups_internal(newcred, ngrp, groups); + /* + * If some groups were passed, the first one is currently the desired + * egid. This code is to be removed (along with some commented block + * above) when setgroups() is changed to take only supplementary groups. + */ + if (ngrp != 0) + newcred->cr_gid = egid; + crsetgroups_internal(newcred, ngrp, groups); setsugid(p); proc_set_cred(p, newcred); @@ -1693,11 +1716,11 @@ groups_check_normalized(int ngrp, const gid_t *groups) groups_check_positive_len(ngrp); groups_check_max_len(ngrp); - if (ngrp == 1) + if (ngrp <= 1) return; - prev_g = groups[1]; - for (int i = 2; i < ngrp; ++i) { + prev_g = groups[0]; + for (int i = 1; i < ngrp; ++i) { const gid_t g = groups[i]; if (prev_g >= g) @@ -1723,7 +1746,7 @@ group_is_supplementary(const gid_t gid, const struct ucred *const cred) * Perform a binary search of the supplementary groups. This is * possible because we sort the groups in crsetgroups(). */ - return (bsearch(&gid, cred->cr_groups + 1, cred->cr_ngroups - 1, + return (bsearch(&gid, cred->cr_groups, cred->cr_ngroups, sizeof(gid), gidp_cmp) != NULL); } @@ -2588,11 +2611,6 @@ void crcopy(struct ucred *dest, struct ucred *src) { - /* - * Ideally, 'cr_ngroups' should be moved out of 'struct ucred''s bcopied - * area, but this would break the ABI, so is deferred until there is - * a compelling need to change it. - */ bcopy(&src->cr_startcopy, &dest->cr_startcopy, (unsigned)((caddr_t)&src->cr_endcopy - (caddr_t)&src->cr_startcopy)); @@ -2634,11 +2652,17 @@ cru2x(struct ucred *cr, struct xucred *xcr) bzero(xcr, sizeof(*xcr)); xcr->cr_version = XUCRED_VERSION; xcr->cr_uid = cr->cr_uid; + xcr->cr_gid = cr->cr_gid; - ngroups = MIN(cr->cr_ngroups, XU_NGROUPS); + /* + * We use a union to alias cr_gid to cr_groups[0] in the xucred, so + * this is kind of ugly; cr_ngroups still includes the egid for our + * purposes to avoid bumping the xucred version. + */ + ngroups = MIN(cr->cr_ngroups + 1, nitems(xcr->cr_groups)); xcr->cr_ngroups = ngroups; - bcopy(cr->cr_groups, xcr->cr_groups, - ngroups * sizeof(*cr->cr_groups)); + bcopy(cr->cr_groups, xcr->cr_sgroups, + (ngroups - 1) * sizeof(*cr->cr_groups)); } void @@ -2809,12 +2833,8 @@ crextend(struct ucred *cr, int n) /* * Normalizes a set of groups to be applied to a 'struct ucred'. * - * The set of groups is an array that must comprise the effective GID as its - * first element (so its length cannot be 0). - * - * Normalization ensures that elements after the first, which stand for the - * supplementary groups, are sorted in ascending order and do not contain - * duplicates. + * Normalization ensures that the supplementary groups are sorted in ascending + * order and do not contain duplicates. */ static void groups_normalize(int *ngrp, gid_t *groups) @@ -2825,15 +2845,15 @@ groups_normalize(int *ngrp, gid_t *groups) groups_check_positive_len(*ngrp); groups_check_max_len(*ngrp); - if (*ngrp == 1) + if (*ngrp <= 1) return; - qsort(groups + 1, *ngrp - 1, sizeof(*groups), gidp_cmp); + qsort(groups, *ngrp, sizeof(*groups), gidp_cmp); /* Remove duplicates. */ - prev_g = groups[1]; - ins_idx = 2; - for (int i = 2; i < *ngrp; ++i) { + prev_g = groups[0]; + ins_idx = 1; + for (int i = ins_idx; i < *ngrp; ++i) { const gid_t g = groups[i]; if (g != prev_g) { @@ -2876,7 +2896,7 @@ crsetgroups_internal(struct ucred *cr, int ngrp, const gid_t *groups) * Copy groups in to a credential after expanding it if required. * * May sleep in order to allocate memory (except if, e.g., crextend() was called - * before with 'ngrp' or greater). Truncates the list to (ngroups_max + 1) if + * before with 'ngrp' or greater). Truncates the list to ngroups_max if * it is too large. Array 'groups' doesn't need to be sorted. 'ngrp' must be * strictly positive. */ @@ -2884,8 +2904,8 @@ void crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) { - if (ngrp > ngroups_max + 1) - ngrp = ngroups_max + 1; + if (ngrp > ngroups_max) + ngrp = ngroups_max; /* * crextend() asserts that groups are not set, as it may allocate a new * backing storage without copying the content of the old one. Since we @@ -2893,6 +2913,9 @@ crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) * consider the old ones thrown away. */ cr->cr_ngroups = 0; + if (ngrp == 0) + return; + crextend(cr, ngrp); crsetgroups_internal(cr, ngrp, groups); groups_normalize(&cr->cr_ngroups, cr->cr_groups); @@ -2902,18 +2925,22 @@ crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) * Same as crsetgroups() but accepts an empty groups array. * * This function ensures that an effective GID is always present in credentials. - * An empty array is treated as a one-size one holding the passed effective GID - * fallback. + * An empty array will only set the effective GID to the fallback, while a + * non-empty array will peel off groups[0] to set as the effective GID and use + * the remainder, if any, as supplementary groups. */ void crsetgroups_fallback(struct ucred *cr, int ngrp, const gid_t *groups, const gid_t fallback) { - if (ngrp == 0) - /* Shortcut. */ - crsetgroups_internal(cr, 1, &fallback); - else - crsetgroups(cr, ngrp, groups); + if (ngrp == 0) { + cr->cr_gid = fallback; + cr->cr_ngroups = 0; + return; + } + + crsetgroups(cr, ngrp - 1, groups + 1); + cr->cr_gid = groups[0]; } /* diff --git a/sys/rpc/authunix_prot.c b/sys/rpc/authunix_prot.c index 7b531946488a..b107d5541c50 100644 --- a/sys/rpc/authunix_prot.c +++ b/sys/rpc/authunix_prot.c @@ -96,8 +96,12 @@ xdr_authunix_parms(XDR *xdrs, uint32_t *time, struct xucred *cred) if (!xdr_uint32_t(xdrs, &cred->cr_gid)) return (FALSE); - /* XXXKE Fix this is cr_gid gets separated out. */ if (xdrs->x_op == XDR_ENCODE) { + /* + * Note that this is a `struct xucred`, which maintains its + * historical layout of preserving the egid in cr_ngroups and + * cr_groups[0] == egid. + */ ngroups = cred->cr_ngroups - 1; if (ngroups > NGRPS) ngroups = NGRPS; diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c index 92f1ee0f2844..838fa9ed313a 100644 --- a/sys/rpc/svc_auth.c +++ b/sys/rpc/svc_auth.c @@ -39,6 +39,7 @@ */ #include +#include #include #include #include @@ -191,7 +192,7 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) return (FALSE); cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xprt->xp_uid; - crsetgroups(cr, xprt->xp_ngrps, xprt->xp_gidp); + crsetgroups_fallback(cr, xprt->xp_ngrps, xprt->xp_gidp, GID_NOGROUP); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); @@ -206,7 +207,7 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) return (FALSE); cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xcr->cr_uid; - crsetgroups(cr, xcr->cr_ngroups, xcr->cr_groups); + crsetgroups_fallback(cr, xcr->cr_ngroups, xcr->cr_groups, GID_NOGROUP); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); diff --git a/sys/rpc/svc_auth_unix.c b/sys/rpc/svc_auth_unix.c index b10ef33be704..963f4f272964 100644 --- a/sys/rpc/svc_auth_unix.c +++ b/sys/rpc/svc_auth_unix.c @@ -89,8 +89,12 @@ _svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg) stat = AUTH_BADCRED; goto done; } - /* XXXKE Fix this if cr_gid gets separated out. */ for (i = 0; i < gid_len; i++) { + /* + * Note that this is a `struct xucred`, which maintains + * its historical layout of preserving the egid in + * cr_ngroups and cr_groups[0] == egid. + */ if (i + 1 < XU_NGROUPS) xcr->cr_groups[i + 1] = IXDR_GET_INT32(buf); else diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index ddd8f3ddb63d..4831d8cb6e1b 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -76,15 +76,12 @@ struct ucred { u_int cr_users; /* (c) proc + thread using this cred */ u_int cr_flags; /* credential flags */ struct auditinfo_addr cr_audit; /* Audit properties. */ + int cr_ngroups; /* number of supplementary groups */ #define cr_startcopy cr_uid uid_t cr_uid; /* effective user id */ uid_t cr_ruid; /* real user id */ uid_t cr_svuid; /* saved user id */ - /* - * XXXOC: On the next ABI change, please move 'cr_ngroups' out of the - * copied area (crcopy() already copes with this change). - */ - int cr_ngroups; /* number of groups */ + gid_t cr_gid; /* effective group id */ gid_t cr_rgid; /* real group id */ gid_t cr_svgid; /* saved group id */ struct uidinfo *cr_uidinfo; /* per euid resource consumption */ @@ -111,8 +108,20 @@ struct ucred { struct xucred { u_int cr_version; /* structure layout version */ uid_t cr_uid; /* effective user id */ - short cr_ngroups; /* number of groups */ - gid_t cr_groups[XU_NGROUPS]; /* groups */ + short cr_ngroups; /* number of groups (incl. cr_gid). */ + union { + /* + * Special little hack to avoid needing a cr_gid macro, which + * would cause problems if one were to use it with struct ucred + * which also has a cr_groups member. + */ + struct { + gid_t cr_gid; /* effective group id */ + gid_t cr_sgroups[XU_NGROUPS - 1]; + }; + + gid_t cr_groups[XU_NGROUPS]; /* groups */ + }; union { void *_cr_unused1; /* compatibility with old ucred */ pid_t cr_pid; @@ -120,9 +129,6 @@ struct xucred { }; #define XUCRED_VERSION 0 -/* This can be used for both ucred and xucred structures. */ -#define cr_gid cr_groups[0] - struct mac; /* * Structure to pass as an argument to the setcred() system call. diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index ee2188baf28d..ffc993aef9fc 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2038,7 +2038,6 @@ ufs_mkdir( { #ifdef QUOTA struct ucred ucred, *ucp; - gid_t ucred_group; ucp = cnp->cn_cred; #endif /* @@ -2065,13 +2064,8 @@ ufs_mkdir( */ ucred.cr_ref = 1; ucred.cr_uid = ip->i_uid; - - /* - * XXXKE Fix this is cr_gid gets separated out - */ - ucred.cr_ngroups = 1; - ucred.cr_groups = &ucred_group; - ucred.cr_gid = ucred_group = dp->i_gid; + ucred.cr_gid = dp->i_gid; + ucred.cr_ngroups = 0; ucp = &ucred; } #endif @@ -2802,7 +2796,6 @@ ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, { #ifdef QUOTA struct ucred ucred, *ucp; - gid_t ucred_group; ucp = cnp->cn_cred; #endif /* @@ -2828,13 +2821,8 @@ ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, */ ucred.cr_ref = 1; ucred.cr_uid = ip->i_uid; - - /* - * XXXKE Fix this is cr_gid gets separated out - */ - ucred.cr_ngroups = 1; - ucred.cr_groups = &ucred_group; - ucred.cr_gid = ucred_group = pdir->i_gid; + ucred.cr_gid = pdir->i_gid; + ucred.cr_ngroups = 0; ucp = &ucred; #endif } else { From nobody Thu Jul 31 04:57:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsxf14gdzz63S03; Thu, 31 Jul 2025 04:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsxf12kVNz3NQd; Thu, 31 Jul 2025 04:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753937849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AdwdbqDDltwlsNIt15M7Z8Ci4gLI9IB++qfie5yMyq8=; b=cvTLkNNrmg33P39PwwJFLECcSGvspqJlFCD0XXhjiNRUYxRcFSdf8Iz3X6ffohL2+yD9jK yUV41HHVbu2yenkKLu+tOmYrPg8+3kpi1McyCiIjvZOxo9+872EKdt9LCz38NlbCKPtCqQ C4A8HdOpiLT3W/YcmVm2sGiT5yVPR5gUbSLeWa7LArmWLr54b/U8korTzusSIoNOSiugMf EcbncwCf369tBHq5C2r++YpCqOiUC8yP4uHKB2iIEN+LP0SQe39gsUrAv5Lpjj1VUGhhJl pVkUjYMGBNw69EyBueh1+aGb15liXgQXuS6Tunyphh6xevC4S4X+EZ1F0yUJZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753937849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AdwdbqDDltwlsNIt15M7Z8Ci4gLI9IB++qfie5yMyq8=; b=mz3BE1kvvWr4jnJFrzHmMaHPc2KyHWMDn6Xo2v1J0KmZiXY0t1TB/E9X3ZuHpG3eVqemHS 3yoo3/SzWzOsrARUFOCncsjA2uXfRvyMoldPuuBYYEp8554afTlyUgqm3JHeLWgOIMdxpB XRDTg5Ayd81M1LGf8rpPZoSqLe4+YLPMep1QUDH/1KMMg4PKrZ6xXwM4IAMnAKO/TCyMuj o5vfjw2vZ4L2E9oklHGsAsDITLL4H0m0kl82GYy+tEEUZ453QjKD02WnBtrBapXKrTKFDB 4P4Nj/pTLPNZ3y6XTqQDcRwTkziOrXeu0O26G0/rM2PQ4y3XIq6Yf2G8U0qGbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753937849; a=rsa-sha256; cv=none; b=X2K1kRLfrQTA//C2UWstBQWFQWDSE4RLPwel4m6UZN6kkKxfmpRTLHHl9nlrhRtBC9HQDj ZPv/WmGCBu+yg0veV4fl6uOE62qCo6BqqJebyDxNNLK2G+hgUB0rOLd6vqwvDljYEXYZMz +2ZTbbCvU3RoYsWLSxL3NJgTt86p8yR5qAknTTcg2Sg0givZgkKYI4d52aJZEpgSNjJyvQ OYxzuSTGQakd68J/+h+r506cWMs1wnhJN7mCFhidy57EL20ZDzbznBIwpDccNa5j/BZ0s8 ZlrCL1mhot95c10FDm+rmWEjCniCCsBycDgXDE30UZqIjLVuMfoQH7sAJkOYJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bsxf12Kryznxn; Thu, 31 Jul 2025 04:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V4vTRo073929; Thu, 31 Jul 2025 04:57:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V4vTNj073927; Thu, 31 Jul 2025 04:57:29 GMT (envelope-from git) Date: Thu, 31 Jul 2025 04:57:29 GMT Message-Id: <202507310457.56V4vTNj073927@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: 4befc6711ab2 - main - param.h: bump __FreeBSD_version for be1f7435ef218b List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4befc6711ab25912c3378afe5a2989945acf803f Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4befc6711ab25912c3378afe5a2989945acf803f commit 4befc6711ab25912c3378afe5a2989945acf803f Author: Kyle Evans AuthorDate: 2025-07-31 04:55:50 +0000 Commit: Kyle Evans CommitDate: 2025-07-31 04:55:50 +0000 param.h: bump __FreeBSD_version for be1f7435ef218b I meant to review the diff again to make sure that __FreeBSD_version had not progressed in the interim, but failed to do so- belatedly bump it for a struct ucred ABI change. Fixes: be1f7435ef21 ("kern: start tracking cr_gid outside of [...]") --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 33d61e8a1619..f7abc740ddc3 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -74,7 +74,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500055 +#define __FreeBSD_version 1500056 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Jul 31 09:51:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt49l4Pqmz63h2j; Thu, 31 Jul 2025 09:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt49l0D1Jz3v0C; Thu, 31 Jul 2025 09:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753955515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bQ6FIhkYFrr+SPtSvn/eusjuITWlq2wozTsLvncnQ9A=; b=jGn44QLJv9kFpBUHWUX1uPOy9FW5wtgpOdoR4rnMNVfSMTSwfMVpHLAwrhkgj0kX8qw4pP ySZ89yt4D2b5+Qd5hXwbr3SYvbmFK4fSb+6xZhS7K4628LXmOcxnC92yU1KsRNu89u+xz2 0SohUv9QoL8/FIAW5fcsL6H7UFyAKope6UY+UaoEob8E/MWKF0O2VpilfXQ3988UbOzpFY lGdQMm9esJYDrLuFAOPwEDUlN7OHtarmuLsdZ5wIiQNo7S3c37aqjCZWtreuB3tD58U8NW kJQYrQ4CJuaV1Pwe51zksxWvCzSBN5jmTNv46DKg6CDKiqYXKSCKx5nY+Sp2zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753955515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bQ6FIhkYFrr+SPtSvn/eusjuITWlq2wozTsLvncnQ9A=; b=IY8TTlneM4sQZogLVpLIFtcNjOVpAYJa6Q5VLFp6XDmr5PeOnhymRBZHtgSsUTNjFGUy4H gfsirVYbSAZQBGwWIeeeNAr2Y4CLl4Bf1KGnYcvcqbX8cfEczl7HfDHvoC2JeM0LhbwVpU f7bcFJbfoZPkZkIIXwuOsi3A/ElET1hR2+OASVYblIjDm1mcRZI+oqZkyomQAE1XcQlpgy 57969c1IAS8Hyh1KLdB8IS4CZXnxo/vIqrnC9l91VcXwmdoYcOj7cB5CkZhyuC4AZC5BoN 25hADCxC2VtK/Tus8YSm+D9C5492UWyB7mwZkuId5K4E7LMtDYSDIlNHFSmmyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753955515; a=rsa-sha256; cv=none; b=XzJki2AtXgW9ZLxssYyoJzv0J7prqWc0cGzK9fbfo2yd7MvzQaODEcIh0drVysq0n29AXu bSgqbiNo+EL7oqw6db6c2O2LKLL3GB35DVzEFJag0F5aSHgVOFPn3A3NUaKitwqXasg4TK dIOVnbbMNgk8rPi+8mk4UVZ8Bdyds/xStG+nqdby97lS36lz+XZLmmsRtYeWuyoufdnoH0 BkbIiy26DsfMD0wogSB4VQ/KjwnsPWnTePZKvI0RAg7c1LhfzsZGWYWwuAo8IVTwvqNS3p JBpuYcBeq/H5G2B80GdWX2RQvg5DqkmXgVoLeCmTmqFrHfryvhz3JFKz4VBvkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt49k6k4jzx9s; Thu, 31 Jul 2025 09:51:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56V9ps13040761; Thu, 31 Jul 2025 09:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56V9pscn040758; Thu, 31 Jul 2025 09:51:54 GMT (envelope-from git) Date: Thu, 31 Jul 2025 09:51:54 GMT Message-Id: <202507310951.56V9pscn040758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 30218eb7c4bc - stable/14 - clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 30218eb7c4bcc8d49dc09a3e3001c64588af2e05 Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=30218eb7c4bcc8d49dc09a3e3001c64588af2e05 commit 30218eb7c4bcc8d49dc09a3e3001c64588af2e05 Author: Lexi Winter AuthorDate: 2025-07-27 10:53:19 +0000 Commit: Lexi Winter CommitDate: 2025-07-31 09:11:01 +0000 clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC} ${.ALLSRC} can include the dependency OptParser.td, which causes llvm-tblgen to fail since it only accepts a single input argument. Use ${TDFILE} directly instead, which matches the other invocations of tblgen in the LLVM Makefiles. Fixes: d3c06bed2c16 ("clang: install clang-scan-deps") MFC after: 3 days Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D51569 (cherry picked from commit ad023bc26e106e28e1b4845f991b52b533bd0802) --- usr.bin/clang/clang-scan-deps/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/clang/clang-scan-deps/Makefile b/usr.bin/clang/clang-scan-deps/Makefile index 16fecdb88867..8da12faccc45 100644 --- a/usr.bin/clang/clang-scan-deps/Makefile +++ b/usr.bin/clang/clang-scan-deps/Makefile @@ -10,13 +10,14 @@ SRCS+= ClangScanDeps.cpp \ .include "${SRCTOP}/lib/clang/clang.pre.mk" CFLAGS+= -I${.OBJDIR} -TDFILE= Opts.td -INCFILE= ${TDFILE:.td=.inc} + +INCFILE= Opts.inc +TDFILE= ${LLVM_BASE}/${SRCDIR}/Opts.td GENOPT= -gen-opt-parser-defs ${INCFILE}: ${TDFILE} ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} DEPENDFILES+= ${TGHDRS:C/$/.d/} From nobody Thu Jul 31 10:02:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt4Pf0lcPz63hgk; Thu, 31 Jul 2025 10:02:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt4Pd6vNwz3w2f; Thu, 31 Jul 2025 10:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbjwQ+1B8TfnBUAfAmeb16xJ129a2/tX8wwpeTDKJ6I=; b=W86lRaOsiuyobaYu10Bfj2bd/me+rO+GRGuZ1ORuQYzgJ8CH+B2aT6gJzdckxFRf4/5QNU 5BBnTjDM1AIfkmXvPruaiEQQEi5323ToGLMG+1u/AF74weAzE04lpDVZxI/90XTPluDggv CiQoQ+FMpVK96IHLMhUlCJh5QQxUNHfj3b0BEUZWCXnUCnfv2wfHhVJpt/N30tTqwHZGW3 ii53le3dvcsUpZvFX9MNAzs1BEChCWBIlw44TwzEYEUBAZRi85MW/eIux4eoMsxiteA2te UHRaqsz3aSXZ5YSyHd0z116SazXiTkTxn8VWiDCZPlmcLkIAmeWTwSUmuca9yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbjwQ+1B8TfnBUAfAmeb16xJ129a2/tX8wwpeTDKJ6I=; b=LCeuYYfHFRbEVUeqkdsTyXJ+tmjzHgkAf1/RTEW4tHeFvSGW+nBpgYh3wLd1LHJzjJwOhp cFP0RJyvqF8y6rvEZO869RhNKdwYCY1edKFMvBIg+eH+Wv2KNMes+cnufQEXACAMg3lAGS GjVYQfONixQ4q6E2wP4ETmbAwofNymKLF4xPWpYggNz2MRWL8ltfDaij+DSL5nC+QNiDC5 A/Ddxl4HJPjudP3lzrMwOuxqAn8YNRdd+gmg3FnjTdfHmiZJ0fXWFhR+gWiBgGGZhNj4Td IF3Iz/sA3Hob2LhGoOfinnNe3sXUHihy0oXD9u+buSggnMA6EYBsu2nAlPGStw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753956134; a=rsa-sha256; cv=none; b=RxgNxVIvc73IapWXzSA344C3mD+58BEnEbXLPBFALjPJ+dFlF/EWfly66v47eMfnVEc508 DZn+QNDCvZcdXWSNkqgXlYaRf3gBEHsr+g9l6X5Jn9yfapy5kEBAyuBLRbICVJklAp7iS6 kqHKIg8SScz0vdTRnp73LIf/K1UZ1Ek6bkdtjor/e4l5LwyevkN5Qi8ACEO4TtPqSDwBcP UwOwK6AbDSq5RTAA6ftlYBM9jb4r6KiBJktFrj7jNLcVZObqSXSSl3DBUPpunKb6ierjzX 2QY5dnzAddrNFfofxwseC1AiUPECvoPICsGTJ26Y8WTs3adm/y0afsrDCRNMcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt4Pd6J6vzxwW; Thu, 31 Jul 2025 10:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VA2D6l063613; Thu, 31 Jul 2025 10:02:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VA2DIQ063610; Thu, 31 Jul 2025 10:02:13 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:02:13 GMT Message-Id: <202507311002.56VA2DIQ063610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 0a2335471314 - stable/13 - pom.6: add a more complete bibliography List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0a2335471314ea026042944d5971558e301cc779 Auto-Submitted: auto-generated The branch stable/13 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=0a2335471314ea026042944d5971558e301cc779 commit 0a2335471314ea026042944d5971558e301cc779 Author: Lexi Winter AuthorDate: 2025-07-24 21:12:50 +0000 Commit: Lexi Winter CommitDate: 2025-07-31 09:56:30 +0000 pom.6: add a more complete bibliography Source: Wikipedia (cherry picked from commit bf0ee5f2175a3c6eb52f9fc74b93b445d37a6086) --- usr.bin/pom/pom.6 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.bin/pom/pom.6 b/usr.bin/pom/pom.6 index 7b8248ed78a0..7d41d0c5ec61 100644 --- a/usr.bin/pom/pom.6 +++ b/usr.bin/pom/pom.6 @@ -27,7 +27,7 @@ .\" .\" @(#)pom.6 8.1 (Berkeley) 5/31/93 .\" -.Dd July 14, 2010 +.Dd July 24, 2025 .Dt POM 6 .Os .Sh NAME @@ -62,4 +62,10 @@ but not has been specified, it will calculate the phase of the moon on that day at midnight. .Sh SEE ALSO -`Practical Astronomy with Your Calculator' by Duffett-Smith. +.Rs +.%A Peter Duffett-Smith +.%B Practical Astronomy with Your Calculator +.%I Cambridge University Press +.%C Cambridge, UK +.%D 1979 +.Re From nobody Thu Jul 31 10:02:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt4Pg2jcnz63hW4; Thu, 31 Jul 2025 10:02:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt4Pg0dGbz3wJl; Thu, 31 Jul 2025 10:02:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNC1m5Bs4LxemoCTqzXJj+RnjyGmjjDaxpeRLs9brMg=; b=urg45pli6FCIw5zv3bbYgCxMVMaJ/p99neEHTnQqfC5oNZ4HPKM8imo0APaeid/elHCj0t Z5gtaFvt8RREUKxmJY93JgL+UrTaAbh2u24r9vJkOLWTrI0iTwhrZNiFSfpPE8Nqo9IVJj R6nqI+/HBlCuF2De8978vw53eGlPQqEEBdXWyHaDDKgmMFXbRSvzgIN44KcJEZSoULrYQM xiOaZ9s17piO2kHNG+AmFb1rFCvMHLLwATjMwMp0GWGC6h1D6AxdLuMjoLzRXjLpZ1558u l6t9OeTxsPu17xUSY1xkIwxXAf64vgghLoFa6m/UiduOBd+Fjj15/Jhx5HxLtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNC1m5Bs4LxemoCTqzXJj+RnjyGmjjDaxpeRLs9brMg=; b=nZgGDd4jzqwgECSZFJaSPJIaqKRch6qPD+EaNPq/63/llEDsaGzqRRrUg6AZnYVLX3Ptyn HewuQxW0+6O/RLrSGoFRNe/g/u1G5RpjVlqju2EygdGuLGPo9tUdseY2eQH+OrejofH0+6 oKUaQZSuQEn9wJRRg6Ss2c/sugBSB+cLteS2M7TCLN/QGyyOzjgS5gAMbHo26CjBeNH1q3 nRYr/tESZT63EKpR/2BoX8C+q1XyzZ673g/M0jl0QJfgfQJTgeHXIQ3WfGgmt2XBG1fx7L CrFd+Fnt1GCGiZ4IvbMUXeXQNhjJHPkfsG5UvKqXTo5TsmlsY+UxPCzNpTemTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753956135; a=rsa-sha256; cv=none; b=SBkVCAXdMpK2EruXJzm3WxCrXB9R77gons9v3aNUTop+qZZwG5kBYaR/xrofdM44M9xWpR fyRJmdsVlqxTSvR0ptP8dzcKf172nM0pct/lzH3CSP4atgxmjRSh91EnW7ybst3ZRnv1+M djSk+jcvMA6GqabSRBy4P1tALERAK93p1P675YW9dI4LT+h1nHxaaLMQGAQrWmZZ/37EWu XvjSiCI+2O4f6C3AL8mhrjdDHDbLVyx+1NiB5gax1FUsN+dKhlKeRo/JP4v7PrSN6iBvOp oYWqSRX5/+RtTB9qNjtTiu8CFF+Dw/gjth+j9jm5l4xv+nMixQfTYlqjxf0+fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt4Pf750ZzxBl; Thu, 31 Jul 2025 10:02:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VA2ERO063646; Thu, 31 Jul 2025 10:02:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VA2E7V063643; Thu, 31 Jul 2025 10:02:14 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:02:14 GMT Message-Id: <202507311002.56VA2E7V063643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 4eee2c9e9625 - stable/13 - crash.8: update a little List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4eee2c9e9625f32fe822092f4fdbd87b30ec10a8 Auto-Submitted: auto-generated The branch stable/13 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=4eee2c9e9625f32fe822092f4fdbd87b30ec10a8 commit 4eee2c9e9625f32fe822092f4fdbd87b30ec10a8 Author: Lexi Winter AuthorDate: 2025-07-25 13:59:58 +0000 Commit: Lexi Winter CommitDate: 2025-07-31 09:56:56 +0000 crash.8: update a little Replace "cannot mount root" (which is no longer a panic) with a brief description of the mountroot> prompt, and recommend using "system install media" rather than the fixit floppy. Remove "timeout table full" entirely since this panic no longer exists. MFC after: 3 days Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D51512 (cherry picked from commit c9868af774ec24bcf6914fc971378e9723eb44ab) --- share/man/man8/crash.8 | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/share/man/man8/crash.8 b/share/man/man8/crash.8 index e1ccd4259358..4af2629afff1 100644 --- a/share/man/man8/crash.8 +++ b/share/man/man8/crash.8 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 23, 2011 +.Dd July 25, 2025 .Dt CRASH 8 .Os .Sh NAME @@ -71,18 +71,19 @@ Left unstated in all cases is the possibility that hardware or software error produced the message in some unexpected way. .Pp .Bl -diag -compact -.It "cannot mount root" -This panic message results from a failure to mount the root file system -during the bootstrap process. -Either the root file system has been corrupted, -or the system is attempting to use the wrong device as root file system. -Usually, an alternate copy of the system binary or an alternate root -file system can be used to bring up the system to investigate. -Most often -this is done by the use of the boot floppy you used to install the system, -and then using the -.Dq fixit -floppy. +.It Mounting from failed with error +The system was unable to mount the configured root filesystem. +Either the root filesystem has been corrupted, +or the system is attempting to use the wrong device as root filesystem. +.Pp +This is not a panic message; rather it is followed by an interactive +.Sy mountroot> +prompt where the operator can list detected devices and filesystems, +and select an alternative root filesystem to mount. +Alternatively, the system can be booted from recovery media to repair +the situation. +The system install media provides a live environment which is suitable +for this task. .Pp .It "init: not found" This is not a panic message, as reboots are likely to be futile. @@ -108,11 +109,6 @@ after a crash, hardware failures, or other condition that should not normally occur. A file system check will normally correct the problem. .Pp -.It "timeout table full" -This really should not be a panic, but until the data structure -involved is made to be extensible, running out of entries causes a crash. -If this happens, make the timeout table bigger. -.Pp .\" .It "trap type %d, code = %x, v = %x" .\" An unexpected trap has occurred within the system; the trap types are: .\" .Bl -column xxxx -offset indent From nobody Thu Jul 31 10:02:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt4Ph3vsbz63hW5; Thu, 31 Jul 2025 10:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt4Ph1VTxz3wGg; Thu, 31 Jul 2025 10:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gc46FGAl9s7E9AzcWIiYTJU+Nkz9E/mXkDJVCkcEEfM=; b=Rr7jUQvqOk6zlK8F5Gard6X6wLMS3mx5bRu9DbcktQLzjNlg0ltV09IRMUaF3oLufA7xw8 t1svBlT2PgdRK3jo+jry9x8AVvD6XUzASL2KSiTFCrBD+OKhFLfLxr5IA9ksCIHI4kvj0O N0XQ47DF2Lz5dpmx7LxqmEKAlgStfJNLxZETG+rgfm89FZqxUkgEgcdPQhTdPEF5mqjXRz yGkcDW3hii7VdftQ+1sesUaeiiSMFA/jNuQ+taZvQr6x3S9Pf9uzsA7M3PQA2PWbfAaZkH pSDvopT4ANP2hp1hv2oJn909/FrHXF8Ms9UrbYURI25j9MGVhMLWwXhBF9dylA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gc46FGAl9s7E9AzcWIiYTJU+Nkz9E/mXkDJVCkcEEfM=; b=nPVUD7s52yYGM3j+APc6pRAOV3tPYQ2v2L4rnssolewJQI9qn4mCuTpwGuwYCS8iHWqAoF ZL/ZYZXgIe94+qgtAYMfMb92MyaFT/JGRS1Mb//zEYrwyN0kjH2YG/v5ULTApSKDCj8eDj qVOvrT5tAcAPV3Hj1kaT0yjn8gtTlfZfVjJKqU8WGhDF3gq0uANgfQ3dwgJbvQzRs0UYfT 76RSlrD+4TLisf6gUyjYEGcaJic5irLWQPtrW0fNj6TjBhZg6N4PHRUhJ/LZw4syV6Qetb HPDs8cod9QmpAOAcgWBW94qnDJbpMfyizHJOuytxMMdLLFDKe8cjpUiVVZVSjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753956136; a=rsa-sha256; cv=none; b=A4WE2Zu0opCi4ivZ7pZBsxDFTi6w+lVr1n1esZTH5BrXDdzevJX5KxdsQnGT2a8L5OBqSJ yFciYvFxw3xX+g/0LtCqJa2H3HpiFQFfV/efkBDsshVm1Z9c+UGocktpdcWB52l0aflKUL jwUbzx8uuXAQ2xztlxMgrq1MUWD2oz7IBf5o7uiZMKeTkYW+MVMZkYMNQX5Bw1MMMjVAis J2e1yTvxetL3XWudno+nQweJ6A2+yKGKX1HE29k4epk3RJraEic4Xe2MPOSl+UBXdVI7ab OUr4xVonYSIwX0FsGLdnW5c1EthIVvuKxbz0lfOI8GDaMlA4UTtO3Ewme3smrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt4Ph136KzxVm; Thu, 31 Jul 2025 10:02:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VA2GVu063679; Thu, 31 Jul 2025 10:02:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VA2G7E063676; Thu, 31 Jul 2025 10:02:16 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:02:16 GMT Message-Id: <202507311002.56VA2G7E063676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: de19b9d6e967 - stable/13 - clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: de19b9d6e967a91565605b04c9f4b61b2099f096 Auto-Submitted: auto-generated The branch stable/13 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=de19b9d6e967a91565605b04c9f4b61b2099f096 commit de19b9d6e967a91565605b04c9f4b61b2099f096 Author: Lexi Winter AuthorDate: 2025-07-27 10:53:19 +0000 Commit: Lexi Winter CommitDate: 2025-07-31 09:57:54 +0000 clang-scan-deps: Pass ${TDFILE} to tblgen, not ${.ALLSRC} ${.ALLSRC} can include the dependency OptParser.td, which causes llvm-tblgen to fail since it only accepts a single input argument. Use ${TDFILE} directly instead, which matches the other invocations of tblgen in the LLVM Makefiles. Fixes: d3c06bed2c16 ("clang: install clang-scan-deps") MFC after: 3 days Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D51569 (cherry picked from commit ad023bc26e106e28e1b4845f991b52b533bd0802) --- usr.bin/clang/clang-scan-deps/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/clang/clang-scan-deps/Makefile b/usr.bin/clang/clang-scan-deps/Makefile index 16fecdb88867..8da12faccc45 100644 --- a/usr.bin/clang/clang-scan-deps/Makefile +++ b/usr.bin/clang/clang-scan-deps/Makefile @@ -10,13 +10,14 @@ SRCS+= ClangScanDeps.cpp \ .include "${SRCTOP}/lib/clang/clang.pre.mk" CFLAGS+= -I${.OBJDIR} -TDFILE= Opts.td -INCFILE= ${TDFILE:.td=.inc} + +INCFILE= Opts.inc +TDFILE= ${LLVM_BASE}/${SRCDIR}/Opts.td GENOPT= -gen-opt-parser-defs ${INCFILE}: ${TDFILE} ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${TDFILE} TGHDRS+= ${INCFILE} DEPENDFILES+= ${TGHDRS:C/$/.d/} From nobody Thu Jul 31 10:07:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt4WD0H7dz63hdC; Thu, 31 Jul 2025 10:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt4WC6dC3z3x8H; Thu, 31 Jul 2025 10:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YE3dkPe5wDCg1uvm2uJsUhQsBBjqxQCIYSfNooLzUd8=; b=tF3o1W/smXJkeYScCeCX/TvibEw8iShu9Qu+TCYORXJOpLuodnGzB8Y68SgxQ7lQx8CorT DXxBC/TpMc6uKHjcN46zWt019601ZDdPd80uQY0uKElrBSZvMy9vxVUAkI1aBodnd3XsLD hrln6lUcJJvfJgpJpswncS9Z7xpJXZTlrYMwb0tqwJ5BRoWKma4DCIdPpXxfxbW7DJfO4F G1IlNa/PDvAI8jsGGstDbpsYHWWk5C4j6oNrnh6caSyRpe12z+lTPp5BFVKWK4cqBebo3M 4eqq8miZarLMCl2USdbwDtVoNFkZR05y/f2EmbupX+pyXSYBqG4lm+EV4CJNnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YE3dkPe5wDCg1uvm2uJsUhQsBBjqxQCIYSfNooLzUd8=; b=xOCyMhnlJV2TaPy0S+Ikkd/tGJg4xMpq8F5ekfQOiSfzFb1GE8J+ixkMQa1bi+pfXGW/Bk o7dGf6GEDf2CzTfuRUwGd9JuamAAeHCPgdFlQOjg/IfrEi2CXQh7nEbnZ3nkDAkk9R7VvX 06OHhJmk9PH6K/iJv7b60sgq+UDxKv7cjWOhBfYnrBKLtcuqC6UuPsR4i17EYQpu2tBOoj osk+ioSlZec7b1dOkuONZIcVuqDDd3YaL8holqIPJnnnVjS0iIJBnDhaj4I/UGGsBtxaCM pdmlgKWHS2wDi9HKGEhl77rgaC646v5rq29W2O80RSCeO6F1zQkxhlX+tQBJcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753956423; a=rsa-sha256; cv=none; b=C8fKjIx7HpMg5ZemOGyT5a852N7qmSzrBR5aIa8CE6g4XYrcEDAzrVMh1V+WZkBF0MKqWk jEhj+AKSnbJy65vUXytIF9Q14nxFbeFeKfH312zAoWFYTYbj4EHr3T4I0Hsu+DWoiu7u2W m5aZu0hR3x5I/Av0Bk6a2nTQ9GTU+GCY2/fRH8GZ+2WtGzChWusZbePZLyyEChNjnLdsJo THKi5d20fwyn6f/s2kmwYcp3sVOfJh0rL5UimD9UWsqM9AS8YN4jwYBSo23+DtkqK920f4 fgLWgaxNX5rj6awgqhihDuM2ZIpqftrKtshAumMe1kQH1UBHXzKRPSHO9eDkcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt4WC5nqqzxwb; Thu, 31 Jul 2025 10:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VA73VG067881; Thu, 31 Jul 2025 10:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VA73qn067878; Thu, 31 Jul 2025 10:07:03 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:07:03 GMT Message-Id: <202507311007.56VA73qn067878@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: a8d90e32133b - main - netlink: Fully clear parser state between messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8d90e32133b77a49c2551f22e59f72d65293b64 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a8d90e32133b77a49c2551f22e59f72d65293b64 commit a8d90e32133b77a49c2551f22e59f72d65293b64 Author: Dag-Erling Smørgrav AuthorDate: 2025-07-31 10:06:47 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-07-31 10:06:47 +0000 netlink: Fully clear parser state between messages Failing to reset the cookie between messages can lead to an attempt to interpret a zeroed buffer as a struct nlattr, causing a length calculation to underflow, resulting in a memcpy() call where the length exceeds the actual size of the buffer. MFC after: 1 week PR: 283797 Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D51634 --- sys/netlink/netlink_io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netlink/netlink_io.c b/sys/netlink/netlink_io.c index ce323910af3f..e7908d6f3a44 100644 --- a/sys/netlink/netlink_io.c +++ b/sys/netlink/netlink_io.c @@ -308,6 +308,7 @@ static void npt_clear(struct nl_pstate *npt) { lb_clear(&npt->lb); + npt->cookie = NULL; npt->error = 0; npt->err_msg = NULL; npt->err_off = 0; From nobody Thu Jul 31 10:12:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt4dM2fZZz63hVQ; Thu, 31 Jul 2025 10:12:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt4dM0TQLz3xwp; Thu, 31 Jul 2025 10:12:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AI2dDdJkg2SfLRaGcpCUBfM/rixr+fSKPZ9PHLiFO08=; b=Fb4mhW12j2o56m8jBPLK89mRwBWI1ukucHeGMN5qjQpRZyd6OKMcJYtUXq+aPDkdwAcaoc /sJ0aNCUsn57rAaCg9Qr5gXNkP21cMibmTlDjWhtOmRVKbvxoeMdneA6LPO5Tnl/G2GmdU owSnetpaFztcYDJ4yfErHdaSadJmhVfczydALBwt4EYyfXEH+kITdXp6eaMtvwSyJ4ZoJx W1Bd6rMvlh4VXNCX57TAzDynCqXCW3EngauBWO7wTyrAwVYpfxZuIH6RP3dmuktnjTGBcc R1TY/8UaDDqo1p4+0W+WvarCUy7ady7dk3uc+sjkeB1QMe9bbtyTVC3KsawWHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AI2dDdJkg2SfLRaGcpCUBfM/rixr+fSKPZ9PHLiFO08=; b=gNn/KGFuskBd5b5kdIAgdC3XGPuyW/uOKDKys9b1QZnuBAMRPAc1sHPMRXiFWk1LCybboZ uYVkx6i7LjIDw58IoUX7sTf65aQBublG48n9bpINSAOjybEit60yXSTlONJIsleQRCTDv0 hlXqtcWmvVmhbq7GUpHxukrfi5mNA6ShJf66Ot2PBt2nggDCwjCGVLWe523zg9T61Cgjma mT4RWZoINSxrm4O+mBE99sTDqCadP8N7Q43HJlyzKk2tEDBuH5gfe4GuHsbUxP9NCefNz/ YBeCUijwdRLO/RhXoMAl3O+ktPIAV5DXIOfR9p9yBXfV286rTSWb0KCrDDXqbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753956743; a=rsa-sha256; cv=none; b=XDdOuOc0Az7uw7h70T3y8UBsOl9wibtUkW5jfuWYSp9IvrVTOHwu5TEqwtz0ip/h+YDbLL OZY75uA0zH/z3nC0/R/PByg0LW0cN5Qr64cYj85bK/dwkd3wUEMtdlacFYKT68CdRJTBDm S/99UhotG2b4sd5xibN/KdaUwMcEmOCJ57vjv3DRg7l2XhMn2pxNKvldgUKobNNpTNo2lH xtuMHC3DxcQXUSj5pRX7wZldIu1XvZ+JUoxxZu/erU4uhSZUHUHlXP7aBd2+oP/1gD+qNb 7bpsyLqbMzGIsAqbmq8GrGFK3mrkUPqVw8ugGkQDBCyM2AKfAaT77vQsHbRwMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt4dM05N9zxgm; Thu, 31 Jul 2025 10:12:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VACM16084733; Thu, 31 Jul 2025 10:12:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VACMuG084730; Thu, 31 Jul 2025 10:12:22 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:12:22 GMT Message-Id: <202507311012.56VACMuG084730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 8c49d0a9f825 - stable/13 - if_genet: Consistently use the boolean form List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c49d0a9f825a1915a3ff8eb5ef8ee8223b5d5f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8c49d0a9f825a1915a3ff8eb5ef8ee8223b5d5f1 commit 8c49d0a9f825a1915a3ff8eb5ef8ee8223b5d5f1 Author: Zhenlei Huang AuthorDate: 2025-07-19 17:07:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-31 10:11:51 +0000 if_genet: Consistently use the boolean form The variable eaddr_found is declared as bool. This change improves readability a little. No functional change intended. MFC after: 3 days (cherry picked from commit 2fc051d090933203e1af6a8452cdd87a4c76ad5b) (cherry picked from commit 97d5f16c6966e2ae261ddabe1f16a9675dedf43a) --- sys/arm64/broadcom/genet/if_genet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index e1a43b427ca4..967583aad62c 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -350,7 +350,7 @@ gen_attach(device_t dev) } /* If address was not found, create one based on the hostid and name. */ - if (eaddr_found == 0) + if (!eaddr_found) ether_gen_addr(sc->ifp, &eaddr); /* Attach ethernet interface */ ether_ifattach(sc->ifp, eaddr.octet); From nobody Thu Jul 31 10:12:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt4dN4cPJz63hqQ; Thu, 31 Jul 2025 10:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt4dN17Cxz3xkk; Thu, 31 Jul 2025 10:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJ+xPGIAi61tHqzYqd6NcIUGdNdENUSOohJ5BckJvM4=; b=gVODZlBpZ5+wUaAiSYTqgl1Kh+VkFKEW5UMB4QAt1YhiWkjlDsNdv4gwBbaOJEUtTa82RD wwKj2B/hnKCc3vjlQ8ek09bY3dLKZK2u9bCT1S9uJjoLbKJVmHJ+USuPMvjjd1wfBb2w61 5Tmg22RuJZmT51+F8xmvyK7G+D3Pp9T0NIh/JeeNNyQ4c8Rs3gxCtP3sRs5k0+c6VFYZim z8rs32qcocBiGILkDEHb1FD/Dh5XsCJouQbkKh03HERuNx4s+lfKN54uFujQrdllrgCDJe FdAf2QorDA6hLbDARN22kSPIeYIg43plc3+L/w/N5L5cqlK5ZGLNnmve9P5l3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJ+xPGIAi61tHqzYqd6NcIUGdNdENUSOohJ5BckJvM4=; b=vUeUgzNqEMn/+ifH1XzzoMu7whNLdbs8HpqmMYTElrRY/QOC+Pbo2VD1i59r5AzqfIYF62 MukOJofGymRjqF763mywYFfKcJk8FvKxcLw7dD2OrjkeHUj8dZPbKjZoT60iFT0pPU0VaI iTiRNxfsrpTiy+bJ02tFCmgFPdFEqa9CJXzcoa/atd0oOdYS2trzTXACUEgIXBCw0+iM8G 4sj3G+kmv1zZdDfFxp0Mair2C8tkdpQv9qrWXoQr56sJ9L0EzlpjNu+SbtGI6J6fSH9EdE uiltIXylIRTOMriQ9QTJVzzjLCBYhzBGOZe0rsE9aFpaeWhiiO+Lk1z3DTZkOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753956744; a=rsa-sha256; cv=none; b=FpNj8cnMN1cGeW4Js9tgQdG9ULZ4CS8ga9abbEIAO5K4UYJspurrvvudFKX1Dok8+0Ejgy DbgMMpojQnqThJH7YtE50QykZ4oiqnYAo7+n8ZVS0nO9LYgi9Gf5LNDfNyiXrlOlLIUQkD /4xrgeNd1nfACw33aMWyeJd9/VkoQDzF03QYCYO4QPBDazEPTBWJvxWwqtuJ3JzUwwi7SF VoQJMK3+gBTeW5Rwc7tWbL1L8W3/niwKnCgDKGgG47TlF32JzQP2Non89y7WPTD0SaunCh bPP7GP4kzFxDG3kn195yPVPIUz9d0lBtZlf4cUZtFdxmrMaAHo7xX9SckoA0Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt4dN0jPpzxhl; Thu, 31 Jul 2025 10:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VACOfX084778; Thu, 31 Jul 2025 10:12:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VACOic084774; Thu, 31 Jul 2025 10:12:24 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:12:24 GMT Message-Id: <202507311012.56VACOic084774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: aee028cb4e96 - stable/13 - if_genet: Plug memory leaks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aee028cb4e96541150c528767c1aeb0ca3869d37 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=aee028cb4e96541150c528767c1aeb0ca3869d37 commit aee028cb4e96541150c528767c1aeb0ca3869d37 Author: Zhenlei Huang AuthorDate: 2025-07-19 17:07:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-07-31 10:11:52 +0000 if_genet: Plug memory leaks The rx_buf_tag should be checked when destroying rx dma mappings. PR: 288309 Reviewed by: zlei Submitted by: Mike Belanger MFC after: 3 days (cherry picked from commit f46e95ae3addc9f7b975c187f71125825a38ffb1) (cherry picked from commit 337c3e9859e7b5d971e84bf546a51c2cf9a9e44f) --- sys/arm64/broadcom/genet/if_genet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index 967583aad62c..68966fcfc956 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -657,7 +657,7 @@ gen_bus_dma_teardown(struct gen_softc *sc) error); } - if (sc->tx_buf_tag != NULL) { + if (sc->rx_buf_tag != NULL) { for (i = 0; i < RX_DESC_COUNT; i++) { error = bus_dmamap_destroy(sc->rx_buf_tag, sc->rx_ring_ent[i].map); From nobody Thu Jul 31 10:13:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt4fJ1rxvz63hqf; Thu, 31 Jul 2025 10:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt4fJ1FW0z3yv2; Thu, 31 Jul 2025 10:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jC6yeUINpK8fQzGMqceBHINKpOgXUgrNs2y541e0eXk=; b=VeDG6nwJIJonKWcBliNJiidmM9gI0uiwz1mAnbsQWrM9c+oMZ2fi0YW3eRhoxBbNy8q2sN +rfFTaQ5J46z3u/ue4Ous3wyn+2Fa9qyEb2uU/+CBairQt64Tz/ckqoE0PKqlg5W1fog0C MnFOEtzRUoa7k8ZBsXFEnZgyexDVe0szwEIm98XvML3kqdfRCVl9ywz+jM8vRLqyjp5R7c oWLdwKvt8lA8Jj95tusH6d2baCA7lYXGBgXuzPldofC0ie9FQWYPvYsUVApPWj6rkHwBHu 3ubRmCjql6dnaW40v8kFATFu4OOVAi7AY5qBVu9iTKCuwEAbtpbMTvNKH/qyUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753956792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jC6yeUINpK8fQzGMqceBHINKpOgXUgrNs2y541e0eXk=; b=SuVSgTmfCCWg62LF54J+7O1nKAYkELPkxBAOKw1bCoLiDv6w/wrHdqflofpIIPQTGRgIWR a4Sk3NSHfrmZIjiZMI20MtpB6bG/OR6o8ObBkt7eabeF0uP9zf+SoGbkCbmUk9NSFaClWo gFuQDkrI2PE1vdQvLF3WND+sr9By45u2MymiH0Vuna5dzrEaIOe7biHQKNN8SI9Gd4ze7x My2mOaw10wHyw/lNwWKvu3cdhd7MlbfvJpon/IciQ9T28RzJA91Zx1gNvY6CXJH+De0rNJ Oq1M+ylXvlrIYn01hNmnc2ZEG5p/JiqIw9I0bN9C5M2FbFcVgfGYEY3qXdXhaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753956792; a=rsa-sha256; cv=none; b=Q1QMBSXn4zg267B32vWMoi9yj7qmeH2P/DBYx4nsE8Sk+ZyaKsmTMVkyK91bz+28MXJ6Qa DwcMXp3TYTRNpLH5JDQrs6maLPoiv54MK0JzbW8qtzSIi2vE9qIGBscUDezO0xKKYq/h11 R4xFlwjP3QpYgfXCoGv/CT7dcqHBoNpWNtymdyYpYVetPQCV4XWddLW0HwTg5cwDdPDmWV TVocufRsuFMG6vc71Sr7rn6GFQe/NYeP43/2XNGdxSIhgYWkjBPkCeVcBHCGxYBkcXT4mP QkXzetvRFv+K/VcZ+t+L/CtFYDKJiSH5ViD49NxnB4+6HEpCDz/6ViliKhESZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt4fJ0Z46zxj0; Thu, 31 Jul 2025 10:13:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VADB01085196; Thu, 31 Jul 2025 10:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VADBuP085193; Thu, 31 Jul 2025 10:13:11 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:13:11 GMT Message-Id: <202507311013.56VADBuP085193@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: 868b5492d184 - main - style.9: Fix "parantheses" typos in the new C++ section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 868b5492d184683c4b46927706f7cbd551d0e209 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=868b5492d184683c4b46927706f7cbd551d0e209 commit 868b5492d184683c4b46927706f7cbd551d0e209 Author: Trond Endrestøl AuthorDate: 2025-07-31 09:04:10 +0000 Commit: Olivier Certner CommitDate: 2025-07-31 10:11:45 +0000 style.9: Fix "parantheses" typos in the new C++ section PR: 288564 Fixes: 4b02ad9d5063 ("style.9: Add a C++ section") Sponsored by: The FreeBSD Foundation (commit) --- share/man/man9/style.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index e9f17392ae0c..26c7a3b2aa64 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -934,9 +934,9 @@ and Header files should always use a suffix, unlike headers from the C++ standard library. .Pp -Return values should not be enclosed in parantheses. +Return values should not be enclosed in parentheses. When converting existing C code to C++, -existing return values may remain in parantheses. +existing return values may remain in parentheses. .Pp The opening curly brace for namespace declarations should be on the first line similar to structure and class definitions. From nobody Thu Jul 31 10:59:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt5gc0DVBz63kyn; Thu, 31 Jul 2025 10:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt5gb70ZLz455Z; Thu, 31 Jul 2025 10:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753959563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r8pZYupQjHWNt75ji/O7hbfRo4Pjcbzl5n5TyNeoX9A=; b=iiBe4m+421T1uTrfJHvIG3nPJ3k/6pCkbRv5VeDAY7LdpbxiCQkTt2+0ndFj53Z+++bWh9 KFK9dxNccgOSmef7N/nXRoSRV1zPivK5grq6M6glRwcbZAcTFVEIAU0kHMdU0oBhICEghc P+DbIMhmmrCuQr0aWqT79SYkO3Wjv7808k7UYK3l7p5AqUCNnhHn/8jwD/3os9vYGCLbPN nKcxuPjiddIanChXRL8WPTMLLFlXGH75kU02OQWWLLCSsT4NGdca95BPfwk8XFpLHBuLGM +2NN42ZwPzIMVZ48I+fbhsodPElPi93SOnhdFbg9BgeYsCIjiA1Ytj7lIehouA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753959563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r8pZYupQjHWNt75ji/O7hbfRo4Pjcbzl5n5TyNeoX9A=; b=tRqTekprIU0D8UNhsOGsCbBqut/D7UowDGU55VBtuPy+pq6Sc0djj8e/ZTSsSCyj8DSPC4 L/qzPJOEQ/YcdIk3JDQ0bB6dsZrpVoJRqs/ncY+r4Tn/N5SuIl96yOSYQDHfHjIRTstT36 3Yp/DOIOD7kAAIAArexjyoJisFdlNor3fp4i9cV6TB042vGXkgtuvmaWxJR4id0ZMqILH2 ejoHcKz/5I6mGwDyMa1341oC+4VDkFWNY+7jDOGicuIjauxnBrXrgY58JNcYtkAW+U7dFe iswSTh8LmKksZ6U1DhM/aPdVegBj38dL6To8ANNV4tnVpRHMmOqp3UGUkizJtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753959563; a=rsa-sha256; cv=none; b=Unpm3H+xcn2UILVSu664Q6G3nlWrbLr4sVvoMPP4ITjIM7miVngw/KjYVM/GZno7rXnchs j2yRF9wlVhhRk8Sof8nR/gpCtJx2E67GeEpoGY2sFkxyt73AVQf8bZjI6kkLSYecoTBATP OfUrdtCr0SZ9S2ZNT3y8d/bKQcYcquraeln1O7WY98twNrK85PCHYo7teqOdO5ZHDU+UZO 1nGIVnhY/X8J0k2dIPcLbJSwnLeZ4x2Dcbumllcn9XBUVUcNzpsoZd3aKEn4nJJOly4Bwt qS16yY3lHuIABXaGfosPCexe2cSryPOJWa+uHS+bUts++N/ljV3oI8GOtMLz+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 4bt5gb6MTvz105c; Thu, 31 Jul 2025 10:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VAxN9u062279; Thu, 31 Jul 2025 10:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VAxNPt062277; Thu, 31 Jul 2025 10:59:23 GMT (envelope-from git) Date: Thu, 31 Jul 2025 10:59:23 GMT Message-Id: <202507311059.56VAxNPt062277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: dc0c74244ac4 - main - tcp: improve function names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc0c74244ac41e393bdabcadeb730d43b5c107d6 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=dc0c74244ac41e393bdabcadeb730d43b5c107d6 commit dc0c74244ac41e393bdabcadeb730d43b5c107d6 Author: Nick Banks AuthorDate: 2025-07-31 12:56:10 +0000 Commit: Michael Tuexen CommitDate: 2025-07-31 12:56:10 +0000 tcp: improve function names tcp_tv_to_usectick(), tcp_tv_to_mssectick(), and tcp_tv_to_lusectick() are not related to ticks. Therefore remove the trailing 'tick'. No functional change intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_hpts.c | 8 ++-- sys/netinet/tcp_hpts.h | 10 ++--- sys/netinet/tcp_lro_hpts.c | 2 +- sys/netinet/tcp_stacks/bbr.c | 44 ++++++++++----------- sys/netinet/tcp_stacks/rack.c | 80 +++++++++++++++++++-------------------- sys/netinet/tcp_stacks/rack_pcm.c | 6 +-- 6 files changed, 75 insertions(+), 75 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index b60cdf45af52..40d8ca15ed83 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -453,7 +453,7 @@ tcp_hpts_log(struct tcp_hpts_entry *hpts, struct tcpcb *tp, struct timeval *tv, log.u_bbr.inflight = slots_to_run; log.u_bbr.applimited = hpts->overidden_sleep; log.u_bbr.delivered = hpts->saved_curtick; - log.u_bbr.timeStamp = tcp_tv_to_usectick(tv); + log.u_bbr.timeStamp = tcp_tv_to_usec(tv); log.u_bbr.epoch = hpts->saved_curslot; log.u_bbr.lt_epoch = hpts->saved_prev_slot; log.u_bbr.pkts_out = hpts->p_delayed_by; @@ -1104,7 +1104,7 @@ tcp_hptsi(struct tcp_hpts_entry *hpts, bool from_callout) hpts->p_lasttick = hpts->p_curtick; hpts->p_curtick = tcp_gethptstick(&tv); - tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usec(&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)) { @@ -1446,7 +1446,7 @@ no_one: goto again; } no_run: - tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usec(&tv); /* * Set flag to tell that we are done for * any slot input that happens during @@ -1948,7 +1948,7 @@ tcp_hpts_mod_load(void) hpts->p_hpts_sleep_time = hpts_sleep_max; hpts->p_num = i; hpts->p_curtick = tcp_gethptstick(&tv); - tcp_pace.cts_last_ran[i] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[i] = tcp_tv_to_usec(&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); diff --git a/sys/netinet/tcp_hpts.h b/sys/netinet/tcp_hpts.h index f5856ed8e688..d9c01d6d2ac4 100644 --- a/sys/netinet/tcp_hpts.h +++ b/sys/netinet/tcp_hpts.h @@ -171,19 +171,19 @@ tcp_tv_to_hptstick(const struct timeval *sv) } static inline uint32_t -tcp_tv_to_usectick(const struct timeval *sv) +tcp_tv_to_usec(const struct timeval *sv) { return ((uint32_t) ((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); } static inline uint32_t -tcp_tv_to_mssectick(const struct timeval *sv) +tcp_tv_to_msec(const struct timeval *sv) { return ((uint32_t) ((sv->tv_sec * HPTS_MSEC_IN_SEC) + (sv->tv_usec/HPTS_USEC_IN_MSEC))); } static inline uint64_t -tcp_tv_to_lusectick(const struct timeval *sv) +tcp_tv_to_lusec(const struct timeval *sv) { return ((uint64_t)((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); } @@ -217,7 +217,7 @@ tcp_get_u64_usecs(struct timeval *tv) if (tv == NULL) tv = &tvd; microuptime(tv); - return (tcp_tv_to_lusectick(tv)); + return (tcp_tv_to_lusec(tv)); } static inline uint32_t @@ -228,7 +228,7 @@ tcp_get_usecs(struct timeval *tv) if (tv == NULL) tv = &tvd; microuptime(tv); - return (tcp_tv_to_usectick(tv)); + return (tcp_tv_to_usec(tv)); } #endif /* _KERNEL */ diff --git a/sys/netinet/tcp_lro_hpts.c b/sys/netinet/tcp_lro_hpts.c index 7e756285da45..43587285fe26 100644 --- a/sys/netinet/tcp_lro_hpts.c +++ b/sys/netinet/tcp_lro_hpts.c @@ -188,7 +188,7 @@ tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc, log.u_bbr.cur_del_rate = (uintptr_t)m; log.u_bbr.bw_inuse = (uintptr_t)le->m_head; bintime2timeval(&lc->lro_last_queue_time, &btv); - log.u_bbr.flex6 = tcp_tv_to_usectick(&btv); + log.u_bbr.flex6 = tcp_tv_to_usec(&btv); log.u_bbr.flex7 = le->compressed; log.u_bbr.pacing_gain = le->uncompressed; if (in_epoch(net_epoch_preempt)) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index b232d3f08fe6..0a5888dae9db 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -2173,7 +2173,7 @@ bbr_log_rtt_sample(struct tcp_bbr *bbr, uint32_t rtt, uint32_t tsin) log.u_bbr.flex3 = bbr->r_ctl.rc_ack_hdwr_delay; log.u_bbr.flex4 = bbr->rc_tp->ts_offset; log.u_bbr.flex5 = bbr->r_ctl.rc_target_at_state; - log.u_bbr.pkts_out = tcp_tv_to_mssectick(&bbr->rc_tv); + log.u_bbr.pkts_out = tcp_tv_to_msec(&bbr->rc_tv); log.u_bbr.flex6 = tsin; log.u_bbr.flex7 = 0; log.u_bbr.flex8 = bbr->rc_ack_was_delayed; @@ -2241,13 +2241,13 @@ bbr_log_ack_event(struct tcp_bbr *bbr, struct tcphdr *th, struct tcpopt *to, uin mbuf_tstmp2timespec(m, &ts); tv.tv_sec = ts.tv_sec; tv.tv_usec = ts.tv_nsec / 1000; - log.u_bbr.lt_epoch = tcp_tv_to_usectick(&tv); + log.u_bbr.lt_epoch = tcp_tv_to_usec(&tv); } else { log.u_bbr.lt_epoch = 0; } if (m->m_flags & M_TSTMP_LRO) { mbuf_tstmp2timeval(m, &tv); - log.u_bbr.flex5 = tcp_tv_to_usectick(&tv); + log.u_bbr.flex5 = tcp_tv_to_usec(&tv); } else { /* No arrival timestamp */ log.u_bbr.flex5 = 0; @@ -6792,7 +6792,7 @@ bbr_update_rtt(struct tcpcb *tp, struct tcp_bbr *bbr, (ack_type == BBR_CUM_ACKED) && (to->to_flags & TOF_TS) && (to->to_tsecr != 0)) { - t = tcp_tv_to_mssectick(&bbr->rc_tv) - to->to_tsecr; + t = tcp_tv_to_msec(&bbr->rc_tv) - to->to_tsecr; if (t < 1) t = 1; t *= MS_IN_USEC; @@ -7330,7 +7330,7 @@ bbr_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, uint32_t ts, now, rtt; ts = bbr_ts_convert(to->to_tsecr); - now = bbr_ts_convert(tcp_tv_to_mssectick(&bbr->rc_tv)); + now = bbr_ts_convert(tcp_tv_to_msec(&bbr->rc_tv)); rtt = now - ts; if (rtt < 1) rtt = 1; @@ -8461,7 +8461,7 @@ bbr_do_fastnewdata(struct mbuf *m, struct tcphdr *th, struct socket *so, } if ((to->to_flags & TOF_TS) != 0 && SEQ_LEQ(th->th_seq, tp->last_ack_sent)) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } /* @@ -8893,7 +8893,7 @@ bbr_do_syn_sent(struct mbuf *m, struct tcphdr *th, struct socket *so, if ((to->to_flags & TOF_TS) != 0) { uint32_t t, rtt; - t = tcp_tv_to_mssectick(&bbr->rc_tv); + t = tcp_tv_to_msec(&bbr->rc_tv); if (TSTMP_GEQ(t, to->to_tsecr)) { rtt = t - to->to_tsecr; if (rtt == 0) { @@ -9034,7 +9034,7 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN | TH_FIN)) != 0))) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } tp->snd_wnd = tiwin; @@ -9067,7 +9067,7 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so, if ((to->to_flags & TOF_TS) != 0) { uint32_t t, rtt; - t = tcp_tv_to_mssectick(&bbr->rc_tv); + t = tcp_tv_to_msec(&bbr->rc_tv); if (TSTMP_GEQ(t, to->to_tsecr)) { rtt = t - to->to_tsecr; if (rtt == 0) { @@ -9258,7 +9258,7 @@ bbr_do_established(struct mbuf *m, struct tcphdr *th, struct socket *so, SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN | TH_FIN)) != 0))) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } /* @@ -9355,7 +9355,7 @@ bbr_do_close_wait(struct mbuf *m, struct tcphdr *th, struct socket *so, SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN | TH_FIN)) != 0))) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } /* @@ -9486,7 +9486,7 @@ bbr_do_fin_wait_1(struct mbuf *m, struct tcphdr *th, struct socket *so, SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN | TH_FIN)) != 0))) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } /* @@ -9602,7 +9602,7 @@ bbr_do_closing(struct mbuf *m, struct tcphdr *th, struct socket *so, SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN | TH_FIN)) != 0))) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } /* @@ -9704,7 +9704,7 @@ bbr_do_lastack(struct mbuf *m, struct tcphdr *th, struct socket *so, SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN | TH_FIN)) != 0))) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } /* @@ -9818,7 +9818,7 @@ bbr_do_fin_wait_2(struct mbuf *m, struct tcphdr *th, struct socket *so, SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN | TH_FIN)) != 0))) { - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); tp->ts_recent = to->to_tsval; } /* @@ -11327,7 +11327,7 @@ bbr_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, mbuf_tstmp2timespec(m, &ts); bbr->rc_tv.tv_sec = ts.tv_sec; bbr->rc_tv.tv_usec = ts.tv_nsec / 1000; - bbr->r_ctl.rc_rcvtime = cts = tcp_tv_to_usectick(&bbr->rc_tv); + bbr->r_ctl.rc_rcvtime = cts = tcp_tv_to_usec(&bbr->rc_tv); } else if (m->m_flags & M_TSTMP_LRO) { /* Next the arrival timestamp */ struct timespec ts; @@ -11335,7 +11335,7 @@ bbr_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, mbuf_tstmp2timespec(m, &ts); bbr->rc_tv.tv_sec = ts.tv_sec; bbr->rc_tv.tv_usec = ts.tv_nsec / 1000; - bbr->r_ctl.rc_rcvtime = cts = tcp_tv_to_usectick(&bbr->rc_tv); + bbr->r_ctl.rc_rcvtime = cts = tcp_tv_to_usec(&bbr->rc_tv); } else { /* * Ok just get the current time. @@ -11376,7 +11376,7 @@ bbr_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, */ if ((to.to_flags & TOF_TS) && (to.to_tsecr != 0)) { to.to_tsecr -= tp->ts_offset; - if (TSTMP_GT(to.to_tsecr, tcp_tv_to_mssectick(&bbr->rc_tv))) + if (TSTMP_GT(to.to_tsecr, tcp_tv_to_msec(&bbr->rc_tv))) to.to_tsecr = 0; } /* @@ -11414,7 +11414,7 @@ bbr_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, (tp->t_flags & TF_REQ_TSTMP)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; - tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->ts_recent_age = tcp_tv_to_msec(&bbr->rc_tv); } else tp->t_flags &= ~TF_REQ_TSTMP; if (to.to_flags & TOF_MSS) @@ -11870,7 +11870,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv) bbr = (struct tcp_bbr *)tp->t_fb_ptr; /* We take a cache hit here */ memcpy(&bbr->rc_tv, tv, sizeof(struct timeval)); - cts = tcp_tv_to_usectick(&bbr->rc_tv); + cts = tcp_tv_to_usec(&bbr->rc_tv); inp = bbr->rc_inp; hpts_calling = !!(tp->t_flags2 & TF2_HPTS_CALLS); tp->t_flags2 &= ~TF2_HPTS_CALLS; @@ -12885,7 +12885,7 @@ send: /* Timestamps. */ if ((tp->t_flags & TF_RCVD_TSTMP) || ((flags & TH_SYN) && (tp->t_flags & TF_REQ_TSTMP))) { - to.to_tsval = tcp_tv_to_mssectick(&bbr->rc_tv) + tp->ts_offset; + to.to_tsval = tcp_tv_to_msec(&bbr->rc_tv) + tp->ts_offset; to.to_tsecr = tp->ts_recent; to.to_flags |= TOF_TS; local_options += TCPOLEN_TIMESTAMP + 2; @@ -12893,7 +12893,7 @@ send: /* Set receive buffer autosizing timestamp. */ if (tp->rfbuf_ts == 0 && (so->so_rcv.sb_flags & SB_AUTOSIZE)) - tp->rfbuf_ts = tcp_tv_to_mssectick(&bbr->rc_tv); + tp->rfbuf_ts = tcp_tv_to_msec(&bbr->rc_tv); /* Selective ACK's. */ if (flags & TH_SYN) to.to_flags |= TOF_SACKPERM; diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 940a4024bb73..a411162d275d 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -604,7 +604,7 @@ rack_get_lt_bw(struct tcp_rack *rack) /* Include all the current bytes too */ microuptime(&tv); bytes += (rack->rc_tp->snd_una - rack->r_ctl.lt_seq); - tim += (tcp_tv_to_lusectick(&tv) - rack->r_ctl.lt_timemark); + tim += (tcp_tv_to_lusec(&tv) - rack->r_ctl.lt_timemark); } if ((bytes != 0) && (tim != 0)) return ((bytes * (uint64_t)1000000) / tim); @@ -2245,7 +2245,7 @@ rack_rate_cap_bw(struct tcp_rack *rack, uint64_t *bw, int *capped) ent = rack->r_ctl.rc_last_sft; microuptime(&tv); - timenow = tcp_tv_to_lusectick(&tv); + timenow = tcp_tv_to_lusec(&tv); if (timenow >= ent->deadline) { /* No time left we do DGP only */ rack_log_hybrid_bw(rack, rack->rc_tp->snd_max, @@ -2888,7 +2888,7 @@ rack_log_rtt_upd(struct tcpcb *tp, struct tcp_rack *rack, uint32_t t, uint32_t l log.u_bbr.lt_epoch = rack->r_ctl.rc_time_probertt_entered; log.u_bbr.cur_del_rate = rack->r_ctl.rc_lower_rtt_us_cts; log.u_bbr.delRate = rack->r_ctl.rc_gp_srtt; - log.u_bbr.bw_inuse = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + log.u_bbr.bw_inuse = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); log.u_bbr.bw_inuse <<= 32; if (rsm) log.u_bbr.bw_inuse |= ((uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)]); @@ -3644,7 +3644,7 @@ rack_enough_for_measurement(struct tcpcb *tp, struct tcp_rack *rack, tcp_seq th_ } /* Now what about time? */ srtts = (rack->r_ctl.rc_gp_srtt * rack_min_srtts); - tim = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time) - tp->gput_ts; + tim = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time) - tp->gput_ts; if ((tim >= srtts) && (IN_RECOVERY(rack->rc_tp->t_flags) == 0)) { /* * We do not allow a measurement if we are in recovery @@ -4891,7 +4891,7 @@ rack_do_goodput_measurement(struct tcpcb *tp, struct tcp_rack *rack, uint64_t resid_bw, subpart = 0, addpart = 0, srtt; int did_add = 0; - us_cts = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + us_cts = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); segsiz = min(ctf_fixed_maxseg(tp), rack->r_ctl.rc_pace_min_segs); if (TSTMP_GEQ(us_cts, tp->gput_ts)) tim = us_cts - tp->gput_ts; @@ -5355,7 +5355,7 @@ skip_measurement: rack->r_ctl.rc_gp_lowrtt = 0xffffffff; rack->r_ctl.rc_gp_high_rwnd = rack->rc_tp->snd_wnd; - tp->gput_ts = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + tp->gput_ts = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); rack->app_limited_needs_set = 0; tp->gput_seq = th_ack; if (rack->in_probe_rtt) @@ -5490,7 +5490,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, uint32_t th_ack, uint rack->r_ctl.lt_bw_bytes += (tp->snd_max - rack->r_ctl.lt_seq); rack->r_ctl.lt_seq = tp->snd_max; - tmark = tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time); + tmark = tcp_tv_to_lusec(&rack->r_ctl.act_rcv_time); if (tmark >= rack->r_ctl.lt_timemark) { rack->r_ctl.lt_bw_time += (tmark - rack->r_ctl.lt_timemark); } @@ -6390,7 +6390,7 @@ rack_enter_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts, tcp_se rack->r_ctl.lt_bw_bytes += (snd_una - rack->r_ctl.lt_seq); rack->r_ctl.lt_seq = snd_una; - tmark = tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time); + tmark = tcp_tv_to_lusec(&rack->r_ctl.act_rcv_time); if (tmark >= rack->r_ctl.lt_timemark) { rack->r_ctl.lt_bw_time += (tmark - rack->r_ctl.lt_timemark); } @@ -8780,7 +8780,7 @@ tcp_rack_xmit_timer_commit(struct tcp_rack *rack, struct tcpcb *tp) } stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_PATHRTT, imax(0, rack->r_ctl.rack_rs.rs_us_rtt)); #endif - rack->r_ctl.last_rcv_tstmp_for_rtt = tcp_tv_to_mssectick(&rack->r_ctl.act_rcv_time); + rack->r_ctl.last_rcv_tstmp_for_rtt = tcp_tv_to_msec(&rack->r_ctl.act_rcv_time); /* * the retransmit should happen at rtt + 4 * rttvar. Because of the * way we do the smoothing, srtt and rttvar will each average +1/2 @@ -8886,8 +8886,8 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, rack->r_ctl.rc_rack_min_rtt = 1; } } - if (TSTMP_GT(tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time), rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)])) - us_rtt = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time) - (uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)]; + if (TSTMP_GT(tcp_tv_to_usec(&rack->r_ctl.act_rcv_time), rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)])) + us_rtt = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time) - (uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)]; else us_rtt = tcp_get_usecs(NULL) - (uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)]; if (us_rtt == 0) @@ -8896,7 +8896,7 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, /* Kick the RTT to the CC */ CC_ALGO(tp)->rttsample(&tp->t_ccv, us_rtt, 1, rsm->r_fas); } - rack_apply_updated_usrtt(rack, us_rtt, tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time)); + rack_apply_updated_usrtt(rack, us_rtt, tcp_tv_to_usec(&rack->r_ctl.act_rcv_time)); if (ack_type == SACKED) { rack_log_rtt_sample_calc(rack, t, (uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt - 1)], cts, 1); tcp_rack_xmit_timer(rack, t + 1, len_acked, us_rtt, 2 , rsm, rsm->r_rtr_cnt); @@ -8991,8 +8991,8 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, * we retransmitted. This is because * we match the timestamps. */ - if (TSTMP_GT(tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time), rsm->r_tim_lastsent[i])) - us_rtt = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time) - (uint32_t)rsm->r_tim_lastsent[i]; + if (TSTMP_GT(tcp_tv_to_usec(&rack->r_ctl.act_rcv_time), rsm->r_tim_lastsent[i])) + us_rtt = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time) - (uint32_t)rsm->r_tim_lastsent[i]; else us_rtt = tcp_get_usecs(NULL) - (uint32_t)rsm->r_tim_lastsent[i]; CC_ALGO(tp)->rttsample(&tp->t_ccv, us_rtt, 1, rsm->r_fas); @@ -9185,7 +9185,7 @@ rack_need_set_test(struct tcpcb *tp, seq = tp->gput_seq; ts = tp->gput_ts; rack->app_limited_needs_set = 0; - tp->gput_ts = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + tp->gput_ts = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); /* Do we start at a new end? */ if ((use_which == RACK_USE_BEG) && SEQ_GEQ(rsm->r_start, tp->gput_seq)) { @@ -10820,7 +10820,7 @@ rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th, int entered changed = th_ack - rsm->r_start; if (changed) { rack_process_to_cumack(tp, rack, th_ack, cts, to, - tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time)); + tcp_tv_to_lusec(&rack->r_ctl.act_rcv_time)); } if ((to->to_flags & TOF_SACK) == 0) { /* We are done nothing left and no sack. */ @@ -11698,7 +11698,7 @@ rack_req_check_for_comp(struct tcp_rack *rack, tcp_seq th_ack) rack_log_hybrid_sends(rack, ent, __LINE__); /* calculate the time based on the ack arrival */ data = ent->end - ent->start; - laa = tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time); + laa = tcp_tv_to_lusec(&rack->r_ctl.act_rcv_time); if (ent->flags & TCP_TRK_TRACK_FLG_FSND) { if (ent->first_send > ent->localtime) ftim = ent->first_send; @@ -11844,7 +11844,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, * less than and we have not closed our window. */ if (SEQ_LT(th->th_ack, tp->snd_una) && (sbspace(&so->so_rcv) > ctf_fixed_maxseg(tp))) { - rack->r_ctl.rc_reorder_ts = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + rack->r_ctl.rc_reorder_ts = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); if (rack->r_ctl.rc_reorder_ts == 0) rack->r_ctl.rc_reorder_ts = 1; } @@ -14743,12 +14743,12 @@ rack_init(struct tcpcb *tp, void **ptr) rack->r_ctl.rack_per_of_gp_ss = 250; } rack->r_ctl.rack_per_of_gp_probertt = rack_per_of_gp_probertt; - rack->r_ctl.rc_tlp_rxt_last_time = tcp_tv_to_mssectick(&rack->r_ctl.act_rcv_time); - rack->r_ctl.last_rcv_tstmp_for_rtt = tcp_tv_to_mssectick(&rack->r_ctl.act_rcv_time); + rack->r_ctl.rc_tlp_rxt_last_time = tcp_tv_to_msec(&rack->r_ctl.act_rcv_time); + rack->r_ctl.last_rcv_tstmp_for_rtt = tcp_tv_to_msec(&rack->r_ctl.act_rcv_time); setup_time_filter_small(&rack->r_ctl.rc_gp_min_rtt, FILTER_TYPE_MIN, rack_probertt_filter_life); - us_cts = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + us_cts = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); rack->r_ctl.rc_lower_rtt_us_cts = us_cts; rack->r_ctl.rc_time_of_last_probertt = us_cts; rack->r_ctl.rc_went_idle_time = us_cts; @@ -15385,7 +15385,7 @@ rack_log_input_packet(struct tcpcb *tp, struct tcp_rack *rack, struct tcp_ackent ts.tv_nsec = ae->timestamp % 1000000000; ltv.tv_sec = ts.tv_sec; ltv.tv_usec = ts.tv_nsec / 1000; - log.u_bbr.lt_epoch = tcp_tv_to_usectick(<v); + log.u_bbr.lt_epoch = tcp_tv_to_usec(<v); } else if (ae->flags & TSTMP_LRO) { /* Record the LRO the arrival timestamp */ log.u_bbr.flex3 = M_TSTMP_LRO; @@ -15393,7 +15393,7 @@ rack_log_input_packet(struct tcpcb *tp, struct tcp_rack *rack, struct tcp_ackent ts.tv_nsec = ae->timestamp % 1000000000; ltv.tv_sec = ts.tv_sec; ltv.tv_usec = ts.tv_nsec / 1000; - log.u_bbr.flex5 = tcp_tv_to_usectick(<v); + log.u_bbr.flex5 = tcp_tv_to_usec(<v); } log.u_bbr.timeStamp = tcp_get_usecs(<v); /* Log the rcv time */ @@ -15564,7 +15564,7 @@ rack_log_pcm(struct tcp_rack *rack, uint8_t mod, uint32_t flex1, uint32_t flex2, (void)tcp_get_usecs(&tv); memset(&log, 0, sizeof(log)); - log.u_bbr.timeStamp = tcp_tv_to_usectick(&tv); + log.u_bbr.timeStamp = tcp_tv_to_usec(&tv); log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); log.u_bbr.flex8 = mod; log.u_bbr.flex1 = flex1; @@ -15747,8 +15747,8 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb the_win = tp->snd_wnd; win_seq = tp->snd_wl1; win_upd_ack = tp->snd_wl2; - cts = tcp_tv_to_usectick(tv); - ms_cts = tcp_tv_to_mssectick(tv); + cts = tcp_tv_to_usec(tv); + ms_cts = tcp_tv_to_msec(tv); rack->r_ctl.rc_rcvtime = cts; segsiz = ctf_fixed_maxseg(tp); if ((rack->rc_gp_dyn_mul) && @@ -15864,7 +15864,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb * or it could be a keep-alive or persists */ if (SEQ_LT(ae->ack, tp->snd_una) && (sbspace(&so->so_rcv) > segsiz)) { - rack->r_ctl.rc_reorder_ts = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + rack->r_ctl.rc_reorder_ts = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); if (rack->r_ctl.rc_reorder_ts == 0) rack->r_ctl.rc_reorder_ts = 1; } @@ -15883,7 +15883,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb } if (rack->forced_ack) { rack_handle_probe_response(rack, tiwin, - tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time)); + tcp_tv_to_usec(&rack->r_ctl.act_rcv_time)); } #ifdef TCP_ACCOUNTING win_up_req = 1; @@ -15930,7 +15930,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack->r_ctl.act_rcv_time = *tv; } rack_process_to_cumack(tp, rack, ae->ack, cts, to, - tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time)); + tcp_tv_to_lusec(&rack->r_ctl.act_rcv_time)); #ifdef TCP_REQUEST_TRK rack_req_check_for_comp(rack, high_seq); #endif @@ -16398,7 +16398,7 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, * must process the ack coming in but need to defer sending * anything becase a pacing timer is running. */ - us_cts = tcp_tv_to_usectick(tv); + us_cts = tcp_tv_to_usec(tv); if (m->m_flags & M_ACKCMP) { /* * All compressed ack's are ack's by definition so @@ -16466,8 +16466,8 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, if (m->m_flags & M_ACKCMP) { panic("Impossible reach m has ackcmp? m:%p tp:%p", m, tp); } - cts = tcp_tv_to_usectick(tv); - ms_cts = tcp_tv_to_mssectick(tv); + cts = tcp_tv_to_usec(tv); + ms_cts = tcp_tv_to_msec(tv); nsegs = m->m_pkthdr.lro_nsegs; counter_u64_add(rack_proc_non_comp_ack, 1); #ifdef TCP_ACCOUNTING @@ -16595,13 +16595,13 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, mbuf_tstmp2timespec(m, &ts); ltv.tv_sec = ts.tv_sec; ltv.tv_usec = ts.tv_nsec / 1000; - log.u_bbr.lt_epoch = tcp_tv_to_usectick(<v); + log.u_bbr.lt_epoch = tcp_tv_to_usec(<v); } else if (m->m_flags & M_TSTMP_LRO) { /* Record the LRO the arrival timestamp */ mbuf_tstmp2timespec(m, &ts); ltv.tv_sec = ts.tv_sec; ltv.tv_usec = ts.tv_nsec / 1000; - log.u_bbr.flex5 = tcp_tv_to_usectick(<v); + log.u_bbr.flex5 = tcp_tv_to_usec(<v); } log.u_bbr.timeStamp = tcp_get_usecs(<v); /* Log the rcv time */ @@ -16819,7 +16819,7 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, } if (thflags & TH_FIN) tcp_log_end_status(tp, TCP_EI_STATUS_CLIENT_FIN); - us_cts = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time); + us_cts = tcp_tv_to_usec(&rack->r_ctl.act_rcv_time); if ((rack->rc_gp_dyn_mul) && (rack->use_fixed_rate == 0) && (rack->rc_always_pace)) { @@ -19442,7 +19442,7 @@ again: } if ((error == 0) && (rack->lt_bw_up == 0)) { /* Unlikely */ - rack->r_ctl.lt_timemark = tcp_tv_to_lusectick(tv); + rack->r_ctl.lt_timemark = tcp_tv_to_lusec(tv); rack->r_ctl.lt_seq = tp->snd_una; rack->lt_bw_up = 1; } else if ((error == 0) && @@ -19785,7 +19785,7 @@ rack_output(struct tcpcb *tp) #endif early = 0; cts = tcp_get_usecs(&tv); - ms_cts = tcp_tv_to_mssectick(&tv); + ms_cts = tcp_tv_to_msec(&tv); if (((rack->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) == 0) && tcp_in_hpts(rack->rc_tp)) { /* @@ -20023,7 +20023,7 @@ rack_output(struct tcpcb *tp) again: sendalot = 0; cts = tcp_get_usecs(&tv); - ms_cts = tcp_tv_to_mssectick(&tv); + ms_cts = tcp_tv_to_msec(&tv); tso = 0; mtu = 0; if (TCPS_HAVEESTABLISHED(tp->t_state) && @@ -22090,7 +22090,7 @@ out: } if (rsm == NULL) { if (rack->lt_bw_up == 0) { - rack->r_ctl.lt_timemark = tcp_tv_to_lusectick(&tv); + rack->r_ctl.lt_timemark = tcp_tv_to_lusec(&tv); rack->r_ctl.lt_seq = tp->snd_una; rack->lt_bw_up = 1; } else if (((rack_seq + len) - rack->r_ctl.lt_seq) > 0x7fffffff) { @@ -22838,7 +22838,7 @@ process_hybrid_pacing(struct tcp_rack *rack, struct tcp_hybrid_req *hybrid) rack->r_ctl.rc_fixed_pacing_rate_ca = 0; rack->r_ctl.rc_fixed_pacing_rate_ss = 0; /* Now allocate or find our entry that will have these settings */ - sft = tcp_req_alloc_req_full(rack->rc_tp, &hybrid->req, tcp_tv_to_lusectick(&tv), 0); + sft = tcp_req_alloc_req_full(rack->rc_tp, &hybrid->req, tcp_tv_to_lusec(&tv), 0); if (sft == NULL) { rack->rc_tp->tcp_hybrid_error++; /* no space, where would it have gone? */ diff --git a/sys/netinet/tcp_stacks/rack_pcm.c b/sys/netinet/tcp_stacks/rack_pcm.c index 101e6826536c..759bfda98357 100644 --- a/sys/netinet/tcp_stacks/rack_pcm.c +++ b/sys/netinet/tcp_stacks/rack_pcm.c @@ -174,7 +174,7 @@ rack_update_pcm_ack(struct tcp_rack *rack, int was_cumack, uint32_t start, uint3 /* * Record ACK data. */ - ack_arrival = tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time); + ack_arrival = tcp_tv_to_lusec(&rack->r_ctl.act_rcv_time); if (SEQ_GT(end, rack->r_ctl.pcm_i.eseq)) { /* Trim the end to the end of our range if it is beyond */ end = rack->r_ctl.pcm_i.eseq; @@ -242,7 +242,7 @@ skip_ack_accounting: e = &rack->r_ctl.pcm_s[i]; memset(&log, 0, sizeof(log)); - log.u_bbr.timeStamp = tcp_tv_to_usectick(&tv); + log.u_bbr.timeStamp = tcp_tv_to_usec(&tv); log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); log.u_bbr.flex8 = 1; log.u_bbr.flex1 = e->sseq; @@ -286,7 +286,7 @@ skip_ack_accounting: * Prev time holds the last ack arrival time. */ memset(&log.u_bbr, 0, sizeof(log.u_bbr)); - log.u_bbr.timeStamp = tcp_tv_to_usectick(&tv); + log.u_bbr.timeStamp = tcp_tv_to_usec(&tv); log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); log.u_bbr.flex8 = 2; log.u_bbr.flex1 = rack->r_ctl.pcm_i.sseq; From nobody Thu Jul 31 11:07:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt5rr3ZYqz63lN0; Thu, 31 Jul 2025 11:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt5rr1VHKz46Cd; Thu, 31 Jul 2025 11:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753960044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qeNK01ftmK0b7AGHE3NZn5kfpP6T8vttonyNkJrDc58=; b=FOsCj0uGYiID7+jvcZks03esJUPWkCq91UhdFQU6D04Oz4pD+vCVcLoK9jdlnWswUIPBlH al0vWBfhMs0y0w9ug9Y5WMqsMtA3m14pp8fV6dgyK5vAq4T+9EtZeitw9kClHfCZwLXQWD tyD17hxSc/Ra74TfX4nVJgqfVlBNH0JfDYwzykSXLKZ7DDSHXEhG4i4mVMpD1wVm9CuPCw Y4gW/OQp+dS/BBodULQMXCXWYU6Qy7qofpE+EHZJWBoALeW6x4T67E8BHurHBlmY46WUgA T43eEWseU6J101f264NserGbzE2rBhYassGI/IwamqWKQIWSIQetm72UoVh6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753960044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qeNK01ftmK0b7AGHE3NZn5kfpP6T8vttonyNkJrDc58=; b=EPm2dgdbPziFOu3XN4OfwNqPTMSC/HO31R+n/suUTsAeYtUqz6wXdzIJPEl5rA98NDizN+ XmnQqiO/y/Kgp37Yyn9esQ+XFoAJG0qbHuoCwlUvAL34n3tDZqZ4XEwR91QGnxZPBmT1zr As9Yh0qSwOYyllpeh/853W6FIxcKg1r8r/fWF82JWUVcUeoJGN/qyaGtUnQ13Jz7XdAS5a 28dVL51bIh5g4Pgh5YOyhE83qjIeQkz19TCHYMZV7hCR89LMpEoDaDDnr6p0C9bRq9HFsT mhYIRxyEpxIhW8d224jbtK+AjYFQaAFvnvOzxX4U+zbAbeP6mqD71pyj1hSRUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753960044; a=rsa-sha256; cv=none; b=qJnCYJcOZd9BsTvWi0ftR2S773gXVf92iF3dfogSr7b5CfqBh3tQDh0EGQ/S2EEbQI6fxI Kb9FRGZjzlIFhNRcKDQbBQFaD2qE4qxBgw2Pa1UhLGG4mC7GAlklUWsFq8hL0MKwlMyCe3 sjxR+fVk7UWqz08pTzKirDPVCW7rhER5TYGX/ciHJhMD9YqsVUHrjNYlbL2BQEmFnlPTJQ 8ycyfIPtnG63oqDtCiaHsJWZcyC7HmkdcBlLdhpipC81Dwr+n3WQQQBE3h4L3FSqVeJXN4 9cpFFVHY3fR0CMEe7491Eg20CZELODUxA2MX1LUnu73dOTeeSi0YMciBVFMPuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt5rr0tRSz10Dy; Thu, 31 Jul 2025 11:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VB7O53082589; Thu, 31 Jul 2025 11:07:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VB7NpS082585; Thu, 31 Jul 2025 11:07:23 GMT (envelope-from git) Date: Thu, 31 Jul 2025 11:07:23 GMT Message-Id: <202507311107.56VB7NpS082585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: f197a24d1196 - main - tcp: improve variable and constant names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f197a24d11967b5780717d05e84a749f34b773c4 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f197a24d11967b5780717d05e84a749f34b773c4 commit f197a24d11967b5780717d05e84a749f34b773c4 Author: Nick Banks AuthorDate: 2025-07-31 13:03:47 +0000 Commit: Michael Tuexen CommitDate: 2025-07-31 13:03:47 +0000 tcp: improve variable and constant names Don't use ticks in variable names or constant when they don't have a relation to ticks. Use slots or usecs. No functional change intended. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_hpts.c | 32 ++++++++++++++++---------------- sys/netinet/tcp_hpts.h | 20 ++++++++++---------- sys/netinet/tcp_stacks/bbr.c | 6 +++--- sys/netinet/tcp_stacks/rack.c | 26 +++++++++++++------------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 40d8ca15ed83..8cbe1e81a06a 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -366,7 +366,7 @@ sysctl_net_inet_tcp_hpts_max_sleep(SYSCTL_HANDLER_ARGS) new = hpts_sleep_max; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr) { - if ((new < (dynamic_min_sleep/HPTS_TICKS_PER_SLOT)) || + if ((new < (dynamic_min_sleep/HPTS_USECS_PER_SLOT)) || (new > HPTS_MAX_SLEEP_ALLOWED)) error = EINVAL; else @@ -404,15 +404,15 @@ SYSCTL_PROC(_net_inet_tcp_hpts, OID_AUTO, minsleep, &sysctl_net_inet_tcp_hpts_min_sleep, "IU", "The minimum time the hpts must sleep before processing more slots"); -static int ticks_indicate_more_sleep = TICKS_INDICATE_MORE_SLEEP; -static int ticks_indicate_less_sleep = TICKS_INDICATE_LESS_SLEEP; +static int slots_indicate_more_sleep = SLOTS_INDICATE_MORE_SLEEP; +static int slots_indicate_less_sleep = SLOTS_INDICATE_LESS_SLEEP; static int tcp_hpts_no_wake_over_thresh = 1; SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, more_sleep, CTLFLAG_RW, - &ticks_indicate_more_sleep, 0, + &slots_indicate_more_sleep, 0, "If we only process this many or less on a timeout, we need longer sleep on the next callout"); SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, less_sleep, CTLFLAG_RW, - &ticks_indicate_less_sleep, 0, + &slots_indicate_less_sleep, 0, "If we process this many or more on a timeout, we need less sleep on the next callout"); SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, nowake_over_thresh, CTLFLAG_RW, &tcp_hpts_no_wake_over_thresh, 0, @@ -877,7 +877,7 @@ tcp_hpts_insert_diag(struct tcpcb *tp, uint32_t slot, int32_t line, struct hpts_ return (slot_on); } /* Get the current time relative to the wheel */ - wheel_cts = tcp_tv_to_hptstick(&tv); + wheel_cts = tcp_tv_to_hpts_slot(&tv); /* Map it onto the wheel */ wheel_slot = tick_to_wheel(wheel_cts); /* Now what's the max we can place it at? */ @@ -949,7 +949,7 @@ tcp_hpts_insert_diag(struct tcpcb *tp, uint32_t slot, int32_t line, struct hpts_ * We need to reschedule the hpts's time-out. */ hpts->p_hpts_sleep_time = slot; - need_new_to = slot * HPTS_TICKS_PER_SLOT; + need_new_to = slot * HPTS_USECS_PER_SLOT; } } /* @@ -1121,7 +1121,7 @@ again: HPTS_MTX_ASSERT(hpts); slots_to_run = hpts_slots_diff(hpts->p_prev_slot, hpts->p_cur_slot); if (((hpts->p_curtick - hpts->p_lasttick) > - ((NUM_OF_HPTSI_SLOTS-1) * HPTS_TICKS_PER_SLOT)) && + ((NUM_OF_HPTSI_SLOTS-1) * HPTS_USECS_PER_SLOT)) && (hpts->p_on_queue_cnt != 0)) { /* * Wheel wrap is occuring, basically we @@ -1202,7 +1202,7 @@ again: * was not any (i.e. if slots_to_run == 1, no delay). */ hpts->p_delayed_by = (slots_to_run - (i + 1)) * - HPTS_TICKS_PER_SLOT; + HPTS_USECS_PER_SLOT; runningslot = hpts->p_runningslot; hptsh = &hpts->p_hptss[runningslot]; @@ -1569,7 +1569,7 @@ __tcp_run_hpts(void) ticks_ran = tcp_hptsi(hpts, false); /* We may want to adjust the sleep values here */ if (hpts->p_on_queue_cnt >= conn_cnt_thresh) { - if (ticks_ran > ticks_indicate_less_sleep) { + if (ticks_ran > slots_indicate_less_sleep) { struct timeval tv; sbintime_t sb; @@ -1579,7 +1579,7 @@ __tcp_run_hpts(void) /* Reschedule with new to value */ tcp_hpts_set_max_sleep(hpts, 0); tv.tv_sec = 0; - tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_SLOT; + tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_USECS_PER_SLOT; /* Validate its in the right ranges */ if (tv.tv_usec < hpts->p_mysleep.tv_usec) { hpts->overidden_sleep = tv.tv_usec; @@ -1601,7 +1601,7 @@ __tcp_run_hpts(void) callout_reset_sbt_on(&hpts->co, sb, 0, hpts_timeout_swi, hpts, hpts->p_cpu, (C_DIRECT_EXEC | C_PREL(tcp_hpts_precision))); - } else if (ticks_ran < ticks_indicate_more_sleep) { + } else if (ticks_ran < slots_indicate_more_sleep) { /* For the further sleep, don't reschedule hpts */ hpts->p_mysleep.tv_usec *= 2; if (hpts->p_mysleep.tv_usec > dynamic_max_sleep) @@ -1683,7 +1683,7 @@ tcp_hpts_thread(void *ctx) hpts->p_hpts_active = 1; ticks_ran = tcp_hptsi(hpts, true); tv.tv_sec = 0; - tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_SLOT; + tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_USECS_PER_SLOT; if ((hpts->p_on_queue_cnt > conn_cnt_thresh) && (hpts->hit_callout_thresh == 0)) { hpts->hit_callout_thresh = 1; atomic_add_int(&hpts_that_need_softclock, 1); @@ -1697,11 +1697,11 @@ tcp_hpts_thread(void *ctx) * Only adjust sleep time if we were * called from the callout i.e. direct_wake == 0. */ - if (ticks_ran < ticks_indicate_more_sleep) { + if (ticks_ran < slots_indicate_more_sleep) { hpts->p_mysleep.tv_usec *= 2; if (hpts->p_mysleep.tv_usec > dynamic_max_sleep) hpts->p_mysleep.tv_usec = dynamic_max_sleep; - } else if (ticks_ran > ticks_indicate_less_sleep) { + } else if (ticks_ran > slots_indicate_less_sleep) { hpts->p_mysleep.tv_usec /= 2; if (hpts->p_mysleep.tv_usec < dynamic_min_sleep) hpts->p_mysleep.tv_usec = dynamic_min_sleep; @@ -1995,7 +1995,7 @@ tcp_hpts_mod_load(void) } } tv.tv_sec = 0; - tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_SLOT; + tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_USECS_PER_SLOT; hpts->sleeping = tv.tv_usec; sb = tvtosbt(tv); callout_reset_sbt_on(&hpts->co, sb, 0, diff --git a/sys/netinet/tcp_hpts.h b/sys/netinet/tcp_hpts.h index d9c01d6d2ac4..61f5160ffad6 100644 --- a/sys/netinet/tcp_hpts.h +++ b/sys/netinet/tcp_hpts.h @@ -26,8 +26,8 @@ #ifndef __tcp_hpts_h__ #define __tcp_hpts_h__ -/* Number of useconds in a hpts tick */ -#define HPTS_TICKS_PER_SLOT 10 +/* Number of useconds represented by an hpts slot */ +#define HPTS_USECS_PER_SLOT 10 #define HPTS_MS_TO_SLOTS(x) ((x * 100) + 1) #define HPTS_USEC_TO_SLOTS(x) ((x+9) /10) #define HPTS_USEC_IN_SEC 1000000 @@ -91,8 +91,8 @@ struct hpts_diag { #define DYNAMIC_MAX_SLEEP 5000 /* 5ms */ /* Thresholds for raising/lowering sleep */ -#define TICKS_INDICATE_MORE_SLEEP 100 /* This would be 1ms */ -#define TICKS_INDICATE_LESS_SLEEP 1000 /* This would indicate 10ms */ +#define SLOTS_INDICATE_MORE_SLEEP 100 /* This would be 1ms */ +#define SLOTS_INDICATE_LESS_SLEEP 1000 /* This would indicate 10ms */ /** * * Dynamic adjustment of sleeping times is done in "new" mode @@ -102,10 +102,10 @@ struct hpts_diag { * When we are in the "new" mode i.e. conn_cnt > conn_cnt_thresh * then we do a dynamic adjustment on the time we sleep. * Our threshold is if the lateness of the first client served (in ticks) is - * greater than or equal too ticks_indicate_more_sleep (10ms + * greater than or equal too slots_indicate_more_sleep (10ms * or 10000 ticks). If we were that late, the actual sleep time * is adjusted down by 50%. If the ticks_ran is less than - * ticks_indicate_more_sleep (100 ticks or 1000usecs). + * slots_indicate_more_sleep (100 ticks or 1000usecs). * */ @@ -165,9 +165,9 @@ extern int32_t tcp_min_hptsi_time; * to userspace as well. */ static inline uint32_t -tcp_tv_to_hptstick(const struct timeval *sv) +tcp_tv_to_hpts_slot(const struct timeval *sv) { - return ((sv->tv_sec * 100000) + (sv->tv_usec / HPTS_TICKS_PER_SLOT)); + return ((sv->tv_sec * 100000) + (sv->tv_usec / HPTS_USECS_PER_SLOT)); } static inline uint32_t @@ -195,7 +195,7 @@ extern int32_t tcp_min_hptsi_time; static inline int32_t get_hpts_min_sleep_time(void) { - return (tcp_min_hptsi_time + HPTS_TICKS_PER_SLOT); + return (tcp_min_hptsi_time + HPTS_USECS_PER_SLOT); } static inline uint32_t @@ -206,7 +206,7 @@ tcp_gethptstick(struct timeval *sv) if (sv == NULL) sv = &tv; microuptime(sv); - return (tcp_tv_to_hptstick(sv)); + return (tcp_tv_to_hpts_slot(sv)); } static inline uint64_t diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 0a5888dae9db..ce4e9f30020c 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -14123,17 +14123,17 @@ bbr_switch_failed(struct tcpcb *tp) toval = bbr->rc_pacer_started - cts; } else { /* one slot please */ - toval = HPTS_TICKS_PER_SLOT; + toval = HPTS_USECS_PER_SLOT; } } else if (bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK) { if (TSTMP_GT(bbr->r_ctl.rc_timer_exp, cts)) { toval = bbr->r_ctl.rc_timer_exp - cts; } else { /* one slot please */ - toval = HPTS_TICKS_PER_SLOT; + toval = HPTS_USECS_PER_SLOT; } } else - toval = HPTS_TICKS_PER_SLOT; + toval = HPTS_USECS_PER_SLOT; (void)tcp_hpts_insert_diag(tp, HPTS_USEC_TO_SLOTS(toval), __LINE__, &diag); bbr_log_hpts_diag(bbr, cts, &diag); diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index a411162d275d..d6bbfeb886d9 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -6592,22 +6592,22 @@ rack_start_hpts_timer (struct tcp_rack *rack, struct tcpcb *tp, uint32_t cts, * on the clock. We always have a min * 10 slots (10 x 10 i.e. 100 usecs). */ - if (slot <= HPTS_TICKS_PER_SLOT) { + if (slot <= HPTS_USECS_PER_SLOT) { /* We gain delay */ - rack->r_ctl.rc_agg_delayed += (HPTS_TICKS_PER_SLOT - slot); - slot = HPTS_TICKS_PER_SLOT; + rack->r_ctl.rc_agg_delayed += (HPTS_USECS_PER_SLOT - slot); + slot = HPTS_USECS_PER_SLOT; } else { /* We take off some */ - rack->r_ctl.rc_agg_delayed -= (slot - HPTS_TICKS_PER_SLOT); - slot = HPTS_TICKS_PER_SLOT; + rack->r_ctl.rc_agg_delayed -= (slot - HPTS_USECS_PER_SLOT); + slot = HPTS_USECS_PER_SLOT; } } else { slot -= rack->r_ctl.rc_agg_delayed; rack->r_ctl.rc_agg_delayed = 0; /* Make sure we have 100 useconds at minimum */ - if (slot < HPTS_TICKS_PER_SLOT) { - rack->r_ctl.rc_agg_delayed = HPTS_TICKS_PER_SLOT - slot; - slot = HPTS_TICKS_PER_SLOT; + if (slot < HPTS_USECS_PER_SLOT) { + rack->r_ctl.rc_agg_delayed = HPTS_USECS_PER_SLOT - slot; + slot = HPTS_USECS_PER_SLOT; } if (rack->r_ctl.rc_agg_delayed == 0) rack->r_late = 0; @@ -14368,17 +14368,17 @@ rack_switch_failed(struct tcpcb *tp) toval = rack->r_ctl.rc_last_output_to - cts; } else { /* one slot please */ - toval = HPTS_TICKS_PER_SLOT; + toval = HPTS_USECS_PER_SLOT; } } else if (rack->r_ctl.rc_hpts_flags & PACE_TMR_MASK) { if (TSTMP_GT(rack->r_ctl.rc_timer_exp, cts)) { toval = rack->r_ctl.rc_timer_exp - cts; } else { /* one slot please */ - toval = HPTS_TICKS_PER_SLOT; + toval = HPTS_USECS_PER_SLOT; } } else - toval = HPTS_TICKS_PER_SLOT; + toval = HPTS_USECS_PER_SLOT; (void)tcp_hpts_insert_diag(tp, HPTS_USEC_TO_SLOTS(toval), __LINE__, &diag); rack_log_hpts_diag(rack, cts, &diag, &tv); @@ -14957,7 +14957,7 @@ rack_init(struct tcpcb *tp, void **ptr) if (TSTMP_GT(qr.timer_pacing_to, us_cts)) tov = qr.timer_pacing_to - us_cts; else - tov = HPTS_TICKS_PER_SLOT; + tov = HPTS_USECS_PER_SLOT; } if (qr.timer_hpts_flags & PACE_TMR_MASK) { rack->r_ctl.rc_timer_exp = qr.timer_timer_exp; @@ -14965,7 +14965,7 @@ rack_init(struct tcpcb *tp, void **ptr) if (TSTMP_GT(qr.timer_timer_exp, us_cts)) tov = qr.timer_timer_exp - us_cts; else - tov = HPTS_TICKS_PER_SLOT; + tov = HPTS_USECS_PER_SLOT; } } rack_log_chg_info(tp, rack, 4, From nobody Thu Jul 31 11:17:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt64M39Tbz63lct; Thu, 31 Jul 2025 11:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt64M26Xrz48KZ; Thu, 31 Jul 2025 11:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753960643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BcgZ21tocvunwzcJgmdtRT97XcZ8kWP22BxMtkC5JQ=; b=SdRvii4Cfr5eBZ0Sw22Ug8KOiuw43yolMbYA3JI3mk9FllxF4dqrvpRxzWRtpFC9nzxtE4 CYOcTBO9rj6ybo/gWvU4rLg8e+NNysKAoDwqv2hKrwNh3eI1t5yHjunP/4vV/lMnGyGdmh iXBXTKTSnUdwHvP0exTPx2ik8VP4PJ5A/faXzJ1dwfqVwDcHp1BPvvagU06fhqTvoPYvDl QAM84xRoLE8fUgRkSnV4OS4e8te7ieUfA3ZOQIyd/mEoXblzxOvvbKRG7u6AH3MmB2VPsX CnPbjDng9fIer0GxuTdPAo7NoyjWJFGQMPkbgs2TgTkqweA7JOo/+wb9dDsQvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753960643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BcgZ21tocvunwzcJgmdtRT97XcZ8kWP22BxMtkC5JQ=; b=J6RGozIXf9OmW/nVKRMJuYhWa4ibTlRoiXRTobcRTjAivsyuCEwZh2SNrmJ+tq07xORY3f tQVJ9u6Dhx4BR+Wdm+/HrhYnlLcKsfr4KqCKWTx0dwJiEgDDjnJURaDozVXBzzTTM9QNL1 ZNeIXIn8meQiv80wJhLHlwjozcaqrPFKYIoIIKZZjUrc6r0sS5Ef/RDorb7iBZBe0kArIz tmAgNtSRdD1GNe6ZpzH766fpFNujcdyB8R3bFeX3T6DHGYZ9Q9VQYpD5ADN7B8WsKYY//Z UVxfjRAG/nTG6Ql+SPW4m1nSBa4XvdLBrtAU309k+HIJA87jidoN7jZXj7QPhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753960643; a=rsa-sha256; cv=none; b=Hj5ZwscrSzNzl8r8WavseMPMORnCI4yQ8aT7S/qHIRP+MRWyaA6J6ZXLcGm1LlzSJ4saZw bdKuVWNpR6MKopIMv08k5XCPH+E7enwNJLWLLNGV9Q6VEDUG1s0PgvzL7mFSUfQLr4oBLF A+lT70c//7w/VBXWlhBGOd83gXQDXycKSlZ/pnwIiFmVzdCsIW2bw93MNKWJZuxDdLSjox vel0RGlN+H54OFaH4RrJ1Xo66AQmnvZq+VAZjTDRjOKbYAxtVVE5MHXtKc+r6n/pBOE8nW UcgZe3bbCm+pvWotwjtv8uOyoYAJnSbqFNl9n4vSVecRVQHnkAeYJCjRTgXKtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt64M1Y3Zz10J9; Thu, 31 Jul 2025 11:17:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VBHNj5001322; Thu, 31 Jul 2025 11:17:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VBHN37001319; Thu, 31 Jul 2025 11:17:23 GMT (envelope-from git) Date: Thu, 31 Jul 2025 11:17:23 GMT Message-Id: <202507311117.56VBHN37001319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 2266c602b384 - main - tcp hpts: cleanup header file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2266c602b3840e281b159dc39a97c56490c566c5 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2266c602b3840e281b159dc39a97c56490c566c5 commit 2266c602b3840e281b159dc39a97c56490c566c5 Author: Nick Banks AuthorDate: 2025-07-31 13:13:53 +0000 Commit: Michael Tuexen CommitDate: 2025-07-31 13:13:53 +0000 tcp hpts: cleanup header file Cleanup tcp_hpts.h by * move definition used only in tcp_hpts.c to that file * fix a typo * remove duplicate declarion of tcp_min_hptsi_time * rearange declarations for simpler reading Approved by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_hpts.c | 47 +++++++++++++++++++- sys/netinet/tcp_hpts.h | 116 +++++++++++++++---------------------------------- 2 files changed, 81 insertions(+), 82 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 8cbe1e81a06a..22fc99496d34 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -170,6 +170,50 @@ #define NUM_OF_HPTSI_SLOTS 102400 +/* The number of connections after which the dynamic sleep logic kicks in. */ +#define DEFAULT_CONNECTION_THRESHOLD 100 + +/* + * When using the hpts, a TCP stack must make sure + * that once a INP_DROPPED flag is applied to a INP + * that it does not expect tcp_output() to ever be + * called by the hpts. The hpts will *not* call + * any output (or input) functions on a TCB that + * is in the DROPPED state. + * + * This implies final ACK's and RST's that might + * be sent when a TCB is still around must be + * sent from a routine like tcp_respond(). + */ +#define LOWEST_SLEEP_ALLOWED 50 +#define DEFAULT_MIN_SLEEP 250 /* How many usec's is default for hpts sleep + * this determines min granularity of the + * hpts. If 1, granularity is 10useconds at + * the cost of more CPU (context switching). + * Note do not set this to 0. + */ +#define DYNAMIC_MIN_SLEEP DEFAULT_MIN_SLEEP +#define DYNAMIC_MAX_SLEEP 5000 /* 5ms */ + +/* Thresholds for raising/lowering sleep */ +#define SLOTS_INDICATE_MORE_SLEEP 100 /* This would be 1ms */ +#define SLOTS_INDICATE_LESS_SLEEP 1000 /* This would indicate 10ms */ +/** + * + * Dynamic adjustment of sleeping times is done in "new" mode + * where we are depending on syscall returns and lro returns + * to push hpts forward mainly and the timer is only a backstop. + * + * When we are in the "new" mode i.e. conn_cnt > conn_cnt_thresh + * then we do a dynamic adjustment on the time we sleep. + * Our threshold is if the lateness of the first client served (in ticks) is + * greater than or equal too slots_indicate_more_sleep (10ms + * or 10000 ticks). If we were that late, the actual sleep time + * is adjusted down by 50%. If the ticks_ran is less than + * slots_indicate_more_sleep (100 ticks or 1000usecs). + * + */ + /* Each hpts has its own p_mtx which is used for locking */ #define HPTS_MTX_ASSERT(hpts) mtx_assert(&(hpts)->p_mtx, MA_OWNED) #define HPTS_LOCK(hpts) mtx_lock(&(hpts)->p_mtx) @@ -244,11 +288,10 @@ static int32_t tcp_hptsi(struct tcp_hpts_entry *hpts, bool from_callout); static void tcp_hpts_thread(void *ctx); int32_t tcp_min_hptsi_time = DEFAULT_MIN_SLEEP; -static int conn_cnt_thresh = DEFAULT_CONNECTION_THESHOLD; +static int conn_cnt_thresh = DEFAULT_CONNECTION_THRESHOLD; static int32_t dynamic_min_sleep = DYNAMIC_MIN_SLEEP; static int32_t dynamic_max_sleep = DYNAMIC_MAX_SLEEP; - SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hpts, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Hpts controls"); SYSCTL_NODE(_net_inet_tcp_hpts, OID_AUTO, stats, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, diff --git a/sys/netinet/tcp_hpts.h b/sys/netinet/tcp_hpts.h index 61f5160ffad6..6172baf2a062 100644 --- a/sys/netinet/tcp_hpts.h +++ b/sys/netinet/tcp_hpts.h @@ -34,6 +34,30 @@ #define HPTS_MSEC_IN_SEC 1000 #define HPTS_USEC_IN_MSEC 1000 +static inline uint32_t +tcp_tv_to_hpts_slot(const struct timeval *sv) +{ + return ((sv->tv_sec * 100000) + (sv->tv_usec / HPTS_USECS_PER_SLOT)); +} + +static inline uint32_t +tcp_tv_to_usec(const struct timeval *sv) +{ + return ((uint32_t) ((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); +} + +static inline uint32_t +tcp_tv_to_msec(const struct timeval *sv) +{ + return ((uint32_t) ((sv->tv_sec * HPTS_MSEC_IN_SEC) + (sv->tv_usec/HPTS_USEC_IN_MSEC))); +} + +static inline uint64_t +tcp_tv_to_lusec(const struct timeval *sv) +{ + return ((uint64_t)((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); +} + struct hpts_diag { uint32_t p_hpts_active; /* bbr->flex7 x */ uint32_t p_nxt_slot; /* bbr->flex1 x */ @@ -66,52 +90,16 @@ struct hpts_diag { #define PACE_PKT_OUTPUT 0x40 /* Output Packets being paced */ #define PACE_TMR_MASK (PACE_TMR_KEEP|PACE_TMR_PERSIT|PACE_TMR_RXT|PACE_TMR_TLP|PACE_TMR_RACK|PACE_TMR_DELACK) -#define DEFAULT_CONNECTION_THESHOLD 100 +#ifdef _KERNEL /* - * When using the hpts, a TCP stack must make sure - * that once a INP_DROPPED flag is applied to a INP - * that it does not expect tcp_output() to ever be - * called by the hpts. The hpts will *not* call - * any output (or input) functions on a TCB that - * is in the DROPPED state. - * - * This implies final ACK's and RST's that might - * be sent when a TCB is still around must be - * sent from a routine like tcp_respond(). - */ -#define LOWEST_SLEEP_ALLOWED 50 -#define DEFAULT_MIN_SLEEP 250 /* How many usec's is default for hpts sleep - * this determines min granularity of the - * hpts. If 1, granularity is 10useconds at - * the cost of more CPU (context switching). - * Note do not set this to 0. - */ -#define DYNAMIC_MIN_SLEEP DEFAULT_MIN_SLEEP -#define DYNAMIC_MAX_SLEEP 5000 /* 5ms */ - -/* Thresholds for raising/lowering sleep */ -#define SLOTS_INDICATE_MORE_SLEEP 100 /* This would be 1ms */ -#define SLOTS_INDICATE_LESS_SLEEP 1000 /* This would indicate 10ms */ -/** - * - * Dynamic adjustment of sleeping times is done in "new" mode - * where we are depending on syscall returns and lro returns - * to push hpts forward mainly and the timer is only a backstop. - * - * When we are in the "new" mode i.e. conn_cnt > conn_cnt_thresh - * then we do a dynamic adjustment on the time we sleep. - * Our threshold is if the lateness of the first client served (in ticks) is - * greater than or equal too slots_indicate_more_sleep (10ms - * or 10000 ticks). If we were that late, the actual sleep time - * is adjusted down by 50%. If the ticks_ran is less than - * slots_indicate_more_sleep (100 ticks or 1000usecs). - * - */ + * The following are the definitions for the kernel HPTS interface for managing + * the HPTS ring and the TCBs on it. +*/ -#ifdef _KERNEL void tcp_hpts_init(struct tcpcb *); void tcp_hpts_remove(struct tcpcb *); + static inline bool tcp_in_hpts(struct tcpcb *tp) { @@ -151,45 +139,6 @@ uint32_t tcp_hpts_insert_diag(struct tcpcb *tp, uint32_t slot, int32_t line, void tcp_set_hpts(struct tcpcb *tp); -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; - -#endif /* _KERNEL */ - -/* - * The following functions should also be available - * to userspace as well. - */ -static inline uint32_t -tcp_tv_to_hpts_slot(const struct timeval *sv) -{ - return ((sv->tv_sec * 100000) + (sv->tv_usec / HPTS_USECS_PER_SLOT)); -} - -static inline uint32_t -tcp_tv_to_usec(const struct timeval *sv) -{ - return ((uint32_t) ((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); -} - -static inline uint32_t -tcp_tv_to_msec(const struct timeval *sv) -{ - return ((uint32_t) ((sv->tv_sec * HPTS_MSEC_IN_SEC) + (sv->tv_usec/HPTS_USEC_IN_MSEC))); -} - -static inline uint64_t -tcp_tv_to_lusec(const struct timeval *sv) -{ - return ((uint64_t)((sv->tv_sec * HPTS_USEC_IN_SEC) + sv->tv_usec)); -} - -#ifdef _KERNEL - extern int32_t tcp_min_hptsi_time; static inline int32_t @@ -231,5 +180,12 @@ tcp_get_usecs(struct timeval *tv) return (tcp_tv_to_usec(tv)); } +/* + * LRO HPTS initialization and uninitialization, only for internal use by the + * HPTS code. + */ +void tcp_lro_hpts_init(void); +void tcp_lro_hpts_uninit(void); + #endif /* _KERNEL */ #endif /* __tcp_hpts_h__ */ From nobody Thu Jul 31 13:07:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt8X45gRkz63qZP; Thu, 31 Jul 2025 13:08:04 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt8X43j3Bz4KrT; Thu, 31 Jul 2025 13:08:04 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-615398dc162so1414571a12.3; Thu, 31 Jul 2025 06:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753967278; x=1754572078; 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=meRbfJ2cqUQBqVuicYtW3DoZwyaFCB1zISZzsgXGbsY=; b=hkz7ypjxuPwDxWYcY26v4bPAElkGzgB6p9H+eOmcHfWgvuG0kfPar6YgNAJYm20ZM/ X+N4F+WQmccdy8NcPhvM7ZgJQ2PnmJRkcO7JjGvj8tVbG3HfMqOoROgOHXrE7oLeC4KE gNewkamlZumXliue7X1PM+7HkgZ7+HIVZqL4rimWQGblQmQS6fBcCZ10IuAshEY62irg 5gaieZ4DntBsbccdJP6P8I+5EMRNtNYCK++FCspipezjmTHjyc9S9VBWehB03oVOW3jo g54JAERMkyp0GG5x1WE75RLpyo0oZ5FyEjEq2LMliS0yjyACagITzRX7SLNwWxZbqBLP 9Ecw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753967278; x=1754572078; 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=meRbfJ2cqUQBqVuicYtW3DoZwyaFCB1zISZzsgXGbsY=; b=g4TO+cXo0LW/DkA9uK7Sqrfm5rbazDiuBt0eNL2RjpTRJiUsEiYsiTvtBc3wMgdZk/ +yc+00jngmzrtPPX57En7yEc0U2lbzrJdd2FZrJ/Ra6aurH1gf5lay6TYjyPtZdrnXnz Z5KKWAoZV269rMfjgZzw3bKxlHOI+i/2zyIi1JKbsLoiKz0mAjFJsZ87uYkGrNuxKVSi Dp+JFMhZSttUsrFnfi3V8VqMG4rjmxzteRC7Bmse6vfMTJSg8doQ35avHeVYU0KsBl+m xilaaZ4Jek4FU5/MFUEBejDpnw/yDuiz7Wtm+aJ9b+sppnHyTVazGSLckbvsFS4Lx2Ix OPpQ== X-Forwarded-Encrypted: i=1; AJvYcCUmvIifbTdCsbVf/TeuQbEid3VGaecWB5q/R0DevPMsawfOXCZ4BmpPXhtX3TZ2VpeoKL4BxypW@freebsd.org, AJvYcCV5Bb85vxywQKI5UEXGJNBOXCU8FuD/9VvqKRVsJTovmk9ESutD1OnH2EyBd5QZ3lfDDimPm5Nt549nei+UcovIckQlyw==@freebsd.org, AJvYcCVXDAj8/bh0EsVPeJfLkdHDsGhTJemjMqYHmsoTgAey5Fm/L8CdOANK6tzln6jfQq5LaIg5eOrENKD8kSQpm+LzAJqyB8I=@freebsd.org, AJvYcCXRptddwdCpxeM5Zq9WaIiC3PMDrkHuk2HGjwqMBe/fAy2vjHWAo6lpkR6jo44MrTi/sA==@freebsd.org, AJvYcCXWfAx3cIQ4Zh9cGYwxvWS5AJNONur16WUJXPjTiHsmZxOyn+Zb2RdaiV8pLoIEPEL9xr9M4y9oI4GpLCXmwdI=@freebsd.org X-Gm-Message-State: AOJu0YzCKrn/hJa0TkXsjcxGfi6mE0/Pdp7G1ZrAwk7Oggs7rcah9jWf iI+vKytlulT/cE6ht78KbLw3pmTf1qTr+tfd30ldRldO9RaH7OMBzrOa9L+xe2P1MUXSFAotuZB Cnw1mVLlFz/iFkmcR0RgMlGw1381Okw== X-Gm-Gg: ASbGnct+TMRWvkp8Res6Azobc1//9FHrbkVVo+fPXfEOY/Iy4Yaf2ckjfSTQ0XS5+eA 0fp5MdGM9cxQrjhT3Tv4zbbCPT9MO4bllbGNr4QyFmgGDT6zz3XIp1Icv0K2VsteZO/Y9LJNOyJ F8QyrCYPOk59NyIeVMLCL5gnvkYtCWI5A0bP9ikupj5ZJ4Q4Q4dgz+HKehRFQacYfUjdRCYK50T Mi8A+mV7CKLcf+btEc/OmSZT5pJa3tBHM257eB3u+ttpaHzUQ== X-Google-Smtp-Source: AGHT+IGNf9fI7r4dDsddADpDQAheoO7yHsUVi1n/E50A+CuKQBb2dRSDo2jtIQQ/hz+LtC3RrPl4SjAxuXaxHcgymVc= X-Received: by 2002:a05:6402:35d2:b0:615:756b:1b1d with SMTP id 4fb4d7f45d1cf-615871fa650mr7065553a12.30.1753967277406; Thu, 31 Jul 2025 06:07:57 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Thu, 31 Jul 2025 06:07:44 -0700 X-Gm-Features: Ac12FXyB_CWjg932hwFWBMz0U-ziOcHK0S0QQQOauMLnCi4NtpT-x3v-_Ednncs Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Benjamin Kaduk Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bt8X43j3Bz4KrT X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk = wrote: > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem wrote: >> >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk wrote: >> > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk wrote: >> >> >> >> >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context() A= PI that does a lot of the work of getting useful bits out of an established= GSS security context. >> >> >> > >> > >> > >> > >> > And a bit more context on what is going on here and why kgssapi has to= care: >> > The GSS-API (RFC 2743) is all about a way to "establish a security con= text" (i.e., do crypto negotiation, authentication, sometimes authorization= , etc.) between two entities, the initiator and the acceprot, and then exch= anging protected messages between the two (which can be either encrypted or= just integrity protection tags for otherweise cleartext data); later exten= sions included the ability to produce identical PRF output on both parties,= etc.. The details are "mechanism-specific", and for this purpose we're ex= clusively talking about the krb5 mechanism. The steps to establish the sec= urity context are complicated and sometimes fiddly, and in the general case= can require a large number of round-trips between the initiator and accept= or before the security context is established. The individual message-prot= ection parts are comparatively simple and amendable to implementation in th= e kernel for processing efficiency. >> > RFC 2743 also defines functions for GSS_Export_sec_context() and GSS_I= mport_sec_context(), that are designed essentially to pass information abou= t an established security context from one process to another on the same m= achine (which are presumably using the same implementation and version of t= he implementation), so the contents of the exported blob are opaque and imp= lementation-specific. We are abusing that mechanism to export information = about the security context that gssd has established and feed that informat= ion into the kernel implementation of the per-message processing routines. = At present, this necessarily entails knowing the details of the implementa= tion-specific opaque blob that is the "export sec context token", which is = what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get the= information we want without breaking the abstraction barrier, such as via = the gss_krb5_export_lucid_sec_context() API, we are in a more robust postur= e overall and somewhat future-proofed against future evolution by MIT krb5. >> > (I note that recent Heimdal versions seem to also expose a gss_krb5_ex= port_lucid_sec_context() API, so part of the problem is just that the Heimd= al in base is so old.) >> >> Well, here's some "not so good" news... >> I've been trying to use gss_inquire_sec_context_by_oid(..) with the oid >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. >> It kept failing. >> The problem seems to be that "gctx->proto =3D=3D 4" in make_external_luc= id_ctx_v1() >> function. This function only knows about the 0 and 1 setting for gctx->p= roto. >> >> Any ideas, rick >> > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is eve= r expected; it looks like it's supposed to just be 0 (for the legacy RFC 19= 64 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence numb= ers for message-protection formats, etc.). So maybe it's worth posting you= r current WIP somewhere to take a closer look at what's going on. Yea, the debugging I did was flawed (I probably got the wrong offset in the structure). It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, ctx, OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it works and gives me the key and encryption type. If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes from = the string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no data and a weird 39756046(decimal) or 0x25ea10e(hex) minor. (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same weird error.) Also, if I look at the actual_mech_type returned by gss_init_sec_context(), I get an instant crash, because the "elements" pointer cannot be accessed (this doesn't much matter, since the info should always be just the Kerberos OID). --> I suspect there is some problem w.r.t. how the libraries are being buil= t? I'm now building from sources to try and dig into the library functions. rick > > From your previous message, > > > I am working on using gss_inquire_sec_context_by_oid(), which I think i= s just a front-end to gss_krb5_export_lucid_sec_context()? If that doesn't = work, I'll switch to gss_krb5_export_lucid_sec_context(). (I am still waiti= ng for the day when there is another mechanism. I have heard rumblings w.r.= t. a mechanism for the Oauth stuff, but as far as I know, about all that th= ey did was define an OID for it.) > > It looks like a front-end to the same core implementation at least (techn= ically not a wrapper for the public API, though). > (There are a bunch of non-krb5 mechanisms, most not in terribly widesprea= d use.) > > > Btw, do you have any experience porting KDC databases from Heimdal to M= IT? (At this point, Cy has done it, but after doing so, the passwords all h= ad to be reset. He thought he had used "--decrypt" when he dumped the Heimd= al KDC.) > > I do not have such experience, but the conventional way to do it involves= an unencrypted dump (which I presume is what the aforementioned "--decrypt= " does). Heimdal and MIT use (or at least used, the last time I looked) di= fferent techniques for encrypting the per-principal data in the dump file, = so a trip through plaintext helps. I do remember reading about Heimdal hav= ing grown some support for the MIT database format; the commit message at h= ttps://github.com/heimdal/heimdal/commit/57f1545a46fdad9207a71903a56f3c1d1f= ff3a10 is perhaps a very high-level description of what is expected to be p= ossible. > > -Ben From nobody Thu Jul 31 13:46:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt9N65rnzz63svy; Thu, 31 Jul 2025 13:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt9N644QKz4Pr5; Thu, 31 Jul 2025 13:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753969574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bT6G4xFZGojOm3NihSSUfeQOdHZcPSvU93zL8xLtJPU=; b=aNBbFVIuLjirc7mFOFHf3ZatO+NAo7DZPd9GXBg3tyLK6iBvtoJoUX6UR6Nj1VP99DPiVM loq2PmtMCXpVxLY3iL+3p54eIuMuw7tBf2qYLrC6w4NEtf/y55MlAqc0oYn0S2vQFtylzP 8uXArpxV8IynPBcWoy1MzbZ4LUb2ltPI0D4BCaMXs8jQnZU1jptMhe23/L1UQIsD2oQ7Kd NQfdpG7IcKdemb3leZO5a52uqw6+m9Y4R9hpNHBXhCo6nVo0ZhAgmNVxOFIROMseCUIFKF wJes3wce2azNz9lCUmC1A8SbMc2eKRfUmTYOVWeogC4K1VZuMBUfMeZ/GPbdlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753969574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bT6G4xFZGojOm3NihSSUfeQOdHZcPSvU93zL8xLtJPU=; b=XuiMrYtdS9BHXi+7xF8FoMNb7Bc0N1nEG0SAHcAIIqi+2tbRLxvWW/DagulpHWndwjCNjp rSuLkcylwyVQgyLFL0oWWoNuZvRbyQZ1mNquD7x4WFrbE46nVFzNiQlTBksIWzWbUhwQ0Z nfJqOoFosTCcSjVgN/I7iF8fwqOcWRbF6oLXSozFIx/g8+HYX9Vlkb76f2Yxus7VSKX0Ji jiKHyR0zhKRTUOmpkARLD4UDp+Q8QfuWMA1hCkWz7uhZk7d/lNp2TQSwHAyL9aqiV9oxS+ Y+TQKjk9oQdOuecl3obCOKRAmh/ma+tM0Q3f91wKiZOpygPymRKT39JQK2Fcog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753969574; a=rsa-sha256; cv=none; b=GEhMbi2JMl0+QZ3oW7jRjLh3szRZbLSm+2cZg5Og2ucHmEAx07DZVjsU54nixSq/AEbP4H mchZTuPTRkF+0x18Im3Rqfb0pFYPcYd0MJ6V2Nb7q51HBhrRoz7XyJUJVQto8EYRvEUue6 Uge+ROPSts6DFHxvGIC3iaLOKp8qhlcY4/Ydemf5+ewq7DsQXgYrnFG+Qgp1uL+TPV4zkh ob0ImmbDz/hUPLpsiwUflwaKs+c76uv3lmcZTfhHUYXHMI0A4iHWLPbTidT9VTZlTQ5OHk a0AaVJCbDZyWZYHGfrbw0eepHrgDr5S/VSluZ69M74V8PRMR45uqKqH0HN4hAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bt9N63RzQz14BB; Thu, 31 Jul 2025 13:46:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VDkEN6081959; Thu, 31 Jul 2025 13:46:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VDkETF081956; Thu, 31 Jul 2025 13:46:14 GMT (envelope-from git) Date: Thu, 31 Jul 2025 13:46:14 GMT Message-Id: <202507311346.56VDkETF081956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rene Ladan Subject: git: ada5bba476bf - main - organization.dot: update list of current portmgr members List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rene X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ada5bba476bf5eab897d1a0b35265f4223476d1a Auto-Submitted: auto-generated The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/src/commit/?id=ada5bba476bf5eab897d1a0b35265f4223476d1a commit ada5bba476bf5eab897d1a0b35265f4223476d1a Author: Rene Ladan AuthorDate: 2025-07-31 13:45:40 +0000 Commit: Rene Ladan CommitDate: 2025-07-31 13:45:40 +0000 organization.dot: update list of current portmgr members --- share/misc/organization.dot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/misc/organization.dot b/share/misc/organization.dot index 1a88bc71b14e..73e879578dd7 100644 --- a/share/misc/organization.dot +++ b/share/misc/organization.dot @@ -30,7 +30,7 @@ doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nbcr, gabor, gjb, hrs,\nblackend, ryusuke, wblock"] pkgmgr [label="Package Management Team\npkgmgr@FreeBSD.org\nantoine, bdrewery"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nbapt, bofh, mat,\npizzamig, rene, tcberner"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nbapt, dvl, mat,\npizzamig, rene, tcberner"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nblackend, delphij, cperciva"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, markj,\nemaste,\ngjb, gordon,\noshogbo, philip"] From nobody Thu Jul 31 13:51:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bt9Vy2yJPz63t26; Thu, 31 Jul 2025 13:52:10 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bt9Vx1pwfz3BmX; Thu, 31 Jul 2025 13:52:09 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Picj5yhX; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::530 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-615622ed677so1381220a12.1; Thu, 31 Jul 2025 06:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753969923; x=1754574723; 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=BY5vPMrJ2PHPFe1sQeNrqoK9PWruaGqzBjAPPkveWv8=; b=Picj5yhXa5sWCQaFJWpJ4ab4aj3bLNezFM/kFNNlyJezL2rWvMDS6K3nbyocysV4Xj mWcIpj/yCeT78C+CpmifsO4mUnqTZTL5TD7yRkcDvWdkafxH3Dtff/5OszKy2/xDYkkX ZNE9B0Bf5K2UdYxWoKBTaF8SP0fRWBriTK/pjrU9e6NPO384Y1YNdcGeKIx5bxxR/cJ+ Ih8z2SqXM1tULRF5mgOFwvtAKXn4subUGGokyalcm9FKpVlyQ6y55HDmNzwfSnnbsO4A m0A8xyvJwWCgGz98yLVeuvf2q2NPKW1FABXx7QBEourlRr3EqX03TAUL8lJYZfp/Utr/ XeMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753969923; x=1754574723; 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=BY5vPMrJ2PHPFe1sQeNrqoK9PWruaGqzBjAPPkveWv8=; b=fdthVq20Lm09wgttHKbYtMy3yxmKOic48jVSiY19rBpC+WM7Uq51QCFG2Tnrjfwv6B f1ON1mneWYjUNjqw+CgdoaC3JolrAhJyo/HN0k0jTFIsr6MC/iAlX8/3dCPQQjbxCkbC 16we+cpbuZymVO36dlE1znb0xGO2xk8KMsOOibWBw3fEWCtPLReRcLKzmD+ciVUx8/Ho yIHYKJyj1unXn74xAH4PAbVtHIMrXeauXySDqcCMO50V1Qokb8jldXJ9lV5Scm8Owkci y9jPRK2kewcPGQ9W8za4XkHMYjg+XOyV0vaMMWahN61/7S9wHteUajemeCKZ77WHDH6O Eo2g== X-Forwarded-Encrypted: i=1; AJvYcCUnUJ/Gq4NxUkFPL31yoK062ACi7oiRjpzWbozScofqsQqPHChFVDS94gQcZuWqmwp6IBGAcZkvO96BKooV+vq1PIXlei0=@freebsd.org, AJvYcCUupsJxYc51HiRfLBQlkoqVU+TxBrc82xZ2NwtUSaYrCAjvjMm+KvjB9ifFWeqsjYppCgIdJ2wH@freebsd.org, AJvYcCVI+stDnFv3kUyqTFwKRNJKSh6Z2Zlmf0PhxHLq8lnYP695uKNZfD9Cz2YtaEjquTBM7KK3KtO0RbatKKs16nDirKf22g==@freebsd.org, AJvYcCW5Z8RK80mzWDcMMaT3b2Siqs5ZDmRN8kGWdypEiTMVLhAjhPRGm4hU9zJ4b4yEIjMOCSDZN3I4fhJvgZpkq+8=@freebsd.org, AJvYcCWz8kjtVyu1xAyoPjCdon/M/+ubeVO5Gpfd0Y6W5BFXKmj4S8tcEH+/CFQhIU1QmSKISA==@freebsd.org X-Gm-Message-State: AOJu0Yxz5T0NFXYGOR3mdvqp4NFbF1cAATcngTi411Y30XNLQXuxw8MN YmFw+to6oZgNtZn69Hm01K1nzgy+tqgWpcROYCYI0kxhqTnLk3kGk0TnpGae1e1ZbjaP96UcxZn UVAk9dk+mZa/59nmijN9yW61qxoELx4cY X-Gm-Gg: ASbGnctmkkz271n7mENGkTEn68QFrimOYXy1qMJS7QS3a6qe9qEQOHO5ByKguZ4Y8JC yZqzBrG6IOGaYjSBu0Lk0mS89cNvh1A2DCjVs2qrKCjWKr7kcVHQB/z6ctzRK8Hq9J3SM8TJl+h EIuxQtFRJ+UQiFfCuX+DAgVT+edr3eAjpj/7/Dbs9nC29/MXyDzKyqeLUS6I4AIuy89oidWoyIc TKW2o+hpFzjviLvpHr4PqvMKcokcODID/7es65I5U09pT3dqA== X-Google-Smtp-Source: AGHT+IEW/QqhztS5Pwa8ymgddjdxuPMWHY724Qt8zFk+GYUxAeskZlzLiRnVRaIsNi43QVa6nU7dpKWwRl3xaOjdQ7Q= X-Received: by 2002:a05:6402:42d4:b0:615:78c6:7aed with SMTP id 4fb4d7f45d1cf-61587213791mr8020647a12.32.1753969922348; Thu, 31 Jul 2025 06:52:02 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Thu, 31 Jul 2025 06:51:51 -0700 X-Gm-Features: Ac12FXzMIrjxSyr7QGXjdnh16RDUb3WGr04zEdzSvjNi9ROiwM_CYoxncVGb7-k Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Benjamin Kaduk Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "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-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TAGGED_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_SEVEN(0.00)[8]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::530:from] X-Rspamd-Queue-Id: 4bt9Vx1pwfz3BmX X-Spamd-Bar: --- On Thu, Jul 31, 2025 at 6:07=E2=80=AFAM Rick Macklem wrote: > > On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk wrote: > > > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem wrote: > >> > >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk wrote: > >> > > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk wrote: > >> >> > >> >> > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context()= API that does a lot of the work of getting useful bits out of an establish= ed GSS security context. > >> >> > >> > > >> > > >> > > >> > > >> > And a bit more context on what is going on here and why kgssapi has = to care: > >> > The GSS-API (RFC 2743) is all about a way to "establish a security c= ontext" (i.e., do crypto negotiation, authentication, sometimes authorizati= on, etc.) between two entities, the initiator and the acceprot, and then ex= changing protected messages between the two (which can be either encrypted = or just integrity protection tags for otherweise cleartext data); later ext= ensions included the ability to produce identical PRF output on both partie= s, etc.. The details are "mechanism-specific", and for this purpose we're = exclusively talking about the krb5 mechanism. The steps to establish the s= ecurity context are complicated and sometimes fiddly, and in the general ca= se can require a large number of round-trips between the initiator and acce= ptor before the security context is established. The individual message-pr= otection parts are comparatively simple and amendable to implementation in = the kernel for processing efficiency. > >> > RFC 2743 also defines functions for GSS_Export_sec_context() and GSS= _Import_sec_context(), that are designed essentially to pass information ab= out an established security context from one process to another on the same= machine (which are presumably using the same implementation and version of= the implementation), so the contents of the exported blob are opaque and i= mplementation-specific. We are abusing that mechanism to export informatio= n about the security context that gssd has established and feed that inform= ation into the kernel implementation of the per-message processing routines= . At present, this necessarily entails knowing the details of the implemen= tation-specific opaque blob that is the "export sec context token", which i= s what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get t= he information we want without breaking the abstraction barrier, such as vi= a the gss_krb5_export_lucid_sec_context() API, we are in a more robust post= ure overall and somewhat future-proofed against future evolution by MIT krb= 5. > >> > (I note that recent Heimdal versions seem to also expose a gss_krb5_= export_lucid_sec_context() API, so part of the problem is just that the Hei= mdal in base is so old.) > >> > >> Well, here's some "not so good" news... > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with the oi= d > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > >> It kept failing. > >> The problem seems to be that "gctx->proto =3D=3D 4" in make_external_l= ucid_ctx_v1() > >> function. This function only knows about the 0 and 1 setting for gctx-= >proto. > >> > >> Any ideas, rick > >> > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is e= ver expected; it looks like it's supposed to just be 0 (for the legacy RFC = 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence nu= mbers for message-protection formats, etc.). So maybe it's worth posting y= our current WIP somewhere to take a closer look at what's going on. > > Yea, the debugging I did was flawed (I probably got the wrong offset > in the structure). > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, ctx, > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > works and gives me the key and encryption type. > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes fro= m the > string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no data a= nd > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same > weird error.) --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_contex= t() returns GSS_S_BAD_MECH. Looking at the src, that error has to be from gss_inquire_sec_context_by_oid(). So, same function fails, but a diffe= rent error return? It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context(), but I've also tried the Kerberos 9 byte OID (both work, in the sense that gss_init_sec_context() seems to work, except that the actual_mech_type returned by it has a bogus pointer in the reply). --> It looks like the "mech_type" field of "ctx" is busted, for some reason= ? I'm going to try building krb5 from ports and linking to that, to see if it does the same thing. rick > > Also, if I look at the actual_mech_type returned by gss_init_sec_context(= ), > I get an instant crash, because the "elements" pointer cannot be > accessed (this doesn't much matter, since the info should always be just > the Kerberos OID). > --> I suspect there is some problem w.r.t. how the libraries are being bu= ilt? > > I'm now building from sources to try and dig into the library functions. > > rick > > > > > From your previous message, > > > > > I am working on using gss_inquire_sec_context_by_oid(), which I think= is just a front-end to gss_krb5_export_lucid_sec_context()? If that doesn'= t work, I'll switch to gss_krb5_export_lucid_sec_context(). (I am still wai= ting for the day when there is another mechanism. I have heard rumblings w.= r.t. a mechanism for the Oauth stuff, but as far as I know, about all that = they did was define an OID for it.) > > > > It looks like a front-end to the same core implementation at least (tec= hnically not a wrapper for the public API, though). > > (There are a bunch of non-krb5 mechanisms, most not in terribly widespr= ead use.) > > > > > Btw, do you have any experience porting KDC databases from Heimdal to= MIT? (At this point, Cy has done it, but after doing so, the passwords all= had to be reset. He thought he had used "--decrypt" when he dumped the Hei= mdal KDC.) > > > > I do not have such experience, but the conventional way to do it involv= es an unencrypted dump (which I presume is what the aforementioned "--decry= pt" does). Heimdal and MIT use (or at least used, the last time I looked) = different techniques for encrypting the per-principal data in the dump file= , so a trip through plaintext helps. I do remember reading about Heimdal h= aving grown some support for the MIT database format; the commit message at= https://github.com/heimdal/heimdal/commit/57f1545a46fdad9207a71903a56f3c1d= 1fff3a10 is perhaps a very high-level description of what is expected to be= possible. > > > > -Ben From nobody Thu Jul 31 14:18:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btB6J0sPdz63vFZ; Thu, 31 Jul 2025 14:19:20 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btB6H1gRZz3FvS; Thu, 31 Jul 2025 14:19:19 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=iUoEeAjX; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::52e as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-61592ff5ebbso1630483a12.3; Thu, 31 Jul 2025 07:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753971551; x=1754576351; 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=XVrohf1GbHtRJzEloS10bKJ91BzY8H2ja99hwrpEb0c=; b=iUoEeAjXRVKXZu7wWDBrKNo2/3UA5I9vWKtBoM2SBBzjR4CYUSpnmAvd2g+h+91MPP 9vkPB5yxeZdrMFDxsSiQ8WdRmlhtthQDGkjwpotcbJAg1/5twBhrWpn6zqmmrem8MwKb V8CAKGlqHeu8eW4KoVgyA1mAuFB6uX7nURCgsSCCH+/ZD7A/QXasRu+spjIrwx9raZRN qzVgHImywLaEcZzDWhnY5wVBUx2o76vZ42PiE6lQh0Zj15TgCiF33Hidt2rPq//V35b9 2UTBECwiWm+Yb3Rp6alqE0hO8h+hk9GRjFtjH4H52cTGYgdXYNhvdsPGyNYLDAGi7AjL PqOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753971551; x=1754576351; 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=XVrohf1GbHtRJzEloS10bKJ91BzY8H2ja99hwrpEb0c=; b=T1Rgl+ox9xyKJHYcrh1mJf0JzASZrPWecV7O32ncUkWNjJkzmt3tMiNYvmZCqX0n17 EJu5quiN0eh0S23eJoh46baBlQOe8PG4Ku3pLLiVtS80lNtc6G+DNN6OV3ngOd0sIvUW aqF2hFSA4/UBbZxjB/SwzXWOjp/1pPkBK5qxUnbw+XcupQPAcDEqZY7FrZ1J//LXSBUx puV1wMCZ/oTg+7mpTaHdgxQMrCAKP4ego0UD/g9jCVR4y8V8vZ0sTEBrA8jMj/mLwg97 /fmtCxD6FUoHBt0HIyyBiHfx7yQwWafflxE37FM3HHlh5+V6Gq3ZSQATOV1Yh6laY1yX 2V6A== X-Forwarded-Encrypted: i=1; AJvYcCUx7zYbndH+btdW/jxbKJbg7PNHMS3rCZy+vHARAY356wr45sQ/f3UveA7uvdfn40nsQpHdmf9d@freebsd.org, AJvYcCVeElatzytrJR6ztHzBfyM8GvuW7P2FUEZ5Z7NzVDaol2OfMp3Y2cZ4qJEMJN/AWgHAww==@freebsd.org, AJvYcCVzIipGpwiKNpg/cR90m1rW25aF0/NZYVRbpQF0maVRet3plXH5mkMDJ/UOtcz2JRr0Mjr3HuQleug3ZUdDLlw=@freebsd.org, AJvYcCXCiH8EVIqTIkkOjVabTD5PyWCf4luGJskr0qdv3h2j3FG/1A3UzdmNkmrw0x7ErEaIETeF/KZ2Nvk5OJCqnoAARUfqUMg=@freebsd.org, AJvYcCXinRwO6elpmQceOs9kDGd+KeVhGuEnwO1+8ZAhk6b6Oc3gk3paBhGNpVpoX6axNOLKmUsVreRJRuL1qdC91UYyZ7Ckxw==@freebsd.org X-Gm-Message-State: AOJu0YygX14FE4EeMOTxWnpJ4E2UivNu6Ovc+RKDPTAV9uZQPn0e3k17 IMf+OhUYhNXouf9p67cTbx54F7yLEypY25R00wVvpTUat/J6Ig+422medye0GrQd+fkU1xtxvnW E/yTAarowFIaKVSVFGFzSc1Q+uigUNg== X-Gm-Gg: ASbGncveYj7lA0r0DB45BpWu6d0vgddqzPWjFUzEsL8UEXPOYqNE5vm1iQvusypNpS3 Pz6my8egr2GUoUHxtUOPNl/KQFDCGc+LBkoGpMTEhhI5UmKOAqFsSdhLWXhN+4+fKAUy9rOXm+V X6UHuBtkKdll9oUorrQy2A3sCs1PLZFTAuB7JGyAed/xEVAPcqcklUDp1Fln1C+W/udcTn+i+7k acscrRUXnmTTOl9OGY/tzfG9+qwR35Qp/daUxw= X-Google-Smtp-Source: AGHT+IG6MA3zSflQ7uAs7JSjITu3b+ekuAord7mrLBrY2UdPZRGohyAXGANrySdDc+tL7dO1+AXJqfMUnOKhrdGn1cQ= X-Received: by 2002:a17:907:9803:b0:ae0:abec:dc13 with SMTP id a640c23a62f3a-af8fda6aae1mr856676666b.53.1753971551277; Thu, 31 Jul 2025 07:19:11 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Thu, 31 Jul 2025 07:18:59 -0700 X-Gm-Features: Ac12FXzJh1KT6sG_nwZlklpW7_g7t7TBP_wxA2zdKZX2XsRjQVe9JorK6FuFeBc Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Benjamin Kaduk Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "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-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TAGGED_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_SEVEN(0.00)[8]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52e:from] X-Rspamd-Queue-Id: 4btB6H1gRZz3FvS X-Spamd-Bar: --- On Thu, Jul 31, 2025 at 6:51=E2=80=AFAM Rick Macklem wrote: > > On Thu, Jul 31, 2025 at 6:07=E2=80=AFAM Rick Macklem wrote: > > > > On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk wrote: > > > > > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem wrote: > > >> > > >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk wrote: > > >> > > > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk wrote: > > >> >> > > >> >> > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context= () API that does a lot of the work of getting useful bits out of an establi= shed GSS security context. > > >> >> > > >> > > > >> > > > >> > > > >> > > > >> > And a bit more context on what is going on here and why kgssapi ha= s to care: > > >> > The GSS-API (RFC 2743) is all about a way to "establish a security= context" (i.e., do crypto negotiation, authentication, sometimes authoriza= tion, etc.) between two entities, the initiator and the acceprot, and then = exchanging protected messages between the two (which can be either encrypte= d or just integrity protection tags for otherweise cleartext data); later e= xtensions included the ability to produce identical PRF output on both part= ies, etc.. The details are "mechanism-specific", and for this purpose we'r= e exclusively talking about the krb5 mechanism. The steps to establish the= security context are complicated and sometimes fiddly, and in the general = case can require a large number of round-trips between the initiator and ac= ceptor before the security context is established. The individual message-= protection parts are comparatively simple and amendable to implementation i= n the kernel for processing efficiency. > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() and G= SS_Import_sec_context(), that are designed essentially to pass information = about an established security context from one process to another on the sa= me machine (which are presumably using the same implementation and version = of the implementation), so the contents of the exported blob are opaque and= implementation-specific. We are abusing that mechanism to export informat= ion about the security context that gssd has established and feed that info= rmation into the kernel implementation of the per-message processing routin= es. At present, this necessarily entails knowing the details of the implem= entation-specific opaque blob that is the "export sec context token", which= is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get= the information we want without breaking the abstraction barrier, such as = via the gss_krb5_export_lucid_sec_context() API, we are in a more robust po= sture overall and somewhat future-proofed against future evolution by MIT k= rb5. > > >> > (I note that recent Heimdal versions seem to also expose a gss_krb= 5_export_lucid_sec_context() API, so part of the problem is just that the H= eimdal in base is so old.) > > >> > > >> Well, here's some "not so good" news... > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with the = oid > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > >> It kept failing. > > >> The problem seems to be that "gctx->proto =3D=3D 4" in make_external= _lucid_ctx_v1() > > >> function. This function only knows about the 0 and 1 setting for gct= x->proto. > > >> > > >> Any ideas, rick > > >> > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is= ever expected; it looks like it's supposed to just be 0 (for the legacy RF= C 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence = numbers for message-protection formats, etc.). So maybe it's worth posting= your current WIP somewhere to take a closer look at what's going on. > > > > Yea, the debugging I did was flawed (I probably got the wrong offset > > in the structure). > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, ctx= , > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > works and gives me the key and encryption type. > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes f= rom the > > string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no data= and > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same > > weird error.) > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_cont= ext() > returns GSS_S_BAD_MECH. Looking at the src, that error has to be fro= m > gss_inquire_sec_context_by_oid(). So, same function fails, but a dif= ferent > error return? > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context(), > but I've also tried the Kerberos 9 byte OID (both work, in the sense that > gss_init_sec_context() seems to work, except that the actual_mech_type > returned by it has a bogus pointer in the reply). > --> It looks like the "mech_type" field of "ctx" is busted, for some reas= on? > > I'm going to try building krb5 from ports and linking to that, to see if = it > does the same thing. Finally some good news... All I did was "pkg install krb5" and then linked the gssd to the libraries = in /usr/local/lib and it worked!! Now I can test/debug the changes. Btw, the stuff in /usr/local/include/gssapi are correct and not messed up like the stuff in /usr/include/gssapi. (The ones in /usr/local/include defi= ne GSS_DLLIMP for example.) I'm going to leave figuring out why the libraries in /usr/lib are messed up to someone else. rick > > rick > > > > > Also, if I look at the actual_mech_type returned by gss_init_sec_contex= t(), > > I get an instant crash, because the "elements" pointer cannot be > > accessed (this doesn't much matter, since the info should always be jus= t > > the Kerberos OID). > > --> I suspect there is some problem w.r.t. how the libraries are being = built? > > > > I'm now building from sources to try and dig into the library functions= . > > > > rick > > > > > > > > From your previous message, > > > > > > > I am working on using gss_inquire_sec_context_by_oid(), which I thi= nk is just a front-end to gss_krb5_export_lucid_sec_context()? If that does= n't work, I'll switch to gss_krb5_export_lucid_sec_context(). (I am still w= aiting for the day when there is another mechanism. I have heard rumblings = w.r.t. a mechanism for the Oauth stuff, but as far as I know, about all tha= t they did was define an OID for it.) > > > > > > It looks like a front-end to the same core implementation at least (t= echnically not a wrapper for the public API, though). > > > (There are a bunch of non-krb5 mechanisms, most not in terribly wides= pread use.) > > > > > > > Btw, do you have any experience porting KDC databases from Heimdal = to MIT? (At this point, Cy has done it, but after doing so, the passwords a= ll had to be reset. He thought he had used "--decrypt" when he dumped the H= eimdal KDC.) > > > > > > I do not have such experience, but the conventional way to do it invo= lves an unencrypted dump (which I presume is what the aforementioned "--dec= rypt" does). Heimdal and MIT use (or at least used, the last time I looked= ) different techniques for encrypting the per-principal data in the dump fi= le, so a trip through plaintext helps. I do remember reading about Heimdal= having grown some support for the MIT database format; the commit message = at https://github.com/heimdal/heimdal/commit/57f1545a46fdad9207a71903a56f3c= 1d1fff3a10 is perhaps a very high-level description of what is expected to = be possible. > > > > > > -Ben From nobody Thu Jul 31 14:35:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btBSt6V6Wz63vbr; Thu, 31 Jul 2025 14:35:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btBSt0rqrz3HFs; Thu, 31 Jul 2025 14:35:26 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=jBkjDSDX; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::533 as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-6155e75a9acso656501a12.0; Thu, 31 Jul 2025 07:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753972519; x=1754577319; 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=RvZ/Ec4FwdZmQsVhku36uHWeA5wHf7cDP4/x76ozV7Y=; b=jBkjDSDXhdYhpgTU6kqC92stE0q/GwwUZhKeYu+yuHdkGm7NtrTpexL4j3csLyY9SE m46OgpBgGU2KtAnVIzjKoLBWEHjAQ8/n5mfV805Suwjio0JeXlmx0d0PDGS2ZAJLXVbQ GihaidzbNjH/hJ6uo8njQLSRjAdnMJh/aemghA6zXLnMu9nMQ1BATacuaH0gaGTfG5YK lejMAwfFr8TVXN/iAD/t4YAFs/shqXlKlRJmEj7CNZr7WfewCUw1aE4eGpICQeeHSwVz ou9iYKfw+F3zrZS+q2yMXyYwdnwsdM1QqS1ahlvPp91hQRYanuWP5DSAqVK4etPO3uai Xr0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753972519; x=1754577319; 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=RvZ/Ec4FwdZmQsVhku36uHWeA5wHf7cDP4/x76ozV7Y=; b=ruwtMZm8IQun0GOmdMI0K9YiNAHhsyw58S5RjEQ07L8DKSqYr6vrNsjlM2w4yEvq6N aojp3Hg5QCXZRGWuJyO7Z9N3MooWVsgp1g7UxqK1jZVTE3ycqBQEgW/3XRAI9beFqt5h 5XPUkbocncn/2c4cgXmJFOhzrOjgwyUn+mupu455q3rS3+6K7B4YsTyUHjnpso09BOc0 V1NS1ybZAVJU2SOVFDB7oheYl2cBUvScf15YOuF+QwNpltrFfHUZ4ytWsSGGj3SIGwpb OVgK8RSD6I+5Q0zBNrjvSwTQ3sZB8XzFV00JER1d6uX6CwIulzVvN0gGbKRaBdgQf0w5 +P/A== X-Forwarded-Encrypted: i=1; AJvYcCVAMTr4L/QgeXIACAiFV/QHudqArl0tZRc/qIrJoEisonSQX313CpeIpugx601yoLYpc3Jsn2q9OFdPwnqrPiw=@freebsd.org, AJvYcCVCDms+TrPamaCBK0X+pijsZKJrhw3jzDrKkUpZ6fRVh/Z6JpJ+P/PTwWCa3WjTTkrG5Ypj6Mx12QHo7USjXXrMGEJM8Q==@freebsd.org, AJvYcCVEVePU33KaWosmqKYesjHimEAa8FI8LFrGbXCqFnUoMpamsCM1zw6yVD3ihGH4eTHsK+vFIclu@freebsd.org, AJvYcCWbos9kqvgd1/6o69cx339yI335h25d9SwiAHfEVjDQP62TBmUMQlGvDIAMXB8vMURzXQ==@freebsd.org, AJvYcCWn6JVc9RuL63vN5CmlxdlU+HwWFYciNK/hlAsw8blLM0mh0eXoToWWPfEZzrmJf1g5zFl2PtB8nYUD8OX8PZ2h6kXHYVk=@freebsd.org X-Gm-Message-State: AOJu0YzzNRNXZhq87KQRcUIRyw2FojNVA06W00ySjJhlKSx7wZ7/OzbH 1k2rO5su3Eu8lHKSVIg+QpAYlB2zBvFYUYKNr+Vp7p7COY3W52Vo3EZVszi5fkgbNurw+ak39MI Kjs1m6tATQoMApx9xedNkf1Z5vnUBS46DlE4= X-Gm-Gg: ASbGncvN+eOHN0z8wX5LWHa1XRVy43PCFmWETzol7oAvwZmnmx80IFXiBLIC+xHSwNA mZrG5Wz8/fT0dcM61f1r4vg6DaVr9wXUJ3dCPHHn4iObR6l8kEodNp482eof50Nwuu3rNSEwlMq 4Z1mTq43NFfWfbMzrys7tBpQ8Mr7PRWmvKv8tMCGxn+7o0ghwAOZxR6BHlSdwePDeBuvfPHy0UG mz3HefJQKiPsfw+6LjW47Ei9X4YG3TZh1s7a+E= X-Google-Smtp-Source: AGHT+IEKoa73AZFgn+JylFw3hL7vxuEVuHjAHCnJeJNi1xHIUygmY2JREcGGKf/BVbxaOd8a+/DMaAvvIx3HWDvu8II= X-Received: by 2002:a05:6402:2756:b0:615:6482:7498 with SMTP id 4fb4d7f45d1cf-615872191b9mr7480322a12.31.1753972519117; Thu, 31 Jul 2025 07:35:19 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Thu, 31 Jul 2025 07:35:07 -0700 X-Gm-Features: Ac12FXyxUmUFB3KDb8KZGOuLAb6YmaSzL82o6wvecyv7NqhhekstwaiJga-hL3o Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Benjamin Kaduk Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "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-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TAGGED_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_SEVEN(0.00)[8]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::533:from] X-Rspamd-Queue-Id: 4btBSt0rqrz3HFs X-Spamd-Bar: --- On Thu, Jul 31, 2025 at 7:18=E2=80=AFAM Rick Macklem wrote: > > On Thu, Jul 31, 2025 at 6:51=E2=80=AFAM Rick Macklem wrote: > > > > On Thu, Jul 31, 2025 at 6:07=E2=80=AFAM Rick Macklem wrote: > > > > > > On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk wrote: > > > > > > > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem wrote: > > > >> > > > >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk wrote: > > > >> > > > > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk wrote: > > > >> >> > > > >> >> > > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_conte= xt() API that does a lot of the work of getting useful bits out of an estab= lished GSS security context. > > > >> >> > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > And a bit more context on what is going on here and why kgssapi = has to care: > > > >> > The GSS-API (RFC 2743) is all about a way to "establish a securi= ty context" (i.e., do crypto negotiation, authentication, sometimes authori= zation, etc.) between two entities, the initiator and the acceprot, and the= n exchanging protected messages between the two (which can be either encryp= ted or just integrity protection tags for otherweise cleartext data); later= extensions included the ability to produce identical PRF output on both pa= rties, etc.. The details are "mechanism-specific", and for this purpose we= 're exclusively talking about the krb5 mechanism. The steps to establish t= he security context are complicated and sometimes fiddly, and in the genera= l case can require a large number of round-trips between the initiator and = acceptor before the security context is established. The individual messag= e-protection parts are comparatively simple and amendable to implementation= in the kernel for processing efficiency. > > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() and= GSS_Import_sec_context(), that are designed essentially to pass informatio= n about an established security context from one process to another on the = same machine (which are presumably using the same implementation and versio= n of the implementation), so the contents of the exported blob are opaque a= nd implementation-specific. We are abusing that mechanism to export inform= ation about the security context that gssd has established and feed that in= formation into the kernel implementation of the per-message processing rout= ines. At present, this necessarily entails knowing the details of the impl= ementation-specific opaque blob that is the "export sec context token", whi= ch is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can g= et the information we want without breaking the abstraction barrier, such a= s via the gss_krb5_export_lucid_sec_context() API, we are in a more robust = posture overall and somewhat future-proofed against future evolution by MIT= krb5. > > > >> > (I note that recent Heimdal versions seem to also expose a gss_k= rb5_export_lucid_sec_context() API, so part of the problem is just that the= Heimdal in base is so old.) > > > >> > > > >> Well, here's some "not so good" news... > > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with th= e oid > > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > > >> It kept failing. > > > >> The problem seems to be that "gctx->proto =3D=3D 4" in make_extern= al_lucid_ctx_v1() > > > >> function. This function only knows about the 0 and 1 setting for g= ctx->proto. > > > >> > > > >> Any ideas, rick > > > >> > > > > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 = is ever expected; it looks like it's supposed to just be 0 (for the legacy = RFC 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequenc= e numbers for message-protection formats, etc.). So maybe it's worth posti= ng your current WIP somewhere to take a closer look at what's going on. > > > > > > Yea, the debugging I did was flawed (I probably got the wrong offset > > > in the structure). > > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, c= tx, > > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > > works and gives me the key and encryption type. > > > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes= from the > > > string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no da= ta and > > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same > > > weird error.) > > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_co= ntext() > > returns GSS_S_BAD_MECH. Looking at the src, that error has to be f= rom > > gss_inquire_sec_context_by_oid(). So, same function fails, but a d= ifferent > > error return? > > > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context(), > > but I've also tried the Kerberos 9 byte OID (both work, in the sense th= at > > gss_init_sec_context() seems to work, except that the actual_mech_type > > returned by it has a bogus pointer in the reply). > > --> It looks like the "mech_type" field of "ctx" is busted, for some re= ason? > > > > I'm going to try building krb5 from ports and linking to that, to see i= f it > > does the same thing. > Finally some good news... > All I did was "pkg install krb5" and then linked the gssd to the librarie= s in > /usr/local/lib and it worked!! Just to clarify, "it" refers to the gss_krb5_export_lucid_sec_context() call. I now have to debug the patch that uses it to get the kerberized NFS mounts working. rick > > Now I can test/debug the changes. > > Btw, the stuff in /usr/local/include/gssapi are correct and not messed up > like the stuff in /usr/include/gssapi. (The ones in /usr/local/include de= fine > GSS_DLLIMP for example.) > > I'm going to leave figuring out why the libraries in /usr/lib are messed = up > to someone else. > > rick > > > > > rick > > > > > > > > Also, if I look at the actual_mech_type returned by gss_init_sec_cont= ext(), > > > I get an instant crash, because the "elements" pointer cannot be > > > accessed (this doesn't much matter, since the info should always be j= ust > > > the Kerberos OID). > > > --> I suspect there is some problem w.r.t. how the libraries are bein= g built? > > > > > > I'm now building from sources to try and dig into the library functio= ns. > > > > > > rick > > > > > > > > > > > From your previous message, > > > > > > > > > I am working on using gss_inquire_sec_context_by_oid(), which I t= hink is just a front-end to gss_krb5_export_lucid_sec_context()? If that do= esn't work, I'll switch to gss_krb5_export_lucid_sec_context(). (I am still= waiting for the day when there is another mechanism. I have heard rumbling= s w.r.t. a mechanism for the Oauth stuff, but as far as I know, about all t= hat they did was define an OID for it.) > > > > > > > > It looks like a front-end to the same core implementation at least = (technically not a wrapper for the public API, though). > > > > (There are a bunch of non-krb5 mechanisms, most not in terribly wid= espread use.) > > > > > > > > > Btw, do you have any experience porting KDC databases from Heimda= l to MIT? (At this point, Cy has done it, but after doing so, the passwords= all had to be reset. He thought he had used "--decrypt" when he dumped the= Heimdal KDC.) > > > > > > > > I do not have such experience, but the conventional way to do it in= volves an unencrypted dump (which I presume is what the aforementioned "--d= ecrypt" does). Heimdal and MIT use (or at least used, the last time I look= ed) different techniques for encrypting the per-principal data in the dump = file, so a trip through plaintext helps. I do remember reading about Heimd= al having grown some support for the MIT database format; the commit messag= e at https://github.com/heimdal/heimdal/commit/57f1545a46fdad9207a71903a56f= 3c1d1fff3a10 is perhaps a very high-level description of what is expected t= o be possible. > > > > > > > > -Ben From nobody Thu Jul 31 14:55:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btBvz18YXz63ws0; Thu, 31 Jul 2025 14:55:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btBvy4YJTz3JZw; Thu, 31 Jul 2025 14:55:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id hPDku1Ykj5MqyhUgouSfST; Thu, 31 Jul 2025 14:55:26 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id hUgluUYcpWbOahUgnucIMt; Thu, 31 Jul 2025 14:55:25 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Q5lx4J2a c=1 sm=1 tr=0 ts=688b83de a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=hEh3JUyyAAAA:8 a=zdPUvaFGAAAA:8 a=04oDvr9pAAAA:8 a=YxBL1-UpAAAA:8 a=gxyqz0aHM-HxaGc6Q_gA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=fvD0gfNcX4AKPV7IvcuC:22 a=sT4bYkpex2i6d5iwGOJT:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 695AFE9; Thu, 31 Jul 2025 07:55:23 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 5EE98286; Thu, 31 Jul 2025 07:55:23 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Rick Macklem cc: Benjamin Kaduk , Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default In-reply-to: References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> Comments: In-reply-to Rick Macklem message dated "Thu, 31 Jul 2025 07:18:59 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 31 Jul 2025 07:55:23 -0700 Message-Id: <20250731145523.5EE98286@slippy.cwsent.com> X-CMAE-Envelope: MS4xfNjJPdECMeWfwreD5CVbnG8D9gxKxg+inxuTU8Hy/TPXnEYIlK/23csYESfKWR98zPrBVvuP8w4Pe+KzxN/uR0J8Rq/X9IkkpHDjEeZeX+BpzzftHyPK t2qNGEIzUbv4SXXrfZng5qQ1nEc7GcRysGtYh+HPwfSHuFgf08pcxjpp00thnwsuRW7F//lgutdRmcFYINICsvfwFktLJ2+9msIaLq1H5Pi3CSX/bLpA4L78 TtJRHUjPFjLZvMxoL7vWApuGPi5CfP0lbRen4UQ29RTa9qQFVow7//QoP+tcpADKyOybWWHC9j9oqpRuA5jQ7BkDRwrmH72YNGFWbQM3ClMkzNQZF7QrlFz8 yVhu9wq/OSqYT1DNoGiXph4Bn0XNICe0rVftP11nvYniCterC9t9xUaEgRejVXuTqwVinBuE4NJ1uked3xJU9/uQmiJEfxiSVvkCx5aBenQYHwfpcAA= X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; MV_CASE(0.50)[]; RWL_MAILSPIKE_EXCELLENT(-0.40)[3.97.99.33:from]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[9]; R_DKIM_NA(0.00)[]; TAGGED_RCPT(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4btBvy4YJTz3JZw X-Spamd-Bar: --- In message , Rick Macklem writes: > On Thu, Jul 31, 2025 at 6:51=E2=80=AFAM Rick Macklem m> wrote: > > > > On Thu, Jul 31, 2025 at 6:07=E2=80=AFAM Rick Macklem com> wrote: > > > > > > On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk om> wrote: > > > > > > > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem mail.com> wrote: > > > >> > > > >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk l.com> wrote: > > > >> > > > > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk ail.com> wrote: > > > >> >> > > > >> >> > > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context= > () API that does a lot of the work of getting useful bits out of an establi= > shed GSS security context. > > > >> >> > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > And a bit more context on what is going on here and why kgssapi ha= > s to care: > > > >> > The GSS-API (RFC 2743) is all about a way to "establish a security= > context" (i.e., do crypto negotiation, authentication, sometimes authoriza= > tion, etc.) between two entities, the initiator and the acceprot, and then = > exchanging protected messages between the two (which can be either encrypte= > d or just integrity protection tags for otherweise cleartext data); later e= > xtensions included the ability to produce identical PRF output on both part= > ies, etc.. The details are "mechanism-specific", and for this purpose we'r= > e exclusively talking about the krb5 mechanism. The steps to establish the= > security context are complicated and sometimes fiddly, and in the general = > case can require a large number of round-trips between the initiator and ac= > ceptor before the security context is established. The individual message-= > protection parts are comparatively simple and amendable to implementation i= > n the kernel for processing efficiency. > > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() and G= > SS_Import_sec_context(), that are designed essentially to pass information = > about an established security context from one process to another on the sa= > me machine (which are presumably using the same implementation and version = > of the implementation), so the contents of the exported blob are opaque and= > implementation-specific. We are abusing that mechanism to export informat= > ion about the security context that gssd has established and feed that info= > rmation into the kernel implementation of the per-message processing routin= > es. At present, this necessarily entails knowing the details of the implem= > entation-specific opaque blob that is the "export sec context token", which= > is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get= > the information we want without breaking the abstraction barrier, such as = > via the gss_krb5_export_lucid_sec_context() API, we are in a more robust po= > sture overall and somewhat future-proofed against future evolution by MIT k= > rb5. > > > >> > (I note that recent Heimdal versions seem to also expose a gss_krb= > 5_export_lucid_sec_context() API, so part of the problem is just that the H= > eimdal in base is so old.) > > > >> > > > >> Well, here's some "not so good" news... > > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with the = > oid > > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > > >> It kept failing. > > > >> The problem seems to be that "gctx->proto =3D=3D 4" in make_external= > _lucid_ctx_v1() > > > >> function. This function only knows about the 0 and 1 setting for gct= > x->proto. > > > >> > > > >> Any ideas, rick > > > >> > > > > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is= > ever expected; it looks like it's supposed to just be 0 (for the legacy RF= > C 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence = > numbers for message-protection formats, etc.). So maybe it's worth posting= > your current WIP somewhere to take a closer look at what's going on. > > > > > > Yea, the debugging I did was flawed (I probably got the wrong offset > > > in the structure). > > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, ctx= > , > > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > > works and gives me the key and encryption type. > > > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes f= > rom the > > > string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no data= > and > > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same > > > weird error.) > > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_cont= > ext() > > returns GSS_S_BAD_MECH. Looking at the src, that error has to be fro= > m > > gss_inquire_sec_context_by_oid(). So, same function fails, but a dif= > ferent > > error return? > > > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context(), > > but I've also tried the Kerberos 9 byte OID (both work, in the sense that > > gss_init_sec_context() seems to work, except that the actual_mech_type > > returned by it has a bogus pointer in the reply). > > --> It looks like the "mech_type" field of "ctx" is busted, for some reas= > on? > > > > I'm going to try building krb5 from ports and linking to that, to see if = > it > > does the same thing. > Finally some good news... > All I did was "pkg install krb5" and then linked the gssd to the libraries = > in > /usr/local/lib and it worked!! I will double check the generated gssapi.h from its .et files in krb5/lib/gssapi/generic. > > Now I can test/debug the changes. > > Btw, the stuff in /usr/local/include/gssapi are correct and not messed up > like the stuff in /usr/include/gssapi. (The ones in /usr/local/include defi= > ne > GSS_DLLIMP for example.) This is generated from one of the .et files. > > I'm going to leave figuring out why the libraries in /usr/lib are messed up > to someone else. > > rick > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Thu Jul 31 15:28:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btCdf5GgDz63xNc; Thu, 31 Jul 2025 15:28:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btCdd6j45z3LwX; Thu, 31 Jul 2025 15:28:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id hQJru1aKq5MqyhVCPuTmHN; Thu, 31 Jul 2025 15:28:05 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id hVCNuUfJwWbOahVCOucM1j; Thu, 31 Jul 2025 15:28:05 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=Q5lx4J2a c=1 sm=1 tr=0 ts=688b8b85 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=hEh3JUyyAAAA:8 a=zdPUvaFGAAAA:8 a=04oDvr9pAAAA:8 a=YxBL1-UpAAAA:8 a=gxyqz0aHM-HxaGc6Q_gA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=fvD0gfNcX4AKPV7IvcuC:22 a=sT4bYkpex2i6d5iwGOJT:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 200D8116; Thu, 31 Jul 2025 08:28:03 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 19F9ACD; Thu, 31 Jul 2025 08:28:03 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Rick Macklem cc: Benjamin Kaduk , Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default In-reply-to: References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> Comments: In-reply-to Rick Macklem message dated "Thu, 31 Jul 2025 07:18:59 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 31 Jul 2025 08:28:03 -0700 Message-Id: <20250731152803.19F9ACD@slippy.cwsent.com> X-CMAE-Envelope: MS4xfAqoOODN1G1IQOYZaR4ct73C+PU4fGMOgwoDp1fCczA5K9veBPmKoYjhFzovCy2P+dbO6idamhaq/EJU79sst5CfJOvs/t5pA2/nYyQ5Mg8jVu126EqX CGdakt7Bz+k5nBxcmi9KroJN4ZMAyjZHJzpVO+xFJIvUy4a0ZSAEusdQ5Yzq9wbAbWUrcXB/Ycnp+c86/iaAy2PEawkQ1HGmKt4VhgEVLFBcER2Yzia4b2M0 rEsQy+Dr02JYX4qxqQ8m7XHC4SeMl7N1EluWYShPZtE7xU7Eh7AbA5k70PcWgfnnmmeoGaX07sZ9NHCh32Wup1o+Mk4zo+ogSBs/nGaNbPHzPYi67LWxygUl vnT9jFvFEeo/ozI7lc+CA4HEOtaBN/Vb5nVs3CvNwY/y3I+okp8mHXpbP3/MdMPRMFy8/0nfV9UJOlT/Nje3StYE4VY58J8KKV2daiWbsU3xmQwO1bA= X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; MV_CASE(0.50)[]; RWL_MAILSPIKE_EXCELLENT(-0.40)[3.97.99.33:from]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[9]; R_DKIM_NA(0.00)[]; TAGGED_RCPT(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4btCdd6j45z3LwX X-Spamd-Bar: --- In message , Rick Macklem writes: > On Thu, Jul 31, 2025 at 6:51=E2=80=AFAM Rick Macklem m> wrote: > > > > On Thu, Jul 31, 2025 at 6:07=E2=80=AFAM Rick Macklem com> wrote: > > > > > > On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk om> wrote: > > > > > > > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem mail.com> wrote: > > > >> > > > >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk l.com> wrote: > > > >> > > > > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk ail.com> wrote: > > > >> >> > > > >> >> > > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context= > () API that does a lot of the work of getting useful bits out of an establi= > shed GSS security context. > > > >> >> > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > And a bit more context on what is going on here and why kgssapi ha= > s to care: > > > >> > The GSS-API (RFC 2743) is all about a way to "establish a security= > context" (i.e., do crypto negotiation, authentication, sometimes authoriza= > tion, etc.) between two entities, the initiator and the acceprot, and then = > exchanging protected messages between the two (which can be either encrypte= > d or just integrity protection tags for otherweise cleartext data); later e= > xtensions included the ability to produce identical PRF output on both part= > ies, etc.. The details are "mechanism-specific", and for this purpose we'r= > e exclusively talking about the krb5 mechanism. The steps to establish the= > security context are complicated and sometimes fiddly, and in the general = > case can require a large number of round-trips between the initiator and ac= > ceptor before the security context is established. The individual message-= > protection parts are comparatively simple and amendable to implementation i= > n the kernel for processing efficiency. > > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() and G= > SS_Import_sec_context(), that are designed essentially to pass information = > about an established security context from one process to another on the sa= > me machine (which are presumably using the same implementation and version = > of the implementation), so the contents of the exported blob are opaque and= > implementation-specific. We are abusing that mechanism to export informat= > ion about the security context that gssd has established and feed that info= > rmation into the kernel implementation of the per-message processing routin= > es. At present, this necessarily entails knowing the details of the implem= > entation-specific opaque blob that is the "export sec context token", which= > is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get= > the information we want without breaking the abstraction barrier, such as = > via the gss_krb5_export_lucid_sec_context() API, we are in a more robust po= > sture overall and somewhat future-proofed against future evolution by MIT k= > rb5. > > > >> > (I note that recent Heimdal versions seem to also expose a gss_krb= > 5_export_lucid_sec_context() API, so part of the problem is just that the H= > eimdal in base is so old.) > > > >> > > > >> Well, here's some "not so good" news... > > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with the = > oid > > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > > >> It kept failing. > > > >> The problem seems to be that "gctx->proto =3D=3D 4" in make_external= > _lucid_ctx_v1() > > > >> function. This function only knows about the 0 and 1 setting for gct= > x->proto. > > > >> > > > >> Any ideas, rick > > > >> > > > > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is= > ever expected; it looks like it's supposed to just be 0 (for the legacy RF= > C 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence = > numbers for message-protection formats, etc.). So maybe it's worth posting= > your current WIP somewhere to take a closer look at what's going on. > > > > > > Yea, the debugging I did was flawed (I probably got the wrong offset > > > in the structure). > > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, ctx= > , > > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > > works and gives me the key and encryption type. > > > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes f= > rom the > > > string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no data= > and > > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same > > > weird error.) > > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_cont= > ext() > > returns GSS_S_BAD_MECH. Looking at the src, that error has to be fro= > m > > gss_inquire_sec_context_by_oid(). So, same function fails, but a dif= > ferent > > error return? > > > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context(), > > but I've also tried the Kerberos 9 byte OID (both work, in the sense that > > gss_init_sec_context() seems to work, except that the actual_mech_type > > returned by it has a bogus pointer in the reply). > > --> It looks like the "mech_type" field of "ctx" is busted, for some reas= > on? > > > > I'm going to try building krb5 from ports and linking to that, to see if = > it > > does the same thing. > Finally some good news... > All I did was "pkg install krb5" and then linked the gssd to the libraries = > in > /usr/local/lib and it worked!! gssapi/gssapi.h from krb5/lib/gssapi/generic is overwritten by our lib/libgssapi. As we have two the MIT gssapi.h is put in /usr/include/gssapi_krb5/gssapi.h. This patch should fix the problem. I haven't tested this yet. diff --git a/usr.sbin/gssd/Makefile b/usr.sbin/gssd/Makefile index 569e2c7e18f5..4c9d342c48c3 100644 --- a/usr.sbin/gssd/Makefile +++ b/usr.sbin/gssd/Makefile @@ -14,7 +14,7 @@ LIBADD= gssapi .if ${MK_MITKRB5} != "no" # MIT KRB5 LIBADD+= krb5 k5crypto krb5profile krb5support -CFLAGS+= -DMK_MITKRB5=yes +CFLAGS+= -DMK_MITKRB5=yes -Iinclude/gssapi_krb5 .else # Heimdal LIBADD+= krb5 roken > > Now I can test/debug the changes. > > Btw, the stuff in /usr/local/include/gssapi are correct and not messed up > like the stuff in /usr/include/gssapi. (The ones in /usr/local/include defi= > ne > GSS_DLLIMP for example.) > > I'm going to leave figuring out why the libraries in /usr/lib are messed up > to someone else. > > rick > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Thu Jul 31 15:28:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btCfF2nD6z63xmL; Thu, 31 Jul 2025 15:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btCfF0MWRz3MTw; Thu, 31 Jul 2025 15:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753975717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cnKi91Er0TVWoI7II4XdVEkjrOzWkKKX00MfVDoTNVU=; b=eRBXAe6Ioff+U0RU6D7qAPH0DKVrPf2yX+Qp4QGWxgC37F84IIy4zDCZVwr55i8RUxJfCN a7o8/WwQjCav1yg7imSV8BLnnha2AFUfDlWfPVU1/Q54jSdMkAfaxkLqiwYAcyFqAXzd8Y KKulmUYbRtKWjhSZuct4i0ia42Nn9hjhUUvNQ49cojQTrkx7SKq0XxC22ILxCx8PYm7NMP pMhx79GnFyrMSXF4se6bk56XH2fXMqKbWgRNYpIHEAwVS8jGRAISO6EFlTJbGk0jW5TsuG xLp+4ftNBBBz83RXyV/XsJBnFl31bb1ANndWQ8NJdCpYXvUfp3erIrEVQVAp3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753975717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cnKi91Er0TVWoI7II4XdVEkjrOzWkKKX00MfVDoTNVU=; b=GQoCVIUbA09XZfwJcC430fFsQo0zfHz3/xLuzPZjP6wRbiA2bSaV3ut11o+uHvAegw8EKA W91IStrTGmP5zl9YeylqZicP0mTygxajgyLXNpAWlxE6CvL6jRRR03168CXe2NzS9FNbvc vfNeWKKlCD5SOM8X8t6YQvhAfF5C3UEsNYPDykZ7yKxiap0YnS7EXW420SEXV9HE+N4tZj t3ivFYqmXl9PR9gGwmMW0uq7vyXStZbmqdaUYKzDDgVeQcN/3RgGvi61Iicg9ZViQlnUwJ UizbQ2295TKBnRGzV42uWeXcgXGeozg2+MntAz3DpJLCJITpqYRal3Yu573MgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753975717; a=rsa-sha256; cv=none; b=fP25/4txZVomerFktAgtBb7WZmGs9q48yoAA3HJnFGcCaE6ouxoiwcPu7afXLzhMj2UtsI Y5mJfvSgB6ztdZBzGlh5863wXTQeY7Rl6wu3l+LENpRY0CSYNOOjBvzU7r5WdKnavfPXq2 cBYR0xU1YAPu+AAERdnTB5nA9JlmC3Ik4FHVwYpH5CmojSjL8ZEhSg/kP8dys1NN4WEV6x 4tEdOUH8RS3NA97U8lMdFiJxp1IWmkSSW17gDZOc9AWybPlDAWyDOKPAth1e57wLATnEdS dWN8FAUAxv6+m8GPgIXIC5l/unWg3Y386JNNJ6P/yA97ibLB2gdZJ0LDGY9t3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btCfD4Hprz16Lm; Thu, 31 Jul 2025 15:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VFSaYg070729; Thu, 31 Jul 2025 15:28:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VFSaxN070726; Thu, 31 Jul 2025 15:28:36 GMT (envelope-from git) Date: Thu, 31 Jul 2025 15:28:36 GMT Message-Id: <202507311528.56VFSaxN070726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 3a686b851f8f - main - dbm_nextkey: Always return an error if we've reached the end of the database List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a686b851f8fda625010859d210c8a5615ea93fc Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=3a686b851f8fda625010859d210c8a5615ea93fc commit 3a686b851f8fda625010859d210c8a5615ea93fc Author: Bojan Novković AuthorDate: 2025-07-30 14:39:54 +0000 Commit: Bojan Novković CommitDate: 2025-07-31 15:27:24 +0000 dbm_nextkey: Always return an error if we've reached the end of the database POSIX.1 states that `dbm_nextkey` must return an invalid key (i.e., `key.dptr == NULL`) after the end of the database was reached. The current implementation of `hash_seq` will incorrectly restart the key sequence after the end of the database is reached. Fix this by checking the "current bucket" index when R_NEXT is passed. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51635 Reviewed by: markj --- lib/libc/db/hash/hash.c | 6 ++-- lib/libc/tests/db/Makefile | 1 + lib/libc/tests/db/dbm_nextkey_test.c | 53 ++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 1eb01ee0f0c5..b1655fe63d55 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -704,17 +704,19 @@ hash_seq(const DB *dbp, DBT *key, DBT *data, u_int32_t flag) u_int16_t *bp, ndx; hashp = (HTAB *)dbp->internal; - if (flag && flag != R_FIRST && flag != R_NEXT) { + if (flag != R_FIRST || flag != R_NEXT) { hashp->error = errno = EINVAL; return (ERROR); } #ifdef HASH_STATISTICS hash_accesses++; #endif - if ((hashp->cbucket < 0) || (flag == R_FIRST)) { + if (flag == R_FIRST) { hashp->cbucket = 0; hashp->cndx = 1; hashp->cpage = NULL; + } else if (hashp->cbucket < 0) { /* R_NEXT */ + return (ABNORMAL); } next_bucket: for (bp = NULL; !bp || !bp[0]; ) { diff --git a/lib/libc/tests/db/Makefile b/lib/libc/tests/db/Makefile index cc181cc81160..771569183584 100644 --- a/lib/libc/tests/db/Makefile +++ b/lib/libc/tests/db/Makefile @@ -9,6 +9,7 @@ ${PACKAGE}FILES+= README ATF_TESTS_C+= dbm_open_test ATF_TESTS_C+= dbm_perm_test +ATF_TESTS_C+= dbm_nextkey_test NETBSD_ATF_TESTS_C+= db_hash_seq_test NETBSD_ATF_TESTS_SH+= db_test diff --git a/lib/libc/tests/db/dbm_nextkey_test.c b/lib/libc/tests/db/dbm_nextkey_test.c new file mode 100644 index 000000000000..67b745efb196 --- /dev/null +++ b/lib/libc/tests/db/dbm_nextkey_test.c @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2025 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include + +#include + +static const char *path = "tmp"; +static const char *dbname = "tmp.db"; + +ATF_TC(dbm_nextkey_test); +ATF_TC_HEAD(dbm_nextkey_test, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Check that dbm_nextkey always returns NULL after reaching the end of the database"); +} + +ATF_TC_BODY(dbm_nextkey_test, tc) +{ + DBM *db; + datum key, data; + + data.dptr = "bar"; + data.dsize = strlen("bar"); + key.dptr = "foo"; + key.dsize = strlen("foo"); + + db = dbm_open(path, O_RDWR | O_CREAT, 0755); + ATF_CHECK(db != NULL); + ATF_REQUIRE(atf_utils_file_exists(dbname)); + ATF_REQUIRE(dbm_store(db, key, data, DBM_INSERT) != -1); + + key = dbm_firstkey(db); + ATF_REQUIRE(key.dptr != NULL); + key = dbm_nextkey(db); + ATF_REQUIRE(key.dptr == NULL); + key = dbm_nextkey(db); + ATF_REQUIRE(key.dptr == NULL); + + dbm_close(db); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, dbm_nextkey_test); + + return (atf_no_error()); +} From nobody Thu Jul 31 15:36:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btCqs2mnjz63yMR; Thu, 31 Jul 2025 15:36:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btCqr6myYz3NNV; Thu, 31 Jul 2025 15:36:56 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id hUHHu1j1O5MqyhVKyuU5uN; Thu, 31 Jul 2025 15:36:56 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id hVKwuLGiBWX70hVKxuAgbl; Thu, 31 Jul 2025 15:36:56 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=d71WygjE c=1 sm=1 tr=0 ts=688b8d98 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=hEh3JUyyAAAA:8 a=zdPUvaFGAAAA:8 a=04oDvr9pAAAA:8 a=YxBL1-UpAAAA:8 a=ZRhIO9LHQHt9jLf1XWAA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=fvD0gfNcX4AKPV7IvcuC:22 a=sT4bYkpex2i6d5iwGOJT:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 385C612E; Thu, 31 Jul 2025 08:36:54 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 0E981194; Thu, 31 Jul 2025 08:36:54 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Rick Macklem cc: Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default In-reply-to: <20250731152803.19F9ACD@slippy.cwsent.com> References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 31 Jul 2025 08:28:03 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 31 Jul 2025 08:36:54 -0700 Message-Id: <20250731153654.0E981194@slippy.cwsent.com> X-CMAE-Envelope: MS4xfI9qZR6HJI2BT5IjCQGpqM+d4CibOEdzb6LI5h/p6yoyAUEMQDV9akUAznQ5Wszizu/Tdk4hpcLz2nxigaXnzA0zZayIYXqaGW1NL2T9MrZ2hw+ABu9i 0YDWVatHAsKbI1rvktCyma9m2K1FQtr/m2BMgJnyCuoqeCPB/tCn08ca6rfIpXP+TAZSFyl16E6kNagxv4He6c/nboOLMmqK/a7dSOjsnxyZXNBv5/mVC5c3 o36TU4xA6LdLA0ZCwsSwR47tCQKvnKzpKeRYsAevHOkLwXwCOgBcHko9hAQ3WjDN7gdh9+2dfj0WjnCmGtT2AJ2JKa2FTiDO6UjX9g77xF6p0enVhdA6NYSe lXatYhzzqHf86PbkHt6/bbfFYbWu5RGZsHqR0iSn5nfTQqpjC0SfB99hdNDGM1PghCM+ES2RnTpOcoKNjlx9hCyjwtMMcJSbC+RFOio6fFTNENGMB7Q= X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; MV_CASE(0.50)[]; RWL_MAILSPIKE_EXCELLENT(-0.40)[3.97.99.33:from]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[8]; R_DKIM_NA(0.00)[]; TAGGED_RCPT(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4btCqr6myYz3NNV X-Spamd-Bar: --- In message <20250731152803.19F9ACD@slippy.cwsent.com>, Cy Schubert writes: > In message om> > , Rick Macklem writes: > > On Thu, Jul 31, 2025 at 6:51=E2=80=AFAM Rick Macklem = > > m> wrote: > > > > > > On Thu, Jul 31, 2025 at 6:07=E2=80=AFAM Rick Macklem = > > com> wrote: > > > > > > > > On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk = > > om> wrote: > > > > > > > > > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem = > > mail.com> wrote: > > > > >> > > > > >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk = > > l.com> wrote: > > > > >> > > > > > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk = > > ail.com> wrote: > > > > >> >> > > > > >> >> > > > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context > = > > () API that does a lot of the work of getting useful bits out of an establi > = > > shed GSS security context. > > > > >> >> > > > > >> > > > > > >> > > > > > >> > > > > > >> > > > > > >> > And a bit more context on what is going on here and why kgssapi ha > = > > s to care: > > > > >> > The GSS-API (RFC 2743) is all about a way to "establish a security > = > > context" (i.e., do crypto negotiation, authentication, sometimes authoriza > = > > tion, etc.) between two entities, the initiator and the acceprot, and then > = > > exchanging protected messages between the two (which can be either encrypte > = > > d or just integrity protection tags for otherweise cleartext data); later e > = > > xtensions included the ability to produce identical PRF output on both part > = > > ies, etc.. The details are "mechanism-specific", and for this purpose we'r > = > > e exclusively talking about the krb5 mechanism. The steps to establish the > = > > security context are complicated and sometimes fiddly, and in the general > = > > case can require a large number of round-trips between the initiator and ac > = > > ceptor before the security context is established. The individual message- > = > > protection parts are comparatively simple and amendable to implementation i > = > > n the kernel for processing efficiency. > > > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() and G > = > > SS_Import_sec_context(), that are designed essentially to pass information > = > > about an established security context from one process to another on the sa > = > > me machine (which are presumably using the same implementation and version > = > > of the implementation), so the contents of the exported blob are opaque and > = > > implementation-specific. We are abusing that mechanism to export informat > = > > ion about the security context that gssd has established and feed that info > = > > rmation into the kernel implementation of the per-message processing routin > = > > es. At present, this necessarily entails knowing the details of the implem > = > > entation-specific opaque blob that is the "export sec context token", which > = > > is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get > = > > the information we want without breaking the abstraction barrier, such as > = > > via the gss_krb5_export_lucid_sec_context() API, we are in a more robust po > = > > sture overall and somewhat future-proofed against future evolution by MIT k > = > > rb5. > > > > >> > (I note that recent Heimdal versions seem to also expose a gss_krb > = > > 5_export_lucid_sec_context() API, so part of the problem is just that the H > = > > eimdal in base is so old.) > > > > >> > > > > >> Well, here's some "not so good" news... > > > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with the > = > > oid > > > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > > > >> It kept failing. > > > > >> The problem seems to be that "gctx->proto =3D=3D 4" in make_external > = > > _lucid_ctx_v1() > > > > >> function. This function only knows about the 0 and 1 setting for gct > = > > x->proto. > > > > >> > > > > >> Any ideas, rick > > > > >> > > > > > > > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is > = > > ever expected; it looks like it's supposed to just be 0 (for the legacy RF > = > > C 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence > = > > numbers for message-protection formats, etc.). So maybe it's worth posting > = > > your current WIP somewhere to take a closer look at what's going on. > > > > > > > > Yea, the debugging I did was flawed (I probably got the wrong offset > > > > in the structure). > > > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, ctx > = > > , > > > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > > > works and gives me the key and encryption type. > > > > > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes f > = > > rom the > > > > string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no data > = > > and > > > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same > > > > weird error.) > > > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_cont > = > > ext() > > > returns GSS_S_BAD_MECH. Looking at the src, that error has to be fro > = > > m > > > gss_inquire_sec_context_by_oid(). So, same function fails, but a dif > = > > ferent > > > error return? > > > > > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > > > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context(), > > > but I've also tried the Kerberos 9 byte OID (both work, in the sense that > > > gss_init_sec_context() seems to work, except that the actual_mech_type > > > returned by it has a bogus pointer in the reply). > > > --> It looks like the "mech_type" field of "ctx" is busted, for some reas > = > > on? > > > > > > I'm going to try building krb5 from ports and linking to that, to see if > = > > it > > > does the same thing. > > Finally some good news... > > All I did was "pkg install krb5" and then linked the gssd to the libraries > = > > in > > /usr/local/lib and it worked!! > > gssapi/gssapi.h from krb5/lib/gssapi/generic is overwritten by our > lib/libgssapi. As we have two the MIT gssapi.h is put in > /usr/include/gssapi_krb5/gssapi.h. > > This patch should fix the problem. I haven't tested this yet. > > diff --git a/usr.sbin/gssd/Makefile b/usr.sbin/gssd/Makefile > index 569e2c7e18f5..4c9d342c48c3 100644 > --- a/usr.sbin/gssd/Makefile > +++ b/usr.sbin/gssd/Makefile > @@ -14,7 +14,7 @@ LIBADD= gssapi > .if ${MK_MITKRB5} != "no" > # MIT KRB5 > LIBADD+= krb5 k5crypto krb5profile krb5support > -CFLAGS+= -DMK_MITKRB5=yes > +CFLAGS+= -DMK_MITKRB5=yes -Iinclude/gssapi_krb5 > .else > # Heimdal > LIBADD+= krb5 roken > > > > > > Now I can test/debug the changes. > > > > Btw, the stuff in /usr/local/include/gssapi are correct and not messed up > > like the stuff in /usr/include/gssapi. (The ones in /usr/local/include defi > = > > ne > > GSS_DLLIMP for example.) > > > > I'm going to leave figuring out why the libraries in /usr/lib are messed up > > to someone else. > > > > rick > > I had explained this to Lexi private moments ago. It's not that. gssapi.h is installed by lib/libgssapi, the gssapi forwarder. Heimdal had no gssapi.h whereas MIT KRB5 does. I put the MIT gssapi.h in /usr/include/gssapi_krb5 for apps that might need it. This was not a problem because Heimdal never had a gssapi.h while with MIT there is a conflict. Removing lib/libgssapi or its gssapi.h is not an option because it's a gssapi forwarder. This was the compromise I settled on. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Thu Jul 31 15:53:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btDBt3BLVz63ynW; Thu, 31 Jul 2025 15:53:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btDBs4DHCz3PpF; Thu, 31 Jul 2025 15:53:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.32 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id hQLNuRleQ9JM2hVauulqBt; Thu, 31 Jul 2025 15:53:24 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id hVatuLK5bWX70hVatuAiTD; Thu, 31 Jul 2025 15:53:24 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=d71WygjE c=1 sm=1 tr=0 ts=688b9174 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=hEh3JUyyAAAA:8 a=zdPUvaFGAAAA:8 a=04oDvr9pAAAA:8 a=YxBL1-UpAAAA:8 a=fCYruoz4OYhIH8cocRQA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=fvD0gfNcX4AKPV7IvcuC:22 a=sT4bYkpex2i6d5iwGOJT:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 9F4B41C6; Thu, 31 Jul 2025 08:53:22 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 6D194304; Thu, 31 Jul 2025 08:53:22 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Rick Macklem cc: Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default In-reply-to: <20250731152803.19F9ACD@slippy.cwsent.com> References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 31 Jul 2025 08:28:03 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 31 Jul 2025 08:53:22 -0700 Message-Id: <20250731155322.6D194304@slippy.cwsent.com> X-CMAE-Envelope: MS4xfAt/O1R5JnnHFrKSK4/3SUl+N7QmCfKc6yvGOrQyPOaPcZehrAjbwjDuY+eFtRXtOUOLGQY3wcn9RROcL7FdYOwsF1znqswZR5/HXICn3RLohKAPotQv txsCr+LXCCjyLGzMrFXSpV6E7Rpqq3G5p6CbJjO4wKqtLUfVs9NmD//ETq0h3vCDyjZsNZiQRlpbmQol0H9bpZKlbeN/qapaEPAyLO94MV1ZZe6kgUk7iriL J0heRT4+CqEkjUqmj9i1lu7kS+jRtXxSRywWSBVyN3LUMeYMPw6Ic0OalB4Uj2A9Gx/epsHxxh3AnGZkH7aX5q9M1NLf7VZkZK+jHlztJ/BSMlPZPDnI0sKx VTOFktkgiUGCTYmG7H5lUeJ1CVeKWydSAM5VZR9qESVrbqTCp9weUxZLPu1IiTZjkacu7m0o73eiTkRJ3sOPXgIZPmsIkzV9yVNMyr9jFf9L7Qpk+G0= X-Spamd-Result: default: False [-2.90 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.32:from]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[8]; R_DKIM_NA(0.00)[]; TAGGED_RCPT(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4btDBs4DHCz3PpF X-Spamd-Bar: -- In message <20250731152803.19F9ACD@slippy.cwsent.com>, Cy Schubert writes: > In message om> > , Rick Macklem writes: > > On Thu, Jul 31, 2025 at 6:51=E2=80=AFAM Rick Macklem = > > m> wrote: > > > > > > On Thu, Jul 31, 2025 at 6:07=E2=80=AFAM Rick Macklem = > > com> wrote: > > > > > > > > On Wed, Jul 30, 2025 at 9:24=E2=80=AFPM Benjamin Kaduk = > > om> wrote: > > > > > > > > > > On Wed, Jul 30, 2025 at 10:36=E2=80=AFAM Rick Macklem = > > mail.com> wrote: > > > > >> > > > > >> On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk = > > l.com> wrote: > > > > >> > > > > > >> > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk = > > ail.com> wrote: > > > > >> >> > > > > >> >> > > > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context > = > > () API that does a lot of the work of getting useful bits out of an establi > = > > shed GSS security context. > > > > >> >> > > > > >> > > > > > >> > > > > > >> > > > > > >> > > > > > >> > And a bit more context on what is going on here and why kgssapi ha > = > > s to care: > > > > >> > The GSS-API (RFC 2743) is all about a way to "establish a security > = > > context" (i.e., do crypto negotiation, authentication, sometimes authoriza > = > > tion, etc.) between two entities, the initiator and the acceprot, and then > = > > exchanging protected messages between the two (which can be either encrypte > = > > d or just integrity protection tags for otherweise cleartext data); later e > = > > xtensions included the ability to produce identical PRF output on both part > = > > ies, etc.. The details are "mechanism-specific", and for this purpose we'r > = > > e exclusively talking about the krb5 mechanism. The steps to establish the > = > > security context are complicated and sometimes fiddly, and in the general > = > > case can require a large number of round-trips between the initiator and ac > = > > ceptor before the security context is established. The individual message- > = > > protection parts are comparatively simple and amendable to implementation i > = > > n the kernel for processing efficiency. > > > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() and G > = > > SS_Import_sec_context(), that are designed essentially to pass information > = > > about an established security context from one process to another on the sa > = > > me machine (which are presumably using the same implementation and version > = > > of the implementation), so the contents of the exported blob are opaque and > = > > implementation-specific. We are abusing that mechanism to export informat > = > > ion about the security context that gssd has established and feed that info > = > > rmation into the kernel implementation of the per-message processing routin > = > > es. At present, this necessarily entails knowing the details of the implem > = > > entation-specific opaque blob that is the "export sec context token", which > = > > is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get > = > > the information we want without breaking the abstraction barrier, such as > = > > via the gss_krb5_export_lucid_sec_context() API, we are in a more robust po > = > > sture overall and somewhat future-proofed against future evolution by MIT k > = > > rb5. > > > > >> > (I note that recent Heimdal versions seem to also expose a gss_krb > = > > 5_export_lucid_sec_context() API, so part of the problem is just that the H > = > > eimdal in base is so old.) > > > > >> > > > > >> Well, here's some "not so good" news... > > > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with the > = > > oid > > > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > > > >> It kept failing. > > > > >> The problem seems to be that "gctx->proto =3D=3D 4" in make_external > = > > _lucid_ctx_v1() > > > > >> function. This function only knows about the 0 and 1 setting for gct > = > > x->proto. > > > > >> > > > > >> Any ideas, rick > > > > >> > > > > > > > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of 4 is > = > > ever expected; it looks like it's supposed to just be 0 (for the legacy RF > = > > C 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider sequence > = > > numbers for message-protection formats, etc.). So maybe it's worth posting > = > > your current WIP somewhere to take a closer look at what's going on. > > > > > > > > Yea, the debugging I did was flawed (I probably got the wrong offset > > > > in the structure). > > > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor, ctx > = > > , > > > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > > > works and gives me the key and encryption type. > > > > > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 bytes f > = > > rom the > > > > string + a 1 byte), it returns major =3D=3D GSS_S_COMPLETE, but no data > = > > and > > > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the same > > > > weird error.) > > > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_cont > = > > ext() > > > returns GSS_S_BAD_MECH. Looking at the src, that error has to be fro > = > > m > > > gss_inquire_sec_context_by_oid(). So, same function fails, but a dif > = > > ferent > > > error return? > > > > > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > > > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context(), > > > but I've also tried the Kerberos 9 byte OID (both work, in the sense that > > > gss_init_sec_context() seems to work, except that the actual_mech_type > > > returned by it has a bogus pointer in the reply). > > > --> It looks like the "mech_type" field of "ctx" is busted, for some reas > = > > on? > > > > > > I'm going to try building krb5 from ports and linking to that, to see if > = > > it > > > does the same thing. > > Finally some good news... > > All I did was "pkg install krb5" and then linked the gssd to the libraries > = > > in > > /usr/local/lib and it worked!! > > gssapi/gssapi.h from krb5/lib/gssapi/generic is overwritten by our > lib/libgssapi. As we have two the MIT gssapi.h is put in > /usr/include/gssapi_krb5/gssapi.h. > > This patch should fix the problem. I haven't tested this yet. > > diff --git a/usr.sbin/gssd/Makefile b/usr.sbin/gssd/Makefile > index 569e2c7e18f5..4c9d342c48c3 100644 > --- a/usr.sbin/gssd/Makefile > +++ b/usr.sbin/gssd/Makefile > @@ -14,7 +14,7 @@ LIBADD= gssapi > .if ${MK_MITKRB5} != "no" > # MIT KRB5 > LIBADD+= krb5 k5crypto krb5profile krb5support > -CFLAGS+= -DMK_MITKRB5=yes > +CFLAGS+= -DMK_MITKRB5=yes -Iinclude/gssapi_krb5 > .else > # Heimdal > LIBADD+= krb5 roken This patch is incorrect. The following patch is correct. diff --git a/usr.sbin/gssd/gssd.c b/usr.sbin/gssd/gssd.c index 94eb6ca575c8..c6dda8fa37b5 100644 --- a/usr.sbin/gssd/gssd.c +++ b/usr.sbin/gssd/gssd.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include > > > > > > Now I can test/debug the changes. > > > > Btw, the stuff in /usr/local/include/gssapi are correct and not messed up > > like the stuff in /usr/include/gssapi. (The ones in /usr/local/include defi > = > > ne > > GSS_DLLIMP for example.) > > > > I'm going to leave figuring out why the libraries in /usr/lib are messed up > > to someone else. > > > > rick > > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Thu Jul 31 15:53:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btDC44XSPz63ysv; Thu, 31 Jul 2025 15:53:36 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btDC40t16z3Q62; Thu, 31 Jul 2025 15:53:36 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-615a115f0c0so1034449a12.0; Thu, 31 Jul 2025 08:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753977209; x=1754582009; 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=qGdXSB5NbUeUkvbQFXm8nUdxOTaQw8yjpc3xdmNPEPE=; b=EmP1x4p/k/l55XnAchSDzL/XqAclKHw44AOuKVsOrekzb5LGKIrZiinhymmhs1dZNc zTD9BEE5tlgpQt0VmKE7Cy+3oyuCnS0IcEbk4UCukzGEqGwIAXLyIif497ZflsLAVoBy d/5wkLYgncaiSPKs2uNFU6v1T0QxI9dyNAzy5vORhv5aEHKkcH5Df/ha++F9PvrtZGBv 6sIXZBUh7RHqBHhkidJDDfVUYyY3PabMKZVisgyb0EVdYkGI+T/SqxDgIsPpKCE6f9da HR1lJflheThZ188gp5uW1b/62Tbr268EIUGPdFKtuOKlWyZxHXW2wpG5BWy+gNgWAKSL owcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753977209; x=1754582009; 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=qGdXSB5NbUeUkvbQFXm8nUdxOTaQw8yjpc3xdmNPEPE=; b=nEKNTHqLLx7gfAXy55goTsT31aJ2IaE3d0BYCfn+6d0Q0KAPaf2qIMTZhMVTVEll76 TRdQf2+mdLJc1dPXU4O6uwSoZIP1zJoH5XpyivqY1yeLgXLiH1ZtGd9mqwf8+b9w1Nvo hiI6K4JPeUuciXMqPKICxicpeViLp6JfT8aWDxExfom4/vZiBzBavqYIK4R9X3RNPSI8 2WVgDdgHH8kbi6szoaoMv8eyab4dR06sTx4kUMau02N8P0viMdaySnGzsk0d7ZyhNXOY moclFNJQfUYH0j5F8rTv7UsUkcXgVZSGJCtsPuVgY9UG+m63yY4cwZtKGMqbpbh7J1cm W/7g== X-Forwarded-Encrypted: i=1; AJvYcCUDtC9u2z0SMVU7GLeSh6h3GKhKmMmwK3KIwP31EEDJXLtdHDqkr3DunrscmjElo/RtTL3JxMXL@freebsd.org, AJvYcCUVg+tsxiwJflPSbr7R2Kk70L+vvaLd7MduAXAFs22lUCZxoh4MkBYPyawsTX0ITS7KY9P2+hkJBR8ONB8B3BQDzbR/og==@freebsd.org, AJvYcCV7KxgIxuosFRN27vCPECQe6hTys8h6dB7YbHt4PY6h/GbppI4QdxZSaGiW5uQ5C5JtAeZmcIr/33sHPZ6T/PXiZ1wI88g=@freebsd.org, AJvYcCVKCkVI7t+FsP9qxzAYNGu5t7DAWZNAZd+5yiRuE9E0uf0haKuf+XCRI7Sbh31Fc8fY+w==@freebsd.org, AJvYcCXvuLGRRZUTMnuG/EVH0Uhx5qMjYTpo2LY4YYlWIabZuTQ8JKiMAfE8zy/qVhPph2NfT96e7yFhnoustIJzJB4=@freebsd.org X-Gm-Message-State: AOJu0Yzd6NGpdKawF20BRa9ugAMr95GidvEPu8KqyMmFd+GDSPbaG9eZ 7o6kPUV4AQfTuTgnsNbgETgHI5kLLzIVVRDpmzw3z4nREwB+XUK85J2P3ibMu9MvXvdO8iY7vcE 2NhT8Mo547XRy7njPzgQOJ5Lu4tA3oA== X-Gm-Gg: ASbGncuNtHsRpAm5NCd4wO9Rq+vFvRX9YPKh8iMGYFXAHKNplaBhptXa8azfAPXXAtn h3rMpW72+Lgh9+upsF8/lKivOyNDpNzhntIrWJqByprWJ1jExc7CRgygBEQ9317rlcV/a5pgJnW uPFyZ128XK/50Z0PVuCMpBKZFHvQWnYGZhbhEcopURxlWY9jyPTsVE9qb75Ew99AIGRgQq+PcsH fHdSxe5fKtU9ziKbgHuGI370phlu9sS27YjnEE= X-Google-Smtp-Source: AGHT+IGNoXZOJqcSe8v8y1fPRM0cxC6wiW6gHK2Ww0mRwkx511k+JO2XAarI+r6TDEVCiRGMsKz5C/iF7TD17d5zrRk= X-Received: by 2002:a05:6402:2106:b0:615:9b4e:7b93 with SMTP id 4fb4d7f45d1cf-6159b4e8017mr5627604a12.30.1753977208933; Thu, 31 Jul 2025 08:53:28 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> In-Reply-To: <20250731152803.19F9ACD@slippy.cwsent.com> From: Rick Macklem Date: Thu, 31 Jul 2025 08:53:16 -0700 X-Gm-Features: Ac12FXxpc-_GZUSZMOceOK8275ryTaZqVoskwgv1WXFG52InmZj2GlSGKvJEq-w Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Cy Schubert Cc: Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4btDC40t16z3Q62 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Thu, Jul 31, 2025 at 8:28=E2=80=AFAM Cy Schubert wrote: > > In message om> > , Rick Macklem writes: > > On Thu, Jul 31, 2025 at 6:51=3DE2=3D80=3DAFAM Rick Macklem > m> wrote: > > > > > > On Thu, Jul 31, 2025 at 6:07=3DE2=3D80=3DAFAM Rick Macklem > com> wrote: > > > > > > > > On Wed, Jul 30, 2025 at 9:24=3DE2=3D80=3DAFPM Benjamin Kaduk > om> wrote: > > > > > > > > > > On Wed, Jul 30, 2025 at 10:36=3DE2=3D80=3DAFAM Rick Macklem > mail.com> wrote: > > > > >> > > > > >> On Mon, Jul 28, 2025 at 3:32=3DE2=3D80=3DAFPM Benjamin Kaduk > l.com> wrote: > > > > >> > > > > > >> > On Mon, Jul 28, 2025 at 3:04=3DE2=3D80=3DAFPM Benjamin Kaduk <= bjkfbsd@gm=3D > > ail.com> wrote: > > > > >> >> > > > > >> >> > > > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_con= text=3D > > () API that does a lot of the work of getting useful bits out of an est= abli=3D > > shed GSS security context. > > > > >> >> > > > > >> > > > > > >> > > > > > >> > > > > > >> > > > > > >> > And a bit more context on what is going on here and why kgssap= i ha=3D > > s to care: > > > > >> > The GSS-API (RFC 2743) is all about a way to "establish a secu= rity=3D > > context" (i.e., do crypto negotiation, authentication, sometimes autho= riza=3D > > tion, etc.) between two entities, the initiator and the acceprot, and t= hen =3D > > exchanging protected messages between the two (which can be either encr= ypte=3D > > d or just integrity protection tags for otherweise cleartext data); lat= er e=3D > > xtensions included the ability to produce identical PRF output on both = part=3D > > ies, etc.. The details are "mechanism-specific", and for this purpose = we'r=3D > > e exclusively talking about the krb5 mechanism. The steps to establish= the=3D > > security context are complicated and sometimes fiddly, and in the gene= ral =3D > > case can require a large number of round-trips between the initiator an= d ac=3D > > ceptor before the security context is established. The individual mess= age-=3D > > protection parts are comparatively simple and amendable to implementati= on i=3D > > n the kernel for processing efficiency. > > > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() a= nd G=3D > > SS_Import_sec_context(), that are designed essentially to pass informat= ion =3D > > about an established security context from one process to another on th= e sa=3D > > me machine (which are presumably using the same implementation and vers= ion =3D > > of the implementation), so the contents of the exported blob are opaque= and=3D > > implementation-specific. We are abusing that mechanism to export info= rmat=3D > > ion about the security context that gssd has established and feed that = info=3D > > rmation into the kernel implementation of the per-message processing ro= utin=3D > > es. At present, this necessarily entails knowing the details of the im= plem=3D > > entation-specific opaque blob that is the "export sec context token", w= hich=3D > > is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can= get=3D > > the information we want without breaking the abstraction barrier, such= as =3D > > via the gss_krb5_export_lucid_sec_context() API, we are in a more robus= t po=3D > > sture overall and somewhat future-proofed against future evolution by M= IT k=3D > > rb5. > > > > >> > (I note that recent Heimdal versions seem to also expose a gss= _krb=3D > > 5_export_lucid_sec_context() API, so part of the problem is just that t= he H=3D > > eimdal in base is so old.) > > > > >> > > > > >> Well, here's some "not so good" news... > > > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with = the =3D > > oid > > > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > > > >> It kept failing. > > > > >> The problem seems to be that "gctx->proto =3D3D=3D3D 4" in make_= external=3D > > _lucid_ctx_v1() > > > > >> function. This function only knows about the 0 and 1 setting for= gct=3D > > x->proto. > > > > >> > > > > >> Any ideas, rick > > > > >> > > > > > > > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of = 4 is=3D > > ever expected; it looks like it's supposed to just be 0 (for the legac= y RF=3D > > C 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider seque= nce =3D > > numbers for message-protection formats, etc.). So maybe it's worth pos= ting=3D > > your current WIP somewhere to take a closer look at what's going on. > > > > > > > > Yea, the debugging I did was flawed (I probably got the wrong offse= t > > > > in the structure). > > > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor,= ctx=3D > > , > > > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > > > works and gives me the key and encryption type. > > > > > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 byt= es f=3D > > rom the > > > > string + a 1 byte), it returns major =3D3D=3D3D GSS_S_COMPLETE, but= no data=3D > > and > > > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the sa= me > > > > weird error.) > > > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_= cont=3D > > ext() > > > returns GSS_S_BAD_MECH. Looking at the src, that error has to be= fro=3D > > m > > > gss_inquire_sec_context_by_oid(). So, same function fails, but a= dif=3D > > ferent > > > error return? > > > > > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > > > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context()= , > > > but I've also tried the Kerberos 9 byte OID (both work, in the sense = that > > > gss_init_sec_context() seems to work, except that the actual_mech_typ= e > > > returned by it has a bogus pointer in the reply). > > > --> It looks like the "mech_type" field of "ctx" is busted, for some = reas=3D > > on? > > > > > > I'm going to try building krb5 from ports and linking to that, to see= if =3D > > it > > > does the same thing. > > Finally some good news... > > All I did was "pkg install krb5" and then linked the gssd to the librar= ies =3D > > in > > /usr/local/lib and it worked!! > > gssapi/gssapi.h from krb5/lib/gssapi/generic is overwritten by our > lib/libgssapi. As we have two the MIT gssapi.h is put in > /usr/include/gssapi_krb5/gssapi.h. > > This patch should fix the problem. I haven't tested this yet. > > diff --git a/usr.sbin/gssd/Makefile b/usr.sbin/gssd/Makefile > index 569e2c7e18f5..4c9d342c48c3 100644 > --- a/usr.sbin/gssd/Makefile > +++ b/usr.sbin/gssd/Makefile > @@ -14,7 +14,7 @@ LIBADD=3D gssapi > .if ${MK_MITKRB5} !=3D "no" > # MIT KRB5 > LIBADD+=3D krb5 k5crypto krb5profile krb5support > -CFLAGS+=3D -DMK_MITKRB5=3Dyes > +CFLAGS+=3D -DMK_MITKRB5=3Dyes -Iinclude/gssapi_krb5 > .else > # Heimdal > LIBADD+=3D krb5 roken Just to be clear to everyone, this might allow it to be built after being patched for MIT, but it does not fix it so that it works. I will be debugging the patches that makes it works later to-day. You state that Heimdal didn't have a gssapi.h, but it does and it has always been included in gssd.c. (It was the other ones like gssapi_krb5.h, which needs the MIT gssapi.h.) rick > > > > > > Now I can test/debug the changes. > > > > Btw, the stuff in /usr/local/include/gssapi are correct and not messed = up > > like the stuff in /usr/include/gssapi. (The ones in /usr/local/include = defi=3D > > ne > > GSS_DLLIMP for example.) > > > > I'm going to leave figuring out why the libraries in /usr/lib are messe= d up > > to someone else. > > > > rick > > > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e**(i*pi)+1=3D0 > > From nobody Thu Jul 31 16:06:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btDTz1jKbz640Rd; Thu, 31 Jul 2025 16:06:31 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btDTy3ptPz3RTP; Thu, 31 Jul 2025 16:06:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id hSZPu1eTi5MqyhVnZuV7eR; Thu, 31 Jul 2025 16:06:29 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id hVnYuXLcvJhBPhVnYuz0QG; Thu, 31 Jul 2025 16:06:29 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=688b9485 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=Wb1JkmetP80A:10 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=hEh3JUyyAAAA:8 a=zdPUvaFGAAAA:8 a=04oDvr9pAAAA:8 a=YxBL1-UpAAAA:8 a=icwiH-l0Uum8cQ8DvP4A:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=fvD0gfNcX4AKPV7IvcuC:22 a=sT4bYkpex2i6d5iwGOJT:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 9430F1E9; Thu, 31 Jul 2025 09:06:27 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 8E164214; Thu, 31 Jul 2025 09:06:27 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Rick Macklem cc: Cy Schubert , Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default In-reply-to: References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> Comments: In-reply-to Rick Macklem message dated "Thu, 31 Jul 2025 08:53:16 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 31 Jul 2025 09:06:27 -0700 Message-Id: <20250731160627.8E164214@slippy.cwsent.com> X-CMAE-Envelope: MS4xfMpQhcnq6x/Ld7dmJ/lrT8SYlSC8Dap4XXbvGWVZDpViKNgrTYHqSFys3vJhivwugYJVfIFkbPoaN3gu+++z3cd6HGx970sCMhUGiNyd2NtjLdYqK5bX nBCOC7cfe+6WuZzOWUUcgDQE3cK/tjd6FBGjDIUm9C+vAvpAbVdkFc9JTyE51gwm49cgXbey/htpT8o9aMNt3pjiwHNi3M2I/I9Rbg15VPt7N97t6Uxtpcuf 0t8SKtST9gjFM4B5A5QZc0LCgqbCWRQzQOOX44Vr0Aol97OTUJsyZMxJrevaenepZBT8bpHfnDugiuvR02UuLulksd3QWysx0df6QUpMcG30X9H4L4wKl1v8 9u/hOyTVVbxbuDghyxE4atO1WYYChplwuS+2u9T+urBcf3CkNF9+8HB//vlV3mPtjvFoCYe/s2nBDwyQutndsmp/8Zd/nWEYs+L3ty7vy83yPEFIoOk= X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; MV_CASE(0.50)[]; RWL_MAILSPIKE_EXCELLENT(-0.40)[3.97.99.33:from]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_CC(0.00)[cschubert.com,gmail.com,freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_SEVEN(0.00)[9]; R_DKIM_NA(0.00)[]; TAGGED_RCPT(0.00)[]; REPLYTO_EQ_FROM(0.00)[] X-Rspamd-Queue-Id: 4btDTy3ptPz3RTP X-Spamd-Bar: --- In message , Rick Macklem writes: > On Thu, Jul 31, 2025 at 8:28=E2=80=AFAM Cy Schubert com> wrote: > > > > In message ail.c > > om> > > , Rick Macklem writes: > > > On Thu, Jul 31, 2025 at 6:51=3DE2=3D80=3DAFAM Rick Macklem m@gmail.co=3D > > > m> wrote: > > > > > > > > On Thu, Jul 31, 2025 at 6:07=3DE2=3D80=3DAFAM Rick Macklem lem@gmail.=3D > > > com> wrote: > > > > > > > > > > On Wed, Jul 30, 2025 at 9:24=3DE2=3D80=3DAFPM Benjamin Kaduk sd@gmail.c=3D > > > om> wrote: > > > > > > > > > > > > On Wed, Jul 30, 2025 at 10:36=3DE2=3D80=3DAFAM Rick Macklem .macklem@g=3D > > > mail.com> wrote: > > > > > >> > > > > > >> On Mon, Jul 28, 2025 at 3:32=3DE2=3D80=3DAFPM Benjamin Kaduk kfbsd@gmai=3D > > > l.com> wrote: > > > > > >> > > > > > > >> > On Mon, Jul 28, 2025 at 3:04=3DE2=3D80=3DAFPM Benjamin Kaduk <= > bjkfbsd@gm=3D > > > ail.com> wrote: > > > > > >> >> > > > > > >> >> > > > > > >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_con= > text=3D > > > () API that does a lot of the work of getting useful bits out of an est= > abli=3D > > > shed GSS security context. > > > > > >> >> > > > > > >> > > > > > > >> > > > > > > >> > > > > > > >> > > > > > > >> > And a bit more context on what is going on here and why kgssap= > i ha=3D > > > s to care: > > > > > >> > The GSS-API (RFC 2743) is all about a way to "establish a secu= > rity=3D > > > context" (i.e., do crypto negotiation, authentication, sometimes autho= > riza=3D > > > tion, etc.) between two entities, the initiator and the acceprot, and t= > hen =3D > > > exchanging protected messages between the two (which can be either encr= > ypte=3D > > > d or just integrity protection tags for otherweise cleartext data); lat= > er e=3D > > > xtensions included the ability to produce identical PRF output on both = > part=3D > > > ies, etc.. The details are "mechanism-specific", and for this purpose = > we'r=3D > > > e exclusively talking about the krb5 mechanism. The steps to establish= > the=3D > > > security context are complicated and sometimes fiddly, and in the gene= > ral =3D > > > case can require a large number of round-trips between the initiator an= > d ac=3D > > > ceptor before the security context is established. The individual mess= > age-=3D > > > protection parts are comparatively simple and amendable to implementati= > on i=3D > > > n the kernel for processing efficiency. > > > > > >> > RFC 2743 also defines functions for GSS_Export_sec_context() a= > nd G=3D > > > SS_Import_sec_context(), that are designed essentially to pass informat= > ion =3D > > > about an established security context from one process to another on th= > e sa=3D > > > me machine (which are presumably using the same implementation and vers= > ion =3D > > > of the implementation), so the contents of the exported blob are opaque= > and=3D > > > implementation-specific. We are abusing that mechanism to export info= > rmat=3D > > > ion about the security context that gssd has established and feed that = > info=3D > > > rmation into the kernel implementation of the per-message processing ro= > utin=3D > > > es. At present, this necessarily entails knowing the details of the im= > plem=3D > > > entation-specific opaque blob that is the "export sec context token", w= > hich=3D > > > is what the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can= > get=3D > > > the information we want without breaking the abstraction barrier, such= > as =3D > > > via the gss_krb5_export_lucid_sec_context() API, we are in a more robus= > t po=3D > > > sture overall and somewhat future-proofed against future evolution by M= > IT k=3D > > > rb5. > > > > > >> > (I note that recent Heimdal versions seem to also expose a gss= > _krb=3D > > > 5_export_lucid_sec_context() API, so part of the problem is just that t= > he H=3D > > > eimdal in base is so old.) > > > > > >> > > > > > >> Well, here's some "not so good" news... > > > > > >> I've been trying to use gss_inquire_sec_context_by_oid(..) with = > the =3D > > > oid > > > > > >> for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. > > > > > >> It kept failing. > > > > > >> The problem seems to be that "gctx->proto =3D3D=3D3D 4" in make_= > external=3D > > > _lucid_ctx_v1() > > > > > >> function. This function only knows about the 0 and 1 setting for= > gct=3D > > > x->proto. > > > > > >> > > > > > >> Any ideas, rick > > > > > >> > > > > > > > > > > > > > > > > > > I'm not seeing anything to suggest that a "gctx->proto" value of = > 4 is=3D > > > ever expected; it looks like it's supposed to just be 0 (for the legac= > y RF=3D > > > C 1964 format) or 1 (for the "CFX" format of RFC 4121, with wider seque= > nce =3D > > > numbers for message-protection formats, etc.). So maybe it's worth pos= > ting=3D > > > your current WIP somewhere to take a closer look at what's going on. > > > > > > > > > > Yea, the debugging I did was flawed (I probably got the wrong offse= > t > > > > > in the structure). > > > > > It is weird, though. If I do gss_inquire_sec_context_by_oid(&minor,= > ctx=3D > > > , > > > > > OID_FOR_GSS_INQUIRE_SSPI_SESSION_KEY, &key), it > > > > > works and gives me the key and encryption type. > > > > > > > > > > If I do the same, but with the 12 byte OID for LUCID v1 (the 11 byt= > es f=3D > > > rom the > > > > > string + a 1 byte), it returns major =3D3D=3D3D GSS_S_COMPLETE, but= > no data=3D > > > and > > > > > a weird 39756046(decimal) or 0x25ea10e(hex) minor. > > > > > (Oh, and I tried gss_krb5_export_lucid_sec_context() and got the sa= > me > > > > > weird error.) > > > > --> Now (after doing a "make buildworld"), gss_krb5_export_lucid_sec_= > cont=3D > > > ext() > > > > returns GSS_S_BAD_MECH. Looking at the src, that error has to be= > fro=3D > > > m > > > > gss_inquire_sec_context_by_oid(). So, same function fails, but a= > dif=3D > > > ferent > > > > error return? > > > > > > > > It looks like "gssint_get_mechanism (ctx->mech_type)" is failing. > > > > I'm currently just passing GSS_C_NULL_OID into gss_init_sec_context()= > , > > > > but I've also tried the Kerberos 9 byte OID (both work, in the sense = > that > > > > gss_init_sec_context() seems to work, except that the actual_mech_typ= > e > > > > returned by it has a bogus pointer in the reply). > > > > --> It looks like the "mech_type" field of "ctx" is busted, for some = > reas=3D > > > on? > > > > > > > > I'm going to try building krb5 from ports and linking to that, to see= > if =3D > > > it > > > > does the same thing. > > > Finally some good news... > > > All I did was "pkg install krb5" and then linked the gssd to the librar= > ies =3D > > > in > > > /usr/local/lib and it worked!! > > > > gssapi/gssapi.h from krb5/lib/gssapi/generic is overwritten by our > > lib/libgssapi. As we have two the MIT gssapi.h is put in > > /usr/include/gssapi_krb5/gssapi.h. > > > > This patch should fix the problem. I haven't tested this yet. > > > > diff --git a/usr.sbin/gssd/Makefile b/usr.sbin/gssd/Makefile > > index 569e2c7e18f5..4c9d342c48c3 100644 > > --- a/usr.sbin/gssd/Makefile > > +++ b/usr.sbin/gssd/Makefile > > @@ -14,7 +14,7 @@ LIBADD=3D gssapi > > .if ${MK_MITKRB5} !=3D "no" > > # MIT KRB5 > > LIBADD+=3D krb5 k5crypto krb5profile krb5support > > -CFLAGS+=3D -DMK_MITKRB5=3Dyes > > +CFLAGS+=3D -DMK_MITKRB5=3Dyes -Iinclude/gssapi_krb5 > > .else > > # Heimdal > > LIBADD+=3D krb5 roken > Just to be clear to everyone, this might allow it to be built after > being patched for MIT, but it does not fix it so that it works. > > I will be debugging the patches that makes it works later to-day. > > You state that Heimdal didn't have a gssapi.h, but it does and it > has always been included in gssd.c. (It was the other ones like > gssapi_krb5.h, which needs the MIT gssapi.h.) /usr/include/gssapi/gssapi.h is installed by /usr/src/lib/libgssapi not by Heimdal v Using the port as an example, the gssapi.h MIT installs is not the same as the gssapi_krb5.h. include/Makefile installs include/gssapi/gssapi.h to /usr/include/gssapi/gssapi.h. Do we need this then? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Thu Jul 31 16:53:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btFXj6MTXz62nw8; Thu, 31 Jul 2025 16:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btFXj5lVWz3WhZ; Thu, 31 Jul 2025 16:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753980837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lgN41iBRyX6yu263sjm9oV2O84p2CmtL4IqSybqHsYw=; b=wLWYct593+WzRJrRzMGAYVXnsbC0YkdxFojjhqB1qxsDlTQUb0ON5SDyZYS3+KZhOozNbr rS9o98GbP+Wkw+DNaaFgpj7MrU1dDGHl6dJXTeb3arvCuPmqnetFo41msh7sFGrg06lfla 0HonRfgTSEiQ/x+m6o9RZpHw62/tSRi5BCj9QVmBqoh5Klhizo2iOQR9FVDCC1Q018zS08 dUzbryXP1gUKnaH02hOm9zq76WAtEtF1Tc9i3LFVreQ5ADtLQESSeiCLK59F6iEggLpG+T 36eeqUjhdPUlBtpod8MWpU6xP7f1SnBzfuKVM0ZAcmSfKakvZO/Oqg9UFPOT2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753980837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lgN41iBRyX6yu263sjm9oV2O84p2CmtL4IqSybqHsYw=; b=inkSpyslRbXmmJO3mXuemnblZG6ZV/6+GV+t5nNaNmiT62cjaTqud7RIpnZaSlJRCnMUTb Rj/S1+0dv8nYydvWuBj67m9y5CJ7nc5vJtH7q6hoEXfB1DEbn/ddP8EbVa5NF3BGzEep3h PbPle6oKxGgkxJlaWJtXqMJf/R3v6bJnKJak1DSjmfS0uxJUg/7afNcNd5h9PjcbrbDY1j ck9K4rK8lQ9/Zvh8l0lsa8jTkd1L0zL5PYKuxV4RdV+RwCLROwBk6BeTOgWYuJzUVA9fLh pEuf02noQd6vMnkStA+6ubu1IiMxLeWw41eCczccwBQZhSBNQf9v9dNtwOqRhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753980837; a=rsa-sha256; cv=none; b=fUS0NUUwVxycXLhQEch6ZIw5P+3Np3ijhKk5GVFgM5UgQ8exhIrxSpCsmYi1EvzioK8k3N dCVgn6g5UWxQkNhjFlNV3xGrx/YVs6n8ZoJais6OZe5SXZX3WhmHc3ICBj438j6AUphwTq hAuBUuYrYNG4Zo1Ju1GT9Ehv0MhhJLXYsKTdhVW2Fl1WM83Xfr57OaDqk4QO7QRG1+rUqs VNFdJKzum/gmoQN7ckN7H5iiNiMkwkikCVut5Z9rywEgyTTyfFztVCm2kqC8dikyCHk1eY XK2bwDC8wtMT6ICB389slR97StLrh2gluNd0eooh2IHJ6eurHV6j1IwE7k/ToQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btFXj4VPQz193K; Thu, 31 Jul 2025 16:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VGrvOI037735; Thu, 31 Jul 2025 16:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VGrvMU037732; Thu, 31 Jul 2025 16:53:57 GMT (envelope-from git) Date: Thu, 31 Jul 2025 16:53:57 GMT Message-Id: <202507311653.56VGrvMU037732@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: 2dde3bed347a - main - aio: Fix a race in sys_aio_cancel() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2dde3bed347ab46685d079c2fcc1dbd1fa149286 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2dde3bed347ab46685d079c2fcc1dbd1fa149286 commit 2dde3bed347ab46685d079c2fcc1dbd1fa149286 Author: Mark Johnston AuthorDate: 2025-07-29 14:46:53 +0000 Commit: Mark Johnston CommitDate: 2025-07-31 16:51:49 +0000 aio: Fix a race in sys_aio_cancel() sys_aio_cancel() loops over pending jobs for the process, cancelling some of them. To cancel a job with a cancel callback, it must drop the job list mutex. It uses flags, KAIOCB_CANCELLING and KAIOCB_CANCELLED, to make sure that a job isn't double-cancelled. However, when iterating over the list it uses TAILQ_FOREACH_SAFE and thus assumes that the next job isn't going to be removed while the lock is dropped. Of course, this assumption is false. We could simply start search from the beginning after cancelling a job, but that might be quite expensive. Instead, introduce the notion of a marker job, used to keep track of one's position in the queue. Use it in sys_aio_cancel() to resume iteration after a job is cancelled. Reported by: syzkaller Reviewed by: kib, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51626 --- sys/kern/vfs_aio.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 02973146068d..e63fa4c01434 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -222,6 +222,7 @@ typedef struct oaiocb { #define KAIOCB_CHECKSYNC 0x08 #define KAIOCB_CLEARED 0x10 #define KAIOCB_FINISHED 0x20 +#define KAIOCB_MARKER 0x40 /* ioflags */ #define KAIOCB_IO_FOFFSET 0x01 @@ -584,6 +585,12 @@ aio_cancel_job(struct proc *p, struct kaioinfo *ki, struct kaiocb *job) int cancelled; AIO_LOCK_ASSERT(ki, MA_OWNED); + + /* + * If we're running down the queue, the process must be single-threaded, + * and so no markers should be present. + */ + MPASS((job->jobflags & KAIOCB_MARKER) == 0); if (job->jobflags & (KAIOCB_CANCELLED | KAIOCB_FINISHED)) return (0); MPASS((job->jobflags & KAIOCB_CANCELLING) == 0); @@ -658,7 +665,7 @@ restart: } /* Wait for all running I/O to be finished */ - if (TAILQ_FIRST(&ki->kaio_jobqueue) || ki->kaio_active_count != 0) { + if (!TAILQ_EMPTY(&ki->kaio_jobqueue) || ki->kaio_active_count != 0) { ki->kaio_flags |= KAIO_WAKEUP; msleep(&p->p_aioinfo, AIO_MTX(ki), PRIBIO, "aioprn", hz); goto restart; @@ -1804,6 +1811,8 @@ aio_queue_file(struct file *fp, struct kaiocb *job) } else if (job->uaiocb.aio_lio_opcode & LIO_SYNC) { AIO_LOCK(ki); TAILQ_FOREACH(job2, &ki->kaio_jobqueue, plist) { + if ((job2->jobflags & KAIOCB_MARKER) != 0) + continue; if (job2->fd_file == job->fd_file && ((job2->uaiocb.aio_lio_opcode & LIO_SYNC) == 0) && job2->seqno < job->seqno) { @@ -2033,7 +2042,7 @@ sys_aio_cancel(struct thread *td, struct aio_cancel_args *uap) { struct proc *p = td->td_proc; struct kaioinfo *ki; - struct kaiocb *job, *jobn; + struct kaiocb *job, *jobn, marker; struct file *fp; int error; int cancelled = 0; @@ -2058,16 +2067,30 @@ sys_aio_cancel(struct thread *td, struct aio_cancel_args *uap) } } + /* + * We may have to drop the list mutex in order to cancel a job. After + * that point it is unsafe to rely on the stability of the list. We + * could restart the search from the beginning after canceling a job, + * but this may inefficient. Instead, use a marker job to keep our + * place in the list. + */ + memset(&marker, 0, sizeof(marker)); + marker.jobflags = KAIOCB_MARKER; + AIO_LOCK(ki); TAILQ_FOREACH_SAFE(job, &ki->kaio_jobqueue, plist, jobn) { - if ((uap->fd == job->uaiocb.aio_fildes) && - ((uap->aiocbp == NULL) || - (uap->aiocbp == job->ujob))) { + if (uap->fd == job->uaiocb.aio_fildes && + (uap->aiocbp == NULL || uap->aiocbp == job->ujob) && + (job->jobflags & KAIOCB_MARKER) == 0) { + TAILQ_INSERT_AFTER(&ki->kaio_jobqueue, job, &marker, + plist); if (aio_cancel_job(p, ki, job)) { cancelled++; } else { notcancelled++; } + jobn = TAILQ_NEXT(&marker, plist); + TAILQ_REMOVE(&ki->kaio_jobqueue, &marker, plist); if (uap->aiocbp != NULL) break; } From nobody Thu Jul 31 17:38:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btGXf3GgRz62qlT; Thu, 31 Jul 2025 17:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btGXf2L3Yz3ZcC; Thu, 31 Jul 2025 17:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zd6taCzs5VPmnGF5Nr/+diPzYf2ZV5DGL/zEE9IF8uY=; b=rB4pUlPX58tGGRxhkl9+TbJYdCe+IyqV6uXSfy9wH+Pyf8KccZHPuUyDhesFMPO1h3JnQS qBkid9fxujI/Y9GZHxQKtnldZ+dIPSWVCRit/I1HROl2O7GvOdD7bYvMRvedfNIMdc/i6r ulauTOG2ZlCNaHxDbmAIWXVurO/thkMKWprslU81VGgaRwm+OhNJLkeWVwGqRZ2QoJSQvQ oDzrZsVZqKLULaMF2fEJpX4OEjL1hERL49tmXL+GzF8ZL3KEmLBLESMhH84HcUC3YySnyM 8fJfTpcebtb/JTPRoCLhBtuu+AdQyN2U0Bn/cumm7++FMumCJN+iKuwoIUw6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zd6taCzs5VPmnGF5Nr/+diPzYf2ZV5DGL/zEE9IF8uY=; b=hGA1VgX/NOCKL7xWhRYYOlYcN79W4giplDlRBOAafmAfR2hnqI9o307qqBvbaGJFJHPmfL QWofmgPiWq/FMUO/9LZGyacxsEXCgTNbjOWKGs4GifYjhEHLxnW/Xbczucm7H6drINKfLQ F3ryBmVsmN5hiViHiiEUkYdvkR4oIONTqlJWAUJaM+zP+/E18z+cR2Aly2CzGa0XBGosqc W9fffTSZAvw2CYHswJILI3AiqHy0qYRAFjBlHyUspGQRYDoJCTMabKbIbu4PoN+MQ8Z8Fm LIcGms4Qx5lC47aV8N+oMwupkXRVxGICIeGqcHGxHcLGCZ5ynhsjbUr39Xu9rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753983538; a=rsa-sha256; cv=none; b=lonGqRI1OJetegmgLiRSgsMlQTp4FV9HPlBoexasOrdYYx7Xwy445JMkVUFFA2nJipjSLR 4Nkja4ZCz+pY2Ai5zSE8X6i4q+XQ8bGMjdpwpokt+Tn7jYz920fwKGB7OX7K02kwKBgC05 5vFXXd+sAXjLdD9zjPqO0xkbzu6hVvoFNfM7j4t9Mp5TaxAL+OPg+QR70Uwl+YDT45mJ60 r3Hv2PVljwj+i2Gx4ipl5W2YGjgxGtC5G4ppgrfW59jiu5DpYsRg7yZ/6ciYoxeCA4T3Ue cgZqbMMEh9Q1YUIxF23h3xlefHJ2C7GJsGq1+NPElcy8H6VY7KkOa2fA1tvMZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btGXf1qpfz1BL9; Thu, 31 Jul 2025 17:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VHcwo8015138; Thu, 31 Jul 2025 17:38:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VHcwDT015135; Thu, 31 Jul 2025 17:38:58 GMT (envelope-from git) Date: Thu, 31 Jul 2025 17:38:58 GMT Message-Id: <202507311738.56VHcwDT015135@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: 21cb44bf33f1 - main - LinuxKPI: acpi: fix guid_t argument type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21cb44bf33f137eaab1ff6f9287c6bc8c27677f0 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=21cb44bf33f137eaab1ff6f9287c6bc8c27677f0 commit 21cb44bf33f137eaab1ff6f9287c6bc8c27677f0 Author: Bjoern A. Zeeb AuthorDate: 2025-07-31 00:42:15 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-31 17:37:53 +0000 LinuxKPI: acpi: fix guid_t argument type acpi_check_dsm() and acpi_evaluate_dsm_typed() take a guid_t argument and not a char *. For in-tree Linux based drivers this leads to a compile error due to a warning. Fix the function argument type and cast internally. While this made the long statements in the wrapper functions for *_dsm_* even less readable split them up using a local variable. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51649 --- sys/compat/linuxkpi/common/include/acpi/acpi_bus.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_acpi.c | 24 ++++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h b/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h index 47195e7d66a6..da50d25a63bb 100644 --- a/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h +++ b/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h @@ -45,9 +45,9 @@ struct acpi_bus_event { lkpi_acpi_dev_get_first_match_dev(__VA_ARGS__) ACPI_HANDLE bsd_acpi_get_handle(device_t bsddev); -bool acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, +bool acpi_check_dsm(ACPI_HANDLE handle, const guid_t *uuid, int rev, uint64_t funcs); -ACPI_OBJECT * acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, +ACPI_OBJECT * acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const guid_t *uuid, int rev, int func, ACPI_OBJECT *argv4, ACPI_OBJECT_TYPE type); int register_acpi_notifier(struct notifier_block *nb); diff --git a/sys/compat/linuxkpi/common/src/linux_acpi.c b/sys/compat/linuxkpi/common/src/linux_acpi.c index d18c69d9210d..43783bb8727b 100644 --- a/sys/compat/linuxkpi/common/src/linux_acpi.c +++ b/sys/compat/linuxkpi/common/src/linux_acpi.c @@ -72,8 +72,9 @@ bsd_acpi_get_handle(device_t bsddev) } bool -acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, uint64_t funcs) +acpi_check_dsm(ACPI_HANDLE handle, const guid_t *uuid, int rev, uint64_t funcs) { + UINT64 ret; if (funcs == 0) return (false); @@ -87,17 +88,20 @@ acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, uint64_t funcs) */ funcs |= 1 << 0; - return ((acpi_DSMQuery(handle, uuid, rev) & funcs) == funcs); + ret = acpi_DSMQuery(handle, (const uint8_t *)uuid, rev); + return ((ret & funcs) == funcs); } ACPI_OBJECT * -acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, int rev, +acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const guid_t *uuid, int rev, int func, ACPI_OBJECT *argv4, ACPI_OBJECT_TYPE type) { ACPI_BUFFER buf; + ACPI_STATUS status; - return (ACPI_SUCCESS(acpi_EvaluateDSMTyped(handle, uuid, rev, func, - argv4, &buf, type)) ? (ACPI_OBJECT *)buf.Pointer : NULL); + status = acpi_EvaluateDSMTyped(handle, (const uint8_t *)uuid, rev, func, + argv4, &buf, type); + return (ACPI_SUCCESS(status) ? (ACPI_OBJECT *)buf.Pointer : NULL); } union linuxkpi_acpi_object * @@ -105,9 +109,11 @@ acpi_evaluate_dsm(ACPI_HANDLE ObjHandle, const guid_t *guid, UINT64 rev, UINT64 func, union linuxkpi_acpi_object *pkg) { ACPI_BUFFER buf; + ACPI_STATUS status; - return (ACPI_SUCCESS(acpi_EvaluateDSM(ObjHandle, (const uint8_t *)guid, - rev, func, (ACPI_OBJECT *)pkg, &buf)) ? + status = acpi_EvaluateDSM(ObjHandle, (const uint8_t *)guid, rev, func, + (ACPI_OBJECT *)pkg, &buf); + return (ACPI_SUCCESS(status) ? (union linuxkpi_acpi_object *)buf.Pointer : NULL); } @@ -323,13 +329,13 @@ bsd_acpi_get_handle(device_t bsddev) } bool -acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, uint64_t funcs) +acpi_check_dsm(ACPI_HANDLE handle, const guid_t *uuid, int rev, uint64_t funcs) { return (false); } ACPI_OBJECT * -acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const char *uuid, int rev, +acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const guid_t *uuid, int rev, int func, ACPI_OBJECT *argv4, ACPI_OBJECT_TYPE type) { return (NULL); From nobody Thu Jul 31 17:38:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btGXg5PGLz62qdg; Thu, 31 Jul 2025 17:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btGXg3D6Kz3ZBp; Thu, 31 Jul 2025 17:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3iEBT7ArdTJ5BFm6zyzU6S+RLjp7R1ChXAkS4M33Dr4=; b=unIyrJa3jRwz7daZ3Qr57ReNbEMr276bGh2+/idxljn8TFva0LBMDl1fdb/K23LIJhHWQl yoHNPlgNNTi8y7sC9iHTLxLU/f/6zM0JvQzXAtUNW2vkt8K30g0W1zb/KQ7Pe+d6r0qwoK I2sj9gP6nWU4EruQ+MmUql54ZThwfu0ovDf6t41TjyPwwpSfOlyTxtpHK6tpwazpomjAqI z53mjz16suhWp0q+2d+VAl44S+Dzl9teoaEVyw2JjKzmxZhMqnD0VYx7FWZtfe5PYiCTrU TS2oeH94dw0DxL7Wwez1sP3PRHwpi7m3zkMmK0GaMvHE07L9IJ6aUeYewIWJhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3iEBT7ArdTJ5BFm6zyzU6S+RLjp7R1ChXAkS4M33Dr4=; b=pzoZf1qEooR+/6Dr7YL4BEkfvSoHU8+1I7snSe6vABgkZBZ3K1lZQeBd03BAE4AoIM4FcH tElstbBPea5DaXcnYI6OFI+X5UW0sY1AuoOHL01sh75lHOjjvkkKdBeuyWgRWa4lR0b8jt wOWIuR0R0aqkcUtCXoL9mZVD7A2iF8AhSEJ1SC5cj/hN1X1jDlOEJGtmO/XSFLb1uRqW9Q N5d+7zZ5MGZiL3tidIyTMpZHnPRN0/B/Hz11sWAgYfhlGzqQjFerbiK+9ROrRtPvvKzNhL s2LZnN4EkRKPfpo1522B+54J1uBpAybeKb9AA3BXP4UevMfzpZOtgdXOiFOYww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753983539; a=rsa-sha256; cv=none; b=oeZlkpqbPv67KJTGO3lQIBEOU/pyjldzKBLHiljV6XHLd7opJgRPYRdMepfkV+9lmGaMtP mrYKXdU8U+B/+1tpfloO0ulmgeIVqrhSP9/PpXKPhx9ypm+tiUyFUaOUriyalpVpCQIEYr Fh9LM4h9t0zm7QaLjQTq+L1x2Pb1cNatMaJpZEtft7wBQWs6+obJET/0aGt04vxToQFZmt QwRhtTIAZ7oQ3aFt79P7pc39ZFVlxeRZf8RLZnZgP/9/Gl6HfzO0v4RvL7sxkxmgcF+VXB atqW93/PyVA4iqM8QM19i4I5QeYk8tT9WjSJreac4g5zHk8uE9qnf2/g/iN8vw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btGXg2mrkz1B98; Thu, 31 Jul 2025 17:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VHcxbE015176; Thu, 31 Jul 2025 17:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VHcx3A015173; Thu, 31 Jul 2025 17:38:59 GMT (envelope-from git) Date: Thu, 31 Jul 2025 17:38:59 GMT Message-Id: <202507311738.56VHcx3A015173@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: 69ed0f766bb6 - main - LinuxKPI: pci: harmonize #defines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 69ed0f766bb68876fed2096739d8adc313cf3340 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=69ed0f766bb68876fed2096739d8adc313cf3340 commit 69ed0f766bb68876fed2096739d8adc313cf3340 Author: Bjoern A. Zeeb AuthorDate: 2025-07-31 07:04:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-31 17:37:53 +0000 LinuxKPI: pci: harmonize #defines In some blocks of #defines spacing, trailing \ and indentation of a second line differed. Some of them are currently fine on a single line but future additions may not fit in that scheme. Harmonize them into a #define X\t\t\t...\\n<4 spaces>Y scheme. No functional changes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51650 --- sys/compat/linuxkpi/common/include/linux/pci.h | 48 +++++++++++++++----------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index af19829f1cbb..5864ed45065b 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -561,10 +561,12 @@ done: return (pdev->bus->self); } -#define pci_release_region(pdev, bar) linuxkpi_pci_release_region(pdev, bar) -#define pci_release_regions(pdev) linuxkpi_pci_release_regions(pdev) -#define pci_request_regions(pdev, res_name) \ - linuxkpi_pci_request_regions(pdev, res_name) +#define pci_release_region(pdev, bar) \ + linuxkpi_pci_release_region(pdev, bar) +#define pci_release_regions(pdev) \ + linuxkpi_pci_release_regions(pdev) +#define pci_request_regions(pdev, res_name) \ + linuxkpi_pci_request_regions(pdev, res_name) static inline void lkpi_pci_disable_msix(struct pci_dev *pdev) @@ -730,8 +732,10 @@ int linux_pci_register_drm_driver(struct pci_driver *pdrv); void linux_pci_unregister_driver(struct pci_driver *pdrv); void linux_pci_unregister_drm_driver(struct pci_driver *pdrv); -#define pci_register_driver(pdrv) linux_pci_register_driver(pdrv) -#define pci_unregister_driver(pdrv) linux_pci_unregister_driver(pdrv) +#define pci_register_driver(pdrv) \ + linux_pci_register_driver(pdrv) +#define pci_unregister_driver(pdrv) \ + linux_pci_unregister_driver(pdrv) /* * Enable msix, positive errors indicate actual number of available @@ -740,10 +744,11 @@ void linux_pci_unregister_drm_driver(struct pci_driver *pdrv); * NB: define added to prevent this definition of pci_enable_msix from * clashing with the native FreeBSD version. */ -#define pci_enable_msix(...) linuxkpi_pci_enable_msix(__VA_ARGS__) +#define pci_enable_msix(...) \ + linuxkpi_pci_enable_msix(__VA_ARGS__) -#define pci_enable_msix_range(...) \ - linux_pci_enable_msix_range(__VA_ARGS__) +#define pci_enable_msix_range(...) \ + linux_pci_enable_msix_range(__VA_ARGS__) static inline int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, @@ -768,8 +773,8 @@ pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, return (nvec); } -#define pci_enable_msi(pdev) \ - linux_pci_enable_msi(pdev) +#define pci_enable_msi(pdev) \ + linux_pci_enable_msi(pdev) static inline int pci_enable_msi(struct pci_dev *pdev) @@ -794,11 +799,12 @@ static inline void pci_disable_sriov(struct pci_dev *dev) { } -#define pci_iomap_range(pdev, mmio_bar, mmio_off, mmio_size) \ - linuxkpi_pci_iomap_range(pdev, mmio_bar, mmio_off, mmio_size) -#define pci_iomap(pdev, mmio_bar, mmio_size) \ - linuxkpi_pci_iomap(pdev, mmio_bar, mmio_size) -#define pci_iounmap(pdev, res) linuxkpi_pci_iounmap(pdev, res) +#define pci_iomap_range(pdev, mmio_bar, mmio_off, mmio_size) \ + linuxkpi_pci_iomap_range(pdev, mmio_bar, mmio_off, mmio_size) +#define pci_iomap(pdev, mmio_bar, mmio_size) \ + linuxkpi_pci_iomap(pdev, mmio_bar, mmio_size) +#define pci_iounmap(pdev, res) \ + linuxkpi_pci_iounmap(pdev, res) static inline void lkpi_pci_save_state(struct pci_dev *pdev) @@ -1387,10 +1393,12 @@ struct pci_dev *lkpi_pci_get_base_class(unsigned int class, /* -------------------------------------------------------------------------- */ -#define pcim_enable_device(pdev) linuxkpi_pcim_enable_device(pdev) -#define pcim_iomap_table(pdev) linuxkpi_pcim_iomap_table(pdev) -#define pcim_iomap_regions(pdev, mask, name) \ - linuxkpi_pcim_iomap_regions(pdev, mask, name) +#define pcim_enable_device(pdev) \ + linuxkpi_pcim_enable_device(pdev) +#define pcim_iomap_table(pdev) \ + linuxkpi_pcim_iomap_table(pdev) +#define pcim_iomap_regions(pdev, mask, name) \ + linuxkpi_pcim_iomap_regions(pdev, mask, name) static inline int pcim_iomap_regions_request_all(struct pci_dev *pdev, uint32_t mask, char *name) From nobody Thu Jul 31 17:39:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btGXh66vmz62qVt; Thu, 31 Jul 2025 17:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btGXh49Mgz3ZBv; Thu, 31 Jul 2025 17:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wx823zPtYc/YsmY5J31kmiuhMVgD1Ni6vvfXcXwFshU=; b=MbBzvvV7K3TQVrWjv3fph9uiptCWk+zi7mNws95gFeZanisf1opQdS1yXhlrWnHf43pv// qIekcCBGKBRDXXK/5063bfzkYDmEzuBsu60i+q4Fjsf8AsRmoHEX6HGQFTwy1hGQNaXTsk 1XNcS7g9s98CK7xwnkDSynXjLy82FnLXExPyMyg8GmaVZWEAymo6MgZt9wTu4A2i8jSRU0 R8QDCbsaS2w7jHrDLIU7VcpPPvALXlFYfmJ6Fu23mlHQ7dUpUuUwregfdeVe5TwaA5v+/3 E3NrBt7t401pxN2iZIY3KUX6T4T5K5l6yFCyjrlToYmNKe5YES4h4mdkfm7LYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wx823zPtYc/YsmY5J31kmiuhMVgD1Ni6vvfXcXwFshU=; b=HOWm313q8ua8fBV9Af8XipWisVKGgu50toM5cFsYjCU/WOJhDKTvftpEawSxiRtH62WwzD Sxe+8fuGmd/GQuwNmy4d9O0u1UPwRQGvjbzyKy1hMpBMbh1Xdo/BcS4BxuAHhgXMVJ/yxi OkZZM2SbbVyFhglxpQRxRyMfrPJKohOcRnQqbpfXIPU4Rjk8m1GimQm5LHWTdFDwfDiGUh YaLu28AX6yVmlQZG49Gfh+TljeLIwgy4CPOVPek8s5NfbpRpqR6kYuWZl4D2hSjY/w1T5E Y3uE1JMadZWrRLTOBxB1khoo9RF5dnLBrWDfvqbTLjBCeHGL0x7jYThqJALW7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753983540; a=rsa-sha256; cv=none; b=LWOVRImV91B4eUSgPo//UrTtcSGCYdvaMGeGcSyOQNhKJasNM7jMkvihM47gfarSz5o/4z S6AyoFDuZ/8mjgcxZRVdTmO//bqp1vk5HRV0Ohq4d5VpQUUJ1fIi3uqY4FZP3c+ShLlpya cX9bnghdPWaoiJ558wuxxMonJMcThUPAsw0avQwwenBcbj7aYNK9087q6OYkoj+DCbd9Bj aH35Tq+jLXCtwpkCj0OHnbnRT3W96ow+cvXxxPzQjeM1QC5rtQO+RzZRnTgZVi+p7rkOfN o+8j+XrR7VibFyByjfuUfRBvtuc4EQFYR1+CaJ9UWs+0I2wq6RCgrlGtV8eRRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btGXh3kZRz19st; Thu, 31 Jul 2025 17:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VHd0dr015219; Thu, 31 Jul 2025 17:39:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VHd0Y9015216; Thu, 31 Jul 2025 17:39:00 GMT (envelope-from git) Date: Thu, 31 Jul 2025 17:39:00 GMT Message-Id: <202507311739.56VHd0Y9015216@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: 421bf3a96867 - main - LinuxKPI: pci: fix argument type to linuxkpi_pci_iomap[_range] List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 421bf3a968674cbb1fc7eb1c323fd4d5d2409718 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=421bf3a968674cbb1fc7eb1c323fd4d5d2409718 commit 421bf3a968674cbb1fc7eb1c323fd4d5d2409718 Author: Bjoern A. Zeeb AuthorDate: 2025-07-31 07:14:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-31 17:37:54 +0000 LinuxKPI: pci: fix argument type to linuxkpi_pci_iomap[_range] The last argument (maxlen) to linuxkpi_pci_iomap_range and linuxkpi_pci_iomap is an unsigned long not an int. LinuxKPI is not using that argument in the end but fix it where needed. While here adjust the name to 'maxlen' and remove the "mmio_" to bar and off. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51651 --- sys/compat/linuxkpi/common/include/linux/pci.h | 8 ++++---- sys/compat/linuxkpi/common/src/linux_pci.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 5864ed45065b..059f8561c71e 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -4,7 +4,7 @@ * Copyright (c) 2010 Panasas, Inc. * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. - * Copyright (c) 2020-2022 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * Portions of this software were developed by Björn Zeeb * under sponsorship from the FreeBSD Foundation. @@ -362,9 +362,9 @@ bool pci_device_is_present(struct pci_dev *pdev); int linuxkpi_pcim_enable_device(struct pci_dev *pdev); void __iomem **linuxkpi_pcim_iomap_table(struct pci_dev *pdev); -void *linuxkpi_pci_iomap_range(struct pci_dev *pdev, int mmio_bar, - unsigned long mmio_off, unsigned long mmio_size); -void *linuxkpi_pci_iomap(struct pci_dev *pdev, int mmio_bar, int mmio_size); +void *linuxkpi_pci_iomap_range(struct pci_dev *, int, + unsigned long, unsigned long); +void *linuxkpi_pci_iomap(struct pci_dev *, int, unsigned long); void linuxkpi_pci_iounmap(struct pci_dev *pdev, void *res); int linuxkpi_pcim_iomap_regions(struct pci_dev *pdev, uint32_t mask, const char *name); diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 55202da00440..057585d9edc0 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1,7 +1,7 @@ /*- * Copyright (c) 2015-2016 Mellanox Technologies, Ltd. * All rights reserved. - * Copyright (c) 2020-2022 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * * Portions of this software were developed by Björn Zeeb * under sponsorship from the FreeBSD Foundation. @@ -752,7 +752,7 @@ linuxkpi_pcim_iomap_table(struct pci_dev *pdev) } static struct resource * -_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size __unused) +_lkpi_pci_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen __unused) { struct pci_mmio_region *mmio, *p; int type; @@ -792,25 +792,25 @@ _lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size __unused) } void * -linuxkpi_pci_iomap_range(struct pci_dev *pdev, int mmio_bar, - unsigned long mmio_off, unsigned long mmio_size) +linuxkpi_pci_iomap_range(struct pci_dev *pdev, int bar, + unsigned long off, unsigned long maxlen) { struct resource *res; - res = _lkpi_pci_iomap(pdev, mmio_bar, mmio_size); + res = _lkpi_pci_iomap(pdev, bar, maxlen); if (res == NULL) return (NULL); /* This is a FreeBSD extension so we can use bus_*(). */ if (pdev->want_iomap_res) return (res); - MPASS(mmio_off < rman_get_size(res)); - return ((void *)(rman_get_bushandle(res) + mmio_off)); + MPASS(off < rman_get_size(res)); + return ((void *)(rman_get_bushandle(res) + off)); } void * -linuxkpi_pci_iomap(struct pci_dev *pdev, int mmio_bar, int mmio_size) +linuxkpi_pci_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen) { - return (linuxkpi_pci_iomap_range(pdev, mmio_bar, 0, mmio_size)); + return (linuxkpi_pci_iomap_range(pdev, bar, 0, maxlen)); } void From nobody Thu Jul 31 17:39:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btGXk2RC5z62r2p; Thu, 31 Jul 2025 17:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btGXj5BL0z3Zkk; Thu, 31 Jul 2025 17:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sTpixAlVsZKErcrGA3BZAECVwEkAprA1MqIQ/AeE4DE=; b=uMHOuOx5dwMk3ZxuO9lYZy52yDz01InLaF+ZvvWMpMF65CYFsf5mwrcP7aTQhDP0J+fZj1 cEAM61jX7OyYLBckVYEQiE2p2JTR8Hi3G3ZoRAcKT6JPz0pWt0wUkL8KtuMUodZCkFrPGx sjzxfDbMbP5XkhWuq7TilaKtRgE5sgzhUDERNe/N0/2zTJptXGMovfRYn1Qfrk8o9BhiTK e+u6PngpTLLhNToti7eNJbS1N1AGYMyAnddPN4WgL1DQoWoVJCvX2EjARq8ftZZkYxyDJp lNQOy2MJgIlM19ulpRwFB3BJK/pIq+9gX06IbVbY6NXDs9Dxhl/vuLZ/OHjazg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sTpixAlVsZKErcrGA3BZAECVwEkAprA1MqIQ/AeE4DE=; b=HeTdzuZF7my+NMyluPoDaOZ0nK6rk7s+UJeLNRD5UiCr6DiP5I2+LyLfqs4rjYhhiCU741 P4BDmKUo7688SkY1xWYktKN0NkVAkpW9oSwsbdN2JIbWmQXZrQvYFdi5f3FuzmBuNG2SSv JZzikX0fXzDo6TdB46QCYuvC3YtbQp9FhOMEyYaU4YGVrwY4ZewmpRtFMHIhNM0EyaeB3M TloJMpo/DxPZB3NkxD6GnhXWCw7cYZhOZtMmUYJvdSK1bSOTx3HrYZC3koFcO1zwsJt9eY /V5JBf371nT0Oc8VfXredDhA90futMekfuTz2y61kB97Y+B2qkEvgNVUU9hqVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753983541; a=rsa-sha256; cv=none; b=vKgV2anvC4WORw1m9a4HPjalX18xRWRMipyQZgAvmgF6qsCfxFYiiXK7EXzDFm5mlLSWRO rZjAAK7tgJ4DJNFpFmer5VXCOzLYhtjQmy20YAxXynFp33AuzS5Ris2O10zySVpdUt5r0v acxjFlvw3OJHO+6sbSXepJ87EX974fEmeZny/pIjecD3ccVSN5gJUQ0zP1Y7GXXPMukgLw LwWw5GmvmPUOHUEDarCpl932ahwqQgIcGjh9/zDGjUiGUMOgNBi8+AWVHliDVDGnRMIqVn pj6Onvz/kGWLqsus+hyAVe5m4f/r9KVXO4205s7qwewFuT186dpcYE4GxZmyiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btGXj4h1hz19sv; Thu, 31 Jul 2025 17:39:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VHd18G015260; Thu, 31 Jul 2025 17:39:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VHd1cV015257; Thu, 31 Jul 2025 17:39:01 GMT (envelope-from git) Date: Thu, 31 Jul 2025 17:39:01 GMT Message-Id: <202507311739.56VHd1cV015257@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: a96486531b91 - main - LinuxKPI: pci: use unsigned int for vendor/device arguments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: a96486531b915c621947980d01decff759afc65e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a96486531b915c621947980d01decff759afc65e commit a96486531b915c621947980d01decff759afc65e Author: Bjoern A. Zeeb AuthorDate: 2025-07-31 07:24:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-31 17:37:54 +0000 LinuxKPI: pci: use unsigned int for vendor/device arguments Linux drivers may pass a typed PCI_ANY_ID (-1U) in which then leads to a warning that the value gets truncated. Switch argument types to unsigned int (or uint32_t as we use in struct pci_device_id) to avoid the problem. Sponsored by: The FreeBSD Foundation Discussed in: D50008 MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51652 --- sys/compat/linuxkpi/common/include/linux/pci.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_pci.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 059f8561c71e..ba1c0d2ac99e 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -377,7 +377,7 @@ int linuxkpi_pci_enable_msix(struct pci_dev *pdev, struct msix_entry *entries, /* Internal helper function(s). */ struct pci_dev *lkpinew_pci_dev(device_t); void lkpi_pci_devres_release(struct device *, void *); -struct pci_dev *lkpi_pci_get_device(uint16_t, uint16_t, struct pci_dev *); +struct pci_dev *lkpi_pci_get_device(uint32_t, uint32_t, struct pci_dev *); struct msi_desc *lkpi_pci_msi_desc_alloc(int); struct device *lkpi_pci_find_irq_dev(unsigned int irq); int _lkpi_pci_enable_msi_range(struct pci_dev *pdev, int minvec, int maxvec); @@ -1439,7 +1439,7 @@ err: * using pci_get_device() need to be changed to call linuxkpi_pci_get_device(). */ static inline struct pci_dev * -linuxkpi_pci_get_device(uint16_t vendor, uint16_t device, struct pci_dev *odev) +linuxkpi_pci_get_device(uint32_t vendor, uint32_t device, struct pci_dev *odev) { return (lkpi_pci_get_device(vendor, device, odev)); diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 057585d9edc0..d5bbbea1eb2c 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -285,7 +285,7 @@ linux_pci_find(device_t dev, const struct pci_device_id **idp) } struct pci_dev * -lkpi_pci_get_device(uint16_t vendor, uint16_t device, struct pci_dev *odev) +lkpi_pci_get_device(uint32_t vendor, uint32_t device, struct pci_dev *odev) { struct pci_dev *pdev, *found; From nobody Thu Jul 31 17:39:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btGXl03Dhz62qdm; Thu, 31 Jul 2025 17:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btGXk5xHtz3ZYh; Thu, 31 Jul 2025 17:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ho7j54M9kGVdu3aQf+ttpXQpSRyMDoOQdsNHSQSw8e8=; b=moHUSjsc71/2+awn3iqppl+N26lIrK5Lx2oRN5KpXHBE8G3k7iiTmOFJnfD9Z7pGPESQEp h+4daA5UsO4ZZcCCv6d+3g2I1d8cL02ktHZbKvhIdxuYSbrh/gB4Ee1dIMPaZtVsrATKMp 03+xkmLq2SE73tsJsstT7EJeI0eEXrsj4cGxKidqUxfMki+Y/n+dRRNeXlAvO6yLrDhZL6 a8r5CGbXtXrg617msRaYFaUZqI/T6UUJZFOknjR24W0ezRj9iupCYHslnspdOBT/L8869g fmgmNzsJhZ1apTh54RHjM87rvIqtUgj9WuKgJkBdz9BALKMcxmFdBG1uIdi7gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ho7j54M9kGVdu3aQf+ttpXQpSRyMDoOQdsNHSQSw8e8=; b=h87XjLYZirg/KaTiyHhVz+FS/oWbl4nmx77qY/Wzax0mYD9uYf58ALyQh+jLeHF1Rd+evu i+fbv8L7ihh4+bQFurVkgJ6K8JtBkdcteX4l53i2ZuF4po2wnpkmEltWlr/zHHDqFoHRY3 /hPASFm6iF80tULrahUnTNjqvXaA+GOgoLa35HfpXUQRMnR32gQD4taQ0Fk6Oi06yxV01+ pVErSLtfM5GI0km8pxcz8PvJHZZV8v+slFOVWV+S+ZMWjSENyLaU3h1FXAQM3k04Nkou9I v0wGiB0cdDDI+KSSp5bBChe23AhQE8iRTl5l7uRDXnQFVUGXk6bZSh1gF6+9MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753983542; a=rsa-sha256; cv=none; b=gMz+0uyBdxYkMDVW1mqZm5Vps3KVpXgh0kX/y1Bmsbs2wZnjACU24E/3L34kwRI1Lo82B7 g5Hr4llX3zowJhT70A5T6FtOiP1hnOKC95dVZnquF9v1K3QXJX4KkR82EAQfA2qseljsGV +rVkq2kWnhxbam566dSnzloyav09fL6CrcCzxvcUzH0rG9S3zOa+lXolPZ1m2zVFtnqAGD WB3D6RHnO1VI+ecZTFeWiDubdbPrRBj55HN9yPo2XICx2RGfHw8Q1sI1ExlSlAfA6NRX2U idXs8duG9c0JZ0XtPNOndq/IEvPTlRSJtpYKBbDFWCWOdx0pGyUZT4ntRi4xjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btGXk5LnKz1B3S; Thu, 31 Jul 2025 17:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VHd2w4015297; Thu, 31 Jul 2025 17:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VHd2p8015294; Thu, 31 Jul 2025 17:39:02 GMT (envelope-from git) Date: Thu, 31 Jul 2025 17:39:02 GMT Message-Id: <202507311739.56VHd2p8015294@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: 0f8a8416a4e0 - main - dwmmc: cleanup cmd and locking, consistency between mmc and mmccam List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 0f8a8416a4e07ddeaecc4eafd6f418da0f21efc7 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0f8a8416a4e07ddeaecc4eafd6f418da0f21efc7 commit 0f8a8416a4e07ddeaecc4eafd6f418da0f21efc7 Author: Bjoern A. Zeeb AuthorDate: 2025-07-29 12:36:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-31 17:37:54 +0000 dwmmc: cleanup cmd and locking, consistency between mmc and mmccam In general sprinkle locking assertions and harmonized KASSERTs throughout the upper part of the driver to document expectations. In dwmmc_cmd_done() "cmd" should be set correctly and be used for both MMCCAM and classic mmc rather than special-casing mmccam. In dwmmc_next_operation() place variable declarations on the top for both cases before the first debug and lock assertion calls; then factor out common parts at the end and put both cases in the same order. By calling dwmmc_next_operation() directly from both dwmmc_request() in the mmc case, and dwmmc_cam_request() in the mmccase (rather than) chaining calls in the latter, we avoid unlocking the sc in the mmccam case and have a consistent call path from both; also removing the mmccam #ifdef from dwmmc_request() brings more clarity. In dwmmc_next_operation() enhance the panic/error messages with some extra information and assert that we come in with a cam pinfo on CAM_ACTIVE_INDEX. MFC after: 3 days Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D51628 --- sys/dev/mmc/host/dwmmc.c | 83 +++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 57992571982c..a422d86d6034 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -315,20 +315,11 @@ static void dwmmc_cmd_done(struct dwmmc_softc *sc) { struct mmc_command *cmd; -#ifdef MMCCAM - union ccb *ccb; -#endif -#ifdef MMCCAM - ccb = sc->ccb; - if (ccb == NULL) - return; - cmd = &ccb->mmcio.cmd; -#else + DWMMC_ASSERT_LOCKED(sc); + cmd = sc->curcmd; -#endif - if (cmd == NULL) - return; + KASSERT(cmd != NULL, ("%s: sc %p curcmd %p == NULL", __func__, sc, cmd)); if (cmd->flags & MMC_RSP_PRESENT) { if (cmd->flags & MMC_RSP_136) { @@ -350,15 +341,17 @@ dwmmc_tasklet(struct dwmmc_softc *sc) { struct mmc_command *cmd; + DWMMC_ASSERT_LOCKED(sc); + cmd = sc->curcmd; - if (cmd == NULL) - return; + KASSERT(cmd != NULL, ("%s: sc %p curcmd %p == NULL", __func__, sc, cmd)); if (!sc->cmd_done) return; if (cmd->error != MMC_ERR_NONE || !cmd->data) { dwmmc_next_operation(sc); + } else if (cmd->data && sc->dto_rcvd) { if ((cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK || cmd->opcode == MMC_READ_MULTIPLE_BLOCK) && @@ -383,6 +376,7 @@ dwmmc_intr(void *arg) DWMMC_LOCK(sc); cmd = sc->curcmd; + KASSERT(cmd != NULL, ("%s: sc %p curcmd %p == NULL", __func__, sc, cmd)); /* First handle SDMMC controller interrupts */ reg = READ4(sc, SDMMC_MINTSTS); @@ -1093,6 +1087,9 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, struct mmc_command *cmd) uint32_t cmdr; dprintf("%s\n", __func__); + + DWMMC_ASSERT_LOCKED(sc); + sc->curcmd = cmd; data = cmd->data; @@ -1177,18 +1174,22 @@ dwmmc_start_cmd(struct dwmmc_softc *sc, struct mmc_command *cmd) static void dwmmc_next_operation(struct dwmmc_softc *sc) { - struct mmc_command *cmd; - dprintf("%s\n", __func__); #ifdef MMCCAM union ccb *ccb; +#else + struct mmc_request *req; +#endif + struct mmc_command *cmd; + dprintf("%s\n", __func__); + DWMMC_ASSERT_LOCKED(sc); + +#ifdef MMCCAM ccb = sc->ccb; if (ccb == NULL) return; cmd = &ccb->mmcio.cmd; #else - struct mmc_request *req; - req = sc->req; if (req == NULL) return; @@ -1205,7 +1206,7 @@ dwmmc_next_operation(struct dwmmc_softc *sc) * mostly caused by multi-block write command * followed by single-read. */ - while(READ4(sc, SDMMC_STATUS) & (SDMMC_STATUS_DATA_BUSY)) + while (READ4(sc, SDMMC_STATUS) & (SDMMC_STATUS_DATA_BUSY)) continue; if (sc->flags & PENDING_CMD) { @@ -1219,50 +1220,44 @@ dwmmc_next_operation(struct dwmmc_softc *sc) return; } -#ifdef MMCCAM - sc->ccb = NULL; sc->curcmd = NULL; +#ifdef MMCCAM ccb->ccb_h.status = (ccb->mmcio.cmd.error == 0 ? CAM_REQ_CMP : CAM_REQ_CMP_ERR); xpt_done(ccb); + sc->ccb = NULL; #else - sc->req = NULL; - sc->curcmd = NULL; req->done(req); + sc->req = NULL; #endif } +#ifndef MMCCAM static int dwmmc_request(device_t brdev, device_t reqdev, struct mmc_request *req) { struct dwmmc_softc *sc; - sc = device_get_softc(brdev); - dprintf("%s\n", __func__); - DWMMC_LOCK(sc); + sc = device_get_softc(brdev); -#ifdef MMCCAM - sc->flags |= PENDING_CMD; -#else + DWMMC_LOCK(sc); if (sc->req != NULL) { DWMMC_UNLOCK(sc); return (EBUSY); } - sc->req = req; sc->flags |= PENDING_CMD; if (sc->req->stop) sc->flags |= PENDING_STOP; -#endif - dwmmc_next_operation(sc); + dwmmc_next_operation(sc); DWMMC_UNLOCK(sc); + return (0); } -#ifndef MMCCAM static int dwmmc_get_ro(device_t brdev, device_t reqdev) { @@ -1505,10 +1500,15 @@ dwmmc_cam_request(device_t dev, union ccb *ccb) struct ccb_mmcio *mmcio; sc = device_get_softc(dev); - mmcio = &ccb->mmcio; - DWMMC_LOCK(sc); + KASSERT(ccb->ccb_h.pinfo.index == CAM_ACTIVE_INDEX, + ("%s: ccb %p index %d != CAM_ACTIVE_INDEX: func=%#x %s status %#x\n", + __func__, ccb, ccb->ccb_h.pinfo.index, ccb->ccb_h.func_code, + xpt_action_name(ccb->ccb_h.func_code), ccb->ccb_h.status)); + + mmcio = &ccb->mmcio; + #ifdef DEBUG if (__predict_false(bootverbose)) { device_printf(sc->dev, "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", @@ -1519,16 +1519,21 @@ dwmmc_cam_request(device_t dev, union ccb *ccb) #endif if (mmcio->cmd.data != NULL) { if (mmcio->cmd.data->len == 0 || mmcio->cmd.data->flags == 0) - panic("data->len = %d, data->flags = %d -- something is b0rked", - (int)mmcio->cmd.data->len, mmcio->cmd.data->flags); + panic("%s: data %p data->len = %d, data->flags = %d -- something is b0rked", + __func__, mmcio->cmd.data, (int)mmcio->cmd.data->len, mmcio->cmd.data->flags); } + if (sc->ccb != NULL) { - device_printf(sc->dev, "Controller still has an active command\n"); + device_printf(sc->dev, "%s: Controller still has an active command: " + "sc->ccb %p new ccb %p\n", __func__, sc->ccb, ccb); + DWMMC_UNLOCK(sc); return (EBUSY); } sc->ccb = ccb; + sc->flags |= PENDING_CMD; + + dwmmc_next_operation(sc); DWMMC_UNLOCK(sc); - dwmmc_request(sc->dev, NULL, NULL); return (0); } From nobody Thu Jul 31 17:39:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btGXm1BG9z62qdn; Thu, 31 Jul 2025 17:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btGXl6kmsz3ZlN; Thu, 31 Jul 2025 17:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fE23wpwKgT31/FAqAY3TK9kAT3ebvlhDgX+vvrOJQlI=; b=SQahdOYYMCrATzjsVMh1+hAVJz2+znwv43IDHkm/iHf2x3j43+3Ga+jGnlYMe4BibpqSgk bFRM0kN/bEjBvIgWCWmfXZHLFrIhgCI1ymdasdiGhCrVzfaXBuxTRRCOhndE6Vy498c/5W beHEdLxYHERQYxlgbGkPZcrr6jsukbm0Gl+EshUwZSsnQICtBgL5JFEpADlwg7d8YWLfFe 6hBEBAr/H1Czf3SNiSDgbcQsiCntFbC6eqS+M31l3DulI15tLdSmo/kBWZtZxTEwyZFY1N WfPdi6kt1740tMVDfOJIZ2h84JyX+nM0vRJx8zUP1y1UGwOIviASQyKDFi251A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753983543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fE23wpwKgT31/FAqAY3TK9kAT3ebvlhDgX+vvrOJQlI=; b=D+iidlcodNngLOFDIUXdfaw1skegzLYByg/IY0tWe1BdTFRqDtRT4gOAUvPyY/dYqCy8nZ He+BRWbBs0c4u2in1Vq0/mWn9ADLm3oNmOCQZItsuqxNoRGNXThnngwDZLYGxN7qsPgjCQ inrIHZXOoQ2xMYFDZovLuT/sozz9Gtove9WgTXGNmydXLw3bireg/xoAGGfzD+yGIG2cc3 omZaFXyj8U32luDFRn1t2mLeFDpmJPizvllwCSVpYBfPVj7XLh2wUd1+8iTfD4Vk/Qs3qy aCCHBGZXN0tWit7MicFmSv5C0/XZxMfiH6vbTvUFEllZRsXhAvRrXKd/sbhC4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753983543; a=rsa-sha256; cv=none; b=hnZRcUgo/aRccKJt0ThLlP8cpYzZ6aIwH2vsn0HlyGXJIYsr9vLK4MM7BGzPIUiyRA+dnH gq4izLSFsMgcvR5kL9bbtht0D2Q/po5z2qzpQ/FbD2ejCrE9jKVAsm8efGAZejEK2EBNoW ioVz/ZYo3ctq7scO8BVg4xh9qVJPsGS3OuJSKoGW8xEolzkDoRv0g6Ad0gOS2C+83lYEWo hE+Tc69vDol/XUFTQZon2FNW/08k7ZwKSq3r6mo+7bCY/jx4JARB8bHlcuy24pt4xY/88g DZrM36UfsbKCz3UAxjXzMJx6sk6uPRe4K6bwOGCjWEVAdGFqVgAq+KFO7oikYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btGXl6LHqz1B4S; Thu, 31 Jul 2025 17:39:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VHd30R015342; Thu, 31 Jul 2025 17:39:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VHd3k7015339; Thu, 31 Jul 2025 17:39:03 GMT (envelope-from git) Date: Thu, 31 Jul 2025 17:39:03 GMT Message-Id: <202507311739.56VHd3k7015339@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: 69ffe3a6e778 - main - bsnmp: wlan: use correct value for rssi List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 69ffe3a6e778c3400a27a1098969802ac4cb5f56 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=69ffe3a6e778c3400a27a1098969802ac4cb5f56 commit 69ffe3a6e778c3400a27a1098969802ac4cb5f56 Author: Bjoern A. Zeeb AuthorDate: 2025-06-19 00:01:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-07-31 17:37:54 +0000 bsnmp: wlan: use correct value for rssi net80211 keeps the rssi value in 0.5bm relative to the noise floor (see comment in ieee80211_node.h). Do proper maths to get a plain rssi value back (once further fixes are in net80211). Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50930 --- usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c index b129e42b9d85..e80b53dcf44e 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c @@ -2167,7 +2167,7 @@ wlan_add_new_scan_result(struct wlan_iface *wif, return (-1); sr->opchannel = wlan_channel_flags_to_snmp_phy(isr->isr_flags); - sr->rssi = isr->isr_rssi; + sr->rssi = (isr->isr_rssi / 2) - isr->isr_noise; sr->frequency = isr->isr_freq; sr->noise = isr->isr_noise; sr->bintval = isr->isr_intval; From nobody Thu Jul 31 17:47:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btGks37drz62r5Y; Thu, 31 Jul 2025 17:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btGks2Tq7z3cdN; Thu, 31 Jul 2025 17:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753984069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IoM/xz0j1qUs/WS4O879xeVPw4wPrri8lBTxG9+5Pdo=; b=GoXqgm5UXGIsUa1k6QBIrSVSOOfPc4fMjS2dlUVssW6JFmP4kKJjF8IlUtC8JWC8QRaVEI TGiydjCJN6pJY0Fj4cWNGqoJU05uAQv5UepRdlHmfijAXazYFXcN9WEpjVeDMD7++GWcNu b4/5kT+UgeLaJeI35ump6Puua4r1H4a5KrJgwia3iEoiTH/TbnXZbRcusDqqNXPF3olwWP h5WFELzbdghBQlnYzhoT/YTGdyk4uMFsN3WcyAsWOimzoWZ9hwhMrYPyOjQQENnVTnwu46 FfC/FhxhZlULgnmPT8/4zOBmzrUznL7CvisQh/kmDkHNoT+K2YT9IRUpPPi+cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753984069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IoM/xz0j1qUs/WS4O879xeVPw4wPrri8lBTxG9+5Pdo=; b=d0WpQPTcpC5j8RHdi82NNVak2DkAKI7I458VYs+a/ltJiRQRRq3zobONXZz/8KbAwPILDu hYivTvDegoZNI6b8fPNOD0Dgn6cYetAKkIN4Ab2W4G9JIAzEuz71/iHYgSc+jO+eXRAXL+ AGQyCpc58dpC73xbsA+Pmj/2hvsoo/Fzy9S2c767IGElEC5S21XDkNr3ijpSwcfZI4wIG9 YUFyahhA5Q5vna2rSdXcP3IRi3K6rvBHumjbocsnca6muOie28Oqmh5XbRd5+LaVe0N8xA eJ6ljnNh0644FHC/Vi/2wl4ITKPaOguGndaBfEygo7FqB9wSbE8jk5gCyO3oFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753984069; a=rsa-sha256; cv=none; b=OVROAR1tAZs32EAJ1njFCjBVlK0p2enTv3FWKgvISkcJVadGfXOkK63KvjDHaroXzl4xVW haqMQOll9RHSDS3wWtoLhdgHbTGQUYGSreTmDi4HSt0x0H+0AjyXs5JA5o21J4o5YU0Kac ax9QR0k2S9lrOCiw6O0OdaVjQ8BF5+sHOC9zyEXPT1qOrnR3Hc7sUPLVuP6ookZSR3tGEK KKyTWNlG/vVM0+mMZyTwa8RJECDVdy4puCg9NEcF9/e3/i1RlNafABLtrh6zlyEAw04973 fAVF11jhVtcoHhzHmPA5r9/lfr2JeSLgRTOW36fGbycpxuHLDYXrjjsHKQyF7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btGks1p0jz19r0; Thu, 31 Jul 2025 17:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VHlnPs034525; Thu, 31 Jul 2025 17:47:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VHlnOu034522; Thu, 31 Jul 2025 17:47:49 GMT (envelope-from git) Date: Thu, 31 Jul 2025 17:47:49 GMT Message-Id: <202507311747.56VHlnOu034522@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 0a3792d5c576 - main - release: No newaliases when cross-building VMs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a3792d5c5764945259333db4c66774385f01ba7 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0a3792d5c5764945259333db4c66774385f01ba7 commit 0a3792d5c5764945259333db4c66774385f01ba7 Author: Colin Percival AuthorDate: 2025-07-31 17:44:15 +0000 Commit: Colin Percival CommitDate: 2025-07-31 17:47:36 +0000 release: No newaliases when cross-building VMs We've been running newaliases(8) when cross-building VMs for a long time, and it's not entirely clear why -- especially since we don't do it when we're building a native VM image. If someone knows why running newaliases is important we can add it back later, but only after newaliases gets unbroken: As of last week (a3d4ae7cf351) newaliases fails with EPERM on /etc/dma/dma.conf. This should unbreak VM (and cloudware) cross-builds. With hat: re@ --- release/tools/vmimage.subr | 1 - 1 file changed, 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index eb816018e9d3..156987e33457 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -118,7 +118,6 @@ vm_emulation_setup() { mkdir -p ${DESTDIR}/dev mount -t devfs devfs ${DESTDIR}/dev - chroot ${DESTDIR} ${EMULATOR} /usr/bin/newaliases chroot ${DESTDIR} ${EMULATOR} /bin/sh /etc/rc.d/ldconfig forcestart cp /etc/resolv.conf ${DESTDIR}/etc/resolv.conf From nobody Thu Jul 31 18:24:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btHY45lYMz62tSk; Thu, 31 Jul 2025 18:24:24 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btHY45Ghpz3h95; Thu, 31 Jul 2025 18:24:24 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753986264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=E54HcSbAK4cX85s0SKQHiMRRePAIX7nHU5YwhTaF4o8=; b=j5q9avdjlkWsjArrS8fq2+CfF+jmxqbpoV5Cgb0VvZZPXNwexr2N/khAEOWejgliuRmTfs h/spG6sRhOjkNlWMu2+RtJarv9bu2MLY0ecUI/ltSmPdPhzKhR41UpGfbWpBE7uyS3zy8p edC4q8NAZlpk6cuZQUnD/KE0+nsrW1KoeK8aqvlZ9C9rbIo3v4sZ1y81FQXGWpiR36Mx/H a6ppVvB4+zCDHtn4ze9pJNGDsiAjHzE5WQoSDIbRgJ7UkkLGjx6SOc2aI6OwGZ+2G1cACv 50jut0kbCHO1CCf6Xn5T5gsyT8WeyD+y6VwNLRlRGzFji0STuPoM4eM8h3cRKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753986264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=E54HcSbAK4cX85s0SKQHiMRRePAIX7nHU5YwhTaF4o8=; b=E4ohtVpQKroOZjaGv+oy07dJMn2yNjUUAMBej/WHFAxgaqxe4+/VrFTMFYMaHoGTkoTsL1 eOJLtSC/3rNgfUg4u1W0cboaSK4BHPio9J2e67w7Ac3Lz1dqn2vJbC93ypCStBDm8vaTlM 9v+xQ9WtHw3734mHinctHGOQomL4aYnuPulGPcHrmpIRwkZ11aVh+TYt47Mf0LGRrc0f3L wQV+afLv37MPt81HmhNPELSNrt9iA7sWzNEl2HtMWU2TdEpcGhX7ePzrRwsedseY6m026W SOWDLr9QPLpBNMaahcBpvct+WsPi2GQ47hNK4AUx/YD9B04faTQOrX1wtA2O1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753986264; a=rsa-sha256; cv=none; b=ZhktJcKdQlOAEHGdhAtxccs/bsyXOJOUdylPj2ZS+Hozu7Fr+in6nkynPcm3/97yYDb1o9 g43r6WavaG8bzLF0EptKqWhnhPi1NkV0FEBHdmjt4OMB0tKr3JLUtNPl+KF9/djRk7j8Qz 5IbSF+a0AdSCpgEZXuws+BFjjekTiRy9+F+nJMl0ZyLe3yqaI6VONGPanyhpfXlshzlSTU PDNdI4PljrrUFsBMp+/Njpy+noIQYLLjt2klbfbdAHneLpKbzQV4lxoP+0wahrfNZ0RxqL a0/OzsC651rBBnoyc2Z0fAg13ObhtAv5xk6/GdGza/orIs4kVnvFP7NCXEiHHQ== Received: from [10.216.0.119] (unknown [188.243.165.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4btHY311rfzNLw; Thu, 31 Jul 2025 18:24:23 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <4820cbcc-e94c-40a4-8642-19d8edec553f@FreeBSD.org> Date: Thu, 31 Jul 2025 21:24:20 +0300 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Cy Schubert , Rick Macklem Cc: Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> <20250731153654.0E981194@slippy.cwsent.com> Content-Language: ru, en-GB From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <20250731153654.0E981194@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------qSX0obzJi9Q40DK8eTKEmVcr" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------qSX0obzJi9Q40DK8eTKEmVcr Content-Type: multipart/mixed; boundary="------------6Ta41uX8tAKL06OF5zMCsvUy"; protected-headers="v1" From: Dima Panov To: Cy Schubert , Rick Macklem Cc: Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <4820cbcc-e94c-40a4-8642-19d8edec553f@FreeBSD.org> Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> <20250731153654.0E981194@slippy.cwsent.com> In-Reply-To: <20250731153654.0E981194@slippy.cwsent.com> --------------6Ta41uX8tAKL06OF5zMCsvUy Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCk9uIDMxLjA3LjIwMjUgMTg6MzYsIEN5IFNjaHViZXJ0IHdyb3RlOg0KPiBJ biBtZXNzYWdlIDwyMDI1MDczMTE1MjgwMy4xOUY5QUNEQHNsaXBweS5jd3NlbnQuY29tPiwg Q3kgU2NodWJlcnQgd3JpdGVzOg0KPj4gSW4gbWVzc2FnZSA8Q0FNNXROeTRYdXBQR1hITVMw cDBUSzBXZl96QWc1YnNPeng0QzFLMWUtXzJiPTNleVV3QG1haWwuZ21haWwuYw0KPj4gb20+ DQo+PiAsIFJpY2sgTWFja2xlbSB3cml0ZXM6DQo+Pj4gT24gVGh1LCBKdWwgMzEsIDIwMjUg YXQgNjo1MT1FMj04MD1BRkFNIFJpY2sgTWFja2xlbSA8cmljay5tYWNrbGVtQGdtYWlsLmNv DQo+PiA9DQo+Pj4gbT4gd3JvdGU6DQo+Pj4+DQo+Pj4+IE9uIFRodSwgSnVsIDMxLCAyMDI1 IGF0IDY6MDc9RTI9ODA9QUZBTSBSaWNrIE1hY2tsZW0gPHJpY2subWFja2xlbUBnbWFpbC4N Cj4+ID0NCj4+PiBjb20+IHdyb3RlOg0KPj4+Pj4NCj4+Pj4+IE9uIFdlZCwgSnVsIDMwLCAy MDI1IGF0IDk6MjQ9RTI9ODA9QUZQTSBCZW5qYW1pbiBLYWR1ayA8YmprZmJzZEBnbWFpbC5j DQo+PiA9DQo+Pj4gb20+IHdyb3RlOg0KPj4+Pj4+DQo+Pj4+Pj4gT24gV2VkLCBKdWwgMzAs IDIwMjUgYXQgMTA6MzY9RTI9ODA9QUZBTSBSaWNrIE1hY2tsZW0gPHJpY2subWFja2xlbUBn DQo+PiA9DQo+Pj4gbWFpbC5jb20+IHdyb3RlOg0KPj4+Pj4+Pg0KPj4+Pj4+PiBPbiBNb24s IEp1bCAyOCwgMjAyNSBhdCAzOjMyPUUyPTgwPUFGUE0gQmVuamFtaW4gS2FkdWsgPGJqa2Zi c2RAZ21haQ0KPj4gPQ0KPj4+IGwuY29tPiB3cm90ZToNCj4+Pj4+Pj4+DQo+Pj4+Pj4+PiBP biBNb24sIEp1bCAyOCwgMjAyNSBhdCAzOjA0PUUyPTgwPUFGUE0gQmVuamFtaW4gS2FkdWsg PGJqa2Zic2RAZ20NCj4+ID0NCj4+PiBhaWwuY29tPiB3cm90ZToNCj4+Pj4+Pj4+Pg0KPj4+ Pj4+Pj4+DQo+Pj4+Pj4+Pj4gTm90ZSB0aGF0IE1JVCBrcmI1IHByb3ZpZGVzIHRoZSBnc3Nf a3JiNV9leHBvcnRfbHVjaWRfc2VjX2NvbnRleHQNCj4+ID0NCj4+PiAoKSBBUEkgdGhhdCBk b2VzIGEgbG90IG9mIHRoZSB3b3JrIG9mIGdldHRpbmcgdXNlZnVsIGJpdHMgb3V0IG9mIGFu IGVzdGFibGkNCj4+ID0NCj4+PiBzaGVkIEdTUyBzZWN1cml0eSBjb250ZXh0Lg0KPj4+Pj4+ Pj4+DQo+Pj4+Pj4+Pg0KPj4+Pj4+Pj4NCj4+Pj4+Pj4+DQo+Pj4+Pj4+Pg0KPj4+Pj4+Pj4g QW5kIGEgYml0IG1vcmUgY29udGV4dCBvbiB3aGF0IGlzIGdvaW5nIG9uIGhlcmUgYW5kIHdo eSBrZ3NzYXBpIGhhDQo+PiA9DQo+Pj4gcyB0byBjYXJlOg0KPj4+Pj4+Pj4gVGhlIEdTUy1B UEkgKFJGQyAyNzQzKSBpcyBhbGwgYWJvdXQgYSB3YXkgdG8gImVzdGFibGlzaCBhIHNlY3Vy aXR5DQo+PiA9DQo+Pj4gICBjb250ZXh0IiAoaS5lLiwgZG8gY3J5cHRvIG5lZ290aWF0aW9u LCBhdXRoZW50aWNhdGlvbiwgc29tZXRpbWVzIGF1dGhvcml6YQ0KPj4gPQ0KPj4+IHRpb24s IGV0Yy4pIGJldHdlZW4gdHdvIGVudGl0aWVzLCB0aGUgaW5pdGlhdG9yIGFuZCB0aGUgYWNj ZXByb3QsIGFuZCB0aGVuDQo+PiA9DQo+Pj4gZXhjaGFuZ2luZyBwcm90ZWN0ZWQgbWVzc2Fn ZXMgYmV0d2VlbiB0aGUgdHdvICh3aGljaCBjYW4gYmUgZWl0aGVyIGVuY3J5cHRlDQo+PiA9 DQo+Pj4gZCBvciBqdXN0IGludGVncml0eSBwcm90ZWN0aW9uIHRhZ3MgZm9yIG90aGVyd2Vp c2UgY2xlYXJ0ZXh0IGRhdGEpOyBsYXRlciBlDQo+PiA9DQo+Pj4geHRlbnNpb25zIGluY2x1 ZGVkIHRoZSBhYmlsaXR5IHRvIHByb2R1Y2UgaWRlbnRpY2FsIFBSRiBvdXRwdXQgb24gYm90 aCBwYXJ0DQo+PiA9DQo+Pj4gaWVzLCBldGMuLiAgVGhlIGRldGFpbHMgYXJlICJtZWNoYW5p c20tc3BlY2lmaWMiLCBhbmQgZm9yIHRoaXMgcHVycG9zZSB3ZSdyDQo+PiA9DQo+Pj4gZSBl eGNsdXNpdmVseSB0YWxraW5nIGFib3V0IHRoZSBrcmI1IG1lY2hhbmlzbS4gIFRoZSBzdGVw cyB0byBlc3RhYmxpc2ggdGhlDQo+PiA9DQo+Pj4gICBzZWN1cml0eSBjb250ZXh0IGFyZSBj b21wbGljYXRlZCBhbmQgc29tZXRpbWVzIGZpZGRseSwgYW5kIGluIHRoZSBnZW5lcmFsDQo+ PiA9DQo+Pj4gY2FzZSBjYW4gcmVxdWlyZSBhIGxhcmdlIG51bWJlciBvZiByb3VuZC10cmlw cyBiZXR3ZWVuIHRoZSBpbml0aWF0b3IgYW5kIGFjDQo+PiA9DQo+Pj4gY2VwdG9yIGJlZm9y ZSB0aGUgc2VjdXJpdHkgY29udGV4dCBpcyBlc3RhYmxpc2hlZC4gIFRoZSBpbmRpdmlkdWFs IG1lc3NhZ2UtDQo+PiA9DQo+Pj4gcHJvdGVjdGlvbiBwYXJ0cyBhcmUgY29tcGFyYXRpdmVs eSBzaW1wbGUgYW5kIGFtZW5kYWJsZSB0byBpbXBsZW1lbnRhdGlvbiBpDQo+PiA9DQo+Pj4g biB0aGUga2VybmVsIGZvciBwcm9jZXNzaW5nIGVmZmljaWVuY3kuDQo+Pj4+Pj4+PiBSRkMg Mjc0MyBhbHNvIGRlZmluZXMgZnVuY3Rpb25zIGZvciBHU1NfRXhwb3J0X3NlY19jb250ZXh0 KCkgYW5kIEcNCj4+ID0NCj4+PiBTU19JbXBvcnRfc2VjX2NvbnRleHQoKSwgdGhhdCBhcmUg ZGVzaWduZWQgZXNzZW50aWFsbHkgdG8gcGFzcyBpbmZvcm1hdGlvbg0KPj4gPQ0KPj4+IGFi b3V0IGFuIGVzdGFibGlzaGVkIHNlY3VyaXR5IGNvbnRleHQgZnJvbSBvbmUgcHJvY2VzcyB0 byBhbm90aGVyIG9uIHRoZSBzYQ0KPj4gPQ0KPj4+IG1lIG1hY2hpbmUgKHdoaWNoIGFyZSBw cmVzdW1hYmx5IHVzaW5nIHRoZSBzYW1lIGltcGxlbWVudGF0aW9uIGFuZCB2ZXJzaW9uDQo+ PiA9DQo+Pj4gb2YgdGhlIGltcGxlbWVudGF0aW9uKSwgc28gdGhlIGNvbnRlbnRzIG9mIHRo ZSBleHBvcnRlZCBibG9iIGFyZSBvcGFxdWUgYW5kDQo+PiA9DQo+Pj4gICBpbXBsZW1lbnRh dGlvbi1zcGVjaWZpYy4gIFdlIGFyZSBhYnVzaW5nIHRoYXQgbWVjaGFuaXNtIHRvIGV4cG9y dCBpbmZvcm1hdA0KPj4gPQ0KPj4+IGlvbiBhYm91dCB0aGUgc2VjdXJpdHkgY29udGV4dCB0 aGF0IGdzc2QgaGFzIGVzdGFibGlzaGVkIGFuZCBmZWVkIHRoYXQgaW5mbw0KPj4gPQ0KPj4+ IHJtYXRpb24gaW50byB0aGUga2VybmVsIGltcGxlbWVudGF0aW9uIG9mIHRoZSBwZXItbWVz c2FnZSBwcm9jZXNzaW5nIHJvdXRpbg0KPj4gPQ0KPj4+IGVzLiAgQXQgcHJlc2VudCwgdGhp cyBuZWNlc3NhcmlseSBlbnRhaWxzIGtub3dpbmcgdGhlIGRldGFpbHMgb2YgdGhlIGltcGxl bQ0KPj4gPQ0KPj4+IGVudGF0aW9uLXNwZWNpZmljIG9wYXF1ZSBibG9iIHRoYXQgaXMgdGhl ICJleHBvcnQgc2VjIGNvbnRleHQgdG9rZW4iLCB3aGljaA0KPj4gPQ0KPj4+ICAgaXMgd2hh dCB0aGUgc3lzL2tnc3NhcGkva3JiNS9rcmI1X21lY2guYyBjb2RlIGlzIGRvaW5nLiAgQnV0 IGlmIHdlIGNhbiBnZXQNCj4+ID0NCj4+PiAgIHRoZSBpbmZvcm1hdGlvbiB3ZSB3YW50IHdp dGhvdXQgYnJlYWtpbmcgdGhlIGFic3RyYWN0aW9uIGJhcnJpZXIsIHN1Y2ggYXMNCj4+ID0N Cj4+PiB2aWEgdGhlIGdzc19rcmI1X2V4cG9ydF9sdWNpZF9zZWNfY29udGV4dCgpIEFQSSwg d2UgYXJlIGluIGEgbW9yZSByb2J1c3QgcG8NCj4+ID0NCj4+PiBzdHVyZSBvdmVyYWxsIGFu ZCBzb21ld2hhdCBmdXR1cmUtcHJvb2ZlZCBhZ2FpbnN0IGZ1dHVyZSBldm9sdXRpb24gYnkg TUlUIGsNCj4+ID0NCj4+PiByYjUuDQo+Pj4+Pj4+PiAoSSBub3RlIHRoYXQgcmVjZW50IEhl aW1kYWwgdmVyc2lvbnMgc2VlbSB0byBhbHNvIGV4cG9zZSBhIGdzc19rcmINCj4+ID0NCj4+ PiA1X2V4cG9ydF9sdWNpZF9zZWNfY29udGV4dCgpIEFQSSwgc28gcGFydCBvZiB0aGUgcHJv YmxlbSBpcyBqdXN0IHRoYXQgdGhlIEgNCj4+ID0NCj4+PiBlaW1kYWwgaW4gYmFzZSBpcyBz byBvbGQuKQ0KPj4+Pj4+Pg0KPj4+Pj4+PiBXZWxsLCBoZXJlJ3Mgc29tZSAibm90IHNvIGdv b2QiIG5ld3MuLi4NCj4+Pj4+Pj4gSSd2ZSBiZWVuIHRyeWluZyB0byB1c2UgZ3NzX2lucXVp cmVfc2VjX2NvbnRleHRfYnlfb2lkKC4uKSB3aXRoIHRoZQ0KPj4gPQ0KPj4+IG9pZA0KPj4+ Pj4+PiBmb3IgdGhlIEdTU19LUkI1X0VYUE9SVF9MVUNJRF9TRUNfQ09OVEVYVF9PSUQgd2l0 aCB2ZXJzaW9uIDEuDQo+Pj4+Pj4+IEl0IGtlcHQgZmFpbGluZy4NCj4+Pj4+Pj4gVGhlIHBy b2JsZW0gc2VlbXMgdG8gYmUgdGhhdCAiZ2N0eC0+cHJvdG8gPTNEPTNEIDQiIGluIG1ha2Vf ZXh0ZXJuYWwNCj4+ID0NCj4+PiBfbHVjaWRfY3R4X3YxKCkNCj4+Pj4+Pj4gZnVuY3Rpb24u IFRoaXMgZnVuY3Rpb24gb25seSBrbm93cyBhYm91dCB0aGUgMCBhbmQgMSBzZXR0aW5nIGZv ciBnY3QNCj4+ID0NCj4+PiB4LT5wcm90by4NCj4+Pj4+Pj4NCj4+Pj4+Pj4gQW55IGlkZWFz LCByaWNrDQo+Pj4+Pj4+DQo+Pj4+Pj4NCj4+Pj4+Pg0KPj4+Pj4+IEknbSBub3Qgc2VlaW5n IGFueXRoaW5nIHRvIHN1Z2dlc3QgdGhhdCBhICJnY3R4LT5wcm90byIgdmFsdWUgb2YgNCBp cw0KPj4gPQ0KPj4+ICAgZXZlciBleHBlY3RlZDsgaXQgbG9va3MgbGlrZSBpdCdzIHN1cHBv c2VkIHRvIGp1c3QgYmUgMCAoZm9yIHRoZSBsZWdhY3kgUkYNCj4+ID0NCj4+PiBDIDE5NjQg Zm9ybWF0KSBvciAxIChmb3IgdGhlICJDRlgiIGZvcm1hdCBvZiBSRkMgNDEyMSwgd2l0aCB3 aWRlciBzZXF1ZW5jZQ0KPj4gPQ0KPj4+IG51bWJlcnMgZm9yIG1lc3NhZ2UtcHJvdGVjdGlv biBmb3JtYXRzLCBldGMuKS4gIFNvIG1heWJlIGl0J3Mgd29ydGggcG9zdGluZw0KPj4gPQ0K Pj4+ICAgeW91ciBjdXJyZW50IFdJUCBzb21ld2hlcmUgdG8gdGFrZSBhIGNsb3NlciBsb29r IGF0IHdoYXQncyBnb2luZyBvbi4NCj4+Pj4+DQo+Pj4+PiBZZWEsIHRoZSBkZWJ1Z2dpbmcg SSBkaWQgd2FzIGZsYXdlZCAoSSBwcm9iYWJseSBnb3QgdGhlIHdyb25nIG9mZnNldA0KPj4+ Pj4gaW4gdGhlIHN0cnVjdHVyZSkuDQo+Pj4+PiBJdCBpcyB3ZWlyZCwgdGhvdWdoLiBJZiBJ IGRvIGdzc19pbnF1aXJlX3NlY19jb250ZXh0X2J5X29pZCgmbWlub3IsIGN0eA0KPj4gPQ0K Pj4+ICwNCj4+Pj4+IE9JRF9GT1JfR1NTX0lOUVVJUkVfU1NQSV9TRVNTSU9OX0tFWSwgJmtl eSksIGl0DQo+Pj4+PiB3b3JrcyBhbmQgZ2l2ZXMgbWUgdGhlIGtleSBhbmQgZW5jcnlwdGlv biB0eXBlLg0KPj4+Pj4NCj4+Pj4+IElmIEkgZG8gdGhlIHNhbWUsIGJ1dCB3aXRoIHRoZSAx MiBieXRlIE9JRCBmb3IgTFVDSUQgdjEgKHRoZSAxMSBieXRlcyBmDQo+PiA9DQo+Pj4gcm9t IHRoZQ0KPj4+Pj4gc3RyaW5nICsgYSAxIGJ5dGUpLCBpdCByZXR1cm5zIG1ham9yID0zRD0z RCBHU1NfU19DT01QTEVURSwgYnV0IG5vIGRhdGENCj4+ID0NCj4+PiAgIGFuZA0KPj4+Pj4g YSB3ZWlyZCAzOTc1NjA0NihkZWNpbWFsKSBvciAweDI1ZWExMGUoaGV4KSBtaW5vci4NCj4+ Pj4+IChPaCwgYW5kIEkgdHJpZWQgZ3NzX2tyYjVfZXhwb3J0X2x1Y2lkX3NlY19jb250ZXh0 KCkgYW5kIGdvdCB0aGUgc2FtZQ0KPj4+Pj4gd2VpcmQgZXJyb3IuKQ0KPj4+PiAtLT4gTm93 IChhZnRlciBkb2luZyBhICJtYWtlIGJ1aWxkd29ybGQiKSwgZ3NzX2tyYjVfZXhwb3J0X2x1 Y2lkX3NlY19jb250DQo+PiA9DQo+Pj4gZXh0KCkNCj4+Pj4gICAgICAgcmV0dXJucyBHU1Nf U19CQURfTUVDSC4gTG9va2luZyBhdCB0aGUgc3JjLCB0aGF0IGVycm9yIGhhcyB0byBiZSBm cm8NCj4+ID0NCj4+PiBtDQo+Pj4+ICAgICAgIGdzc19pbnF1aXJlX3NlY19jb250ZXh0X2J5 X29pZCgpLiBTbywgc2FtZSBmdW5jdGlvbiBmYWlscywgYnV0IGEgZGlmDQo+PiA9DQo+Pj4g ZmVyZW50DQo+Pj4+ICAgICAgIGVycm9yIHJldHVybj8NCj4+Pj4NCj4+Pj4gSXQgbG9va3Mg bGlrZSAiZ3NzaW50X2dldF9tZWNoYW5pc20gKGN0eC0+bWVjaF90eXBlKSIgaXMgZmFpbGlu Zy4NCj4+Pj4gSSdtIGN1cnJlbnRseSBqdXN0IHBhc3NpbmcgR1NTX0NfTlVMTF9PSUQgaW50 byBnc3NfaW5pdF9zZWNfY29udGV4dCgpLA0KPj4+PiBidXQgSSd2ZSBhbHNvIHRyaWVkIHRo ZSBLZXJiZXJvcyA5IGJ5dGUgT0lEIChib3RoIHdvcmssIGluIHRoZSBzZW5zZSB0aGF0DQo+ Pj4+IGdzc19pbml0X3NlY19jb250ZXh0KCkgc2VlbXMgdG8gd29yaywgZXhjZXB0IHRoYXQg dGhlIGFjdHVhbF9tZWNoX3R5cGUNCj4+Pj4gcmV0dXJuZWQgYnkgaXQgaGFzIGEgYm9ndXMg cG9pbnRlciBpbiB0aGUgcmVwbHkpLg0KPj4+PiAtLT4gSXQgbG9va3MgbGlrZSB0aGUgIm1l Y2hfdHlwZSIgZmllbGQgb2YgImN0eCIgaXMgYnVzdGVkLCBmb3Igc29tZSByZWFzDQo+PiA9 DQo+Pj4gb24/DQo+Pj4+DQo+Pj4+IEknbSBnb2luZyB0byB0cnkgYnVpbGRpbmcga3JiNSBm cm9tIHBvcnRzIGFuZCBsaW5raW5nIHRvIHRoYXQsIHRvIHNlZSBpZg0KPj4gPQ0KPj4+IGl0 DQo+Pj4+IGRvZXMgdGhlIHNhbWUgdGhpbmcuDQo+Pj4gRmluYWxseSBzb21lIGdvb2QgbmV3 cy4uLg0KPj4+IEFsbCBJIGRpZCB3YXMgInBrZyBpbnN0YWxsIGtyYjUiIGFuZCB0aGVuIGxp bmtlZCB0aGUgZ3NzZCB0byB0aGUgbGlicmFyaWVzDQo+PiA9DQo+Pj4gaW4NCj4+PiAvdXNy L2xvY2FsL2xpYiBhbmQgaXQgd29ya2VkISENCj4+DQo+PiBnc3NhcGkvZ3NzYXBpLmggZnJv bSBrcmI1L2xpYi9nc3NhcGkvZ2VuZXJpYyBpcyBvdmVyd3JpdHRlbiBieSBvdXINCj4+IGxp Yi9saWJnc3NhcGkuIEFzIHdlIGhhdmUgdHdvIHRoZSBNSVQgZ3NzYXBpLmggaXMgcHV0IGlu DQo+PiAvdXNyL2luY2x1ZGUvZ3NzYXBpX2tyYjUvZ3NzYXBpLmguDQo+Pg0KPj4gVGhpcyBw YXRjaCBzaG91bGQgZml4IHRoZSBwcm9ibGVtLiBJIGhhdmVuJ3QgdGVzdGVkIHRoaXMgeWV0 Lg0KPj4NCj4+IGRpZmYgLS1naXQgYS91c3Iuc2Jpbi9nc3NkL01ha2VmaWxlIGIvdXNyLnNi aW4vZ3NzZC9NYWtlZmlsZQ0KPj4gaW5kZXggNTY5ZTJjN2UxOGY1Li40YzlkMzQyYzQ4YzMg MTAwNjQ0DQo+PiAtLS0gYS91c3Iuc2Jpbi9nc3NkL01ha2VmaWxlDQo+PiArKysgYi91c3Iu c2Jpbi9nc3NkL01ha2VmaWxlDQo+PiBAQCAtMTQsNyArMTQsNyBAQCBMSUJBREQ9CWdzc2Fw aQ0KPj4gICAuaWYgJHtNS19NSVRLUkI1fSAhPSAibm8iDQo+PiAgICMgTUlUIEtSQjUNCj4+ ICAgTElCQUREKz0Ja3JiNSBrNWNyeXB0byBrcmI1cHJvZmlsZSBrcmI1c3VwcG9ydA0KPj4g LUNGTEFHUys9IC1ETUtfTUlUS1JCNT15ZXMNCj4+ICtDRkxBR1MrPSAtRE1LX01JVEtSQjU9 eWVzIC1JaW5jbHVkZS9nc3NhcGlfa3JiNQ0KPj4gICAuZWxzZQ0KPj4gICAjIEhlaW1kYWwN Cj4+ICAgTElCQUREKz0Ja3JiNSByb2tlbg0KPj4NCj4+DQo+Pj4NCj4+PiBOb3cgSSBjYW4g dGVzdC9kZWJ1ZyB0aGUgY2hhbmdlcy4NCj4+Pg0KPj4+IEJ0dywgdGhlIHN0dWZmIGluIC91 c3IvbG9jYWwvaW5jbHVkZS9nc3NhcGkgYXJlIGNvcnJlY3QgYW5kIG5vdCBtZXNzZWQgdXAN Cj4+PiBsaWtlIHRoZSBzdHVmZiBpbiAvdXNyL2luY2x1ZGUvZ3NzYXBpLiAoVGhlIG9uZXMg aW4gL3Vzci9sb2NhbC9pbmNsdWRlIGRlZmkNCj4+ID0NCj4+PiBuZQ0KPj4+IEdTU19ETExJ TVAgZm9yIGV4YW1wbGUuKQ0KPj4+DQo+Pj4gSSdtIGdvaW5nIHRvIGxlYXZlIGZpZ3VyaW5n IG91dCB3aHkgdGhlIGxpYnJhcmllcyBpbiAvdXNyL2xpYiBhcmUgbWVzc2VkIHVwDQo+Pj4g dG8gc29tZW9uZSBlbHNlLg0KPj4+DQo+Pj4gcmljaw0KPj4+DQo+IA0KPiBJIGhhZCBleHBs YWluZWQgdGhpcyB0byBMZXhpIHByaXZhdGUgbW9tZW50cyBhZ28uDQo+IA0KPiBJdCdzIG5v dCB0aGF0LiBnc3NhcGkuaCBpcyBpbnN0YWxsZWQgYnkgbGliL2xpYmdzc2FwaSwgdGhlIGdz c2FwaQ0KPiBmb3J3YXJkZXIuIEhlaW1kYWwgaGFkIG5vIGdzc2FwaS5oIHdoZXJlYXMgTUlU IEtSQjUgZG9lcy4gSSBwdXQgdGhlIE1JVA0KPiBnc3NhcGkuaCBpbiAvdXNyL2luY2x1ZGUv Z3NzYXBpX2tyYjUgZm9yIGFwcHMgdGhhdCBtaWdodCBuZWVkIGl0Lg0KDQpBbmQgdGhpcyBs ZWFkcyB0byB0aGUgbWVzcyBkdWUgdG8gcmVzdCBvZiBpbmNsdWRlcyBpbiAvdXNyL2luY2x1 ZGUvZ3NzYXBpIGNvbWVzIGZyb20gTUlUIGFuZCByZWx5aW5nIG9uIGdzc3BhaS5oIGZyb20g TUlUIHRvbyBidXQgaXQgaGlkZGVkIGJ5IHNlcGFyYXRlZCBwcmVmaXggYW5kIG5vdCBob29r ZWQgdXAgYnkgZGVmYXVsdC4NCiAgDQpHcmVhdCBleGFtcGxlIG9mIG1lc3NpbmcgY29tZXMg ZnJvbSBldm9sdXRpb24tZGF0YS1zZXJ2ZXIgKG9yIGZyb20gYW55IG90aGVyIGNvbnN1bWVy IG9mICNpbmNsdWRlIDxnc3NhcGkvZ3NzYXBpX2V4dC5oPiBvciAjaW5jbHVkZSA8Z3NzYXBp L2dzc2FwaV9nZW5lcmljLmg+IGR1ZSB0byBib3RoIHdhbnQgI2luY2x1ZGUgPGdzc2FwaS9n c3NhcGkuaD4pOg0KDQpJbiBmaWxlIGluY2x1ZGVkIGZyb20gL3dya2RpcnMvdXNyL3BvcnRz L2RhdGFiYXNlcy9ldm9sdXRpb24tZGF0YS1zZXJ2ZXIvd29yay9ldm9sdXRpb24tZGF0YS1z ZXJ2ZXItMy41Ni4yL3NyYy9jYW1lbC9jYW1lbC1zYXNsLWdzc2FwaS5jOjU5Og0KL3Vzci9p bmNsdWRlL2dzc2FwaS9nc3NhcGlfZ2VuZXJpYy5oOjUwOjE6IGVycm9yOiB1bmtub3duIHR5 cGUgbmFtZSAnR1NTX0RMTElNUCcNCiAgICA1MCB8IEdTU19ETExJTVAgZXh0ZXJuIGdzc19P SUQgZ3NzX250X3VzZXJfbmFtZTsNCiAgICAgICB8IF4NCi91c3IvaW5jbHVkZS9nc3NhcGkv Z3NzYXBpX2dlbmVyaWMuaDo1MDoyNjogZXJyb3I6IGV4cGVjdGVkICc7JyBhZnRlciB0b3Ag bGV2ZWwgZGVjbGFyYXRvcg0KICAgIDUwIHwgR1NTX0RMTElNUCBleHRlcm4gZ3NzX09JRCBn c3NfbnRfdXNlcl9uYW1lOw0KICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgIF4N Ci91c3IvaW5jbHVkZS9nc3NhcGkvZ3NzYXBpX2dlbmVyaWMuaDo1MToxOiBlcnJvcjogdW5r bm93biB0eXBlIG5hbWUgJ0dTU19ETExJTVAnDQogICAgNTEgfCBHU1NfRExMSU1QIGV4dGVy biBnc3NfT0lEIGdzc19udF9tYWNoaW5lX3VpZF9uYW1lOw0KICAgICAgIHwgXg0KL3Vzci9p bmNsdWRlL2dzc2FwaS9nc3NhcGlfZ2VuZXJpYy5oOjUxOjI2OiBlcnJvcjogZXhwZWN0ZWQg JzsnIGFmdGVyIHRvcCBsZXZlbCBkZWNsYXJhdG9yDQogICAgNTEgfCBHU1NfRExMSU1QIGV4 dGVybiBnc3NfT0lEIGdzc19udF9tYWNoaW5lX3VpZF9uYW1lOw0KICAgICAgIHwgICAgICAg ICAgICAgICAgICAgICAgICAgIF4NCi91c3IvaW5jbHVkZS9nc3NhcGkvZ3NzYXBpX2dlbmVy aWMuaDo1MjoxOiBlcnJvcjogdW5rbm93biB0eXBlIG5hbWUgJ0dTU19ETExJTVAnDQogICAg NTIgfCBHU1NfRExMSU1QIGV4dGVybiBnc3NfT0lEIGdzc19udF9zdHJpbmdfdWlkX25hbWU7 DQogICAgICAgfCBeDQovdXNyL2luY2x1ZGUvZ3NzYXBpL2dzc2FwaV9nZW5lcmljLmg6NTI6 MjY6IGVycm9yOiBleHBlY3RlZCAnOycgYWZ0ZXIgdG9wIGxldmVsIGRlY2xhcmF0b3INCiAg ICA1MiB8IEdTU19ETExJTVAgZXh0ZXJuIGdzc19PSUQgZ3NzX250X3N0cmluZ191aWRfbmFt ZTsNCiAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICBeDQovdXNyL2luY2x1ZGUv Z3NzYXBpL2dzc2FwaV9nZW5lcmljLmg6NTQ6MTogZXJyb3I6IHVua25vd24gdHlwZSBuYW1l ICdHU1NfRExMSU1QJw0KICAgIDU0IHwgR1NTX0RMTElNUCBleHRlcm4gZ3NzX09JRCBnc3Nf bnRfc2VydmljZV9uYW1lOw0KICAgICAgIHwgXg0KL3Vzci9pbmNsdWRlL2dzc2FwaS9nc3Nh cGlfZ2VuZXJpYy5oOjU0OjI2OiBlcnJvcjogZXhwZWN0ZWQgJzsnIGFmdGVyIHRvcCBsZXZl bCBkZWNsYXJhdG9yDQogICAgNTQgfCBHU1NfRExMSU1QIGV4dGVybiBnc3NfT0lEIGdzc19u dF9zZXJ2aWNlX25hbWU7DQogICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgXg0K OCBlcnJvcnMgZ2VuZXJhdGVkLg0KDQpCZXN0IHdheSBpcyBpbnN0YWxsIE1JVCdzIG9uZSBn c3NhcGkuaCBhbG9uZ3NpZGUgd2l0aCBvdGhlciBtaXQgaGVhZGVyIHVuZGVyIC9pbmNsdWRl L2dzc2FwaS8gYW5kIG1vdmUgbGliZ3NzYXBpJ3Mgb25lIHVuZGVyIG93biBwcmVmaXggYXMg eW91IHByZXZpb3VzbHkgZGlkIGZvciBtaXQgb25lLg0KDQoNCj4gDQo+IFRoaXMgd2FzIG5v dCBhIHByb2JsZW0gYmVjYXVzZSBIZWltZGFsIG5ldmVyIGhhZCBhIGdzc2FwaS5oIHdoaWxl IHdpdGggTUlUDQo+IHRoZXJlIGlzIGEgY29uZmxpY3QuIFJlbW92aW5nIGxpYi9saWJnc3Nh cGkgb3IgaXRzIGdzc2FwaS5oIGlzIG5vdCBhbg0KPiBvcHRpb24gYmVjYXVzZSBpdCdzIGEg Z3NzYXBpIGZvcndhcmRlci4gVGhpcyB3YXMgdGhlIGNvbXByb21pc2UgSSBzZXR0bGVkDQo+ IG9uLg0KPiANCj4gDQoNCi0tIA0KU2luY2VyZWx5LA0KRGltYSAoZmx1ZmZ5QEZyZWVCU0Qu b3JnLCBodHRwczovL3QubWUvRmx1ZmZ5QlNELCBAZmx1ZmZ5Om1hdHJpeC1kZXYuZnJlZWJz ZC5vcmcpDQooZGVza3RvcCwga2RlLCB4MTEsIG9mZmljZSwgcG9ydHMtc2VjdGVhbSlARnJl ZUJTRCB0ZWFtDQoNCg== --------------6Ta41uX8tAKL06OF5zMCsvUy-- --------------qSX0obzJi9Q40DK8eTKEmVcr Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmiLtNQFAwAAAAAACgkQ+4ugndU5jymI GQ/9GV8y0p3l23LsQxYXYIdg3R/KEUuJNc5q/gNJK7UKRHEMxu+vpADIR8lFGRVr3yY1zuLvQ/OK Py5BS9DzsoKf0bUFcwu4WrCMqnXIknsU0VVhlKjdimomgVQ6d8/TuBIVjdAJb6pJzpBHcLRRh6DX xrJUVcT7foly+jGnifhY/0dLulDF75eJ4ChPGMNS8c78Bz345SmrF5pOPe30Dk4aLl5+Y/9herwn IY33aaToEEIQYSP9mx/wtAS4+HcuQrwDSBUhFnI6q2BHQUHs1Y/FU+iJa41gBp4yy7NHBORkmKf1 JN8a3U4oZHaFzy3GYLAcPsYJj+UBDj4VrRZ9Dlhde+83hziRoF/ixXausFD7wSk4049amxiiXZ3C 8ZrEkcl4mOe39Z4fQFWi7FITRj7/D0Uh91TL5G6oIRavYqC51dEHxK77N22tb8MgAxOUKi20hi9Y GQmNDi/5zDVBllLMipMIM3W4RegkhdbTcRaKO1TlpW3X5xhEdXWNYYVDf2tWJYmXUqzxLE5jV/k/ zWz9RkWEOlKI49S63NZSNtZ11NHVrY6MqVwslW4b6AM9TEQQ6LSpehZ0sD1ql5cwJfMaAViP5f1G KEswUv5UnDyjcuHh+rCsD8hf0OriEaUggw8QC8wmKNJkNbickGR6aTe0x6ysSXb2Q2d/u+ukJ2yv NtA= =fVTz -----END PGP SIGNATURE----- --------------qSX0obzJi9Q40DK8eTKEmVcr-- From nobody Thu Jul 31 18:33:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btHm85Hzrz62tcj; Thu, 31 Jul 2025 18:34:00 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btHm84YQWz3jNl; Thu, 31 Jul 2025 18:34:00 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753986840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=j4XUDv40DKmX1oXvydQ/BxTWz5Abi6+VpgYNaP730vg=; b=fPrTY8I5e2htNBUhj3MvoKI5FqdX6Cf4trh18p0uBOnMGO3Xna32dyTG4IubnvJSNSa1HT YFsThfEpZmt6yJKpYPR3KNSgbL+gjOw+jAr9AtRx3B5wnXzh9BDXz2DRv2aktBYrZ6RL6v LpGyWtyqAZZlLydBZMMMiTSqbr35w/OYpPqjPjCwoZIlsSIuREVvgKv2iSDDRlLry4U+jE pU0bQEQ71AQHOaued//jyxvqDOIc0N1w34EEH87ITLlnyxudO5CY0YyerfCxgSZVqAbI3b XBSveYzt1oNPH0S/2buB3Gyw2sB3QSgEFVxhL2mSl1/P1O2tEH7xEv5m0eV6nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753986840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=j4XUDv40DKmX1oXvydQ/BxTWz5Abi6+VpgYNaP730vg=; b=wQN9AODpqOT70Ky4P8m3TMMeKkNYGSpLDykybX3EmZY4wCdSdEICErd2wkNmMrMQDtmqAi 7MsvSx1q0O2MFWgcPTsNqK+F8nvxn/PIilo1PZeMxB3DD8IGsKoCsBHz8JQRjho/WVWcnV 7ripzHSV+HNarSsfU6r3yhRTUiTLzE9T07cK6nkE7qLaFCvuj2S5Fe6KkkdLbsJAdfo3/6 Tdn7VHWwTeFNkFCdGDrv9efp+tJkdCfmI+0vxUZvUVk013rVSmPLa+lIOqmQXAoel/MR+F pYtKMYKFgvAjMXAffGZQjeR40RIFKyyJMvGwDLx3VWTNn1my5Sm//H43Mc2YpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753986840; a=rsa-sha256; cv=none; b=b4NsUwvkGyyknr8mCoW6R/1ZI+a3cJNiQlPoKpeYk0dmBuIMGHItEeM9vP/MWp0VxJGJHy ZUo3YwibAQZ8qd+ihp9NvdGhpZPHrwuezqfByBRPQFYyJLa2S2agJrRPZCLmNQDzk+LzSw MrRYIBqaTkdHxDGgNiEvcO20gV0JDYqMU6twdfUu+3LtFHK1quHXyfsYbB4bq/HisaCLmG yl/2/ewDfvP7G0jK6vFybs+CuNCvvIUeaLW/yv3084xtqlZrSF3Zej6KGZBNJlKxI1qdVp pDVmVs1R5mU9eYDylC9+NlSI7jSinv3y7Z7cOy+OJuxkwzcRB+eV1aZca8bZQA== Received: from [10.216.0.119] (unknown [188.243.165.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4btHm721BKzMqw; Thu, 31 Jul 2025 18:33:59 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <4de3cb1e-d899-4459-ab67-0d202e3b227a@FreeBSD.org> Date: Thu, 31 Jul 2025 21:33:57 +0300 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Cy Schubert , Rick Macklem Cc: Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> <20250731155322.6D194304@slippy.cwsent.com> Content-Language: ru, en-GB From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <20250731155322.6D194304@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------uxB7MDQ5TFuBCOl4KHjSkMwW" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------uxB7MDQ5TFuBCOl4KHjSkMwW Content-Type: multipart/mixed; boundary="------------23K0HvCamsG5lha92wy1vaZf"; protected-headers="v1" From: Dima Panov To: Cy Schubert , Rick Macklem Cc: Benjamin Kaduk , Konstantin Belousov , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <4de3cb1e-d899-4459-ab67-0d202e3b227a@FreeBSD.org> Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> <20250731152803.19F9ACD@slippy.cwsent.com> <20250731155322.6D194304@slippy.cwsent.com> In-Reply-To: <20250731155322.6D194304@slippy.cwsent.com> --------------23K0HvCamsG5lha92wy1vaZf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQoNCk9uIDMxLjA3LjIwMjUgMTg6NTMsIEN5IFNjaHViZXJ0IHdyb3RlOg0KPiBJbiBtZXNz YWdlIDwyMDI1MDczMTE1MjgwMy4xOUY5QUNEQHNsaXBweS5jd3NlbnQuY29tPiwgQ3kgU2No dWJlcnQgd3JpdGVzOg0KPj4gSW4gbWVzc2FnZSA8Q0FNNXROeTRYdXBQR1hITVMwcDBUSzBX Zl96QWc1YnNPeng0QzFLMWUtXzJiPTNleVV3QG1haWwuZ21haWwuYw0KPj4gb20+DQo+PiAs IFJpY2sgTWFja2xlbSB3cml0ZXM6DQo+Pj4gT24gVGh1LCBKdWwgMzEsIDIwMjUgYXQgNjo1 MT1FMj04MD1BRkFNIFJpY2sgTWFja2xlbSA8cmljay5tYWNrbGVtQGdtYWlsLmNvDQo+PiA9 DQo+Pj4gbT4gd3JvdGU6DQo+Pj4+DQo+Pj4+IE9uIFRodSwgSnVsIDMxLCAyMDI1IGF0IDY6 MDc9RTI9ODA9QUZBTSBSaWNrIE1hY2tsZW0gPHJpY2subWFja2xlbUBnbWFpbC4NCj4+ID0N Cj4+PiBjb20+IHdyb3RlOg0KPj4+Pj4NCj4+Pj4+IE9uIFdlZCwgSnVsIDMwLCAyMDI1IGF0 IDk6MjQ9RTI9ODA9QUZQTSBCZW5qYW1pbiBLYWR1ayA8YmprZmJzZEBnbWFpbC5jDQo+PiA9 DQo+Pj4gb20+IHdyb3RlOg0KPj4+Pj4+DQo+Pj4+Pj4gT24gV2VkLCBKdWwgMzAsIDIwMjUg YXQgMTA6MzY9RTI9ODA9QUZBTSBSaWNrIE1hY2tsZW0gPHJpY2subWFja2xlbUBnDQo+PiA9 DQo+Pj4gbWFpbC5jb20+IHdyb3RlOg0KPj4+Pj4+Pg0KPj4+Pj4+PiBPbiBNb24sIEp1bCAy OCwgMjAyNSBhdCAzOjMyPUUyPTgwPUFGUE0gQmVuamFtaW4gS2FkdWsgPGJqa2Zic2RAZ21h aQ0KPj4gPQ0KPj4+IGwuY29tPiB3cm90ZToNCj4+Pj4+Pj4+DQo+Pj4+Pj4+PiBPbiBNb24s IEp1bCAyOCwgMjAyNSBhdCAzOjA0PUUyPTgwPUFGUE0gQmVuamFtaW4gS2FkdWsgPGJqa2Zi c2RAZ20NCj4+ID0NCj4+PiBhaWwuY29tPiB3cm90ZToNCj4+Pj4+Pj4+Pg0KPj4+Pj4+Pj4+ DQo+Pj4+Pj4+Pj4gTm90ZSB0aGF0IE1JVCBrcmI1IHByb3ZpZGVzIHRoZSBnc3Nfa3JiNV9l eHBvcnRfbHVjaWRfc2VjX2NvbnRleHQNCj4+ID0NCj4+PiAoKSBBUEkgdGhhdCBkb2VzIGEg bG90IG9mIHRoZSB3b3JrIG9mIGdldHRpbmcgdXNlZnVsIGJpdHMgb3V0IG9mIGFuIGVzdGFi bGkNCj4+ID0NCj4+PiBzaGVkIEdTUyBzZWN1cml0eSBjb250ZXh0Lg0KPj4+Pj4+Pj4+DQo+ Pj4+Pj4+Pg0KPj4+Pj4+Pj4NCj4+Pj4+Pj4+DQo+Pj4+Pj4+Pg0KPj4+Pj4+Pj4gQW5kIGEg Yml0IG1vcmUgY29udGV4dCBvbiB3aGF0IGlzIGdvaW5nIG9uIGhlcmUgYW5kIHdoeSBrZ3Nz YXBpIGhhDQo+PiA9DQo+Pj4gcyB0byBjYXJlOg0KPj4+Pj4+Pj4gVGhlIEdTUy1BUEkgKFJG QyAyNzQzKSBpcyBhbGwgYWJvdXQgYSB3YXkgdG8gImVzdGFibGlzaCBhIHNlY3VyaXR5DQo+ PiA9DQo+Pj4gICBjb250ZXh0IiAoaS5lLiwgZG8gY3J5cHRvIG5lZ290aWF0aW9uLCBhdXRo ZW50aWNhdGlvbiwgc29tZXRpbWVzIGF1dGhvcml6YQ0KPj4gPQ0KPj4+IHRpb24sIGV0Yy4p IGJldHdlZW4gdHdvIGVudGl0aWVzLCB0aGUgaW5pdGlhdG9yIGFuZCB0aGUgYWNjZXByb3Qs IGFuZCB0aGVuDQo+PiA9DQo+Pj4gZXhjaGFuZ2luZyBwcm90ZWN0ZWQgbWVzc2FnZXMgYmV0 d2VlbiB0aGUgdHdvICh3aGljaCBjYW4gYmUgZWl0aGVyIGVuY3J5cHRlDQo+PiA9DQo+Pj4g ZCBvciBqdXN0IGludGVncml0eSBwcm90ZWN0aW9uIHRhZ3MgZm9yIG90aGVyd2Vpc2UgY2xl YXJ0ZXh0IGRhdGEpOyBsYXRlciBlDQo+PiA9DQo+Pj4geHRlbnNpb25zIGluY2x1ZGVkIHRo ZSBhYmlsaXR5IHRvIHByb2R1Y2UgaWRlbnRpY2FsIFBSRiBvdXRwdXQgb24gYm90aCBwYXJ0 DQo+PiA9DQo+Pj4gaWVzLCBldGMuLiAgVGhlIGRldGFpbHMgYXJlICJtZWNoYW5pc20tc3Bl Y2lmaWMiLCBhbmQgZm9yIHRoaXMgcHVycG9zZSB3ZSdyDQo+PiA9DQo+Pj4gZSBleGNsdXNp dmVseSB0YWxraW5nIGFib3V0IHRoZSBrcmI1IG1lY2hhbmlzbS4gIFRoZSBzdGVwcyB0byBl c3RhYmxpc2ggdGhlDQo+PiA9DQo+Pj4gICBzZWN1cml0eSBjb250ZXh0IGFyZSBjb21wbGlj YXRlZCBhbmQgc29tZXRpbWVzIGZpZGRseSwgYW5kIGluIHRoZSBnZW5lcmFsDQo+PiA9DQo+ Pj4gY2FzZSBjYW4gcmVxdWlyZSBhIGxhcmdlIG51bWJlciBvZiByb3VuZC10cmlwcyBiZXR3 ZWVuIHRoZSBpbml0aWF0b3IgYW5kIGFjDQo+PiA9DQo+Pj4gY2VwdG9yIGJlZm9yZSB0aGUg c2VjdXJpdHkgY29udGV4dCBpcyBlc3RhYmxpc2hlZC4gIFRoZSBpbmRpdmlkdWFsIG1lc3Nh Z2UtDQo+PiA9DQo+Pj4gcHJvdGVjdGlvbiBwYXJ0cyBhcmUgY29tcGFyYXRpdmVseSBzaW1w bGUgYW5kIGFtZW5kYWJsZSB0byBpbXBsZW1lbnRhdGlvbiBpDQo+PiA9DQo+Pj4gbiB0aGUg a2VybmVsIGZvciBwcm9jZXNzaW5nIGVmZmljaWVuY3kuDQo+Pj4+Pj4+PiBSRkMgMjc0MyBh bHNvIGRlZmluZXMgZnVuY3Rpb25zIGZvciBHU1NfRXhwb3J0X3NlY19jb250ZXh0KCkgYW5k IEcNCj4+ID0NCj4+PiBTU19JbXBvcnRfc2VjX2NvbnRleHQoKSwgdGhhdCBhcmUgZGVzaWdu ZWQgZXNzZW50aWFsbHkgdG8gcGFzcyBpbmZvcm1hdGlvbg0KPj4gPQ0KPj4+IGFib3V0IGFu IGVzdGFibGlzaGVkIHNlY3VyaXR5IGNvbnRleHQgZnJvbSBvbmUgcHJvY2VzcyB0byBhbm90 aGVyIG9uIHRoZSBzYQ0KPj4gPQ0KPj4+IG1lIG1hY2hpbmUgKHdoaWNoIGFyZSBwcmVzdW1h Ymx5IHVzaW5nIHRoZSBzYW1lIGltcGxlbWVudGF0aW9uIGFuZCB2ZXJzaW9uDQo+PiA9DQo+ Pj4gb2YgdGhlIGltcGxlbWVudGF0aW9uKSwgc28gdGhlIGNvbnRlbnRzIG9mIHRoZSBleHBv cnRlZCBibG9iIGFyZSBvcGFxdWUgYW5kDQo+PiA9DQo+Pj4gICBpbXBsZW1lbnRhdGlvbi1z cGVjaWZpYy4gIFdlIGFyZSBhYnVzaW5nIHRoYXQgbWVjaGFuaXNtIHRvIGV4cG9ydCBpbmZv cm1hdA0KPj4gPQ0KPj4+IGlvbiBhYm91dCB0aGUgc2VjdXJpdHkgY29udGV4dCB0aGF0IGdz c2QgaGFzIGVzdGFibGlzaGVkIGFuZCBmZWVkIHRoYXQgaW5mbw0KPj4gPQ0KPj4+IHJtYXRp b24gaW50byB0aGUga2VybmVsIGltcGxlbWVudGF0aW9uIG9mIHRoZSBwZXItbWVzc2FnZSBw cm9jZXNzaW5nIHJvdXRpbg0KPj4gPQ0KPj4+IGVzLiAgQXQgcHJlc2VudCwgdGhpcyBuZWNl c3NhcmlseSBlbnRhaWxzIGtub3dpbmcgdGhlIGRldGFpbHMgb2YgdGhlIGltcGxlbQ0KPj4g PQ0KPj4+IGVudGF0aW9uLXNwZWNpZmljIG9wYXF1ZSBibG9iIHRoYXQgaXMgdGhlICJleHBv cnQgc2VjIGNvbnRleHQgdG9rZW4iLCB3aGljaA0KPj4gPQ0KPj4+ICAgaXMgd2hhdCB0aGUg c3lzL2tnc3NhcGkva3JiNS9rcmI1X21lY2guYyBjb2RlIGlzIGRvaW5nLiAgQnV0IGlmIHdl IGNhbiBnZXQNCj4+ID0NCj4+PiAgIHRoZSBpbmZvcm1hdGlvbiB3ZSB3YW50IHdpdGhvdXQg YnJlYWtpbmcgdGhlIGFic3RyYWN0aW9uIGJhcnJpZXIsIHN1Y2ggYXMNCj4+ID0NCj4+PiB2 aWEgdGhlIGdzc19rcmI1X2V4cG9ydF9sdWNpZF9zZWNfY29udGV4dCgpIEFQSSwgd2UgYXJl IGluIGEgbW9yZSByb2J1c3QgcG8NCj4+ID0NCj4+PiBzdHVyZSBvdmVyYWxsIGFuZCBzb21l d2hhdCBmdXR1cmUtcHJvb2ZlZCBhZ2FpbnN0IGZ1dHVyZSBldm9sdXRpb24gYnkgTUlUIGsN Cj4+ID0NCj4+PiByYjUuDQo+Pj4+Pj4+PiAoSSBub3RlIHRoYXQgcmVjZW50IEhlaW1kYWwg dmVyc2lvbnMgc2VlbSB0byBhbHNvIGV4cG9zZSBhIGdzc19rcmINCj4+ID0NCj4+PiA1X2V4 cG9ydF9sdWNpZF9zZWNfY29udGV4dCgpIEFQSSwgc28gcGFydCBvZiB0aGUgcHJvYmxlbSBp cyBqdXN0IHRoYXQgdGhlIEgNCj4+ID0NCj4+PiBlaW1kYWwgaW4gYmFzZSBpcyBzbyBvbGQu KQ0KPj4+Pj4+Pg0KPj4+Pj4+PiBXZWxsLCBoZXJlJ3Mgc29tZSAibm90IHNvIGdvb2QiIG5l d3MuLi4NCj4+Pj4+Pj4gSSd2ZSBiZWVuIHRyeWluZyB0byB1c2UgZ3NzX2lucXVpcmVfc2Vj X2NvbnRleHRfYnlfb2lkKC4uKSB3aXRoIHRoZQ0KPj4gPQ0KPj4+IG9pZA0KPj4+Pj4+PiBm b3IgdGhlIEdTU19LUkI1X0VYUE9SVF9MVUNJRF9TRUNfQ09OVEVYVF9PSUQgd2l0aCB2ZXJz aW9uIDEuDQo+Pj4+Pj4+IEl0IGtlcHQgZmFpbGluZy4NCj4+Pj4+Pj4gVGhlIHByb2JsZW0g c2VlbXMgdG8gYmUgdGhhdCAiZ2N0eC0+cHJvdG8gPTNEPTNEIDQiIGluIG1ha2VfZXh0ZXJu YWwNCj4+ID0NCj4+PiBfbHVjaWRfY3R4X3YxKCkNCj4+Pj4+Pj4gZnVuY3Rpb24uIFRoaXMg ZnVuY3Rpb24gb25seSBrbm93cyBhYm91dCB0aGUgMCBhbmQgMSBzZXR0aW5nIGZvciBnY3QN Cj4+ID0NCj4+PiB4LT5wcm90by4NCj4+Pj4+Pj4NCj4+Pj4+Pj4gQW55IGlkZWFzLCByaWNr DQo+Pj4+Pj4+DQo+Pj4+Pj4NCj4+Pj4+Pg0KPj4+Pj4+IEknbSBub3Qgc2VlaW5nIGFueXRo aW5nIHRvIHN1Z2dlc3QgdGhhdCBhICJnY3R4LT5wcm90byIgdmFsdWUgb2YgNCBpcw0KPj4g PQ0KPj4+ICAgZXZlciBleHBlY3RlZDsgaXQgbG9va3MgbGlrZSBpdCdzIHN1cHBvc2VkIHRv IGp1c3QgYmUgMCAoZm9yIHRoZSBsZWdhY3kgUkYNCj4+ID0NCj4+PiBDIDE5NjQgZm9ybWF0 KSBvciAxIChmb3IgdGhlICJDRlgiIGZvcm1hdCBvZiBSRkMgNDEyMSwgd2l0aCB3aWRlciBz ZXF1ZW5jZQ0KPj4gPQ0KPj4+IG51bWJlcnMgZm9yIG1lc3NhZ2UtcHJvdGVjdGlvbiBmb3Jt YXRzLCBldGMuKS4gIFNvIG1heWJlIGl0J3Mgd29ydGggcG9zdGluZw0KPj4gPQ0KPj4+ICAg eW91ciBjdXJyZW50IFdJUCBzb21ld2hlcmUgdG8gdGFrZSBhIGNsb3NlciBsb29rIGF0IHdo YXQncyBnb2luZyBvbi4NCj4+Pj4+DQo+Pj4+PiBZZWEsIHRoZSBkZWJ1Z2dpbmcgSSBkaWQg d2FzIGZsYXdlZCAoSSBwcm9iYWJseSBnb3QgdGhlIHdyb25nIG9mZnNldA0KPj4+Pj4gaW4g dGhlIHN0cnVjdHVyZSkuDQo+Pj4+PiBJdCBpcyB3ZWlyZCwgdGhvdWdoLiBJZiBJIGRvIGdz c19pbnF1aXJlX3NlY19jb250ZXh0X2J5X29pZCgmbWlub3IsIGN0eA0KPj4gPQ0KPj4+ICwN Cj4+Pj4+IE9JRF9GT1JfR1NTX0lOUVVJUkVfU1NQSV9TRVNTSU9OX0tFWSwgJmtleSksIGl0 DQo+Pj4+PiB3b3JrcyBhbmQgZ2l2ZXMgbWUgdGhlIGtleSBhbmQgZW5jcnlwdGlvbiB0eXBl Lg0KPj4+Pj4NCj4+Pj4+IElmIEkgZG8gdGhlIHNhbWUsIGJ1dCB3aXRoIHRoZSAxMiBieXRl IE9JRCBmb3IgTFVDSUQgdjEgKHRoZSAxMSBieXRlcyBmDQo+PiA9DQo+Pj4gcm9tIHRoZQ0K Pj4+Pj4gc3RyaW5nICsgYSAxIGJ5dGUpLCBpdCByZXR1cm5zIG1ham9yID0zRD0zRCBHU1Nf U19DT01QTEVURSwgYnV0IG5vIGRhdGENCj4+ID0NCj4+PiAgIGFuZA0KPj4+Pj4gYSB3ZWly ZCAzOTc1NjA0NihkZWNpbWFsKSBvciAweDI1ZWExMGUoaGV4KSBtaW5vci4NCj4+Pj4+IChP aCwgYW5kIEkgdHJpZWQgZ3NzX2tyYjVfZXhwb3J0X2x1Y2lkX3NlY19jb250ZXh0KCkgYW5k IGdvdCB0aGUgc2FtZQ0KPj4+Pj4gd2VpcmQgZXJyb3IuKQ0KPj4+PiAtLT4gTm93IChhZnRl ciBkb2luZyBhICJtYWtlIGJ1aWxkd29ybGQiKSwgZ3NzX2tyYjVfZXhwb3J0X2x1Y2lkX3Nl Y19jb250DQo+PiA9DQo+Pj4gZXh0KCkNCj4+Pj4gICAgICAgcmV0dXJucyBHU1NfU19CQURf TUVDSC4gTG9va2luZyBhdCB0aGUgc3JjLCB0aGF0IGVycm9yIGhhcyB0byBiZSBmcm8NCj4+ ID0NCj4+PiBtDQo+Pj4+ICAgICAgIGdzc19pbnF1aXJlX3NlY19jb250ZXh0X2J5X29pZCgp LiBTbywgc2FtZSBmdW5jdGlvbiBmYWlscywgYnV0IGEgZGlmDQo+PiA9DQo+Pj4gZmVyZW50 DQo+Pj4+ICAgICAgIGVycm9yIHJldHVybj8NCj4+Pj4NCj4+Pj4gSXQgbG9va3MgbGlrZSAi Z3NzaW50X2dldF9tZWNoYW5pc20gKGN0eC0+bWVjaF90eXBlKSIgaXMgZmFpbGluZy4NCj4+ Pj4gSSdtIGN1cnJlbnRseSBqdXN0IHBhc3NpbmcgR1NTX0NfTlVMTF9PSUQgaW50byBnc3Nf aW5pdF9zZWNfY29udGV4dCgpLA0KPj4+PiBidXQgSSd2ZSBhbHNvIHRyaWVkIHRoZSBLZXJi ZXJvcyA5IGJ5dGUgT0lEIChib3RoIHdvcmssIGluIHRoZSBzZW5zZSB0aGF0DQo+Pj4+IGdz c19pbml0X3NlY19jb250ZXh0KCkgc2VlbXMgdG8gd29yaywgZXhjZXB0IHRoYXQgdGhlIGFj dHVhbF9tZWNoX3R5cGUNCj4+Pj4gcmV0dXJuZWQgYnkgaXQgaGFzIGEgYm9ndXMgcG9pbnRl ciBpbiB0aGUgcmVwbHkpLg0KPj4+PiAtLT4gSXQgbG9va3MgbGlrZSB0aGUgIm1lY2hfdHlw ZSIgZmllbGQgb2YgImN0eCIgaXMgYnVzdGVkLCBmb3Igc29tZSByZWFzDQo+PiA9DQo+Pj4g b24/DQo+Pj4+DQo+Pj4+IEknbSBnb2luZyB0byB0cnkgYnVpbGRpbmcga3JiNSBmcm9tIHBv cnRzIGFuZCBsaW5raW5nIHRvIHRoYXQsIHRvIHNlZSBpZg0KPj4gPQ0KPj4+IGl0DQo+Pj4+ IGRvZXMgdGhlIHNhbWUgdGhpbmcuDQo+Pj4gRmluYWxseSBzb21lIGdvb2QgbmV3cy4uLg0K Pj4+IEFsbCBJIGRpZCB3YXMgInBrZyBpbnN0YWxsIGtyYjUiIGFuZCB0aGVuIGxpbmtlZCB0 aGUgZ3NzZCB0byB0aGUgbGlicmFyaWVzDQo+PiA9DQo+Pj4gaW4NCj4+PiAvdXNyL2xvY2Fs L2xpYiBhbmQgaXQgd29ya2VkISENCj4+DQo+PiBnc3NhcGkvZ3NzYXBpLmggZnJvbSBrcmI1 L2xpYi9nc3NhcGkvZ2VuZXJpYyBpcyBvdmVyd3JpdHRlbiBieSBvdXINCj4+IGxpYi9saWJn c3NhcGkuIEFzIHdlIGhhdmUgdHdvIHRoZSBNSVQgZ3NzYXBpLmggaXMgcHV0IGluDQo+PiAv dXNyL2luY2x1ZGUvZ3NzYXBpX2tyYjUvZ3NzYXBpLmguDQo+Pg0KPj4gVGhpcyBwYXRjaCBz aG91bGQgZml4IHRoZSBwcm9ibGVtLiBJIGhhdmVuJ3QgdGVzdGVkIHRoaXMgeWV0Lg0KPj4N Cj4+IGRpZmYgLS1naXQgYS91c3Iuc2Jpbi9nc3NkL01ha2VmaWxlIGIvdXNyLnNiaW4vZ3Nz ZC9NYWtlZmlsZQ0KPj4gaW5kZXggNTY5ZTJjN2UxOGY1Li40YzlkMzQyYzQ4YzMgMTAwNjQ0 DQo+PiAtLS0gYS91c3Iuc2Jpbi9nc3NkL01ha2VmaWxlDQo+PiArKysgYi91c3Iuc2Jpbi9n c3NkL01ha2VmaWxlDQo+PiBAQCAtMTQsNyArMTQsNyBAQCBMSUJBREQ9CWdzc2FwaQ0KPj4g ICAuaWYgJHtNS19NSVRLUkI1fSAhPSAibm8iDQo+PiAgICMgTUlUIEtSQjUNCj4+ICAgTElC QUREKz0Ja3JiNSBrNWNyeXB0byBrcmI1cHJvZmlsZSBrcmI1c3VwcG9ydA0KPj4gLUNGTEFH Uys9IC1ETUtfTUlUS1JCNT15ZXMNCj4+ICtDRkxBR1MrPSAtRE1LX01JVEtSQjU9eWVzIC1J aW5jbHVkZS9nc3NhcGlfa3JiNQ0KPj4gICAuZWxzZQ0KPj4gICAjIEhlaW1kYWwNCj4+ICAg TElCQUREKz0Ja3JiNSByb2tlbg0KPiANCj4gVGhpcyBwYXRjaCBpcyBpbmNvcnJlY3QuIFRo ZSBmb2xsb3dpbmcgcGF0Y2ggaXMgY29ycmVjdC4NCg0KV3JvbmcgYW5zd2VyLCBzb3JyeS4N CllvdSBzdGlsbCBsZWF2ZSBhIG1lc3MgdW5kZXIgL3Vzci9pbmNsdWRlL2dzc2FwaSBhbmQg bGVhZHMgYWxsIGNvbnN1bWVyIG9mICNpbmNsdWRlIDxnc3NhcGkvZ3NzYXBpLmg+IHVzZSBu b24tbWl0IGhlYWRlciB3aXRoIG1pdCBsaWJyYXJpZXMuDQoNCj4gDQo+IGRpZmYgLS1naXQg YS91c3Iuc2Jpbi9nc3NkL2dzc2QuYyBiL3Vzci5zYmluL2dzc2QvZ3NzZC5jDQo+IGluZGV4 IDk0ZWI2Y2E1NzVjOC4uYzZkZGE4ZmEzN2I1IDEwMDY0NA0KPiAtLS0gYS91c3Iuc2Jpbi9n c3NkL2dzc2QuYw0KPiArKysgYi91c3Iuc2Jpbi9nc3NkL2dzc2QuYw0KPiBAQCAtNTIsNyAr NTIsNyBAQA0KPiAgICNpbmNsdWRlIDx1bmlzdGQuaD4NCj4gICAjaW5jbHVkZSA8YXJwYS9p bmV0Lmg+DQo+ICAgI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCj4gLSNpbmNsdWRlIDxnc3Nh cGkvZ3NzYXBpLmg+DQo+ICsjaW5jbHVkZSA8Z3NzYXBpX2tyYjUvZ3NzYXBpLmg+DQo+ICAg I2luY2x1ZGUgPHJwYy9ycGMuaD4NCj4gICAjaW5jbHVkZSA8cnBjL3JwY19jb20uaD4NCj4g DQo+Pg0KPj4NCj4+Pg0KPj4+IE5vdyBJIGNhbiB0ZXN0L2RlYnVnIHRoZSBjaGFuZ2VzLg0K Pj4+DQo+Pj4gQnR3LCB0aGUgc3R1ZmYgaW4gL3Vzci9sb2NhbC9pbmNsdWRlL2dzc2FwaSBh cmUgY29ycmVjdCBhbmQgbm90IG1lc3NlZCB1cA0KPj4+IGxpa2UgdGhlIHN0dWZmIGluIC91 c3IvaW5jbHVkZS9nc3NhcGkuIChUaGUgb25lcyBpbiAvdXNyL2xvY2FsL2luY2x1ZGUgZGVm aQ0KPj4gPQ0KPj4+IG5lDQo+Pj4gR1NTX0RMTElNUCBmb3IgZXhhbXBsZS4pDQo+Pj4NCj4+ PiBJJ20gZ29pbmcgdG8gbGVhdmUgZmlndXJpbmcgb3V0IHdoeSB0aGUgbGlicmFyaWVzIGlu IC91c3IvbGliIGFyZSBtZXNzZWQgdXANCj4+PiB0byBzb21lb25lIGVsc2UuDQo+Pj4NCj4+ PiByaWNrDQo+Pj4NCj4gDQo+IA0KDQotLSANClNpbmNlcmVseSwNCkRpbWEgKGZsdWZmeUBG cmVlQlNELm9yZywgaHR0cHM6Ly90Lm1lL0ZsdWZmeUJTRCwgQGZsdWZmeTptYXRyaXgtZGV2 LmZyZWVic2Qub3JnKQ0KKGRlc2t0b3AsIGtkZSwgeDExLCBvZmZpY2UsIHBvcnRzLXNlY3Rl YW0pQEZyZWVCU0QgdGVhbQ0KDQo= --------------23K0HvCamsG5lha92wy1vaZf-- --------------uxB7MDQ5TFuBCOl4KHjSkMwW Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmiLtxUFAwAAAAAACgkQ+4ugndU5jykU wg//WHSx962ib4zVMSE9s890WxfQTqi+1Ny+amSKPi3v3ZmnGXG1zpqu7uNAa44CJjOQMS2k9nR/ L7WnNJN3i+23fE/HZ4jaHOmkXPvFA4+kB7aoCphORK8C5oGJ0aKMzzDS94VkMjNdtPDoV6qlBNZU 3g4Ts9ls7C4KPAFMtM6N/fCEogPROEAZKS2Mop9ij1BCiUusuoVr4KwxgN81FKJHYvBOCydn9PaD Clj0994kOd7/mec0RpXcjOkDIILvuTsdAvsgGNHQdDnbQ26frYpRqkLOe1fYt7cOpYOoy87e/5vv ydGFsbCD8avQL5Rv3HAA70EYYHOWadaDJnocbTv7kvgeMyJnT4oMtAfmVAJ/ApoMfZF4EEIII6IA DHL5c0k1S1KaGkc5sENbRfVK45WcT3n58+5W3HzKVjS6cDogBMfx9rbP0R5drx7aTwGZ3UwlEfS3 uV2T++8MoHRKLb9ZYMT1WGTLgQkyXM5AJdrVp08+7ok8EU6TqlraoBwKxO7GyOoVfEMK+yeMlCYx K2JujsNxz4pwWOaS9Aggp1MuvrW+hxna5Wl/y2mME1AzErSxBHKEe+nudR1zx2I8m0ochHn9gUZi nMP5kXFRyEtKcuNop28pYSsbaqbEi8o9AQ6W2lnd8Ja8B/Pcn3ODvGkq5EJWGH1PziliycFhM8yj kwY= =2T4w -----END PGP SIGNATURE----- --------------uxB7MDQ5TFuBCOl4KHjSkMwW-- From nobody Thu Jul 31 18:46:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btJ2Q0Bh6z62vGM; Thu, 31 Jul 2025 18:46:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btJ2P5CKqz3lKc; Thu, 31 Jul 2025 18:46:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-4ab3802455eso16181351cf.2; Thu, 31 Jul 2025 11:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753987580; x=1754592380; 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=KHPF9ytN7OMFf2tov2SVG9KZVsALcC8IXi7zaU3KEFo=; b=hinjmMrKPcO/l/JkQ3/RKrwXC13Osl31WQiX3bq7urKR8/bgEFPsiFVMd8z4yqIzRO 16pJhS7nuxi/OIiWKvekUpLJxIL2RidOwNe56HoyQZqEUrH7WchiJyTv3nqZnAQs8Ywl tY2mn9GZlR4qHA53oPjQaYcQYc2CB+nSJoeoHiZHspWG51BU2rNBVjPv/w8NZloGl+kE Q+Py+hbA762fkCIpYsQhuxw2/LEWCIA07uU7W3zuPdpUU14w9OajpsNqaK3gzYE37JcK Dc5BulJ1po5YDG6cFyQrmSgqyX/SyZsFVHmZK4YL8OwgG+zgFyRBWw940jf+6Pot8Jgu 1TBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753987580; x=1754592380; 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=KHPF9ytN7OMFf2tov2SVG9KZVsALcC8IXi7zaU3KEFo=; b=NNhWNyndLmGJ34HVaPzVIQNrVsQuPadBOm5x3SB4/VA86eeL1G3Aj/ZBpyr0dRL7YC hmp9bq3ksMvU9VjKAsvGkdlvdBIpS2lduSCgBFNXMfViRvmiiNURz55ZtzZQz/zBemR1 WmouxwIPrNUGliQvgvxRWV2TSL7U044OvdiLhk3fplYyC9FzdGmLYCB0uagD6APq0855 d+dvdfdsy5JTuQQnYPz6iyDqAe1Yzs0+A1LW2m2qBu1Kmee6HbUbAG4q18RYdRj+IQG3 ivuUv/DylE0znlKzkDj/aGone6cux1HnxXIfG3dyxom9I3KkvaIu9I2lHs56DUPZBsL0 nliw== X-Forwarded-Encrypted: i=1; AJvYcCU3e5kg/M9I3IPCtQCBG083L19LXfLrq+ry+eO/dpz194EkGARgKSA+rR/OHenQRbGgT1H7606Ao80O6jGFsJwfGyEg@freebsd.org, AJvYcCUbX4huBzt98vLrpsCMzLK/aRFroJ8vHSlasQ64cwORgsULd4dWCj+hN31WJUflEkV5ZPsriQoHH1LoJ0uMqOLAxnHHgIU=@freebsd.org, AJvYcCVJ5vdSjrbDLC3yk2W7V/GWgXSbjd4O1KF+xbwOuT9yrbyKgTzSKiOdOTlDiJ7jsVbFjAKnjg==@freebsd.org X-Gm-Message-State: AOJu0YwINr5L5jPB1b9KG9P/V0IMuulnxbDoVT4gMOtG5rlduKUNtSdE MJBcsKf3GQHw0J+aJnuFYr+4tFYDs38DNTi/tse3IunJ1PGpWDCYC/C65hSIKP4E X-Gm-Gg: ASbGncvVpQir9qRevAgHBGMJPECgXnX/7oRnPla6L+AcqwePqjg6o9285w765sxXMQc NQKvec0DrdBl4mCyiNI5dqKiveYJvILLefXHu6ZulCkMJuNoLnoLOsFlKlFjTxfz8MO/PFfdY95 GhLy1EWg3A/TV4SnEj5KhlpadoeRCzhm/YUvclAgeE3P78KihNCfr9it77fQtrlU/m6takF1IZx qQAVwUwZzzcmUbqsohdvaxU/ImjdMomd1Vpm99EGgzEhcJOxoRE8UHuPYwH/gEuIVfd8fR/2bKA O1gk88VtSAI+SNN23xVij8CtDTzfqxZIqbpe4aBT/+YRGcgx9/CRf5WRhueYjtVMeNPjOOp+NT+ z1X/VVas50SfVs6kDXSpWfaWJSO/XPsgxJdon X-Google-Smtp-Source: AGHT+IEHKm8U5+Fa37hijiiRbviBF20tSVycQTe8atHTV/fz3R1zJ0MIf+G1B9NfTWpAb+a9Qfynqg== X-Received: by 2002:ac8:57d5:0:b0:4ab:63f7:9a80 with SMTP id d75a77b69052e-4aedb986770mr149197671cf.13.1753987579484; Thu, 31 Jul 2025 11:46:19 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4aeeebde17fsm12179181cf.1.2025.07.31.11.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 11:46:19 -0700 (PDT) Date: Thu, 31 Jul 2025 14:46:16 -0400 From: Mark Johnston To: Kyle Evans , olce@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: be1f7435ef21 - main - kern: start tracking cr_gid outside of cr_groups[] Message-ID: References: <202507310444.56V4icA3054832@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202507310444.56V4icA3054832@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4btJ2P5CKqz3lKc X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Thu, Jul 31, 2025 at 04:44:38AM +0000, Kyle Evans wrote: > The branch main has been updated by kevans: > > URL: https://cgit.FreeBSD.org/src/commit/?id=be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 > > commit be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 > Author: Kyle Evans > AuthorDate: 2025-07-31 04:44:11 +0000 > Commit: Kyle Evans > CommitDate: 2025-07-31 04:44:11 +0000 > > kern: start tracking cr_gid outside of cr_groups[] > > This is the (mostly) kernel side of de-conflating cr_gid and the > supplemental groups. The pre-existing behavior for getgroups() and > setgroups() is retained to keep the user <-> kernel boundary > functionally the same while we audit use of these syscalls, but we can > remove a lot of the internal special-casing just by reorganizing ucred > like this. > > struct xucred has been altered because the cr_gid macro becomes > problematic if ucred has a real cr_gid member but xucred does not. Most > notably, they both also have cr_groups[] members, so the definition > means that we could easily have situations where we end up using the > first supplemental group as the egid in some places. We really can't > change the ABI of xucred, so instead we alias the first member to the > `cr_gid` name and maintain the status quo. > > This also fixes the Linux setgroups(2)/getgroups(2) implementation to > more cleanly preserve the group set, now that we don't need to special > case cr_groups[0]. > > __FreeBSD_version bumped for the `struct ucred` ABI break. > > For relnotes: downstreams and out-of-tree modules absolutely must fix > any references to cr_groups[0] in their code. These are almost > exclusively incorrect in the new world, and cr_gid should be used > instead. There is a cr_gid macro available in earlier FreeBSD versions > that can be used to avoid having version-dependant conditionals to refer > to the effective group id. Surrounding code may need adjusted if it > peels off the first element of cr_groups and uses the others as the > supplemental groups, since the supplemental groups start at cr_groups[0] > now if &cr_groups[0] != &cr_gid. > > Relnotes: yes (see last paragraph) > Co-authored-by: olce > Differential Revision: https://reviews.freebsd.org/D51489 This syzbot report looks like it might be related to this change: https://syzkaller.appspot.com/bug?extid=4e68da43c26f357a2b7e No reproducer yet, but sometimes it takes a little while. From nobody Thu Jul 31 19:00:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btJLv02Jnz62vmf; Thu, 31 Jul 2025 19:00:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btJLt5wZtz3mxT; Thu, 31 Jul 2025 19:00:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753988438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D/cRWnfwKyZ0AJwjLN0tKta9MUO2FxY4TgA4wd5ywCw=; b=FjxqWwaqbdCumdF41Pe7fG9EZqKEtbWR3kMV6oYYwR/XH7EAYCOZTC3RSHw6af++DY62tV tXQiPlJhxnlNuDqt62MlWFiozziGdx1kyWGcUdtBhY4+C1Pu9MlfjFtkOadzad/wnS4Dwp nv84qgOp57zNwPQrZbPLDGQQZVa7G7/1ejz4q4ivk+w4ovm5+f32mpwrU8NxkXn/5DyjPT kcMhmrUBCCdEPGEbCxcp81sCaps0KMJuntZYAwAnPZVHFCmzOduclfrRC3RA++dHbIGLy+ 4yfNqjxwJR+rwLyrCb0eLOLa7AjO8lG6IFpJdAgVXnDx2EzOrxGZlF4hPLQerg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753988438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D/cRWnfwKyZ0AJwjLN0tKta9MUO2FxY4TgA4wd5ywCw=; b=YRL43jzwaoplfKNuEenXxx+RUSxiHaznlAlW7DAmSXMad6ojY/oK1tDRf3bvdB0JK5FAow AntIlb5RLJffy0NyQJj2L2wfb9+AFieFvFcuJGnrcsLPhZ+PfqXs4ymvrP2KVQ11/2WgE+ MxA53tBPcuYJwo5phIPB0bj4b5vofLaNlue4a8VfKSNg9boswrrAKl1aGzyHFV+2a5hAw0 2rDXZetc1r0R2rWPhAsMK+SjLXzU9LASjWhVs3ygh+GuKDnHab0MwEtWKhdNVnrwx47uz5 MJuGx+SXo+6WsUq4qnWeMtYFiu1E1KB1S8VUUqTdp7A9nOdysXgg3BSRjsso9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753988438; a=rsa-sha256; cv=none; b=waqsySDNpIaHafseGh5Q2fcpQuc8KUWeI57QdGLEqCgANV99jPW5K5zNnF7Yxq6BXnAv2s 6hEDLXfoI05pYjXcy99Q0dH5bz+qON8+yBhM/kMw2TMmNsy/apCOpZx0bgstfvdOli/bOZ Vm2BvrbEMnMm/xzhAgoxObEuuJ8mGOaYtCeyRu5kd0rQCjt9OFh7VkheaolODJwkJVHqh5 0wsg197f/RLAMK9m8EpLGDz9wHR1MlMh+fe75LKNL+/Hvs2e0eUBtKpE/gmYf9j5Tuo6wD SvJoNfQXmfDCd3PSGXR+BTcUpVXvw3E391v491LCPY1TNB4UFThPPvbsGmC+8w== 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 4btJLt2hmgzP62; Thu, 31 Jul 2025 19:00:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <4184e804-b731-4b4e-9399-d27f776f575d@FreeBSD.org> Date: Thu, 31 Jul 2025 14:00:37 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: be1f7435ef21 - main - kern: start tracking cr_gid outside of cr_groups[] To: Mark Johnston , olce@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507310444.56V4icA3054832@gitrepo.freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/31/25 13:46, Mark Johnston wrote: > On Thu, Jul 31, 2025 at 04:44:38AM +0000, Kyle Evans wrote: >> The branch main has been updated by kevans: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 >> >> commit be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 >> Author: Kyle Evans >> AuthorDate: 2025-07-31 04:44:11 +0000 >> Commit: Kyle Evans >> CommitDate: 2025-07-31 04:44:11 +0000 >> >> kern: start tracking cr_gid outside of cr_groups[] >> >> This is the (mostly) kernel side of de-conflating cr_gid and the >> supplemental groups. The pre-existing behavior for getgroups() and >> setgroups() is retained to keep the user <-> kernel boundary >> functionally the same while we audit use of these syscalls, but we can >> remove a lot of the internal special-casing just by reorganizing ucred >> like this. >> >> struct xucred has been altered because the cr_gid macro becomes >> problematic if ucred has a real cr_gid member but xucred does not. Most >> notably, they both also have cr_groups[] members, so the definition >> means that we could easily have situations where we end up using the >> first supplemental group as the egid in some places. We really can't >> change the ABI of xucred, so instead we alias the first member to the >> `cr_gid` name and maintain the status quo. >> >> This also fixes the Linux setgroups(2)/getgroups(2) implementation to >> more cleanly preserve the group set, now that we don't need to special >> case cr_groups[0]. >> >> __FreeBSD_version bumped for the `struct ucred` ABI break. >> >> For relnotes: downstreams and out-of-tree modules absolutely must fix >> any references to cr_groups[0] in their code. These are almost >> exclusively incorrect in the new world, and cr_gid should be used >> instead. There is a cr_gid macro available in earlier FreeBSD versions >> that can be used to avoid having version-dependant conditionals to refer >> to the effective group id. Surrounding code may need adjusted if it >> peels off the first element of cr_groups and uses the others as the >> supplemental groups, since the supplemental groups start at cr_groups[0] >> now if &cr_groups[0] != &cr_gid. >> >> Relnotes: yes (see last paragraph) >> Co-authored-by: olce >> Differential Revision: https://reviews.freebsd.org/D51489 > > This syzbot report looks like it might be related to this change: > https://syzkaller.appspot.com/bug?extid=4e68da43c26f357a2b7e > > No reproducer yet, but sometimes it takes a little while. I'll keep an eye out, thanks. It strikes me that crsetgroups_internal should probably grow a groups_check_max_len() call; this assertion likely would have happened in a much more useful spot in the first place. Thanks, Kyle Evans From nobody Thu Jul 31 19:26:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btJx30wcCz62x1Z; Thu, 31 Jul 2025 19:26:47 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btJx2733dz3qYL; Thu, 31 Jul 2025 19:26:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753990007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NdRS69KJLXpZrTyUfv15PRQmLkmWokYhXP8JfVhxUDE=; b=GOuE3HLsCM5VHdvbaKxo5xZgTMnKnOH2X5JWciXEJ2TPRpGSjdZm7ThkX4I7qHrtIueE8G MAJ5OBLxbsme7i1FdUOv1pn5kG1oVYq+3uK4dtEGvfqi6IMRMXUzy3D9iramb/pxndL/TL d3RsOUdJ9yI9C1HRPkarHyBEoaZiELOmu2i4EfgXdR1WM+Ra38h5fB3d8ddEExxa0ACf4O dHScIW1UVRpTSrly8MguWFtd0nl/hvlMe79WNIe3ZZwYFAxB6VSxPz9dCn6glP4P/aHE2k lJl5kjkMMP8701VTB5GEECQ0JBRWhNj2pzDDeRvDCYLXcpbB6FdQ9TCf7IR7YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753990007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NdRS69KJLXpZrTyUfv15PRQmLkmWokYhXP8JfVhxUDE=; b=uf9cZyAakvrFZbGXuMTtW1XoRGZXHoxAwTSFXlVjliy2WkaEE5RHVmpHObcQRzm5RpTrAW A0UrLTq9vXdUtb+VKEMLMCWDdW3J5T4KfR+12Recas1mjN0IIoh7mEDchzxTIqtAj0T7wh zCoQEoqguugVDFC3NioJDP3+9qpEaAbIpIu8H932tJay13L1PnxnYSU/piALxuKAmWJ4lO ByyI+AsDaKlvTwMWg22VseHIcyxOLI0leW1lFB2+iQmyvaYWPu2xUIa6JEii7R2wiy6M/i jLfNOVxq7KbHL16CdYtdS5fpXtenZobbiTEm7+uKDSIzNdCzxUyAoH4qnKpikw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753990007; a=rsa-sha256; cv=none; b=RCk3yZeN4cwAwFzSpt00F2ijJ5551zcbESG/yJ7/jqxz1lx4dwtCBEaErHdxeT+YXTPmfx vExDsZTXrPNmHndd5+CHnc+7v38k0Hf0l27TtKrXItQD/xt+tvEQdrs9bKnasaXyjQcrEC F/iuIDf63gGc9OrccOKEL2unHX9wxL9E4ExUIkkS/0eht4nOYAfeJSwwtxWTudSSQAyKSS XRbI1o5cluncMSUGxMGiFxwsibtL9MdLYX4srOkaqWL6RCtgrKM6B4TlUXdYwnjypHQeeu NO60C/GLJFS5bsfNNlZjhJqBhrOT3gm+IJ6fGxbTUpb4fFHNbI5Ttmdj8azP1Q== 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)) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4btJx23F7CzMGJ; Thu, 31 Jul 2025 19:26:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <8876e655-5e8f-4050-84a9-ec9b1ddc2a35@FreeBSD.org> Date: Thu, 31 Jul 2025 14:26:45 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: be1f7435ef21 - main - kern: start tracking cr_gid outside of cr_groups[] From: Kyle Evans To: Mark Johnston , olce@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507310444.56V4icA3054832@gitrepo.freebsd.org> <4184e804-b731-4b4e-9399-d27f776f575d@FreeBSD.org> Content-Language: en-US In-Reply-To: <4184e804-b731-4b4e-9399-d27f776f575d@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/31/25 14:00, Kyle Evans wrote: > On 7/31/25 13:46, Mark Johnston wrote: >> On Thu, Jul 31, 2025 at 04:44:38AM +0000, Kyle Evans wrote: >>> The branch main has been updated by kevans: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/? >>> id=be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 >>> >>> commit be1f7435ef218b1df35aebf3b90dd65ffd8bbe51 >>> Author:     Kyle Evans >>> AuthorDate: 2025-07-31 04:44:11 +0000 >>> Commit:     Kyle Evans >>> CommitDate: 2025-07-31 04:44:11 +0000 >>> >>>      kern: start tracking cr_gid outside of cr_groups[] >>>      This is the (mostly) kernel side of de-conflating cr_gid and the >>>      supplemental groups.  The pre-existing behavior for getgroups() and >>>      setgroups() is retained to keep the user <-> kernel boundary >>>      functionally the same while we audit use of these syscalls, but >>> we can >>>      remove a lot of the internal special-casing just by reorganizing >>> ucred >>>      like this. >>>      struct xucred has been altered because the cr_gid macro becomes >>>      problematic if ucred has a real cr_gid member but xucred does >>> not.  Most >>>      notably, they both also have cr_groups[] members, so the definition >>>      means that we could easily have situations where we end up using >>> the >>>      first supplemental group as the egid in some places.  We really >>> can't >>>      change the ABI of xucred, so instead we alias the first member >>> to the >>>      `cr_gid` name and maintain the status quo. >>>      This also fixes the Linux setgroups(2)/getgroups(2) >>> implementation to >>>      more cleanly preserve the group set, now that we don't need to >>> special >>>      case cr_groups[0]. >>>      __FreeBSD_version bumped for the `struct ucred` ABI break. >>>      For relnotes: downstreams and out-of-tree modules absolutely >>> must fix >>>      any references to cr_groups[0] in their code.  These are almost >>>      exclusively incorrect in the new world, and cr_gid should be used >>>      instead.  There is a cr_gid macro available in earlier FreeBSD >>> versions >>>      that can be used to avoid having version-dependant conditionals >>> to refer >>>      to the effective group id.  Surrounding code may need adjusted >>> if it >>>      peels off the first element of cr_groups and uses the others as the >>>      supplemental groups, since the supplemental groups start at >>> cr_groups[0] >>>      now if &cr_groups[0] != &cr_gid. >>>      Relnotes:       yes (see last paragraph) >>>      Co-authored-by: olce >>>      Differential Revision:  https://reviews.freebsd.org/D51489 >> >> This syzbot report looks like it might be related to this change: >> https://syzkaller.appspot.com/bug?extid=4e68da43c26f357a2b7e >> >> No reproducer yet, but sometimes it takes a little while. > > I'll keep an eye out, thanks.  It strikes me that crsetgroups_internal > should probably grow a groups_check_max_len() call; this assertion > likely would have happened in a much more useful spot in the first place. > > Thanks, > > Kyle Evans Actually, what crcopysafe() doing here is not ideal. Note the comment from crextend(): 2812 /* 2813 * We allocate a power of 2 larger than 'nbytes', except when that 2814 * exceeds PAGE_SIZE, in which case we allocate the right multiple of 2815 * pages. We assume PAGE_SIZE is a power of 2 (the call to roundup2() 2816 * below) but do not need to for sizeof(gid_t). 2817 */ and then: 2830 cr->cr_agroups = nbytes / sizeof(gid_t); crcopysafe() then attempts to extend up to what cr_agroups can hold, but cr_agroups isn't guaranteed to be <= ngroups_max since we allocate a power of 2 larger; we'll want to cap that. I was considering whether we should do it at assignment time or in crcopysafe(). I'm kind of leaning toward the latter, and slapping a note on cr_agroups somewhere that it may exceed the limit. OTOH, we don't have a compelling need for cr_agroups to reflect the size of the allocation beyond the max number of groups today. Thanks, Kyle Evans Thanks, Kyle Evans From nobody Thu Jul 31 22:04:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btNRP0KzMz6360G; Thu, 31 Jul 2025 22:04:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btNRN6jPFz42rC; Thu, 31 Jul 2025 22:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753999489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JVTPE1OKhhDIUSbuKb+gLdAUVEZKRoOYIQmfMcJ5TY0=; b=J588AVQQ7xF+t35EDKr9yk+Ol54AjPTkzWUC2nGowOgC84Y8H5CVYkXYsTmGri3smCtxnl t91jrFX7SKsCIPDV07t5XZ4QdrRq6uFkdBuQ9y7yUFR2Z9/kZ0i/V4ZkMkeg8XP63zHIqA hTuWmSxrJx9HSd87D2bYyUvzQdpkkZJVT70YSJZS23XEHUsriwk6cDG0IvVDM287ZGqvkP /TnzlaBSVBsH7lXRPUbb/bOZlekgEXNJtB4IaV6AY4eAQKi86jv2bFBBFUYU3oOMwNUtsV dkVh3Q94KBner6MdUdrcs+LsltALeue/FxxIcdN2AjKc7jCGzuxGgtpgTT1TKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753999489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JVTPE1OKhhDIUSbuKb+gLdAUVEZKRoOYIQmfMcJ5TY0=; b=hrxbG3yVjLvGX44TCj1ergJwbFsTG9wHRlDSMOfDDbP1VHbFe4y7LHMIKaM+WWnBVs1m9R ojcXHWlz1yJ8T8lMCQ8O+oLy3oUg9cgXenGSqBOsVJyTNF9l+n+CLoHjrr2P9BIOUKom0j 1Pa9rXn2qGsRhcHHlIkjz1OExE6gQ6/217dS6Wv5UeUcBDSgo6+r1g49bKJeKqGppzrsOs kSBSbvSU028GWEVqm/AmL/syQk7yuKMN+1SmpqVXivmx7tZa/qq7XZDroSX6oxNFAAzjvb HaQE8oPnrEvVxHX29wJn662y6psF5cacWJa+Ebp1acNHeRoVm1DNu2QsKuz/Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753999489; a=rsa-sha256; cv=none; b=WSIGVzwDoOfpsm5BtvhckILlR24cttg+VmAGnhGzLdnpcRN7ZPhQ0KaSWlxxOVzVrP9Fid KMcboAn71RJLmFXLxmAtKwjSNAmV06gqTIgzsD8IV5zZqUbIQq4j4WakZ2HvKqBEEnAs8o Vvucp/+CnIpScjOQW+9ksphDH3Lgh1VdrOrBKkQLP1pTCNmtumGykHh6FAONKGeyn96IXs xExJ68tD1H2qR9iU/7HGPG6Nvm5ubVNloXsBY6+NMuoHQbYyoUKKfcb6liznGm3M3yn/yG iyj/oIxqT/s+AbpJo+hUNXupX37GDLnWUyWOd4y+Jt7zWSmwIdjBR+UarRd8OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btNRN61hmz52B; Thu, 31 Jul 2025 22:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56VM4m0x022237; Thu, 31 Jul 2025 22:04:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56VM4mGZ022234; Thu, 31 Jul 2025 22:04:48 GMT (envelope-from git) Date: Thu, 31 Jul 2025 22:04:48 GMT Message-Id: <202507312204.56VM4mGZ022234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 733da235aa6a - main - libsa: errors with pointer conversion List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 733da235aa6a3c71d06b92a41656bad07fada5e6 Auto-Submitted: auto-generated The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=733da235aa6a3c71d06b92a41656bad07fada5e6 commit 733da235aa6a3c71d06b92a41656bad07fada5e6 Author: Toomas Soome AuthorDate: 2025-07-31 19:11:16 +0000 Commit: Toomas Soome CommitDate: 2025-07-31 22:04:32 +0000 libsa: errors with pointer conversion loader ip implementation is using pointer to structure ip to receive the packet and is using this pointer to cast on other data types (namely structure arphdr). Problem does arise when those data structures are declared with different alignment rules and when/if the compiler does check those rules. To work around and silence warnings, use void * generic pointer instead. Error seen with gcc 14 (-Werror=address-of-packed-member). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51662 --- stand/libsa/ip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stand/libsa/ip.c b/stand/libsa/ip.c index 2c2acf2eda16..6c7b0844b14d 100644 --- a/stand/libsa/ip.c +++ b/stand/libsa/ip.c @@ -181,6 +181,7 @@ readipv4(struct iodesc *d, void **pkt, void **payload, time_t tleft, ssize_t n; size_t hlen; struct ether_header *eh; + void *buf; struct ip *ip; struct udphdr *uh; uint16_t etype; /* host order */ @@ -195,7 +196,7 @@ readipv4(struct iodesc *d, void **pkt, void **payload, time_t tleft, ip = NULL; ptr = NULL; - n = readether(d, (void **)&ptr, (void **)&ip, tleft, &etype); + n = readether(d, (void **)&ptr, (void **)&buf, tleft, &etype); if (n == -1 || n < sizeof(*ip) + sizeof(*uh)) { free(ptr); return (-1); @@ -205,7 +206,7 @@ readipv4(struct iodesc *d, void **pkt, void **payload, time_t tleft, /* Need to respond to ARP requests. */ if (etype == ETHERTYPE_ARP) { - struct arphdr *ah = (void *)ip; + struct arphdr *ah = buf; if (ah->ar_op == htons(ARPOP_REQUEST)) { /* Send ARP reply */ arp_reply(d, ah); @@ -224,6 +225,7 @@ readipv4(struct iodesc *d, void **pkt, void **payload, time_t tleft, return (-1); } + ip = buf; /* Check ip header */ if (ip->ip_v != IPVERSION || /* half char */ ip->ip_p != proto) { From nobody Fri Aug 1 00:23:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btRWh3HPWz63F5w; Fri, 01 Aug 2025 00:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btRWh2KhYz3LNH; Fri, 01 Aug 2025 00:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754007824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXPFbx6iApH9fD7GYhBXZi4zBp5o0PgZYwcTznRol/E=; b=UeItUun3JAmYCGdP1bwNV/WosAclh7eKYaISdFVxhu0PYzZkWswTy65SBuVKzxncWPBSJx iSpzLh8NXhl5hyIdllW0ZL0qG4kVEXzsGEFMAo5J6DoAB7ra7YzXeOp9m4qEU2q0e6XloV NSNJgSaxw1AjsICFUjGW2WvwM2It9oJCzJ03bvqZDdWP2VgER3NlgeVuwQaPSCrSKe+4lb 2EBG/XYtLuHgrsi89k5VKt9tL+KLZrzV2YXIYSzwjzzQfPUwdlb+vvmIabI4ePfx2gBYlr S/bsN8LAAHsABYSQ44zkPf2MG/uHDSrd6UmsC+/vrKPtPsX0wva0fA4hhbCZSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754007824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXPFbx6iApH9fD7GYhBXZi4zBp5o0PgZYwcTznRol/E=; b=cmPG/EychsvtQI1022rL35RM3b+J+fOcvmDvwZXnz9fDKWtuknoTy5mvs4Y0EjhVMghxRl u7LDrhsekc4/d1zMGc/McwdYNJAXXMKOE57OE1I0VBX5fJcsRwQQ0HDCPkHSW+Yyu8Uthi qV8uPlJ4k3QlqFMfv+O7Dn8zCTYK1r/eBzZzOXQYXtZ2FveREyPPHQDPWLsZ5UnLa7RQsv mFYvykafWP5P354Zkkzhz3g7FvZmYz51BO9SSZc1sfT/XZdLWmfLauKg4n7NevjPqCCpJo 2LnIFeDfHijOsxQPf1ILRK0UJiEAg2fcMSbCw03RCEQWXbINShtxdlHPHtbJsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754007824; a=rsa-sha256; cv=none; b=CX1BL28laRMt8JZt4RCeEEZYNg+qgXEqm50vAvREGnc5h9vEK8qWGrT4i0TtRxwJuIUTiQ wxyOWCQXWZUmRg93PYIUHHc3PJLamgDSXF2Spl0vl92SRoAizgoalK3UvTZQwh3VQ49/b8 llyHZf2LTWZs+Tjo57PKHqpauq36O7exSC5Gwejh4zOcQSIkFrxFeRUac/TJjqMlON7o0T 7TJikeKz+SHwr8klZkqHIT0Gy2yJve91s98WYiMS0QBPc4Ad9OycuAdsLDz84SxMHiJlHb E+c1i/A2yJonNqHZwQIJnSiJsaWHHPim0UFl2iCBmNBjxKxltf3ybSLnnrpKfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btRWh1wJBz8rj; Fri, 01 Aug 2025 00:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5710NiPG084184; Fri, 1 Aug 2025 00:23:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5710Niiw084181; Fri, 1 Aug 2025 00:23:44 GMT (envelope-from git) Date: Fri, 1 Aug 2025 00:23:44 GMT Message-Id: <202508010023.5710Niiw084181@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: 3a54914b0e52 - stable/14 - kern/kern_thread.c: fix typo in comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a54914b0e52ebe07c8f03ef53b73a1f5c5d0776 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3a54914b0e52ebe07c8f03ef53b73a1f5c5d0776 commit 3a54914b0e52ebe07c8f03ef53b73a1f5c5d0776 Author: Konstantin Belousov AuthorDate: 2025-07-29 23:32:24 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-01 00:23:01 +0000 kern/kern_thread.c: fix typo in comment (cherry picked from commit a0041aee49bebd306179382658bcf965e6db5aef) --- sys/kern/kern_thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index d0a5a7ffac61..ec9127939f31 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -569,7 +569,7 @@ threadinit(void) /* * Thread structures are specially aligned so that (at least) the - * 5 lower bits of a pointer to 'struct thead' must be 0. These bits + * 5 lower bits of a pointer to 'struct thread' must be 0. These bits * are used by synchronization primitives to store flags in pointers to * such structures. */ From nobody Fri Aug 1 00:23:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btRWj4vgzz63FWk; Fri, 01 Aug 2025 00:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btRWj3H8hz3LwW; Fri, 01 Aug 2025 00:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754007825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L+XN4rRLdbjavuNG3g0YfDdyB5EWGAiD3KCR83FsY4A=; b=fOsxFDtWEL+cf47sUJAzH1x3V5JeCFJYXTzIvBjyR0Q9dAHeyw1R1lv25d+jx+zjFczq79 FhytdCH3InkNuNSvcjpIqSIR8wFK2VMK7Gu9PE3NXreaoCqmN19X+etTZijgUT+p4jDXeQ ew6VLvSQvNWiY5oo/Wr1388eWgvvNt1QrG9DP0hH/uH1dy8IaFHl2TKezak4mFuAIVghhj zmvOzW3ukqqD49y+P9QMiYFJFI38ezV0JCD0mx9bwBobqUvsAq6+6n1dEJG42PaVGyAx8A 8FuIuyLGA7IHPP3yLYAvPpA7NvAoOSQ1V3nKTE3p7u83u0KiiIqdtqlf4QxPZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754007825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L+XN4rRLdbjavuNG3g0YfDdyB5EWGAiD3KCR83FsY4A=; b=JdeyAZZNBPG3wl0j70a9rLVKEWiPC5keiPhofp3xEiZSEqUcXf8GjTNNmrjiujc0D4Zkmb xuhfh6SfUbgAJ8KB2NPBRb48RAv4ELaVmUenIn9oWS+lfeLEFLyK7sb0r3OsicbiITxqnQ Mh1blbxoJFgTrSWZuQzl05k1dXUOZJ28UbjWTT3XhmcQ+V6y/+tyAMTgKlpx44diML/LUr 0QpIPdbR8UgvmwevaOj772xAKKZCJtaEfQXe1EO3cmBBbgwMCt5koeP0OYnHefGnDegFGJ aXS+QN+WvDq+tfbXS6fJIntKxKoR3KKhMbc2Cmo6SuMZi3/6V89LN7vhU3BuwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754007825; a=rsa-sha256; cv=none; b=OIIpIpB2qo7Yndb4Ouy0WSaNcr3EiwrfgWna020fTsf00j2ZY56U8bTuUM2vjs97eFqLAX mdhR9f6tMBwaZ8ElEuyF+fwHJ5gs+LnNsxcQk9P9IC3+Yenc13LED1Z+M9gigwqeF1pleh aY95297VOPI1QdSY0mjYU8MG00NgdQ1Q8kc9g9RyR/RpvDQWKgsn4QAoveQx5t91Ejp3Vg 8ysKV0Yjc7Pgul9I+py+a+d/zj0sbco2pru7vaDiBhLQGNdlupnlZHpjK4vjxz6T9Fssvw j7UKFOE0PMBtnQb982/qcMOw1jyaqCuYFPlLFvJIwisEKH6bWck7EG+gkYubeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btRWj2rJgz8rk; Fri, 01 Aug 2025 00:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5710Nj5R084218; Fri, 1 Aug 2025 00:23:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5710Nje0084215; Fri, 1 Aug 2025 00:23:45 GMT (envelope-from git) Date: Fri, 1 Aug 2025 00:23:45 GMT Message-Id: <202508010023.5710Nje0084215@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: c0b4b2db0adb - stable/14 - libthr: fix typo in comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c0b4b2db0adb7c95367a3b7470f0cbf7f7e9b711 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c0b4b2db0adb7c95367a3b7470f0cbf7f7e9b711 commit c0b4b2db0adb7c95367a3b7470f0cbf7f7e9b711 Author: Konstantin Belousov AuthorDate: 2025-07-29 23:33:04 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-01 00:23:01 +0000 libthr: fix typo in comment (cherry picked from commit b87013fe70c051278e67d103d93c5292721cbcba) --- lib/libthr/thread/thr_getthreadid_np.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_getthreadid_np.c b/lib/libthr/thread/thr_getthreadid_np.c index ade332519dfb..ffecd0bc7ea9 100644 --- a/lib/libthr/thread/thr_getthreadid_np.c +++ b/lib/libthr/thread/thr_getthreadid_np.c @@ -36,7 +36,7 @@ __weak_reference(_thr_getthreadid_np, _pthread_getthreadid_np); __weak_reference(_thr_getthreadid_np, pthread_getthreadid_np); /* - * Provide the equivelant to AIX pthread_getthreadid_np() function. + * Provide the equivalent to AIX pthread_getthreadid_np() function. */ int _thr_getthreadid_np(void) From nobody Fri Aug 1 00:50:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btS741PS8z63G6Q; Fri, 01 Aug 2025 00:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btS740jQbz3Q4Q; Fri, 01 Aug 2025 00:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754009456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGoG+JgaV5zG21B/XDwcRH1psLYT4Z06AbJdgzme1iQ=; b=G0/bP7h6uMef3hT/a0/b3NbaiIUUrHV8hPkJBBVWxcpqY2bTtVwPvf+S7pMfpUIXIayAK7 qP/ZOt4sm1Bjg0Gsxs+52UafNdYIxl3OLsCeYW+CoJvxS7XBFZrjFsaQIFUkYX0ZciuuA2 Mv70YYYEYp8nA5kOBQxPMUG3yMNfSixLDm2j7wJ3w+KdIRXVOPQxMj1daZ5YPDbAWz2m4E rzdcCsZ+Q+jfo8WN410/VUNzNdMGFgFUiSRYdvb3TazjC13ADcCDPgL9gmnlkmclPw6ewC W3wh4Jxz4SvqjFQKz1ojxTIiVjEr27G8cDXxEtg5ouDawjD25og+dU8Kup7KIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754009456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGoG+JgaV5zG21B/XDwcRH1psLYT4Z06AbJdgzme1iQ=; b=vwc0RdgF92HBdFy6kkMH55avNv2WO9mHY6Yx1P4YmG2jkYYq2xWBL6t1aqSrQDopIJkkOq e7qYpj8PCcobL1qBajwyCpYgjiw44/hVgSVYY/1FiHFghwYnI5Pmvk0FVCIx1SSTzX2qyF RdN5EC4Lg57x+A7piUbpYpNatZjI68wTBFdJQAOBdOT0KOp3qzabbTCmx3AxRf9oXu4PGR Q2gxvf1L5mBgrp8/kIhF+WX8Vd6mtZa/P2LvPPmoc8RWxp/0ErR/6j55q1rFGfO5aEVKHM l7R0aIiDUk9EtYp8LeumetBA4X9oDWPHIAxWj7OYiK1yqRTftxwdkuuD9r+7Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754009456; a=rsa-sha256; cv=none; b=IjnE7Rxjn+PdS6gLZovT9FvkiSaNUuotwOCuwKNsAsUEovQ/1gPslN+sUXxSy9ua09m7dd TT3l9yGtUPcs6gPvlw0gL/VS81IvhgOrRtUQxm4FmzQb2cDoYkOZB9WA8hauLA7D63RE9y SBaSpEkAmbvpPgH/JXozwAvFykxPv2zg4VhLa3bma676zIGE4h2+WCY5hCkh11RG55d13e Siv86msBc3TnzwIYFp9vrbDkZVNzSpryHMRpQIFCXFz3zLlsQwtv30QCyL/DVdqycmk+bQ vCaOfik4Mum16+F6a7RlhLg9RL6o1S2VUs3Km9yHMzwuUCh+sdm0s/YVbg8QbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btS7406wLz9P4; Fri, 01 Aug 2025 00:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5710otsE033947; Fri, 1 Aug 2025 00:50:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5710ot9i033944; Fri, 1 Aug 2025 00:50:55 GMT (envelope-from git) Date: Fri, 1 Aug 2025 00:50:55 GMT Message-Id: <202508010050.5710ot9i033944@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: 09f2abaa59f9 - main - kern: add a new ucred flag for groups having been set List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09f2abaa59f948e2d21604b5e528a264a6d8c329 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=09f2abaa59f948e2d21604b5e528a264a6d8c329 commit 09f2abaa59f948e2d21604b5e528a264a6d8c329 Author: Kyle Evans AuthorDate: 2025-08-01 00:50:47 +0000 Commit: Kyle Evans CommitDate: 2025-08-01 00:50:47 +0000 kern: add a new ucred flag for groups having been set Now that we can legitimately have ngroups == 0 as a result of calling crsetgroups(), set a flag when we've set groups for the sake of sanity checking usage of crextend(). While it's true this flag will only really be used under INVARIANTS, it's only the second flag bit that we're adding in 16 years. Reviewed by: olce Differential Revision: https://reviews.freebsd.org/D51646 --- sys/compat/linux/linux_misc.c | 1 + sys/compat/linux/linux_uid16.c | 1 + sys/kern/kern_prot.c | 15 +++++++++++---- sys/sys/ucred.h | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 31460819e6ab..5e32353c6b8e 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1056,6 +1056,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args) newcred->cr_ngroups = ngrp; for (int i = 0; i < ngrp; i++) newcred->cr_groups[i] = linux_gidset[i]; + newcred->cr_flags |= CRED_FLAG_GROUPSET; setsugid(p); proc_set_cred(p, newcred); diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index 9fe799c0b9de..1d9a19916412 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -117,6 +117,7 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args) newcred->cr_ngroups = ngrp; for (int i = 0; i < ngrp; i++) newcred->cr_groups[i] = linux_gidset[i]; + newcred->cr_flags |= CRED_FLAG_GROUPSET; setsugid(td->td_proc); proc_set_cred(p, newcred); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 48ab7c0b520b..632be229af5b 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2796,7 +2796,8 @@ crextend(struct ucred *cr, int n) size_t nbytes; MPASS2(cr->cr_ref == 1, "'cr_ref' must be 1 (referenced, unshared)"); - MPASS2(cr->cr_ngroups == 0, "groups on 'cr' already set!"); + MPASS2((cr->cr_flags & CRED_FLAG_GROUPSET) == 0, + "groups on 'cr' already set!"); groups_check_positive_len(n); groups_check_max_len(n); @@ -2890,6 +2891,7 @@ crsetgroups_internal(struct ucred *cr, int ngrp, const gid_t *groups) bcopy(groups, cr->cr_groups, ngrp * sizeof(gid_t)); cr->cr_ngroups = ngrp; + cr->cr_flags |= CRED_FLAG_GROUPSET; } /* @@ -2906,15 +2908,19 @@ crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) if (ngrp > ngroups_max) ngrp = ngroups_max; + cr->cr_ngroups = 0; + if (ngrp == 0) { + cr->cr_flags |= CRED_FLAG_GROUPSET; + return; + } + /* * crextend() asserts that groups are not set, as it may allocate a new * backing storage without copying the content of the old one. Since we * are going to install a completely new set anyway, signal that we * consider the old ones thrown away. */ - cr->cr_ngroups = 0; - if (ngrp == 0) - return; + cr->cr_flags &= ~CRED_FLAG_GROUPSET; crextend(cr, ngrp); crsetgroups_internal(cr, ngrp, groups); @@ -2936,6 +2942,7 @@ crsetgroups_fallback(struct ucred *cr, int ngrp, const gid_t *groups, if (ngrp == 0) { cr->cr_gid = fallback; cr->cr_ngroups = 0; + cr->cr_flags |= CRED_FLAG_GROUPSET; return; } diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 4831d8cb6e1b..cd4efcb71c0d 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -44,6 +44,7 @@ * Flags for cr_flags. */ #define CRED_FLAG_CAPMODE 0x00000001 /* In capability mode. */ +#define CRED_FLAG_GROUPSET 0x00000002 /* Groups have been set. */ /* * Number of groups inlined in 'struct ucred'. It must stay reasonably low as From nobody Fri Aug 1 00:50:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btS753h99z63GPc; Fri, 01 Aug 2025 00:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btS752QZ6z3QFK; Fri, 01 Aug 2025 00:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754009457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ad8u19vSK1bwGNvDb5PF0UsKZEau8EqgoU6x/z6IV+M=; b=SkkffxXP2/fW444hydI8zncW6UnVm6MlgKS4CsHyZ3wldjgRrRjIni1dUUokASljkubzda wwatSGuzIEPSlwPl/sMpuebrUtMwwsw4sczYFSWLwZ10EKly4Zmt6idClM1An/Bi3pcYcA hj7F+Iut2SJe2B1+E+jZ7y/ZeD25eC1uv/6dQg/qC0RLFWmwHT4T0FwW7OGi8RaSobko2F iWpI+yKUgzCRqB+c/6QUk9PGiuBgeXgyX8en9e8WKVv4MHXOBLgDobCtbTNYnyqQgN8Psr KKqxpICHubPYKrpDyGltriLoKnotbfJ23+lxziXEET3c0/d3sQ4ioMs9x5w5+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754009457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ad8u19vSK1bwGNvDb5PF0UsKZEau8EqgoU6x/z6IV+M=; b=LQPWZoE+59/ZKz8+SVx665GGTYigdRU8ahmK3zFRMGZsuOkJ9MTlCOv0tn/M6eo0xFmmuH OA++3M37cmKMVbrKfIwQdNaxAyyQ02oFBmgfooYuVxrnHsT9gVrB5mL7ziIJfURsMzKF2m seKR8wUYNOQ/Fb5jSHpxjONZCYD0zSEnAHAUVnNM2WL4IQyMKrIR8wJXomwCg+Wh+WHRfC PPzQXIfLt7pECo9gTqRK30m9thZQTrA7Gpf+UZ2Qdv/D1Uce5NJYhEPD6uO9jwtfJ4uCBO c48mDyqNtaBf6b6bhOcwpvB47FTs17QwBvCnLWIWwxgdA50Ra+WpTQ9lHm71iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754009457; a=rsa-sha256; cv=none; b=IMGq/LvzFne8EIW9qIl+K6jJ5SMmjG+bV0EYv/ETW2wIOtrQmKQ86JAW1GwdZVy2CgYGl1 KZe854vujmQ2yx3t6OU1YwhHFwKjKNrsgPPl86g1EG7F7DnmhbI7LXm7q3f1fbiYCG2b2i 0zfUK9SXZGJHLNIBzliOBr0KOsbFISeTx0AahtG+UFp7Hnu9gZGQfS2LfW6A9oVuauU8K0 3hmUNtZfJ2//0VTVQ9sgeMvCktUFxmumX2FB7002vpRSj9mkxohVa5ZCVU9QGGvQ6XTVGp nQGMBmgrzJEZtuVrba9MqVaKazdqs8XWtG2Ns08iQ0dpiNrTnORCQxor9Y2t2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btS751Rxyz99f; Fri, 01 Aug 2025 00:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5710ovu4034495; Fri, 1 Aug 2025 00:50:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5710ovdW034492; Fri, 1 Aug 2025 00:50:57 GMT (envelope-from git) Date: Fri, 1 Aug 2025 00:50:57 GMT Message-Id: <202508010050.5710ovdW034492@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: f61c48f4403f - main - kern: rename crsetgroups_fallback, document it in ucred(9) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: f61c48f4403fc8c69f9b933d3f1bd9663008b0eb Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f61c48f4403fc8c69f9b933d3f1bd9663008b0eb commit f61c48f4403fc8c69f9b933d3f1bd9663008b0eb Author: Kyle Evans AuthorDate: 2025-08-01 00:50:48 +0000 Commit: Kyle Evans CommitDate: 2025-08-01 00:50:48 +0000 kern: rename crsetgroups_fallback, document it in ucred(9) As of FreeBSD 15.0, crsetgroups() *only* sets supplementary groups, while crsetgroups_and_egid() will do both using an array of the same style that previous versions used for crsetgroups() -- i.e., the first element is the egid, and the remainder are supplementary groups. Unlike the previous iteration of crsetgroups(), crsetgroups_and_egid() is less prone to misuse as the caller must provide a default egid to use in case the array is empty. This is particularly useful for groups being set from data provided by userland. Reviewed by: olce Suggested by: olce Differential Revision: https://reviews.freebsd.org/D51647 --- share/man/man9/ucred.9 | 19 +++++++++++++++++-- sys/fs/nfs/nfs_commonport.c | 2 +- sys/fs/nfs/nfs_commonsubs.c | 2 +- sys/fs/nfsserver/nfs_nfsdport.c | 2 +- sys/fs/nfsserver/nfs_nfsdsocket.c | 2 +- sys/kern/kern_prot.c | 10 +++++----- sys/kern/vfs_export.c | 4 ++-- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c | 2 +- sys/rpc/svc_auth.c | 4 ++-- sys/sys/ucred.h | 4 ++-- 10 files changed, 33 insertions(+), 18 deletions(-) diff --git a/share/man/man9/ucred.9 b/share/man/man9/ucred.9 index 16de37dd8b35..38759bddb5b0 100644 --- a/share/man/man9/ucred.9 +++ b/share/man/man9/ucred.9 @@ -54,6 +54,9 @@ .Ft void .Fn crsetgroups "struct ucred *cr" "int ngrp" "gid_t *groups" .Ft void +.Fn crsetgroups_and_egid "struct ucred *cr" "int ngrp" "gid_t *groups" \ + "gid_t default_egid" +.Ft void .Fn cru2x "struct ucred *cr" "struct xucred *xcr" .Sh DESCRIPTION The @@ -110,16 +113,28 @@ The actual copying is performed by .Pp The .Fn crsetgroups -function sets the +and +.Fn crsetgroups_and_egid +functions set the .Va cr_groups and .Va cr_ngroups variables and allocates space as needed. -It also truncates the group list to the current maximum number of +They also truncate the group list to the current maximum number of groups. No other mechanism should be used to modify the .Va cr_groups array. +Note that +.Fn crsetgroups_and_egid +will interpret the first element of +.Va groups +as the new effective GID and the rest of the array as the supplementary groups, +and +.Va default_egid +will be used as the new effective GID only if +.Va groups +is empty. .Pp The .Fn cru2x diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index e382b22fed74..e5fdb395c9f7 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -258,7 +258,7 @@ newnfs_copycred(struct nfscred *nfscr, struct ucred *cr) KASSERT(nfscr->nfsc_ngroups >= 0, ("newnfs_copycred: negative nfsc_ngroups")); cr->cr_uid = nfscr->nfsc_uid; - crsetgroups_fallback(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, + crsetgroups_and_egid(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups, GID_NOGROUP); } diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index a957315aaa12..4ffc4ce5c29f 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4143,7 +4143,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) */ cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid; - crsetgroups_fallback(cr, nidp->nid_ngroup, grps, + crsetgroups_and_egid(cr, nidp->nid_ngroup, grps, GID_NOGROUP); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 9e1a198bf34a..8c427c66c156 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3466,7 +3466,7 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexstuff *exp, nd->nd_cred->cr_gid = credanon->cr_gid; /* * 'credanon' is already a 'struct ucred' that was built - * internally with calls to crsetgroups_fallback(), so + * internally with calls to crsetgroups_and_egid(), so * we don't need a fallback here. */ crsetgroups(nd->nd_cred, credanon->cr_ngroups, diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index d1b6198ba0e1..d6832b4f74be 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -1425,7 +1425,7 @@ nfsrv_createrootcred(void) cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = UID_ROOT; - crsetgroups_fallback(cr, 0, NULL, GID_WHEEL); + crsetgroups_and_egid(cr, 0, NULL, GID_WHEEL); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 632be229af5b..6bdef84a34c1 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2928,19 +2928,19 @@ crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) } /* - * Same as crsetgroups() but accepts an empty groups array. + * Same as crsetgroups() but sets the effective GID as well. * * This function ensures that an effective GID is always present in credentials. - * An empty array will only set the effective GID to the fallback, while a + * An empty array will only set the effective GID to the default_egid, while a * non-empty array will peel off groups[0] to set as the effective GID and use * the remainder, if any, as supplementary groups. */ void -crsetgroups_fallback(struct ucred *cr, int ngrp, const gid_t *groups, - const gid_t fallback) +crsetgroups_and_egid(struct ucred *cr, int ngrp, const gid_t *groups, + const gid_t default_egid) { if (ngrp == 0) { - cr->cr_gid = fallback; + cr->cr_gid = default_egid; cr->cr_ngroups = 0; cr->cr_flags |= CRED_FLAG_GROUPSET; return; diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index a314bda164de..bd7caa01e153 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -134,7 +134,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; - crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, + crsetgroups_and_egid(np->netc_anon, argp->ex_ngroups, argp->ex_groups, GID_NOGROUP); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); @@ -213,7 +213,7 @@ vfs_hang_addrlist(struct mount *mp, struct netexport *nep, np->netc_exflags = argp->ex_flags; np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_uid; - crsetgroups_fallback(np->netc_anon, argp->ex_ngroups, argp->ex_groups, + crsetgroups_and_egid(np->netc_anon, argp->ex_ngroups, argp->ex_groups, GID_NOGROUP); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c index b1790dd167d5..51077c71822c 100644 --- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -537,7 +537,7 @@ rpc_gss_svc_getcred(struct svc_req *req, struct ucred **crp, int *flavorp) cr = client->cl_cred = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = uc->uid; cr->cr_rgid = cr->cr_svgid = uc->gid; - crsetgroups_fallback(cr, uc->gidlen, uc->gidlist, uc->gid); + crsetgroups_and_egid(cr, uc->gidlen, uc->gidlist, uc->gid); cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); *crp = crhold(cr); diff --git a/sys/rpc/svc_auth.c b/sys/rpc/svc_auth.c index 838fa9ed313a..acbb1112e270 100644 --- a/sys/rpc/svc_auth.c +++ b/sys/rpc/svc_auth.c @@ -192,7 +192,7 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) return (FALSE); cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xprt->xp_uid; - crsetgroups_fallback(cr, xprt->xp_ngrps, xprt->xp_gidp, GID_NOGROUP); + crsetgroups_and_egid(cr, xprt->xp_ngrps, xprt->xp_gidp, GID_NOGROUP); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); @@ -207,7 +207,7 @@ svc_getcred(struct svc_req *rqst, struct ucred **crp, int *flavorp) return (FALSE); cr = crget(); cr->cr_uid = cr->cr_ruid = cr->cr_svuid = xcr->cr_uid; - crsetgroups_fallback(cr, xcr->cr_ngroups, xcr->cr_groups, GID_NOGROUP); + crsetgroups_and_egid(cr, xcr->cr_ngroups, xcr->cr_groups, GID_NOGROUP); cr->cr_rgid = cr->cr_svgid = cr->cr_gid; cr->cr_prison = curthread->td_ucred->cr_prison; prison_hold(cr->cr_prison); diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index cd4efcb71c0d..9c1d8545af34 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -242,8 +242,8 @@ void crcowfree(struct thread *td); void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups); -void crsetgroups_fallback(struct ucred *cr, int ngrp, const gid_t *groups, - const gid_t fallback); +void crsetgroups_and_egid(struct ucred *cr, int ngrp, const gid_t *groups, + const gid_t default_egid); bool cr_xids_subset(struct ucred *active_cred, struct ucred *obj_cred); /* From nobody Fri Aug 1 08:17:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btf2R5Hfvz63cv8; Fri, 01 Aug 2025 08:17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btf2R4tcNz3vs4; Fri, 01 Aug 2025 08:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754036255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7uI5fOKTukegm+xw7KtQ8jx7Fwh0l2pxx8Ewt6rhBbs=; b=dGQ1u8U/CuvnM9qyonTAkUS6Agt4frrurSKDAnDz2XHXJMGWaSKxruvLkUtL88VcAuKBjA UTOA/ax7kmRjFeRTMxsUD/8N7GeatMOX/CYVGRxl0BwW4U/E7jUQepH+AWGtCegBujsVvP cAPJcM2ogCtg0YhNUnIDZgwmM0UvM6ijJFhliHr0b6fe7P31hRkFl8bHLsSthpktnBbOaq 4xoScg91a+bLJU00YT6PIgkBJ44vrH5RN0kJMI62ik8l5aXZwjXTrPiT+RKHAhOYKAvn5j ixHXPnnUOoNd+aIh933dbim0HMTLC9Zfbz85K7qZzcbk/B14GpWvCwQx53JFhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754036255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7uI5fOKTukegm+xw7KtQ8jx7Fwh0l2pxx8Ewt6rhBbs=; b=Gn3ydFW2W70g4bBTObVEDBshTMIrgSwDIjsYbIHfRD537T56GeIdhOfUCGq3xmmxGlDbgD lPCLIt6Wum+xd1wtx8lJu9JfYTnS2hJ2q+gJ16F2pADoyRfeSQApp0d3B6vYnJXdHZL9D0 J03G/YQfxJTbWtN4KU+jsWsaN8CdcGBJSKJEDN/cx74NAsH6CQza/md8Ob4GS5FxHGPOto 3g1YY88qKmp4BxwhpporVkek57sHB1Sj97atOgcju8LEoUMr6nwrkMd/NjhGuzcabfhP6z bEfiig7CScOuzkd+VtaOcOYGAG4OcBVrW4vxJ2wrV1lNr2iynlStzN6fUDkmGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754036255; a=rsa-sha256; cv=none; b=m4+5hc1HZFAWSQrx/3Tqx0j6190E/FS49Ecb/zbl4fSEYsnuMhMupvtSKgwtdC2pSfIhcz j5830IQrIqlNvUw7CTgCGV63i4ake9L57V/4vHKPEUC5CfmS/e69QCXMbCYImoDQvKrsNL U25xBQwCG8R9R9aWVWWbXoKOqx6YB+1JkNIDTiCh6i6Gzr5z/baOjnB0i3AtBbY4B0/j8s lCuIGuR/YnFgxcFNN8NWNpBhKSb8mrfggf00iQWzjs10qLeC8LI2VWHKe9tUu+ldq2kQF6 WhhPoTNi7q9kBL3I71u7qUMoRB2zesnwTAnE/Ce8hU4y21ZVRF/574QlkJT21Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btf2R4T9FzgFy; Fri, 01 Aug 2025 08:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5718HZ0j067174; Fri, 1 Aug 2025 08:17:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5718HZM6067171; Fri, 1 Aug 2025 08:17:35 GMT (envelope-from git) Date: Fri, 1 Aug 2025 08:17:35 GMT Message-Id: <202508010817.5718HZM6067171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: bcb298fa9e23 - main - sctp, tcp, udp: improve deferred computation of checksums List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcb298fa9e23c1192c5707086a67d3b396186abc Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bcb298fa9e23c1192c5707086a67d3b396186abc commit bcb298fa9e23c1192c5707086a67d3b396186abc Author: Timo Völker AuthorDate: 2025-08-01 10:09:47 +0000 Commit: Michael Tuexen CommitDate: 2025-08-01 10:09:47 +0000 sctp, tcp, udp: improve deferred computation of checksums When the SCTP, TCP, or UDP implementation send a packet, it does not compute the corresponding checksum but defers that. The network layer will determine whether the network interface selected for the packet has the requested capability and computes the checksum in software, if the selected network interface doesn't have the requested capability. Do this not only for packets being sent by the local SCTP, TCP, and UDP stack, but also when forwarding packets. Furthermore, when such packets are delivered to a local SCTP, TCP, or UDP stack, do not compute or validate the checksum, since such packets never have been on the wire. This allows to support checksum offloading also in the case of local virtual machines or jails. Support for epair, vtnet, and tap interfaces will be added in separate commits. Reviewed by: kp, rgrimes, tuexen, manpages MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D51475 --- share/man/man9/mbuf.9 | 32 +++++++++++++++++++++++--------- sys/netinet/ip_fastfwd.c | 22 ++++++++++++++++++++++ sys/netinet/sctp_input.c | 6 +++++- sys/netinet/tcp_input.c | 12 ++++++++++++ sys/netinet/udp_usrreq.c | 6 ++++++ sys/netinet6/ip6_fastfwd.c | 28 ++++++++++++++++++++++++++++ sys/netinet6/ip6_forward.c | 27 +++++++++++++++++++++++++++ sys/netinet6/sctp6_usrreq.c | 6 +++++- sys/netinet6/udp6_usrreq.c | 6 ++++++ sys/sys/mbuf.h | 17 ++++++++--------- 10 files changed, 142 insertions(+), 20 deletions(-) diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index c05505716a30..e4f30962ccab 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 2025 +.Dd August 1, 2025 .Dt MBUF 9 .Os .\" @@ -1102,8 +1102,7 @@ of a packet contains two fields used for that purpose, .Vt int Va csum_flags and .Vt int Va csum_data . -The meaning of those fields depends on the direction a packet flows in, -and on whether the packet is fragmented. +The meaning of those fields depends on whether the packet is fragmented. Henceforth, .Va csum_flags or @@ -1117,14 +1116,14 @@ in the .Vt mbuf chain containing the packet. .Pp -On output, the computation of the checksum is delayed until the outgoing -interface has been determined for a packet. +When a packet is sent by SCTP, TCP, or UDP, the computation of the checksum +is delayed until the outgoing interface has been determined for a packet. The interface-specific field .Va ifnet.if_data.ifi_hwassist (see .Xr ifnet 9 ) -is consulted for the capabilities of the interface to assist in -computing checksums. +is consulted by IP for the capabilities of the network interface selected for +output to assist in computing checksums. The .Va csum_flags field of the packet header is set to indicate which actions the interface @@ -1163,8 +1162,8 @@ defined by the TCP and UDP specifications. In the case of SCTP, the checksum field will be initially set by the SCTP implementation to 0. .Pp -On input, an interface indicates the actions it has performed -on a packet by setting one or more of the following flags in +When a packet is received by an interface, it indicates the actions it has +performed on a packet by setting one or more of the following flags in .Va csum_flags associated with the packet: .Bl -tag -width ".Dv CSUM_IP_CHECKED" -offset indent @@ -1215,6 +1214,21 @@ is not relevant and in .Va csum_flags is not set, since SCTP does not use a pseudo header checksum. +.Pp +If IP delivers a packet with the flags +.Dv CSUM_SCTP , +.Dv CSUM_TCP , +or +.Dv CSUM_UDP +set in +.Va csum_flags +to a local SCTP, TCP, or UDP stack, the packet will be processed without +computing or validating the checksum, since the packet has not been on the +wire. +This can happen if the packet was handled by a virtual interface such as +.Xr tap 4 +or +.Xr epair 4 . .Sh STRESS TESTING When running a kernel compiled with the option .Dv MBUF_STRESS_TEST , diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 9b81760e58f3..51e7c2fbc4b0 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -69,6 +69,7 @@ #include #include "opt_ipstealth.h" +#include "opt_sctp.h" #include #include @@ -102,6 +103,10 @@ #include +#if defined(SCTP) || defined(SCTP_SUPPORT) +#include +#endif + #define V_ipsendredirects VNET(ipsendredirects) static struct mbuf * @@ -460,6 +465,23 @@ passout: } else gw = (const struct sockaddr *)dst; + /* + * If TCP/UDP header still needs a valid checksum and interface will not + * calculate it for us, do it here. + */ + if (__predict_false(m->m_pkthdr.csum_flags & CSUM_DELAY_DATA & + ~nh->nh_ifp->if_hwassist)) { + in_delayed_cksum(m); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + } +#if defined(SCTP) || defined(SCTP_SUPPORT) + if (__predict_false(m->m_pkthdr.csum_flags & CSUM_IP_SCTP & + ~nh->nh_ifp->if_hwassist)) { + sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); + m->m_pkthdr.csum_flags &= ~CSUM_IP_SCTP; + } +#endif + /* Handle redirect case. */ redest.s_addr = 0; if (V_ipsendredirects && osrc.s_addr == ip->ip_src.s_addr && diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index dc31ffbc2161..5f637cc63df5 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -5780,7 +5780,11 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint16_t port) goto out; } ecn_bits = ip->ip_tos; - if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { + if (m->m_pkthdr.csum_flags & (CSUM_SCTP_VALID | CSUM_IP_SCTP)) { + /* + * Packet with CSUM_IP_SCTP were sent from local host using + * checksum offloading. Checksum not required. + */ SCTP_STAT_INCR(sctps_recvhwcrc); compute_crc = 0; } else { diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index de428ae1af6f..d58cc69b7625 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -650,6 +650,12 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) th->th_sum = in6_cksum_pseudo(ip6, tlen, IPPROTO_TCP, m->m_pkthdr.csum_data); th->th_sum ^= 0xffff; + } else if (m->m_pkthdr.csum_flags & CSUM_IP6_TCP) { + /* + * Packet from local host (maybe from a VM). + * Checksum not required. + */ + th->th_sum = 0; } else th->th_sum = in6_cksum(m, IPPROTO_TCP, off0, tlen); if (th->th_sum) { @@ -710,6 +716,12 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) htonl(m->m_pkthdr.csum_data + tlen + IPPROTO_TCP)); th->th_sum ^= 0xffff; + } else if (m->m_pkthdr.csum_flags & CSUM_IP_TCP) { + /* + * Packet from local host (maybe from a VM). + * Checksum not required. + */ + th->th_sum = 0; } else { struct ipovly *ipov = (struct ipovly *)ip; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 42cfb919e263..df8f293f9426 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -560,6 +560,12 @@ udp_input(struct mbuf **mp, int *offp, int proto) ip->ip_dst.s_addr, htonl((u_short)len + m->m_pkthdr.csum_data + proto)); uh_sum ^= 0xffff; + } else if (m->m_pkthdr.csum_flags & CSUM_IP_UDP) { + /* + * Packet from local host (maybe from a VM). + * Checksum not required. + */ + uh_sum = 0; } else { char b[offsetof(struct ipovly, ih_src)]; struct ipovly *ipov = (struct ipovly *)ip; diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c index 0ed313bd49a5..7139267722b7 100644 --- a/sys/netinet6/ip6_fastfwd.c +++ b/sys/netinet6/ip6_fastfwd.c @@ -27,6 +27,7 @@ #include #include "opt_inet6.h" #include "opt_ipstealth.h" +#include "opt_sctp.h" #include #include @@ -54,6 +55,10 @@ #include #include +#if defined(SCTP) || defined(SCTP_SUPPORT) +#include +#endif + static int ip6_findroute(struct nhop_object **pnh, const struct sockaddr_in6 *dst, struct mbuf *m) @@ -277,6 +282,29 @@ passout: ip6->ip6_hlim -= IPV6_HLIMDEC; } + /* + * If TCP/UDP header still needs a valid checksum and interface will not + * calculate it for us, do it here. + */ + if (__predict_false(m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & + ~nh->nh_ifp->if_hwassist)) { + int offset = ip6_lasthdr(m, 0, IPPROTO_IPV6, NULL); + + if (offset < sizeof(struct ip6_hdr) || offset > m->m_pkthdr.len) + goto drop; + in6_delayed_cksum(m, m->m_pkthdr.len - offset, offset); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } +#if defined(SCTP) || defined(SCTP_SUPPORT) + if (__predict_false(m->m_pkthdr.csum_flags & CSUM_IP6_SCTP & + ~nh->nh_ifp->if_hwassist)) { + int offset = ip6_lasthdr(m, 0, IPPROTO_IPV6, NULL); + + sctp_delayed_cksum(m, offset); + m->m_pkthdr.csum_flags &= ~CSUM_IP6_SCTP; + } +#endif + m_clrprotoflags(m); /* Avoid confusing lower layers. */ IP_PROBE(send, NULL, NULL, ip6, nh->nh_ifp, NULL, ip6); diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index ad8c95c9363c..f6c09b0ac7bc 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -75,6 +75,10 @@ #include +#if defined(SCTP) || defined(SCTP_SUPPORT) +#include +#endif + /* * Forward a packet. If some error occurs return the sender * an icmp packet. Note we can't always generate a meaningful @@ -389,6 +393,29 @@ pass: goto bad; } + /* + * If TCP/UDP header still needs a valid checksum and interface will not + * calculate it for us, do it here. + */ + if (__predict_false(m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & + ~nh->nh_ifp->if_hwassist)) { + int offset = ip6_lasthdr(m, 0, IPPROTO_IPV6, NULL); + + if (offset < sizeof(struct ip6_hdr) || offset > m->m_pkthdr.len) + goto bad; + in6_delayed_cksum(m, m->m_pkthdr.len - offset, offset); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } +#if defined(SCTP) || defined(SCTP_SUPPORT) + if (__predict_false(m->m_pkthdr.csum_flags & CSUM_IP6_SCTP & + ~nh->nh_ifp->if_hwassist)) { + int offset = ip6_lasthdr(m, 0, IPPROTO_IPV6, NULL); + + sctp_delayed_cksum(m, offset); + m->m_pkthdr.csum_flags &= ~CSUM_IP6_SCTP; + } +#endif + /* Currently LLE layer stores embedded IPv6 addresses */ if (IN6_IS_SCOPE_LINKLOCAL(&dst.sin6_addr)) { in6_set_unicast_scopeid(&dst.sin6_addr, dst.sin6_scope_id); diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index 8964ccf54c54..c4716fdafb6e 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -139,7 +139,11 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, uint16_t port) goto out; } ecn_bits = IPV6_TRAFFIC_CLASS(ip6); - if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { + if (m->m_pkthdr.csum_flags & (CSUM_SCTP_VALID | CSUM_IP6_SCTP)) { + /* + * Packet with CSUM_IP6_SCTP were sent from local host using + * checksum offloading. Checksum not required. + */ SCTP_STAT_INCR(sctps_recvhwcrc); compute_crc = 0; } else { diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index b3ed16fda713..0027cf3bd230 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -434,6 +434,12 @@ udp6_input(struct mbuf **mp, int *offp, int proto) uh_sum = in6_cksum_pseudo(ip6, ulen, nxt, m->m_pkthdr.csum_data); uh_sum ^= 0xffff; + } else if (m->m_pkthdr.csum_flags & CSUM_IP6_UDP) { + /* + * Packet from local host (maybe from a VM). + * Checksum not required. + */ + uh_sum = 0; } else uh_sum = in6_cksum_partial(m, nxt, off, plen, ulen); diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 304bd019c9fc..f9141bf70742 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -641,16 +641,15 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgoff) /* * Flags indicating checksum, segmentation and other offload work to be - * done, or already done, by hardware or lower layers. It is split into - * separate inbound and outbound flags. + * done, or already done, by hardware or lower layers. * - * Outbound flags that are set by upper protocol layers requesting lower + * Flags that are set by upper protocol layers requesting lower * layers, or ideally the hardware, to perform these offloading tasks. - * For outbound packets this field and its flags can be directly tested - * against ifnet if_hwassist. Note that the outbound and the inbound flags do - * not collide right now but they could be allowed to (as long as the flags are - * scrubbed appropriately when the direction of an mbuf changes). CSUM_BITS - * would also have to split into CSUM_BITS_TX and CSUM_BITS_RX. + * Before passing packets to a network interface this field and its flags can + * be directly tested against ifnet if_hwassist. Note that the flags + * CSUM_IP_SCTP, CSUM_IP_TCP, and CSUM_IP_UDP can appear on input processing + * of SCTP, TCP, and UDP. In such a case the checksum will not be computed or + * validated by SCTP, TCP, or TCP, since the packet has not been on the wire. * * CSUM_INNER_ is the same as CSUM_ but it applies to the inner frame. * The CSUM_ENCAP_ bits identify the outer encapsulation. @@ -679,7 +678,7 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgoff) #define CSUM_ENCAP_VXLAN 0x00040000 /* VXLAN outer encapsulation */ #define CSUM_ENCAP_RSVD1 0x00080000 -/* Inbound checksum support where the checksum was verified by hardware. */ +/* Flags used to indicate that the checksum was verified by hardware. */ #define CSUM_INNER_L3_CALC 0x00100000 #define CSUM_INNER_L3_VALID 0x00200000 #define CSUM_INNER_L4_CALC 0x00400000 From nobody Fri Aug 1 09:26:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btgZS5S4Mz63gVp; Fri, 01 Aug 2025 09:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btgZS1JWsz42Dk; Fri, 01 Aug 2025 09:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754040416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Dvrb4FUc6hezka1pAZBVV5SK5zKDY67vNVixySsc20=; b=r3IiBaHyggcT1JM9oNxAhEiZJfQQYVzCXqspWKhmpcMEaZ2pHHZ7g9jFQgWmEzfXk+jUhg j0HenqnnpXNPkS5Dy5p3xA3TW3nk1EBLtf7aqSwAx7aYBOMNTVCPEddNvt1OnKXnaUDzSb SQB1sz34/7TqAPC7XMvt833+pfPIjbCIGUHWXDpeFxtX8gmzcLctLMRGFwHqOHbRXVve9W keYAAfnJ7+AIZm3eo2jh1h8Jx8Qb+SlwOlJ7lF2LBCLIu4yD6EtYMbFBIFkw6KUSGDB3lB XJLaUvO4/uGeXhDGPV2NmmzdGpo/dJegukqR6TvnS+IUGrVvmk6ZkREsqXNIjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754040416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Dvrb4FUc6hezka1pAZBVV5SK5zKDY67vNVixySsc20=; b=EPldLDT73ERMV+7c+VrcchTcHs9I/ynjH3Bz8MHHn65EeNEkrZe97MfZT9E5b6SmMDJD9r z1jGLb/+V3LKmF+AS6FUHjGlqMzYDt63aln1V844APsj1qKIh+kKnjCErTUk5rCTOPANl6 JJU609hSbD1wPMLB+Tt4AqZocLak+xK/TyEdRn6W/omIbGMjX9p0a+e35A+3gui6KtPKqd Lfp9yLRpjLd0gU+1HqlAON86wiVQM229ku5FzENLWoF022eLBTP1klaCzs8BacHZzqethe kE44AoFToUVys6wVuHGAoeXlrp1RrteXIrcfob5rQaO4KFMDi/Wd9kn1jAHI3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754040416; a=rsa-sha256; cv=none; b=gQJs9Ho5nNqgGmwFXywKii+O1xLFYN5H8MnfEKCPR4yVG20CerLnjulsnUMcexR8WivWc2 FBTmDMZjEU8c06Pq6EoTc6t5fCbJunb5r/NCEuuVPkDInciKUu9mXcBJqAfNyU8A5i15Fw xzMEzwl52Ws4JDiiWUuDWWvluCeR9fzzgoy/oS9KeydmfmVFxtx3htoPDzBuapyeOeJEPM 7vDX08Zrz+zJQT4Nc41SCDOExS4/jaH9M18y6obNNXszVc8tB9/lRg0e3cDN8ni4YndkEU mo0Q5pfBs4Am7Ekcka0WMaiSUmKr+lfaEJLQCOEuF46elIoI5uquYFpqmR/J9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btgZS0ncRzj3w; Fri, 01 Aug 2025 09:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5719QtET097311; Fri, 1 Aug 2025 09:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5719QtO7097309; Fri, 1 Aug 2025 09:26:55 GMT (envelope-from git) Date: Fri, 1 Aug 2025 09:26:55 GMT Message-Id: <202508010926.5719QtO7097309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 1c52229528e7 - main - lib: Move libopencsd to /usr/lib and make private List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c52229528e7fee22440dd9a7180b562d3cbf339 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1c52229528e7fee22440dd9a7180b562d3cbf339 commit 1c52229528e7fee22440dd9a7180b562d3cbf339 Author: Andrew Turner AuthorDate: 2025-07-30 10:10:16 +0000 Commit: Andrew Turner CommitDate: 2025-07-30 10:11:38 +0000 lib: Move libopencsd to /usr/lib and make private libopencsd is used to decode Arm CoreSight traces. It isn't needed during the boot so can be moved to /usr/lib, and may change it's API so can be marked as private as onlt the future hwt tool will use it. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51380 --- ObsoleteFiles.inc | 5 +++++ lib/libopencsd/Makefile | 6 +----- release/packages/ucl/libopencsd-all.ucl | 5 ----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 83fb2d3f3a2c..99a528806695 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20250801: libopencsd libraries moved to /usr/lib and made private +OLD_FILES+=lib/libopencsd.so.0 +OLD_FILES+=usr/lib/libopencsd.a +OLD_FILES+=usr/lib/libopencsd.so + # 20250728: zfsboot (MBR) removed OLD_FILES+=boot/zfsboot OLD_FILES+=usr/share/man/man8/zfsboot.8.gz diff --git a/lib/libopencsd/Makefile b/lib/libopencsd/Makefile index 649e756eacf6..b37a864f7cbb 100644 --- a/lib/libopencsd/Makefile +++ b/lib/libopencsd/Makefile @@ -1,8 +1,3 @@ -PACKAGE=lib${LIB} -SHLIBDIR?= /lib - -.include - OPENCSDSRC= ${SRCTOP}/contrib/opencsd .PATH: ${OPENCSDSRC}/decoder/source/ete/ \ @@ -182,6 +177,7 @@ INCSGROUPS=INCS APIINCS ETEINCS ETMV3INCS ETMV4INCS PTMINCS STMINCS LIBADD= cxxrt WARNS?= 1 +PRIVATELIB= true HAS_TESTS= diff --git a/release/packages/ucl/libopencsd-all.ucl b/release/packages/ucl/libopencsd-all.ucl deleted file mode 100644 index af46292dceed..000000000000 --- a/release/packages/ucl/libopencsd-all.ucl +++ /dev/null @@ -1,5 +0,0 @@ -comment = "ARM CoreSight Trace Decode Library" -desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: aa05d1b2ef8b - main - db/hash.c: Fix flag check in hash_seq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa05d1b2ef8b573bbd984273f72afa8a70376ae7 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=aa05d1b2ef8b573bbd984273f72afa8a70376ae7 commit aa05d1b2ef8b573bbd984273f72afa8a70376ae7 Author: Bojan Novković AuthorDate: 2025-08-01 09:33:00 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 09:33:00 +0000 db/hash.c: Fix flag check in hash_seq Fixes: 3a686b851f8f --- lib/libc/db/hash/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index b1655fe63d55..88a3ffeab828 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -704,7 +704,7 @@ hash_seq(const DB *dbp, DBT *key, DBT *data, u_int32_t flag) u_int16_t *bp, ndx; hashp = (HTAB *)dbp->internal; - if (flag != R_FIRST || flag != R_NEXT) { + if (flag != R_FIRST && flag != R_NEXT) { hashp->error = errno = EINVAL; return (ERROR); } From nobody Fri Aug 1 09:40:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btgtM4vDBz63hfj; Fri, 01 Aug 2025 09:40:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btgtL5mWgz448c; Fri, 01 Aug 2025 09:40:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=MtNTDVUr; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::733 as permitted sender) smtp.mailfrom=markjdb@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none) Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7e344e0212eso174787885a.0; Fri, 01 Aug 2025 02:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754041237; x=1754646037; 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=KQ844/YbFP6FKcxD9f12hrFenOMkY+6Q2Gt4b77uLzk=; b=MtNTDVUru4kIPEJTaYUOXmygE49C5Nf3yHKf5Pk+iQRH4pT5hGHFN1SUzvB1T25XQj 7erQxoT8ttponqB4cl9l5xZaDlqRH0qfd/CdRLFq0ZIiOppyEWOHs36QfcCvHJso0bP9 poPagLNhE7gc6WGljZJ8dHfyT4n3F8a4Dkh9I1HfYEIPWsIaQ9W10OZUd9dFEzvqWWbk BRkSQFVU1q+3jcJ2G37k7EZ5FE86ISUBn5E5pnX65o2LK140hdh43aRIK+uLAm5ORE2R p2jv0bXldmdLkzTkkOwcvHk4986y0cKcZJgU/syCPel6Ib/gnuWGHRHTMaNM4tUjPA7H l+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754041237; x=1754646037; 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=KQ844/YbFP6FKcxD9f12hrFenOMkY+6Q2Gt4b77uLzk=; b=tI+41rhIgserePOH4mXbfdp+wx+bfbrHqM9JmCx8dUDHmmjqM3a+iJUrMBVShpmJrh cnHV8gOzGCS6rqwrg/C7LLFsBiE4c4ox2HMmOgFjwRyeA2SV5JQmsZHEuiNGriiWO7fK 3sQaYr1jP4b7MvdxGY2+3hDp+iGWdiw92CDgMR9Q9auY1NCt8m1nqr322XgvuFzkTRNA g+CFAUtyh2adE/qNM1ZwY7c2sv0qZ8Jv7Hcv+tsj7HnjE6bx7+ykqKDM3lkf3DzBwl1t DZlP2CBzuhYk9HSGoF6F90pBN4T6BhcCZwRsuFsMZmGk2WUQ+UHTKw2HFQWtPl0V9nc9 LQXw== X-Forwarded-Encrypted: i=1; AJvYcCUxn2NGNepFoxqBsdcdZfBmN/xNbR34Lrr+YnTwWvosVgZ69mBFIGEMTGG1RiFpVmQzlJnjccPGiUQ865/ihsgBtiYKeHw=@freebsd.org, AJvYcCW1RUx2q2Ko6gHno7hf2yW0YU9AvhvIhF91bPzEDFcZbjeEoY29EvyfHarLSC9A3RvmRtyhtyMOQz/wYK5FQIkHAbiT@freebsd.org, AJvYcCXNXN2Dt/Y6ZNz08yt9/Sly9w3UVIqmDmmE+W2ErjIONfE+M2pnyko+Zm2EegPeRr1LIyHFA+Nv5SET+uMU3UU=@freebsd.org X-Gm-Message-State: AOJu0YxAr+623TKwMpdbWD2u3S/I6F+0vq+h5FJDJtZhQRahfDrH+cJI i/LkC7TTesJfw30PaU8Djxssh7eD34mluSQ+Fg803TgloPYle7eIgMM/pZseHIoA X-Gm-Gg: ASbGncvPc+ROIHrEzUPZumq942vK0L3VzfsK/U/Nr5wQXWR22HCYgEpsbvfv1j0wdCT SkDX/73s7lJ2ehDlLuixZvzPUyvo3IkejjA7sUMV5dxu9f9TPM2aN8L5uYx6UgRnL7kUw+JZpei pzItY3D35lmRkCZnLcRpR31UvVNo5Q8+52YSdHjJ+ZZ6ORuAjFLPm8/npClqmCMHFPrwDym3+1e UvgXnBmIkm+Rr1STJxgv+AYwlcd8gFW04R1IPUKNbJ0Gh0Mr8oKbHAEV+alwxWEasxqgVRjPdPI 1VrSM+4IqfdF6ItrfB9MX06pnP6apE9DXdRax9yeF99AVrtjfLlxMyYCHhcV1lyVY1sm5xf3IXA WXABV5WadmWfggRQalLp2nU4xIF+Xg9k/ijMCJ9lNa6C3WY0= X-Google-Smtp-Source: AGHT+IH3NAkEyNvfh5YStforzop0GBnlWJUHFMGm5/TirjUmmEH+KEPC9hENiataM+VGzBukD7fLFA== X-Received: by 2002:a05:620a:1a8c:b0:7ce:eb71:f500 with SMTP id af79cd13be357-7e681435151mr727431485a.28.1754041236442; Fri, 01 Aug 2025 02:40:36 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e67f5b528bsm197659085a.21.2025.08.01.02.40.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 02:40:36 -0700 (PDT) Date: Fri, 1 Aug 2025 05:40:33 -0400 From: Mark Johnston To: Kristof Provost Cc: Hareshx Sankar Raj , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: ded037e65e52 - main - qat: driver updates to improve code and fix bugs Message-ID: References: <202506061357.556Dv9Zc084087@gitrepo.freebsd.org> <9DB885DF-8BDD-451F-B928-0C10E881C4CF@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9DB885DF-8BDD-451F-B928-0C10E881C4CF@FreeBSD.org> X-Spamd-Result: default: False [-2.58 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.981]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::733:from]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4btgtL5mWgz448c X-Spamd-Bar: -- On Wed, Jul 30, 2025 at 02:29:37PM +0200, Kristof Provost wrote: > On 6 Jun 2025, at 15:57, Mark Johnston wrote: > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ded037e65e5239671b1292ec987a2e0894b217b5 > > > > commit ded037e65e5239671b1292ec987a2e0894b217b5 > > Author: Hareshx Sankar Raj > > AuthorDate: 2025-05-07 09:38:21 +0000 > > Commit: Mark Johnston > > CommitDate: 2025-06-06 13:43:54 +0000 > > > > qat: driver updates to improve code and fix bugs > > > > Bug fixes and improvements are done for the qat code base > > to improve code quality. > > > > Reviewed by: markj, ziaee > > MFC after: 2 weeks > > Sponsored by: Intel Corporation > > Differential Revision: https://reviews.freebsd.org/D50379 > > --- > … > > diff --git a/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h > > b/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h > > index bfc5db1f5e5c..cddfc3f84853 100644 > > --- a/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h > > +++ b/sys/dev/qat/qat_hw/qat_c3xxx/adf_c3xxx_hw_data.h > > @@ -1,11 +1,11 @@ > > /* SPDX-License-Identifier: BSD-3-Clause */ > > -/* Copyright(c) 2007-2022 Intel Corporation */ > > +/* Copyright(c) 2007-2025 Intel Corporation */ > > #ifndef ADF_C3XXX_HW_DATA_H_ > > #define ADF_C3XXX_HW_DATA_H_ > > > > /* PCIe configuration space */ > > -#define ADF_C3XXX_PMISC_BAR 0 > > -#define ADF_C3XXX_ETR_BAR 1 > > +#define ADF_C3XXX_PMISC_BAR 1 > > +#define ADF_C3XXX_ETR_BAR 2 > > #define ADF_C3XXX_RX_RINGS_OFFSET 8 > > #define ADF_C3XXX_TX_RINGS_MASK 0xFF > > #define ADF_C3XXX_MAX_ACCELERATORS 3 > > We’re seeing panics loading the QAT driver on Atom Processor C3000 (with > pfSense). > > I believe this change is the trigger. > This causes us to look for the ETR registers in the third BAR, but there are > only two on that hardware: > > # pciconf -l -b -vV pci0:1:0:0 > none0@pci0:1:0:0: class=0x0b4000 rev=0x11 hdr=0x00 vendor=0x8086 > device=0x19e2 subvendor=0x8086 subdevice=0x19e2 > vendor = 'Intel Corporation' > device = 'Atom Processor C3000 Series QuickAssist Technology' > class = processor > bar [18] = type Memory, range 64, base 0x80700000, size 262144, > enabled > bar [20] = type Memory, range 64, base 0x80740000, size 262144, > enabled Indeed, that portion of the change doesn't make a lot of sense. I posted a patch to revert it and will commit it soon if I don't hear back: https://reviews.freebsd.org/D51664 From nobody Fri Aug 1 09:56:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bthDN656vz63jGy; Fri, 01 Aug 2025 09:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bthDN5WTXz45d5; Fri, 01 Aug 2025 09:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754042180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jt1JhJg7Mr+//5msz7v8MeGG+37HTath2ov5OxxKIG4=; b=hskTvu19fqSZ1z5O+Yj4tcGTR2byGvDx/Td86m9oh4gUZgQCLs6s3yWIqvqkHX1lJdY6qZ 59GofH8y8+L9mN46vkJqt0DI4/AEXkoAJRSZ6A0BEBkSnbGi9LpGmPAc/5M31qUSd2ErI6 ATjYgsbf8zu3fP0SPGWXqITeIdmHYoVA0EMfJmljA/L+IF4IX+Z4PKm+kWM57hO5Fi63Q+ BaiNEwsjUw9V7Eq6+NqRVCKQYBp+TaanbwWNeh+aEKA9G6+PNAuKp6l8PwxDd3QUz4RFbW 5DdULS4quHOo0yPbNdjQSrDfrmfNzIzW0t2aa+2er7dEpvXTZnJjeWVVaBT0Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754042180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jt1JhJg7Mr+//5msz7v8MeGG+37HTath2ov5OxxKIG4=; b=Hq+2s7eLnxFvzgi1JrH91bRuwZtUC6WHmNXwmWIjnfEXb5r4H6uLZEunqEannVKjDffDYG DPeq7/0HhoLXlVnRSWHRz8VQIdanGLfgKOQjDYiikPChiF+yExbASCWR2cSM2wUcF6xPsO MLFNup+8/z/cfOa+JLudcUVNKJXe+29g0dgfEgXbAi4j6UGLtQ9QjR9X/cF6QNzoQy1k4M 1gqGcxH8b41zrhTRZjhjWjnBxwnxkBZaUgKhqDSwU4gT5AIY2OJ68eZc6FBg/JTJ1KpGrH Gq7r35I+w+Zst3PyJuy/q3kBRZ7dMyUTQ3csgCEekzU9zx3VaKNrYo5JPbhnww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754042180; a=rsa-sha256; cv=none; b=OMMTm8Zta+csE2aIc08svfnX5ZweqntslQPBTseT50BOq+RNEYa+Bi40BI//bWizfH5zNf vXYIKCDPYN7j0x99CmNzUJfey9A+rH6gFySVUCtbpGvmEopdhY2xRixjAYsKQlC/fQq5Y2 Cq4k2m3eVpyWVTxAlr0qjZM2vie+Ti6s8HLDz5N0nuS/QAfA2+OX5354PHZ17NeVx5tLhA qj/GiD+Y59KOfNx6Sbl5X2bqWEh8shxBygps7CttJazeo9dOg8FZtCwd/qpUfqzVCa09XK 6UN2LO9fywIbHA/4P8PCEZpyVxF8s58TSsZT08MImdJjDL9I59HmGqjrI7FPjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bthDN4yQ4zjZ9; Fri, 01 Aug 2025 09:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5719uKgh053207; Fri, 1 Aug 2025 09:56:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5719uKtQ053205; Fri, 1 Aug 2025 09:56:20 GMT (envelope-from git) Date: Fri, 1 Aug 2025 09:56:20 GMT Message-Id: <202508010956.5719uKtQ053205@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: c1c58c001943 - main - stress2: Added two syzkaller reproducers and updated the exclude 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: c1c58c0019430c9df12499e14046fe077c62c6d3 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=c1c58c0019430c9df12499e14046fe077c62c6d3 commit c1c58c0019430c9df12499e14046fe077c62c6d3 Author: Peter Holm AuthorDate: 2025-08-01 09:54:05 +0000 Commit: Peter Holm CommitDate: 2025-08-01 09:54:05 +0000 stress2: Added two syzkaller reproducers and updated the exclude list --- tools/test/stress2/misc/all.exclude | 2 + tools/test/stress2/misc/syzkaller82.sh | 122 ++++++++++++++++++++++++ tools/test/stress2/misc/syzkaller83.sh | 168 +++++++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index 54524c92eac0..f9b32db95799 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -73,6 +73,8 @@ syzkaller66.sh panic: in_pcbconnect: inp is already connected 20230621 syzkaller67.sh panic: ASan: Invalid access, 8-byte read at ... 20230621 syzkaller80.sh panic 20250711 syzkaller81.sh panic 20250711 +syzkaller82.sh panic: m_apply, length > size of mbuf chain 20250724 +quota3.sh https://people.freebsd.org/~pho/stress/log/log0604.txt 20250728 quota6.sh https://people.freebsd.org/~pho/stress/log/log0456.txt 20240707 truss3.sh WiP 20200915 zfs18.sh https://people.freebsd.org/~pho/stress/log/log0560.txt 20241118 diff --git a/tools/test/stress2/misc/syzkaller82.sh b/tools/test/stress2/misc/syzkaller82.sh new file mode 100755 index 000000000000..c810942eb060 --- /dev/null +++ b/tools/test/stress2/misc/syzkaller82.sh @@ -0,0 +1,122 @@ +#!/bin/sh + +# panic: m_apply, length > size of mbuf chain (8 extra) +# cpuid = 1 +# time = 1753341719 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01f00c5080 +# vpanic() at vpanic+0x136/frame 0xfffffe01f00c51b0 +# panic() at panic+0x43/frame 0xfffffe01f00c5210 +# m_apply() at m_apply+0x2d3/frame 0xfffffe01f00c5260 +# sctp_delayed_cksum() at sctp_delayed_cksum+0x4c/frame 0xfffffe01f00c5290 +# ip6_output_delayed_csum() at ip6_output_delayed_csum+0xaa/frame 0xfffffe01f00c52d0 +# ip6_output() at ip6_output+0x19e6/frame 0xfffffe01f00c5490 +# sctp_lowlevel_chunk_output() at sctp_lowlevel_chunk_output+0x104f/frame 0xfffffe01f00c55d0 +# sctp_med_chunk_output() at sctp_med_chunk_output+0x2ad2/frame 0xfffffe01f00c5fb0 +# sctp_chunk_output() at sctp_chunk_output+0x121c/frame 0xfffffe01f00c6960 +# sctp_lower_sosend() at sctp_lower_sosend+0x146c/frame 0xfffffe01f00c6b50 +# sctp_sosend() at sctp_sosend+0x333/frame 0xfffffe01f00c6c70 +# sousrsend() at sousrsend+0x79/frame 0xffkern_sendit() at kern_sendit+0x1be/frame 0xfffffe01f00c6d60 +# sendit() at sendit+0x1ab/frame 0xfffffe01f00c6db0 +# sys_sendto() at sys_sendto+0x4d/frame 0xfffffe01f00c6e00 +# amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe01f00c6f30 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01f00c6f30 +# --- syscall (0, FreeBSD ELF64, syscall), rip = 0x823035b0a, rsp = 0x8208fa048, rbp = 0x8208fa060 --- +# KDB: enter: panic +# [ thread pid 41871 tid 736799 ] +# Stopped at kdb_enter+0x33: movq $0,0x1231b52(%rip) +# db> x/s version +# version: FreeBSD 15.0-CURRENT #0 main-n279001-7502c1f27082-dirty: Wed Jul 23 20:31:48 CEST 2025 +# pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO +# db> + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +set -u +prog=$(basename "$0" .sh) +cat > /tmp/$prog.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include + +uint64_t r[1] = {0xffffffffffffffff}; + +int main(void) +{ + syscall(SYS_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, + /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, + /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x1012ul, + /*fd=*/(intptr_t)-1, /*offset=*/0ul); + const char* reason; + (void)reason; + intptr_t res = 0; + if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { + } + res = syscall(SYS_socket, /*domain=*/0x1cul, /*type=SOCK_STREAM*/ 1ul, + /*proto=*/0x84); + if (res != -1) + r[0] = res; + *(uint8_t*)0x2000000001c0 = 0x10; + *(uint8_t*)0x2000000001c1 = 2; + *(uint16_t*)0x2000000001c2 = htobe16(0x4e23); + *(uint32_t*)0x2000000001c4 = htobe32(0); + memset((void*)0x2000000001c8, 0, 8); + memset((void*)0x2000000001d0, 0, 112); + *(uint32_t*)0x200000000240 = 0; + *(uint32_t*)0x200000000244 = 0x5234; + *(uint32_t*)0x200000000248 = 0xffff; + *(uint32_t*)0x20000000024c = 0x314; + *(uint32_t*)0x200000000250 = 0x3bb; + *(uint16_t*)0x200000000254 = 2; + *(uint8_t*)0x200000000256 = 9; + syscall(SYS_setsockopt, /*fd=*/r[0], /*level=*/0x84, /*opt=*/0xa, + /*val=*/0x2000000001c0ul, /*len=*/0x98ul); + *(uint8_t*)0x200000000000 = 0x1c; + *(uint8_t*)0x200000000001 = 0x1c; + *(uint16_t*)0x200000000002 = htobe16(0x4e22); + *(uint32_t*)0x200000000004 = 0; + memset((void*)0x200000000008, 0, 16); + *(uint32_t*)0x200000000018 = 0; + syscall(SYS_bind, /*fd=*/r[0], /*addr=*/0x200000000000ul, /*addrlen=*/0x1cul); + *(uint8_t*)0x200000000180 = 0x5f; + *(uint8_t*)0x200000000181 = 0x1c; + *(uint16_t*)0x200000000182 = htobe16(0x4e22); + *(uint32_t*)0x200000000184 = 0; + *(uint64_t*)0x200000000188 = htobe64(0); + *(uint64_t*)0x200000000190 = htobe64(1); + *(uint32_t*)0x200000000198 = 0; + syscall(SYS_connect, /*fd=*/r[0], /*addr=*/0x200000000180ul, + /*addrlen=*/0x1cul); + memset((void*)0x2000000020c0, 209, 1); + syscall(SYS_sendto, /*fd=*/r[0], /*buf=*/0x2000000020c0ul, /*len=*/0xffeful, + /*f=MSG_NOSIGNAL|MSG_EOF|MSG_DONTWAIT|MSG_DONTROUTE*/ 0x20184ul, + /*addr=*/0ul, /*addrlen=*/0ul); + return 0; +} +EOF +mycc -o /tmp/$prog -Wall -Wextra -O0 /tmp/$prog.c || exit 1 + +work=/tmp/$prog.dir +rm -rf $work +mkdir $work +cd /tmp/$prog.dir +kldstat | grep -q sctp || { kldload sctp.ko && loaded=1; } +timeout 3m /tmp/$prog > /dev/null 2>&1 + +rm -rf /tmp/$prog /tmp/$prog.c /tmp/$prog.core /tmp/$prog.?????? $work +[ $loaded ] && kldunload sctp.ko +exit 0 diff --git a/tools/test/stress2/misc/syzkaller83.sh b/tools/test/stress2/misc/syzkaller83.sh new file mode 100755 index 000000000000..418bfd75982d --- /dev/null +++ b/tools/test/stress2/misc/syzkaller83.sh @@ -0,0 +1,168 @@ +#!/bin/sh + +# panic: handle_workitem_remove: bad file delta +# cpuid = 2 +# time = 1753799597 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00ffc84b70 +# vpanic() at vpanic+0x136/frame 0xfffffe00ffc84ca0 +# panic() at panic+0x43/frame 0xfffffe00ffc84d00 +# handle_workitem_remove() at handle_workitem_remove+0x68d/frame 0xfffffe00ffc84d70 +# handle_workitem_remove() at handle_workitem_remove+0x52d/frame 0xfffffe00ffc84de0 +# process_worklist_item() at process_worklist_item+0x21e/frame 0xfffffe00ffc84e70 +# softdep_process_worklist() at softdep_process_worklist+0xbd/frame 0xfffffe00ffc84eb0 +# softdep_flush() at softdep_flush+0x10f/frame 0xfffffe00ffc84ef0 +# fork_exit() at fork_exit+0x82/frame 0xfffffe00ffc84f30 +# fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00ffc84f30 +# --- trap 0, rip = 0, rsp = 0, rbp = 0 --- +# KDB: enter: panic +# [ thread pid 16 tid 100253 ] +# Stopped at kdb_enter+0x33: movq $0,0x1230852(%rip) +# db> x/s version +# version: FreeBSD 15.0-CURRENT #0 main-n279158-f1f77adfd9bc-dirty: Tue Jul 29 15:49:28 CEST 2025 +# pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +set -u +prog=$(basename "$0" .sh) +cat > /tmp/$prog.c < + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void kill_and_wait(int pid, int* status) +{ + kill(pid, SIGKILL); + while (waitpid(-1, status, 0) != pid) { + } +} + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void execute_one(void); + +#define WAIT_FLAGS 0 + +static void loop(void) +{ +// int iter = 0; + for (;; /*iter++*/) { + int pid = fork(); + if (pid < 0) + exit(1); + if (pid == 0) { + execute_one(); + exit(0); + } + int status = 0; + uint64_t start = current_time_ms(); + for (;;) { + sleep_ms(10); + if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) + break; + if (current_time_ms() - start < 5000) + continue; + kill_and_wait(pid, &status); + break; + } + } +} + +uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff}; + +void execute_one(void) +{ + intptr_t res = 0; + if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { + } + memcpy((void*)0x200000000180, "./file0\000", 8); + syscall(SYS_mkdir, /*path=*/0x200000000180ul, /*mode=*/0ul); + memcpy((void*)0x200000000000, "./file0/file0\000", 14); + syscall(SYS_mkdir, /*path=*/0x200000000000ul, /*mode=*/0ul); + memcpy((void*)0x200000000080, ".\000", 2); + res = syscall(SYS_open, /*file=*/0x200000000080ul, + /*flags=O_DIRECT*/ 0x10000ul, /*mode=*/0ul); + if (res != -1) + r[0] = res; + memcpy((void*)0x200000000080, ".\000", 2); + res = + syscall(SYS_open, /*file=*/0x200000000080ul, /*flags=*/0ul, /*mode=*/0ul); + if (res != -1) + r[1] = res; + memcpy((void*)0x200000000080, ".\000", 2); + res = syscall(SYS_open, /*file=*/0x200000000080ul, /*flags=O_NONBLOCK*/ 4ul, + /*mode=*/0ul); + if (res != -1) + r[2] = res; + memcpy((void*)0x200000000100, "./file1\000", 8); + syscall(SYS_mkdirat, /*fd=*/r[2], /*path=*/0x200000000100ul, + /*mode=S_IROTH|S_IWUSR*/ 0x84ul); + memcpy((void*)0x200000000340, "./file0/file0\000", 14); + memcpy((void*)0x200000000380, "./file1\000", 8); + syscall(SYS_renameat, /*oldfd=*/r[0], /*old=*/0x200000000340ul, + /*newfd=*/r[1], /*new=*/0x200000000380ul); +} +int main(void) +{ + syscall(SYS_mmap, /*addr=*/0x200000000000ul, /*len=*/0x1000000ul, + /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul, + /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x1012ul, + /*fd=*/(intptr_t)-1, /*offset=*/0ul); + const char* reason; + (void)reason; + loop(); + return 0; +} +EOF +mycc -o /tmp/$prog -Wall -Wextra -O0 /tmp/$prog.c || exit 1 + +(cd ../testcases/swap; ./swap -t 3m -i 30 -l 100 > /dev/null 2>&1) & +sleep 5 + +work=/tmp/$prog.dir +rm -rf $work +mkdir $work +cd /tmp/$prog.dir +for i in `jot 30`; do + ( + mkdir d$i + cd d$i + timeout 3m /tmp/$prog > /dev/null 2>&1 & + ) +done +while pgrep -q $prog; do sleep 2; done +while pkill swap; do :; done +wait + +rm -rf /tmp/$prog /tmp/$prog.c /tmp/$prog.core /tmp/$prog.?????? $work +exit 0 From nobody Fri Aug 1 09:56:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bthDQ0gWxz63jH0; Fri, 01 Aug 2025 09:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bthDP5fXfz45XL; Fri, 01 Aug 2025 09:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754042181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u0ry3o1gKT2YcV8YOoae7J8iFGfnCHLFWBHCP8wojvc=; b=t8Z3wRU6xUcbXIfirGjh4ZOqVY5MyANhg5PaQk6AVJeqwPdY01hok1LttxrCH35IneV5zm lwnb3BMYXzH1FzWUulshPGkcGdZgWFIYTRK+t6yUkXkRZ0rmnymypNQILkJkoxN8cZdIxR A8Cv7qqLdC34o/3RngVt+Y3tVZ7qeaw3Ouqouq4QaZRJXjxKndr6xBNIJzfnvuc4mVri/c NddvV+0z0FMRJgN0EQq2LdWF85OzicUZpGVlH/QZi//XYOAmZLhteZc1o7e3JowrdqykFz UrN5sMho9h9IAc61xJ85qYu2o7P4QGiyrGQFkw6Jh6jHAgu/A/lLgcN9EFM8/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754042181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u0ry3o1gKT2YcV8YOoae7J8iFGfnCHLFWBHCP8wojvc=; b=vQlRJPUH15WPnR76VFo1I68QL/QuC5pKrgAKP5kEtmcuPUqbb19/sf0V/soh3wzDNgJyMv oZAMC5AJ/GySbrAH3OSz4sJpthLkosjP9wb9HKVvxkBR11VRITbXseVYb5ZFoir3mNiPXm 2fIZVE66L5qx2702vpYfvq52VFKHVVD3581fUAsDiSLEvECtGIPNgnFFTfO7uEJ8ybY5wX Dq0naWWtZbny99mLV8wVSLDJUTBStMn2rqZ/t8x6U7eLkY7Yd5FDCbiDcvfsd2+5j3i9Bl 7ZiSCRh8XHS4Vb1S+ptJddP4y5vdcJlWHQP87m3rpPDr118wW6fJhF7kAeQoWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754042181; a=rsa-sha256; cv=none; b=jgaHRECqvgrml0XyMQeGZyhFDCFw217mAy8HejgpTP+lgkUpHbB5VWfShZNAzZtfTTNMDa nh2lZyj/HXSMuCt1BUqXBHyv4L3//s4YRlI6xCdvSXz/Y49wwbxaKhKL82e42tJwrWFoKO Ro31npFKCowSZG+eBg2gxPLOaBcpnR6+RntMhcFDN5DDkTyp3zfwC5YoDPlNy0JzoAVYt8 7g9sZ7qQDOtGAWkWtrRpyzTZiy5u4bV0FrmU9i27pditWGA/r0y7URFmxz4XlMnIe20z5s mZrzuh+Nc4yltCr6Yme6ousoy8ZYHYgT2zMeZtl6I5bf2bhfGe1+/d5nHw9DGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bthDP5Cz9zjKN; Fri, 01 Aug 2025 09:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5719uLYo053247; Fri, 1 Aug 2025 09:56:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5719uLQX053244; Fri, 1 Aug 2025 09:56:21 GMT (envelope-from git) Date: Fri, 1 Aug 2025 09:56:21 GMT Message-Id: <202508010956.5719uLQX053244@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: 5b977a8e2b83 - main - stress2: A workaround for an infrequent "filesystem full" issue List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 5b977a8e2b83c8957898840bc4731f8fbf6df7b1 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=5b977a8e2b83c8957898840bc4731f8fbf6df7b1 commit 5b977a8e2b83c8957898840bc4731f8fbf6df7b1 Author: Peter Holm AuthorDate: 2025-08-01 09:55:50 +0000 Commit: Peter Holm CommitDate: 2025-08-01 09:55:50 +0000 stress2: A workaround for an infrequent "filesystem full" issue --- tools/test/stress2/misc/mmap43.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/test/stress2/misc/mmap43.sh b/tools/test/stress2/misc/mmap43.sh index 98f1de174d54..8508d5865aef 100755 --- a/tools/test/stress2/misc/mmap43.sh +++ b/tools/test/stress2/misc/mmap43.sh @@ -10,7 +10,7 @@ set -u prog=$(basename "$0" .sh) -log=/tmp/$prog.log +log=`dirname $diskimage`/$prog.log rm -f $log cat > /tmp/$prog.c < @@ -148,7 +148,12 @@ s=0 start=`date +%s` while [ $((`date +%s` - start)) -lt 300 ]; do st=`date +%s` - cp file.orig file + cp file.orig file || { + # Workaround for known UFS SU ENOSPC issue + echo "Flush file system buffers and retry." + (cd $mntpoint; umount $mntpoint) > /dev/null 2>&1 # busy umount + cp file.orig file || exit 1 + } for i in `jot $n`; do timeout -k 70s 1m /tmp/$prog.sort /dev/zero & done From nobody Fri Aug 1 10:12:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bthbP51Fwz63jZn; Fri, 01 Aug 2025 10:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bthbP3vg4z46m1; Fri, 01 Aug 2025 10:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754043169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rNfGBY1kNqZBWL8K5UhsFikHImPrw8wg4Nbm8hZyQ4g=; b=LCAhDnMaj337sj23rPT8VLzXSfYRltcG8y1PL3A2vgc7w4+K7VqSIOZPgL8+7l14aUiJ/2 gDiPJ3ZcWYq1WuLawzB0dGVgp4k/3YF0l9z90I/RwmkQU1v/8NG4yS13AzXvT7njeTVidF UZgNM9rTEcXFzWtAjIuC60PjvYQO+VIwnLxQauYMO8yXP/lnCAddoM/ygQ1bFMIBN3u3A4 dFxbo++KoQbJy6aaSmFN4j6gN+L8+4PcQomTXzZ0XKDSc9aZIefqnSsrjSKuDFbUTMILFk XkrUFNpqSJhZIZEsgxWRMXFrWNwnGkKFLVLYcagNAkdNYZe7gc043FBJZhGecg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754043169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rNfGBY1kNqZBWL8K5UhsFikHImPrw8wg4Nbm8hZyQ4g=; b=ad5bsD7ph3s6SPnnOYZH+uTZl4DbhNnGUWuQob2HMjHXYB2mTpfmb/Foskjz52gMHcTmqd JiQFEasfMYjb9svDW1cU0+yk2XbIwzzkkoBw/tNCjn1j90iXfPpMWbSrA3M68pXlhKnXCF edjYwGLCDlW5vFw0ZA6EGtvYdau3FYECGaZpsj+UwasqVqTEAH0daOYxesT5/LivlEZpAZ KVv4sFwza/lrBm89jHvQYQdqlqhqyqPeSUTuzXsD7WG7HYBDUzuSDr+VJCJ5WBtOjFu/5q MOrwit44InZ+NE9CtmZR0vsL2vB+i7WYbzieHlzKds1gOurMJ3Nh72GUM+JVwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754043169; a=rsa-sha256; cv=none; b=qt1HHli5wzDHfSUEKwATm7KYyyyrQEF8oCrgbBjbmzN6Vk5lPxeUXkTNRe7n0BLLm8gwLc qn2jS6uTJgSsRa6R3xdMSxvvfruz6hUl/d+lToY80UmDfl6zOUh+mV/vYtCf7KP+RCdbp2 CE4WQvz8hMjg3fp78V1TNHczxW9TuoBUzC8GUoOIRyXMXpYti4OHVQyXzwvzUJV/R+3vAO coWEA7KAFWCHFZG/dgyJgnZRLxD+0XNwQzLtZY2PydRAO72Q8QDBmzN471Zd6SW9dozZXk pXf1V3oKOsG4EgJd2o81AxJooPGl944Rfxpop7O6z6SjQqH7lE7O+k5wq3bVMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bthbP3G26zkHr; Fri, 01 Aug 2025 10:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571ACnWt090200; Fri, 1 Aug 2025 10:12:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571ACnqN090197; Fri, 1 Aug 2025 10:12:49 GMT (envelope-from git) Date: Fri, 1 Aug 2025 10:12:49 GMT Message-Id: <202508011012.571ACnqN090197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 539da08f5567 - main - pfctl: Use sa_family_t for af instead of int List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 539da08f55670aaeec69c286db2dd0849c139b90 Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=539da08f55670aaeec69c286db2dd0849c139b90 commit 539da08f55670aaeec69c286db2dd0849c139b90 Author: Kajetan Staszkiewicz AuthorDate: 2025-07-31 14:06:49 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-08-01 10:11:25 +0000 pfctl: Use sa_family_t for af instead of int Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D51658 --- sbin/pfctl/parse.y | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 358fa909fc50..ddb0f5dc6565 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -249,7 +249,7 @@ struct redirspec { struct node_host *host; struct range rport; struct pool_opts pool_opts; - int af; + sa_family_t af; bool binat; }; @@ -393,7 +393,7 @@ void expand_eth_rule(struct pfctl_eth_rule *, int apply_rdr_ports(struct pfctl_rule *r, struct pfctl_pool *, struct redirspec *); int apply_nat_ports(struct pfctl_pool *, struct redirspec *); int apply_redirspec(struct pfctl_pool *, struct redirspec *); -int check_binat_redirspec(struct node_host *, struct pfctl_rule *, int); +int check_binat_redirspec(struct node_host *, struct pfctl_rule *, sa_family_t); void add_binat_rdr_rule(struct pfctl_rule *, struct redirspec *, struct node_host *, struct pfctl_rule *, struct redirspec **, struct node_host **); @@ -6172,7 +6172,8 @@ apply_redirspec(struct pfctl_pool *rpool, struct redirspec *rs) } int -check_binat_redirspec(struct node_host *src_host, struct pfctl_rule *r, int af) +check_binat_redirspec(struct node_host *src_host, struct pfctl_rule *r, + sa_family_t af) { struct pf_pooladdr *nat_pool = TAILQ_FIRST(&(r->nat.list)); int error = 0; From nobody Fri Aug 1 10:12:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bthbQ58yqz63kBr; Fri, 01 Aug 2025 10:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bthbQ4d0Xz46pg; Fri, 01 Aug 2025 10:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754043170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCawRnDTVjCq10xHoDBBSZoMi7X9mfdCpm4Hpazi0Pw=; b=seYLtkDANvreyQSeNmE7Q566ku7ENmoFoaOFu5YOZvlIc0r6FhLecEideWjdSSEzZWILch S2E5luCH+I4PWH5weuq28tsdBQkQEm0svG0iCabeI2UfxRZ3meF8g6mhyWincg5ngV6VOO rIpr78cgpz4y4EZTLe9PLzSKofJFpsW8LnHUdQmn6n0u+RvG4E5BVqxkN8TBGg1P/ERCGX G/CDpLgZFBuF4FTiS70k/tXuseo325nt0SphG5n2VTIsF/qzeZHl0+uq4dz/sYWOJG7sIc ZAw62YDBvg1AUmdXbO+TUiaZdfA8zc2cWw98YAN+RRtBdFTJsiyNAgcTTVdGqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754043170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCawRnDTVjCq10xHoDBBSZoMi7X9mfdCpm4Hpazi0Pw=; b=hPnAXRlIFrtBjJrY6SnUFxiayzBMGXGKQJufQQYIQNjRkQ4MPTaaha+5D+I2lk6zMBfq1d tgOLe0lyN7XoDYo0IAe6Xze6q08mJVOA+9vw3a9lTj5uLWEqnSg5d3Tecxx+vSAeT7C02h ZA5BtkscFVAgly+rIzbTwsGLineZCyo6IoIM9sJftwq5JHKeK7rOFt/1Y0qBuKvFJhH5PP 10QQflHPHkkRaNI7MkXvz/+fUOgCsW/seH80ghGqZsYsw2zTnD/UEhf73c5XI8dXMHDznU Vkl73aB68X49wHJHGHwFaoli7AjrUTIli98BXaiqI7/Gue0WiL1y01qyqCbP5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754043170; a=rsa-sha256; cv=none; b=Q8QL5GrOhu7w6ND67H0/AvaDf3ulgIkw38dh6570G2gRZNjVD49+BPHEGDQV2PvyZF0bPb 72nAeSNRPo34zwxgLxX86duSQ5Ym+DWp6/fWZx48UG3C0A2HjY/3QKi1ytA76LnAQhUUiO rSHuMLPKtlBbdFlz18N//ts0HAUeGg/6lNo5jTEB+FQvdXfkG5RZulUTwMiS9EGDtuTau0 M01UWblijHlReo0dsE5WXSemKsOhJPJBhU2vq4O892Sov1G63xVm+kbhTaMGZFB+z1dTfU fP0QBlm4T+9+5JFoZ6myOGR56D9E1CxxEvz5+Fm9kS9f6Ixf6XF04GwGiwbXVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bthbQ4BLvzkpR; Fri, 01 Aug 2025 10:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571ACod9090238; Fri, 1 Aug 2025 10:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571ACoxp090234; Fri, 1 Aug 2025 10:12:50 GMT (envelope-from git) Date: Fri, 1 Aug 2025 10:12:50 GMT Message-Id: <202508011012.571ACoxp090234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: d2761422eb0a - main - pf: Use different address family for source and redirection address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2761422eb0a811976390743921b3f15e9d8331a Auto-Submitted: auto-generated The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=d2761422eb0a811976390743921b3f15e9d8331a commit d2761422eb0a811976390743921b3f15e9d8331a Author: Kajetan Staszkiewicz AuthorDate: 2025-07-31 14:28:30 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-08-01 10:11:30 +0000 pf: Use different address family for source and redirection address The function pf_map_addr() and source tracking operate on a single address family. This made sense before introducing address family translation. When combining af-to with route-to or with sticky-address, the next-hop or the NAT address are of different address family than the source address. For example in NAT64 scenaro an IPv6 source address is translated to an IPv4 address and routed over IPv4 gateway. Make source nodes dual-AF, that is have a separate source AF and redirection AF. Store route AF in struct pf_kstate, export it to pfctl. When loading rules with redirection pools with pfctl store address family of each address. When printing states don't deduce next-hop's address family from af-to, use the one stored in state. Reviewed by: kp Approved by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D51659 --- lib/libpfctl/libpfctl.c | 3 +- lib/libpfctl/libpfctl.h | 16 ++++- sbin/pfctl/parse.y | 14 ++-- sbin/pfctl/pf_print_state.c | 13 ++-- sbin/pfctl/pfctl.c | 25 +++---- sbin/pfctl/pfctl_parser.c | 28 +++----- sbin/pfctl/pfctl_parser.h | 4 +- sys/net/pfvar.h | 15 ++-- sys/netpfil/pf/if_pfsync.c | 12 ++++ sys/netpfil/pf/pf.c | 21 +++--- sys/netpfil/pf/pf_ioctl.c | 2 + sys/netpfil/pf/pf_lb.c | 139 +++++++++++++++++++++++--------------- sys/netpfil/pf/pf_nl.c | 5 +- sys/netpfil/pf/pf_nl.h | 3 +- tests/sys/netpfil/pf/nat64.sh | 9 +++ tests/sys/netpfil/pf/src_track.sh | 61 +++++++++++++++++ 16 files changed, 252 insertions(+), 118 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index d8e60075e103..104777352d8b 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1940,6 +1940,7 @@ static struct snl_attr_parser ap_state[] = { { .type = PF_ST_RT, .off = _OUT(rt), .cb = snl_attr_get_uint8 }, { .type = PF_ST_RT_IFNAME, .off = _OUT(rt_ifname), .cb = snl_attr_store_ifname }, { .type = PF_ST_SRC_NODE_FLAGS, .off = _OUT(src_node_flags), .cb = snl_attr_get_uint8 }, + { .type = PF_ST_RT_AF, .off = _OUT(rt_af), .cb = snl_attr_get_uint8 }, }; #undef _IN #undef _OUT @@ -3043,7 +3044,7 @@ static struct snl_attr_parser ap_srcnode[] = { { .type = PF_SN_CREATION, .off = _OUT(creation), .cb = snl_attr_get_uint64 }, { .type = PF_SN_EXPIRE, .off = _OUT(expire), .cb = snl_attr_get_uint64 }, { .type = PF_SN_CONNECTION_RATE, .off = _OUT(conn_rate), .arg = &pfctl_threshold_parser, .cb = snl_attr_get_nested }, - { .type = PF_SN_NAF, .off = _OUT(naf), .cb = snl_attr_get_uint8 }, + { .type = PF_SN_RAF, .off = _OUT(raf), .cb = snl_attr_get_uint8 }, { .type = PF_SN_NODE_TYPE, .off = _OUT(type), .cb = snl_attr_get_uint8 }, }; #undef _OUT diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 98a80758ca74..116f9243fda9 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -143,9 +143,18 @@ struct pfctl_eth_anchor { int match; /* XXX: used for pfctl black magic */ }; +struct pfctl_pooladdr { + struct pf_addr_wrap addr; + TAILQ_ENTRY(pfctl_pooladdr) entries; + char ifname[IFNAMSIZ]; + sa_family_t af; +}; + +TAILQ_HEAD(pfctl_palist, pfctl_pooladdr); + struct pfctl_pool { - struct pf_palist list; - struct pf_pooladdr *cur; + struct pfctl_palist list; + struct pfctl_pooladdr *cur; struct pf_poolhashkey key; struct pf_addr counter; struct pf_mape_portset mape; @@ -383,6 +392,7 @@ struct pfctl_state { uint8_t set_prio[2]; uint8_t rt; char rt_ifname[IFNAMSIZ]; + sa_family_t rt_af; uint8_t src_node_flags; }; @@ -414,7 +424,7 @@ struct pfctl_src_node { uint32_t states; uint32_t conn; sa_family_t af; - sa_family_t naf; + sa_family_t raf; uint8_t ruletype; uint64_t creation; uint64_t expire; diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ddb0f5dc6565..00c36b218055 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -4852,7 +4852,7 @@ binatrule : no BINAT natpasslog interface af proto FROM ipspec toipspec tag tagged rtable binat_redirspec { struct pfctl_rule binat; - struct pf_pooladdr *pa; + struct pfctl_pooladdr *pa; if (check_rulestate(PFCTL_STATE_NAT)) YYERROR; @@ -5011,11 +5011,12 @@ binatrule : no BINAT natpasslog interface af proto FROM ipspec toipspec tag YYERROR; } - pa = calloc(1, sizeof(struct pf_pooladdr)); + pa = calloc(1, sizeof(struct pfctl_pooladdr)); if (pa == NULL) err(1, "binat: calloc"); pa->addr = $13->host->addr; pa->ifname[0] = 0; + pa->af = $13->host->af; TAILQ_INSERT_TAIL(&binat.rdr.list, pa, entries); @@ -6115,7 +6116,7 @@ int apply_redirspec(struct pfctl_pool *rpool, struct redirspec *rs) { struct node_host *h; - struct pf_pooladdr *pa; + struct pfctl_pooladdr *pa; if (rs == NULL) return 0; @@ -6155,10 +6156,11 @@ apply_redirspec(struct pfctl_pool *rpool, struct redirspec *rs) sizeof(struct pf_poolhashkey)); for (h = rs->host; h != NULL; h = h->next) { - pa = calloc(1, sizeof(struct pf_pooladdr)); + pa = calloc(1, sizeof(struct pfctl_pooladdr)); if (pa == NULL) err(1, "%s: calloc", __func__); pa->addr = h->addr; + pa->af = h->af; if (h->ifname != NULL) { if (strlcpy(pa->ifname, h->ifname, sizeof(pa->ifname)) >= sizeof(pa->ifname)) @@ -6175,7 +6177,7 @@ int check_binat_redirspec(struct node_host *src_host, struct pfctl_rule *r, sa_family_t af) { - struct pf_pooladdr *nat_pool = TAILQ_FIRST(&(r->nat.list)); + struct pfctl_pooladdr *nat_pool = TAILQ_FIRST(&(r->nat.list)); int error = 0; /* XXX: FreeBSD allows syntax like "{ host1 host2 }" for redirection @@ -6248,7 +6250,7 @@ add_binat_rdr_rule( /* * We're copying the whole rule, but we must re-init redir pools. - * FreeBSD uses lists of pf_pooladdr, we can't just overwrite them. + * FreeBSD uses lists of pfctl_pooladdr, we can't just overwrite them. */ bcopy(binat_rule, rdr_rule, sizeof(struct pfctl_rule)); TAILQ_INIT(&(rdr_rule->rdr.list)); diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index 5abdc2de419d..417ff70de975 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -113,10 +113,11 @@ print_addr(struct pf_addr_wrap *addr, sa_family_t af, int verbose) if (addr->type != PF_ADDR_RANGE && !(PF_AZERO(&addr->v.a.addr, AF_INET6) && PF_AZERO(&addr->v.a.mask, AF_INET6))) { - int bits = unmask(&addr->v.a.mask); - - if (bits < (af == AF_INET ? 32 : 128)) - printf("/%d", bits); + if (af == AF_INET || af == AF_INET6) { + int bits = unmask(&addr->v.a.mask); + if (bits < (af == AF_INET ? 32 : 128)) + printf("/%d", bits); + } } } @@ -228,7 +229,6 @@ print_state(struct pfctl_state *s, int opts) struct pfctl_state_key *key, *sk, *nk; const char *protoname; int min, sec; - sa_family_t af; uint8_t proto; int afto = (s->key[PF_SK_STACK].af != s->key[PF_SK_WIRE].af); int idx; @@ -242,7 +242,6 @@ print_state(struct pfctl_state *s, int opts) key = s->key; #endif - af = s->key[PF_SK_WIRE].af; proto = s->key[PF_SK_WIRE].proto; if (s->direction == PF_OUT) { @@ -430,7 +429,7 @@ print_state(struct pfctl_state *s, int opts) default: printf(" gateway: "); } - print_host(&s->rt_addr, 0, af, opts); + print_host(&s->rt_addr, 0, s->rt_af, opts); if (s->rt_ifname[0]) printf("@%s", s->rt_ifname); } diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 2015e0a09549..9aa50a73ba04 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1038,7 +1038,7 @@ pfctl_get_pool(int dev, struct pfctl_pool *pool, u_int32_t nr, u_int32_t ticket, int r_action, const char *anchorname, int which) { struct pfioc_pooladdr pp; - struct pf_pooladdr *pa; + struct pfctl_pooladdr *pa; u_int32_t pnr, mpnr; int ret; @@ -1054,10 +1054,11 @@ pfctl_get_pool(int dev, struct pfctl_pool *pool, u_int32_t nr, warnc(ret, "DIOCGETADDR"); return (-1); } - pa = calloc(1, sizeof(struct pf_pooladdr)); + pa = calloc(1, sizeof(struct pfctl_pooladdr)); if (pa == NULL) err(1, "calloc"); - bcopy(&pp.addr, pa, sizeof(struct pf_pooladdr)); + bcopy(&pp.addr, pa, sizeof(struct pfctl_pooladdr)); + pa->af = pp.af; TAILQ_INSERT_TAIL(&pool->list, pa, entries); } @@ -1067,7 +1068,7 @@ pfctl_get_pool(int dev, struct pfctl_pool *pool, u_int32_t nr, void pfctl_move_pool(struct pfctl_pool *src, struct pfctl_pool *dst) { - struct pf_pooladdr *pa; + struct pfctl_pooladdr *pa; while ((pa = TAILQ_FIRST(&src->list)) != NULL) { TAILQ_REMOVE(&src->list, pa, entries); @@ -1078,7 +1079,7 @@ pfctl_move_pool(struct pfctl_pool *src, struct pfctl_pool *dst) void pfctl_clear_pool(struct pfctl_pool *pool) { - struct pf_pooladdr *pa; + struct pfctl_pooladdr *pa; while ((pa = TAILQ_FIRST(&pool->list)) != NULL) { TAILQ_REMOVE(&pool->list, pa, entries); @@ -1794,14 +1795,14 @@ pfctl_show_creators(int opts) /* callbacks for rule/nat/rdr/addr */ int -pfctl_add_pool(struct pfctl *pf, struct pfctl_pool *p, sa_family_t af, int which) +pfctl_add_pool(struct pfctl *pf, struct pfctl_pool *p, int which) { - struct pf_pooladdr *pa; + struct pfctl_pooladdr *pa; int ret; - pf->paddr.af = af; TAILQ_FOREACH(pa, &p->list, entries) { - memcpy(&pf->paddr.addr, pa, sizeof(struct pf_pooladdr)); + memcpy(&pf->paddr.addr, pa, sizeof(struct pfctl_pooladdr)); + pf->paddr.af = pa->af; if ((pf->opts & PF_OPT_NOACTION) == 0) { if ((ret = pfctl_add_addr(pf->h, &pf->paddr, which)) != 0) errc(1, ret, "DIOCADDADDR"); @@ -2165,11 +2166,11 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth) errc(1, error, "DIOCBEGINADDRS"); } - if (pfctl_add_pool(pf, &r->rdr, r->af, PF_RDR)) + if (pfctl_add_pool(pf, &r->rdr, PF_RDR)) return (1); - if (pfctl_add_pool(pf, &r->nat, r->naf ? r->naf : r->af, PF_NAT)) + if (pfctl_add_pool(pf, &r->nat, PF_NAT)) return (1); - if (pfctl_add_pool(pf, &r->route, r->af, PF_RT)) + if (pfctl_add_pool(pf, &r->route, PF_RT)) return (1); error = pfctl_add_rule_h(pf->h, r, anchor, name, ticket, pf->paddr.ticket); diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index f2eb75135609..18b78a150c28 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -429,10 +429,9 @@ print_fromto(struct pf_rule_addr *src, pf_osfp_t osfp, struct pf_rule_addr *dst, } void -print_pool(struct pfctl_pool *pool, u_int16_t p1, u_int16_t p2, - sa_family_t af, int id) +print_pool(struct pfctl_pool *pool, u_int16_t p1, u_int16_t p2, int id) { - struct pf_pooladdr *pooladdr; + struct pfctl_pooladdr *pooladdr; if ((TAILQ_FIRST(&pool->list) != NULL) && TAILQ_NEXT(TAILQ_FIRST(&pool->list), entries) != NULL) @@ -442,15 +441,15 @@ print_pool(struct pfctl_pool *pool, u_int16_t p1, u_int16_t p2, case PF_NAT: case PF_RDR: case PF_BINAT: - print_addr(&pooladdr->addr, af, 0); + print_addr(&pooladdr->addr, pooladdr->af, 0); break; case PF_PASS: case PF_MATCH: - if (PF_AZERO(&pooladdr->addr.v.a.addr, af)) + if (PF_AZERO(&pooladdr->addr.v.a.addr, pooladdr->af)) printf("%s", pooladdr->ifname); else { printf("(%s ", pooladdr->ifname); - print_addr(&pooladdr->addr, af, 0); + print_addr(&pooladdr->addr, pooladdr->af, 0); printf(")"); } break; @@ -674,7 +673,7 @@ print_src_node(struct pfctl_src_node *sn, int opts) print_addr(&aw, sn->af, opts & PF_OPT_VERBOSE2); printf(" -> "); aw.v.a.addr = sn->raddr; - print_addr(&aw, sn->naf ? sn->naf : sn->af, opts & PF_OPT_VERBOSE2); + print_addr(&aw, sn->raf, opts & PF_OPT_VERBOSE2); printf(" ( states %u, connections %u, rate %u.%u/%us )\n", sn->states, sn->conn, sn->conn_rate.count / 1000, (sn->conn_rate.count % 1000) / 100, sn->conn_rate.seconds); @@ -952,10 +951,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer else if (r->rt == PF_DUPTO) printf(" dup-to"); printf(" "); - print_pool(&r->rdr, 0, 0, r->af, PF_PASS); - print_pool(&r->route, 0, 0, - r->rule_flag & PFRULE_AFTO && r->rt != PF_REPLYTO ? r->naf : r->af, - PF_PASS); + print_pool(&r->route, 0, 0, PF_PASS); } if (r->af) { if (r->af == AF_INET) @@ -1252,17 +1248,16 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer if (r->action == PF_NAT || r->action == PF_BINAT || r->action == PF_RDR) { printf(" -> "); print_pool(&r->rdr, r->rdr.proxy_port[0], - r->rdr.proxy_port[1], r->af, r->action); + r->rdr.proxy_port[1], r->action); } else { if (!TAILQ_EMPTY(&r->nat.list)) { if (r->rule_flag & PFRULE_AFTO) { - printf(" af-to %s from ", r->naf == AF_INET ? "inet" : "inet6"); + printf(" af-to %s from ", r->naf == AF_INET ? "inet" : (r->naf == AF_INET6 ? "inet6" : "? ")); } else { printf(" nat-to "); } print_pool(&r->nat, r->nat.proxy_port[0], - r->nat.proxy_port[1], r->naf ? r->naf : r->af, - PF_NAT); + r->nat.proxy_port[1], PF_NAT); } if (!TAILQ_EMPTY(&r->rdr.list)) { if (r->rule_flag & PFRULE_AFTO) { @@ -1271,8 +1266,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" rdr-to "); } print_pool(&r->rdr, r->rdr.proxy_port[0], - r->rdr.proxy_port[1], r->naf ? r->naf : r->af, - PF_RDR); + r->rdr.proxy_port[1], PF_RDR); } } } diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 7a3c0c2a523f..721950967661 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -286,7 +286,7 @@ int pfctl_append_rule(struct pfctl *, struct pfctl_rule *, const char *); int pfctl_append_eth_rule(struct pfctl *, struct pfctl_eth_rule *, const char *); int pfctl_add_altq(struct pfctl *, struct pf_altq *); -int pfctl_add_pool(struct pfctl *, struct pfctl_pool *, sa_family_t, int); +int pfctl_add_pool(struct pfctl *, struct pfctl_pool *, int); void pfctl_move_pool(struct pfctl_pool *, struct pfctl_pool *); void pfctl_clear_pool(struct pfctl_pool *); @@ -304,7 +304,7 @@ int parse_config(char *, struct pfctl *); int parse_flags(char *); int pfctl_load_anchors(int, struct pfctl *, struct pfr_buffer *); -void print_pool(struct pfctl_pool *, u_int16_t, u_int16_t, sa_family_t, int); +void print_pool(struct pfctl_pool *, u_int16_t, u_int16_t, int); void print_src_node(struct pfctl_src_node *, int); void print_eth_rule(struct pfctl_eth_rule *, const char *, int); void print_rule(struct pfctl_rule *, const char *, int, int); diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index d55afe750869..8dae95c2cc2e 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -629,6 +629,7 @@ struct pf_kpooladdr { struct pf_addr_wrap addr; TAILQ_ENTRY(pf_kpooladdr) entries; char ifname[IFNAMSIZ]; + sa_family_t af; struct pfi_kkif *kif; }; @@ -656,6 +657,7 @@ struct pf_rule_actions { uint16_t max_mss; uint16_t dnpipe; uint16_t dnrpipe; /* Reverse direction pipe */ + sa_family_t rt_af; uint8_t log; uint8_t set_tos; uint8_t min_ttl; @@ -911,7 +913,7 @@ struct pf_ksrc_node { u_int32_t creation; u_int32_t expire; sa_family_t af; - sa_family_t naf; + sa_family_t raf; u_int8_t ruletype; pf_sn_types_t type; struct mtx *lock; @@ -2717,14 +2719,15 @@ int pf_step_out_of_keth_anchor(struct pf_keth_anchor_stackframe *, struct pf_keth_rule **, struct pf_keth_rule **, int *); -u_short pf_map_addr(u_int8_t, struct pf_krule *, +u_short pf_map_addr(sa_family_t, struct pf_krule *, struct pf_addr *, struct pf_addr *, - struct pfi_kkif **nkif, struct pf_addr *, - struct pf_kpool *); + struct pfi_kkif **nkif, sa_family_t *, + struct pf_addr *, struct pf_kpool *); u_short pf_map_addr_sn(u_int8_t, struct pf_krule *, struct pf_addr *, struct pf_addr *, - struct pfi_kkif **nkif, struct pf_addr *, - struct pf_kpool *, pf_sn_types_t); + sa_family_t *, struct pfi_kkif **nkif, + struct pf_addr *, struct pf_kpool *, + pf_sn_types_t); int pf_get_transaddr_af(struct pf_krule *, struct pf_pdesc *); u_short pf_get_translation(struct pf_test_ctx *); diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index ee10a997c977..e34c08c8c4db 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -529,6 +529,7 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) struct pfi_kkif *rt_kif = NULL; struct pf_kpooladdr *rpool_first; int error; + sa_family_t rt_af = 0; uint8_t rt = 0; int n = 0; @@ -602,6 +603,11 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) } rt = r->rt; rt_kif = rpool_first->kif; + /* + * Guess the AF of the route address, FreeBSD 13 does + * not support af-to so it should be safe. + */ + rt_af = r->af; } else if (!PF_AZERO(&sp->pfs_1301.rt_addr, sp->pfs_1301.af)) { /* * Ruleset different, routing *supposedly* requested, @@ -627,6 +633,11 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) return ((flags & PFSYNC_SI_IOCTL) ? EINVAL : 0); } rt = sp->pfs_1400.rt; + /* + * Guess the AF of the route address, FreeBSD 13 does + * not support af-to so it should be safe. + */ + rt_af = sp->pfs_1400.af; } break; } @@ -706,6 +717,7 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) st->act.rt = rt; st->act.rt_kif = rt_kif; + st->act.rt_af = rt_af; switch (msg_version) { case PFSYNC_MSG_VERSION_1301: diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 79c298c18b46..f6ee02626624 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -401,7 +401,7 @@ static void pf_overload_task(void *v, int pending); static u_short pf_insert_src_node(struct pf_ksrc_node *[PF_SN_MAX], struct pf_srchash *[PF_SN_MAX], struct pf_krule *, struct pf_addr *, sa_family_t, struct pf_addr *, - struct pfi_kkif *, pf_sn_types_t); + struct pfi_kkif *, sa_family_t, pf_sn_types_t); static u_int pf_purge_expired_states(u_int, int); static void pf_purge_unlinked_rules(void); static int pf_mtag_uminit(void *, int, int); @@ -1017,7 +1017,7 @@ static u_short pf_insert_src_node(struct pf_ksrc_node *sns[PF_SN_MAX], struct pf_srchash *snhs[PF_SN_MAX], struct pf_krule *rule, struct pf_addr *src, sa_family_t af, struct pf_addr *raddr, - struct pfi_kkif *rkif, pf_sn_types_t sn_type) + struct pfi_kkif *rkif, sa_family_t raf, pf_sn_types_t sn_type) { u_short reason = 0; struct pf_krule *r_track = rule; @@ -1089,8 +1089,9 @@ pf_insert_src_node(struct pf_ksrc_node *sns[PF_SN_MAX], (*sn)->rule = r_track; pf_addrcpy(&(*sn)->addr, src, af); if (raddr != NULL) - pf_addrcpy(&(*sn)->raddr, raddr, af); + pf_addrcpy(&(*sn)->raddr, raddr, raf); (*sn)->rkif = rkif; + (*sn)->raf = raf; LIST_INSERT_HEAD(&(*sh)->nodes, *sn, entry); (*sn)->creation = time_uptime; (*sn)->ruletype = rule->action; @@ -5907,9 +5908,13 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, * it is applied only from the last pass rule. */ pd->act.rt = r->rt; + if (r->rt == PF_REPLYTO) + pd->act.rt_af = pd->af; + else + pd->act.rt_af = pd->naf; if ((transerror = pf_map_addr_sn(pd->af, r, pd->src, - &pd->act.rt_addr, &pd->act.rt_kif, NULL, &(r->route), - PF_SN_ROUTE)) != PFRES_MATCH) { + &pd->act.rt_addr, &pd->act.rt_af, &pd->act.rt_kif, NULL, + &(r->route), PF_SN_ROUTE)) != PFRES_MATCH) { REASON_SET(&ctx.reason, transerror); goto cleanup; } @@ -6039,7 +6044,7 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, /* src node for limits */ if ((r->rule_flag & PFRULE_SRCTRACK) && (sn_reason = pf_insert_src_node(sns, snhs, r, pd->src, pd->af, - NULL, NULL, PF_SN_LIMIT)) != 0) { + NULL, NULL, pd->af, PF_SN_LIMIT)) != 0) { REASON_SET(&ctx->reason, sn_reason); goto csfailed; } @@ -6047,7 +6052,7 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, if (r->rt) { if ((r->route.opts & PF_POOL_STICKYADDR) && (sn_reason = pf_insert_src_node(sns, snhs, r, pd->src, - pd->af, &pd->act.rt_addr, pd->act.rt_kif, + pd->af, &pd->act.rt_addr, pd->act.rt_kif, pd->act.rt_af, PF_SN_ROUTE)) != 0) { REASON_SET(&ctx->reason, sn_reason); goto csfailed; @@ -6066,7 +6071,7 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, (sn_reason = pf_insert_src_node(sns, snhs, ctx->nr, ctx->sk ? &(ctx->sk->addr[pd->sidx]) : pd->src, pd->af, ctx->nk ? &(ctx->nk->addr[1]) : &(pd->nsaddr), NULL, - PF_SN_NAT)) != 0 ) { + pd->naf, PF_SN_NAT)) != 0 ) { REASON_SET(&ctx->reason, sn_reason); goto csfailed; } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 9abc07c36788..178ee01649c6 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2661,6 +2661,7 @@ pf_ioctl_add_addr(struct pf_nl_pooladdr *pp) PF_RULES_WUNLOCK(); goto out; } + pa->af = pp->af; switch (pp->which) { case PF_NAT: TAILQ_INSERT_TAIL(&V_pf_pabuf[0], pa, entries); @@ -2742,6 +2743,7 @@ pf_ioctl_get_addr(struct pf_nl_pooladdr *pp) return (EBUSY); } pf_kpooladdr_to_pooladdr(pa, &pp->addr); + pp->af = pa->af; pf_addr_copyout(&pp->addr.addr); PF_RULES_RUNLOCK(); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index ea0d6facf695..bc9e1dc72902 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -345,8 +345,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, } } - if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, NULL, &init_addr, - rpool, sn_type)) + if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, &(pd->naf), NULL, + &init_addr, rpool, sn_type)) goto failed; if (pd->proto == IPPROTO_ICMP) { @@ -470,8 +470,8 @@ pf_get_sport(struct pf_pdesc *pd, struct pf_krule *r, struct pf_addr *naddr, * pick a different source address since we're out * of free port choices for the current one. */ - if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, NULL, - &init_addr, rpool, sn_type)) + if (pf_map_addr_sn(pd->naf, r, &pd->nsaddr, naddr, + &(pd->naf), NULL, &init_addr, rpool, sn_type)) return (1); break; case PF_POOL_NONE: @@ -501,8 +501,8 @@ pf_islinklocal(const sa_family_t af, const struct pf_addr *addr) static int pf_get_mape_sport(struct pf_pdesc *pd, struct pf_krule *r, - struct pf_addr *naddr, uint16_t *nport, - struct pf_udp_mapping **udp_mapping, struct pf_kpool *rpool) + struct pf_addr *naddr, uint16_t *nport, struct pf_udp_mapping **udp_mapping, + struct pf_kpool *rpool) { uint16_t psmask, low, highmask; uint16_t i, ahigh, cut; @@ -535,15 +535,22 @@ pf_get_mape_sport(struct pf_pdesc *pd, struct pf_krule *r, } u_short -pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, - struct pf_addr *naddr, struct pfi_kkif **nkif, struct pf_addr *init_addr, - struct pf_kpool *rpool) +pf_map_addr(sa_family_t saf, struct pf_krule *r, struct pf_addr *saddr, + struct pf_addr *naddr, struct pfi_kkif **nkif, sa_family_t *naf, + struct pf_addr *init_addr, struct pf_kpool *rpool) { u_short reason = PFRES_MATCH; struct pf_addr *raddr = NULL, *rmask = NULL; struct pfr_ktable *kt; uint64_t hashidx; int cnt; + sa_family_t wanted_af; + + KASSERT(saf != 0, ("%s: saf == 0", __func__)); + KASSERT(naf != NULL, ("%s: naf = NULL", __func__)); + KASSERT((*naf) != 0, ("%s: *naf = 0", __func__)); + + wanted_af = (*naf); mtx_lock(&rpool->mtx); /* Find the route using chosen algorithm. Store the found route @@ -553,7 +560,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, goto done_pool_mtx; } if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { - switch (af) { + switch (wanted_af) { #ifdef INET case AF_INET: if (rpool->cur->addr.p.dyn->pfid_acnt4 < 1 && @@ -577,7 +584,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, break; #endif /* INET6 */ default: - unhandled_af(af); + unhandled_af(wanted_af); } } else if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (!PF_POOL_DYNTYPE(rpool->opts)) { @@ -587,14 +594,24 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, } else { raddr = &rpool->cur->addr.v.a.addr; rmask = &rpool->cur->addr.v.a.mask; + /* + * For single addresses check their address family. Unless they + * have none, which happens when addresses are added with + * the old ioctl mechanism. In such case trust that the address + * has the proper AF. + */ + if (rpool->cur->af && rpool->cur->af != wanted_af) { + reason = PFRES_MAPFAILED; + goto done_pool_mtx; + } } switch (rpool->opts & PF_POOL_TYPEMASK) { case PF_POOL_NONE: - pf_addrcpy(naddr, raddr, af); + pf_addrcpy(naddr, raddr, wanted_af); break; case PF_POOL_BITMASK: - pf_poolmask(naddr, raddr, rmask, saddr, af); + pf_poolmask(naddr, raddr, rmask, saddr, wanted_af); break; case PF_POOL_RANDOM: if (rpool->cur->addr.type == PF_ADDR_TABLE || @@ -615,13 +632,14 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->tblidx = (int)arc4random_uniform(cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, - af, pf_islinklocal, false)) { + wanted_af, pf_islinklocal, false)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } - pf_addrcpy(naddr, &rpool->counter, af); - } else if (init_addr != NULL && PF_AZERO(init_addr, af)) { - switch (af) { + pf_addrcpy(naddr, &rpool->counter, wanted_af); + } else if (init_addr != NULL && PF_AZERO(init_addr, + wanted_af)) { + switch (wanted_af) { #ifdef INET case AF_INET: rpool->counter.addr32[0] = arc4random(); @@ -650,12 +668,14 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, break; #endif /* INET6 */ } - pf_poolmask(naddr, raddr, rmask, &rpool->counter, af); - pf_addrcpy(init_addr, naddr, af); + pf_poolmask(naddr, raddr, rmask, &rpool->counter, + wanted_af); + pf_addrcpy(init_addr, naddr, wanted_af); } else { - pf_addr_inc(&rpool->counter, af); - pf_poolmask(naddr, raddr, rmask, &rpool->counter, af); + pf_addr_inc(&rpool->counter, wanted_af); + pf_poolmask(naddr, raddr, rmask, &rpool->counter, + wanted_af); } break; case PF_POOL_SRCHASH: @@ -663,7 +683,8 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, unsigned char hash[16]; hashidx = - pf_hash(saddr, (struct pf_addr *)&hash, &rpool->key, af); + pf_hash(saddr, (struct pf_addr *)&hash, &rpool->key, + wanted_af); if (rpool->cur->addr.type == PF_ADDR_TABLE || rpool->cur->addr.type == PF_ADDR_DYNIFTL) { if (rpool->cur->addr.type == PF_ADDR_TABLE) @@ -682,14 +703,14 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->tblidx = (int)(hashidx % cnt); memset(&rpool->counter, 0, sizeof(rpool->counter)); if (pfr_pool_get(kt, &rpool->tblidx, &rpool->counter, - af, pf_islinklocal, false)) { + wanted_af, pf_islinklocal, false)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } - pf_addrcpy(naddr, &rpool->counter, af); + pf_addrcpy(naddr, &rpool->counter, wanted_af); } else { pf_poolmask(naddr, raddr, rmask, - (struct pf_addr *)&hash, af); + (struct pf_addr *)&hash, wanted_af); } break; } @@ -699,14 +720,16 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (!pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL, true)) + &rpool->tblidx, &rpool->counter, wanted_af, + NULL, true)) goto get_addr; } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { if (!pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, pf_islinklocal, - true)) + &rpool->tblidx, &rpool->counter, wanted_af, + pf_islinklocal, true)) goto get_addr; - } else if (pf_match_addr(0, raddr, rmask, &rpool->counter, af)) + } else if (pf_match_addr(0, raddr, rmask, &rpool->counter, + wanted_af)) goto get_addr; try_next: @@ -717,8 +740,9 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, rpool->tblidx = -1; if (rpool->cur->addr.type == PF_ADDR_TABLE) { if (pfr_pool_get(rpool->cur->addr.p.tbl, - &rpool->tblidx, &rpool->counter, af, NULL, true)) { - /* table contains no address of type 'af' */ + &rpool->tblidx, &rpool->counter, wanted_af, NULL, + true)) { + /* table contains no address of type 'wanted_af' */ if (rpool->cur != acur) goto try_next; reason = PFRES_MAPFAILED; @@ -726,9 +750,9 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, } } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, - &rpool->tblidx, &rpool->counter, af, pf_islinklocal, - true)) { - /* table contains no address of type 'af' */ + &rpool->tblidx, &rpool->counter, wanted_af, + pf_islinklocal, true)) { + /* interface has no address of type 'wanted_af' */ if (rpool->cur != acur) goto try_next; reason = PFRES_MAPFAILED; @@ -737,14 +761,18 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, } else { raddr = &rpool->cur->addr.v.a.addr; rmask = &rpool->cur->addr.v.a.mask; - pf_addrcpy(&rpool->counter, raddr, af); + if (rpool->cur->af && rpool->cur->af != wanted_af) { + reason = PFRES_MAPFAILED; + goto done_pool_mtx; + } + pf_addrcpy(&rpool->counter, raddr, wanted_af); } get_addr: - pf_addrcpy(naddr, &rpool->counter, af); - if (init_addr != NULL && PF_AZERO(init_addr, af)) - pf_addrcpy(init_addr, naddr, af); - pf_addr_inc(&rpool->counter, af); + pf_addrcpy(naddr, &rpool->counter, wanted_af); + if (init_addr != NULL && PF_AZERO(init_addr, wanted_af)) + pf_addrcpy(init_addr, naddr, wanted_af); + pf_addr_inc(&rpool->counter, wanted_af); break; } } @@ -759,9 +787,9 @@ done_pool_mtx: } u_short -pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, - struct pf_addr *naddr, struct pfi_kkif **nkif, struct pf_addr *init_addr, - struct pf_kpool *rpool, pf_sn_types_t sn_type) +pf_map_addr_sn(sa_family_t saf, struct pf_krule *r, struct pf_addr *saddr, + struct pf_addr *naddr, sa_family_t *naf, struct pfi_kkif **nkif, + struct pf_addr *init_addr, struct pf_kpool *rpool, pf_sn_types_t sn_type) { struct pf_ksrc_node *sn = NULL; struct pf_srchash *sh = NULL; @@ -772,27 +800,31 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, */ if (rpool->opts & PF_POOL_STICKYADDR && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) - sn = pf_find_src_node(saddr, r, af, &sh, sn_type, false); + sn = pf_find_src_node(saddr, r, saf, &sh, sn_type, false); if (sn != NULL) { PF_SRC_NODE_LOCK_ASSERT(sn); + (*naf) = sn->raf; /* If the supplied address is the same as the current one we've * been asked before, so tell the caller that there's no other * address to be had. */ - if (PF_AEQ(naddr, &(sn->raddr), af)) { + + if (PF_AEQ(naddr, &(sn->raddr), *naf)) { + printf("%s: no more addresses\n", __func__); reason = PFRES_MAPFAILED; goto done; } - pf_addrcpy(naddr, &(sn->raddr), af); + pf_addrcpy(naddr, &(sn->raddr), *naf); + if (nkif) *nkif = sn->rkif; if (V_pf_status.debug >= PF_DEBUG_NOISY) { printf("%s: src tracking maps ", __func__); - pf_print_host(saddr, 0, af); + pf_print_host(saddr, 0, saf); printf(" to "); - pf_print_host(naddr, 0, af); + pf_print_host(naddr, 0, *naf); if (nkif) printf("@%s", (*nkif)->pfik_name); printf("\n"); @@ -804,7 +836,7 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, * Source node has not been found. Find a new address and store it * in variables given by the caller. */ - if ((reason = pf_map_addr(af, r, saddr, naddr, nkif, init_addr, + if ((reason = pf_map_addr(saf, r, saddr, naddr, nkif, naf, init_addr, rpool)) != 0) { if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: pf_map_addr has failed\n", __func__); @@ -814,7 +846,7 @@ pf_map_addr_sn(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, if (V_pf_status.debug >= PF_DEBUG_NOISY && (rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_NONE) { printf("%s: selected address ", __func__); - pf_print_host(naddr, 0, af); + pf_print_host(naddr, 0, *naf); if (nkif) printf("@%s", (*nkif)->pfik_name); printf("\n"); @@ -996,8 +1028,9 @@ pf_get_transaddr(struct pf_test_ctx *ctx, struct pf_krule *r, int tries; uint16_t cut, low, high, nport; - reason = pf_map_addr_sn(pd->af, r, &pd->nsaddr, naddr, NULL, - NULL, rpool, PF_SN_NAT); + reason = pf_map_addr_sn(pd->af, r, &pd->nsaddr, naddr, + &(pd->naf), NULL, NULL, rpool, PF_SN_NAT); + if (reason != 0) goto notrans; if ((rpool->opts & PF_POOL_TYPEMASK) == PF_POOL_BITMASK) @@ -1161,8 +1194,8 @@ pf_get_transaddr_af(struct pf_krule *r, struct pf_pdesc *pd) /* get the destination address and port */ if (! TAILQ_EMPTY(&r->rdr.list)) { - if (pf_map_addr_sn(pd->naf, r, &nsaddr, &naddr, NULL, NULL, - &r->rdr, PF_SN_NAT)) + if (pf_map_addr_sn(pd->naf, r, &nsaddr, &naddr, &(pd->naf), + NULL, NULL, &r->rdr, PF_SN_NAT)) return (-1); if (r->rdr.proxy_port[0]) pd->ndport = htons(r->rdr.proxy_port[0]); diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 73933c022ca2..c5de1e84a287 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -178,7 +178,7 @@ dump_state(struct nlpcb *nlp, const struct nlmsghdr *hdr, struct pf_kstate *s, nlattr_add_string(nw, PF_ST_IFNAME, s->kif->pfik_name); nlattr_add_string(nw, PF_ST_ORIG_IFNAME, s->orig_kif->pfik_name); - dump_addr(nw, PF_ST_RT_ADDR, &s->act.rt_addr, af); + dump_addr(nw, PF_ST_RT_ADDR, &s->act.rt_addr, s->act.rt_af); nlattr_add_u32(nw, PF_ST_CREATION, time_uptime - (s->creation / 1000)); uint32_t expire = pf_state_expires(s); if (expire > time_uptime) @@ -224,6 +224,7 @@ dump_state(struct nlpcb *nlp, const struct nlmsghdr *hdr, struct pf_kstate *s, if (s->sns[PF_SN_ROUTE] != NULL) src_node_flags |= PFSTATE_SRC_NODE_ROUTE; nlattr_add_u8(nw, PF_ST_SRC_NODE_FLAGS, src_node_flags); + nlattr_add_u8(nw, PF_ST_RT_AF, s->act.rt_af); if (!dump_state_peer(nw, PF_ST_PEER_SRC, &s->src)) goto enomem; @@ -1761,7 +1762,7 @@ pf_handle_get_srcnodes(struct nlmsghdr *hdr, struct nl_pstate *npt) nlattr_add_u32(nw, PF_SN_STATES, n->states); nlattr_add_u32(nw, PF_SN_CONNECTIONS, n->conn); nlattr_add_u8(nw, PF_SN_AF, n->af); - nlattr_add_u8(nw, PF_SN_NAF, n->naf); + nlattr_add_u8(nw, PF_SN_RAF, n->raf); nlattr_add_u8(nw, PF_SN_RULE_TYPE, n->ruletype); nlattr_add_u64(nw, PF_SN_CREATION, secs - n->creation); diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 929c20e4c582..d263a0b22deb 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -135,6 +135,7 @@ enum pfstate_type_t { PF_ST_RT = 36, /* u8 */ PF_ST_RT_IFNAME = 37, /* string */ PF_ST_SRC_NODE_FLAGS = 38, /* u8 */ + PF_ST_RT_AF = 39, /* u8 */ }; enum pf_addr_type_t { @@ -433,7 +434,7 @@ enum pf_srcnodes_types_t { PF_SN_CREATION = 12, /* u64 */ PF_SN_EXPIRE = 13, /* u64 */ PF_SN_CONNECTION_RATE = 14, /* nested, pf_threshold */ - PF_SN_NAF = 15, /* u8 */ + PF_SN_RAF = 15, /* u8 */ PF_SN_NODE_TYPE = 16, /* u8 */ *** 99 LINES SKIPPED *** From nobody Fri Aug 1 11:49:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btklM1hlTz63pFH for ; Fri, 01 Aug 2025 11:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btklM18Rlz3J6H; Fri, 01 Aug 2025 11:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754048991; h=from:from:reply-to:subject:subject: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+o4BKppDngDh87AvigcSc4cZ6ynXSAcVKoT1NwKvtU=; b=wvfZGnSmt9sZ+GEjXt1I5tvnixkL/myf7A5j6DoxPBlW7tTnfYP2oBYub+QpkRF61MPRnx N+U45Tq2yHV0fObqITRqDVvvvtPE8IgZxnZ9AEzRmDByuCNN7SD0q3amsVmyW2vkGv+ikB hEyT/STaznNOtpdq46cgrvzK44jDES9QaN7NbOq0nvoH/e6eY5uEgxCwStKd0UfvebVqkN eiT0KW0VQokiB6k2rnh6RvHTzaodnmhunfwmBjmA5qfwVTU4s3fLCpohP1DY8pPAYZsyMU uqlPkd+lNHoxFIpxuQzgsuPhZnS93Aor/OoGW+t7tHzrbhZlSpwsU8YHkOXfAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754048991; h=from:from:reply-to:subject:subject: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+o4BKppDngDh87AvigcSc4cZ6ynXSAcVKoT1NwKvtU=; b=WUJOObbSSPub3rQBrh0icBA/2oTDRQpc3X0AeD+89kfxq4Q6FPkZO045oZXqGTMalX+6GM AKoYRuq6RjC/prYKym0B7pyHnS+qKTqQ2a/KgrQ9dksg1KM+g3phYEj9OeL0CSTPnLrshC j0r3/lIE6rljMB9I8lIZGUI8H0CL4LGGr5F6zNGEoPaCp+cdhJRH/WlH1rWGknRwvnYRu0 tvd1Snj0i57i6GX/5djx+cxoD0u43MX5wSVQOb6+bqh/IHofferNRo6rBRRumPWSsDCM+R CsYhn5K5Pnz1GzaSz2uIR2i3O2CiXB317ayhDxkWUqhDNNrpLF1XiNJ5D7NoQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754048991; a=rsa-sha256; cv=none; b=CderLRmaWnQ3t0+LcMaDkg8odD8EY/bmlZN+mLaBfO16YlF5stuZwqsxu1h7zyiOqndyXc SxjkCuMwHOGhKOk0aldlQFjJQ1Xe8mjaz5kPgjDDW5zB3OtHSUfo3hBkBoeduaWPCBGszS eWppHZluB5Nuycwtsad7ApY0lFTlIA6PV1B9/hj4LFeRbuQi4f+eMk40LEsI9sUo2/leXU pUdzvzPTtPsBhSUSaM01T+cD4c+/tpNgNNL0kbRmba5EfNXMWDTsAmuxyvitfuQmNQbf2c DmXzrHpbWqi0xO124sh55ltT7RNOHBuTJU4Wg7UOrhzi8wjqWViMlyGmLtLhiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btklM0QgCzmfk; Fri, 01 Aug 2025 11:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571Bnoau059864; Fri, 1 Aug 2025 11:49:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571BnoWw059863; Fri, 1 Aug 2025 11:49:50 GMT (envelope-from git) Date: Fri, 1 Aug 2025 11:49:50 GMT Message-Id: <202508011149.571BnoWw059863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Christos Margiolis Subject: git: b5fe6d28ca9c - Create tag vendor/libsamplerate/0.2.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/tags/vendor/libsamplerate/0.2.2 X-Git-Reftype: annotated tag X-Git-Commit: b5fe6d28ca9cbe15290ea056b7ad4b87f92fe2b1 Auto-Submitted: auto-generated The annotated tag vendor/libsamplerate/0.2.2 has been created by christos: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/libsamplerate/0.2.2 tag vendor/libsamplerate/0.2.2 Tagger: Christos Margiolis TaggerDate: 2025-08-01 11:40:07 +0000 First vendor import. commit 69a539a327ef8d78260056c5394363569b5751ef Author: Christos Margiolis AuthorDate: 2025-08-01 11:28:41 +0000 Commit: Christos Margiolis CommitDate: 2025-08-01 11:28:41 +0000 libsamplerate: Vendor import 0.2.2 Sponsored by: The FreeBSD Foundation From nobody Fri Aug 1 12:09:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlBT6wfVz63q7P; Fri, 01 Aug 2025 12:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlBT6Phsz3KkK; Fri, 01 Aug 2025 12:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754050193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNXIOSjKeoEBVieJWXFUC1g1759jcSr8bu47SITaQLU=; b=K+WnO68iWZ47Wr7cQvs/34C+uY4Vf/ZVI0SuewSyFmw4npau+h/SbKGlbwPz5Pmt/2yAcQ Nn1HYWfIbLddoOQKQZhBv3RhcABXOfR8n5vL707poLb8U9DTLNM8S/IRTIldL6Bb5jETO4 AA+DsTFrSUhl0j7DXhrkk5ron87WmGMai3QuNRC7Vf4H0P7rPOQsDrHK8WPuzkk0Te1wS8 QhX8de59rjUT4EtaUtWm2IgVCQLvoGOFPztDDVNI9uDGj6Eo7Hfa29l1T/T541gsJyjkzr 7iXe8N8Cd3DAuc/dnEWdeEfCzuobL0oxs0dgrUmYzWhg4EHxIaa8pGxNmibQoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754050193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNXIOSjKeoEBVieJWXFUC1g1759jcSr8bu47SITaQLU=; b=oqPtiz4uotwjBF6Et+qup7oaPWLDZE9zbtUvJ4x/Goh+EVUOQgXRT4rVY6hm6iAIoN7T9B /J/gWs+qkt9Mumc/GEs5xrKGcJarPYzPoMrM5PDwQcxDShFskhxhyVZni8NTsPMuSQRr+9 FCduQX2J5yMq9Zc/0TffGD4MRvisJ/tpSMnPI8gwqfCVzieLP6WHmc34RLhcUc72tjEyWC sulxQee+XZYfTeMtjsNcXdi2nvRHP0BJfS7H86w+UK+XpYLb9bBKZe3Kcw9/HmcrloNyxp pArSkBjIDsjM4+GrhJJXPkQVz8uqIPA/JyEfdONQFj89/FF52zWH4Qsth705hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754050193; a=rsa-sha256; cv=none; b=l1m+KRg8JkD5vktj7gxn7QwVX+wPczAvLLGWjEUddZZn+fqxXd2XDlfn0c1uA+2WegPOZU 8pI82YwfwsYMaDbRhJo9sUd5zr0UtDBkaLClwZ6+xyOZYw3zc13lMAsoICnYDjt6iGzP4F DoCcaWxl9HoNkddR0MEyAOeF3JuZOjCIpoK1ZXBVX27ve67xG2VDyqnoe6A11V7g27MqJl UYjeLNO2itnB4IJFgrN0Bs7s4h/00sVF+JtjQAiOJJmAL9YLwTBAkCb/Kq/0YW4LLlFPI0 6v/1II4zvo55ivoLCDAqeuBQIrOXVi1llAoR+GM9CIAi6FayEv5jH+X2/ezIsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlBT57kDznGZ; Fri, 01 Aug 2025 12:09:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571C9rXU097287; Fri, 1 Aug 2025 12:09:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571C9r9i097284; Fri, 1 Aug 2025 12:09:53 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:09:53 GMT Message-Id: <202508011209.571C9r9i097284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 118bfc9f53ac - main - arm64: Fix the sign in ID registers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 118bfc9f53ac9abfc58078195b35e293bbfb8136 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=118bfc9f53ac9abfc58078195b35e293bbfb8136 commit 118bfc9f53ac9abfc58078195b35e293bbfb8136 Author: Andrew Turner AuthorDate: 2025-07-30 10:51:20 +0000 Commit: Andrew Turner CommitDate: 2025-07-30 12:46:22 +0000 arm64: Fix the sign in ID registers Some ID registers use 0b0000 to indicate a feature is enabled, and 0b1111 to indicate it's not. In these cases we need to tell the kernel to treat the value as a signed field. Set the signed flag in fields we decode that should be signed. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51369 --- sys/arm64/arm64/identcpu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 49b4b25b51bb..55f7e98a1b1b 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -618,7 +618,7 @@ static const struct mrs_field id_aa64dfr0_fields[] = { id_aa64dfr0_tracebuffer), MRS_FIELD(ID_AA64DFR0, TraceFilt, false, MRS_LOWER, 0, id_aa64dfr0_tracefilt), - MRS_FIELD(ID_AA64DFR0, DoubleLock, false, MRS_LOWER, 0, + MRS_FIELD(ID_AA64DFR0, DoubleLock, true, MRS_LOWER, 0, id_aa64dfr0_doublelock), MRS_FIELD(ID_AA64DFR0, PMSVer, false, MRS_LOWER, 0, id_aa64dfr0_pmsver), MRS_FIELD(ID_AA64DFR0, CTX_CMPs, false, MRS_LOWER, 0, @@ -628,7 +628,7 @@ static const struct mrs_field id_aa64dfr0_fields[] = { MRS_FIELD(ID_AA64DFR0, PMSS, false, MRS_LOWER, 0, id_aa64dfr0_pmss), MRS_FIELD(ID_AA64DFR0, BRPs, false, MRS_LOWER, MRS_USERSPACE, id_aa64dfr0_brps), - MRS_FIELD(ID_AA64DFR0, PMUVer, false, MRS_LOWER, 0, id_aa64dfr0_pmuver), + MRS_FIELD(ID_AA64DFR0, PMUVer, true, MRS_LOWER, 0, id_aa64dfr0_pmuver), MRS_FIELD(ID_AA64DFR0, TraceVer, false, MRS_LOWER, 0, id_aa64dfr0_tracever), MRS_FIELD(ID_AA64DFR0, DebugVer, false, MRS_LOWER | MRS_SAFE(0x6), 0, @@ -1259,9 +1259,9 @@ static const struct mrs_field id_aa64mmfr0_fields[] = { id_aa64mmfr0_tgran64_2), MRS_FIELD(ID_AA64MMFR0, TGran16_2, false, MRS_LOWER, 0, id_aa64mmfr0_tgran16_2), - MRS_FIELD(ID_AA64MMFR0, TGran4, false, MRS_LOWER, 0, + MRS_FIELD(ID_AA64MMFR0, TGran4, true, MRS_LOWER, 0, id_aa64mmfr0_tgran4), - MRS_FIELD(ID_AA64MMFR0, TGran64, false, MRS_LOWER, 0, + MRS_FIELD(ID_AA64MMFR0, TGran64, true, MRS_LOWER, 0, id_aa64mmfr0_tgran64), MRS_FIELD(ID_AA64MMFR0, TGran16, false, MRS_LOWER, 0, id_aa64mmfr0_tgran16), @@ -1856,7 +1856,8 @@ static const struct mrs_field id_aa64pfr1_fields[] = { MRS_FIELD(ID_AA64PFR1, DF2, false, MRS_LOWER, 0, id_aa64pfr1_df2), MRS_FIELD(ID_AA64PFR1, MTEX, false, MRS_LOWER, 0, id_aa64pfr1_mtex), MRS_FIELD(ID_AA64PFR1, THE, false, MRS_LOWER, 0, id_aa64pfr1_the), - MRS_FIELD(ID_AA64PFR1, MTE_frac, false, MRS_LOWER, 0, id_aa64pfr1_mtefrac), + MRS_FIELD(ID_AA64PFR1, MTE_frac, true, MRS_LOWER, 0, + id_aa64pfr1_mtefrac), MRS_FIELD(ID_AA64PFR1, NMI, false, MRS_LOWER, 0, id_aa64pfr1_nmi), MRS_FIELD(ID_AA64PFR1, CSV2_frac, false, MRS_LOWER, 0, id_aa64pfr1_csv2_frac), From nobody Fri Aug 1 12:09:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlBW2pQhz63qGK; Fri, 01 Aug 2025 12:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlBV6D08z3KkL; Fri, 01 Aug 2025 12:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754050194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMq+l8GSy7PQPhUgaw7QgmjlhX3DM+PPtuooufWZcI0=; b=N8PcsdJNXFl1upWQDYemHu9xiFdTqC3hQUOHuuqHfzyCo1qR38ZtqZ6fgCAHhCFtj8F67c 3KAW6BDmVCPuSHRuHFpqS3Uj6w262+j7h6X7vcg0k+EcJg7VWSfsaIGvrjU2kY70sQtPMG 9mmwW7GUEKJKegW/0DOLUlwXpqvu9IPaSZh6QOKuLN9LnCbZRqEQuqfLfRkKrQHNK8AN6I aMUM9iEFDCp1/gB+QRsgP+QTDk/GoLqxyDRyqnJIvUaXPrFkuHFyaOxTjBQ2dFJ+YmISRw biiPboksgAD7WmlZV5nOdBWatpQXxAvL6axOxDkZVe0cF38vLkmpbIvSn8Qw2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754050194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMq+l8GSy7PQPhUgaw7QgmjlhX3DM+PPtuooufWZcI0=; b=O1pPlGHelsfN8Ddl3JgdENe/Jv6kbEGbCvSOz0eul6DlMZNkoSIO/GlY20qEx4ovmZ80CM 11/uLDDps2Rnx4tuvns1s/TeLQFnm6hLVRhtg2gMjVWjZGyzVxtd0/XKavdvBcmCol8XtN 2IWDC77cK2rdrP3nz9de2+yi6kNwn1RL/YM7PzkVqJ60Bu23+GPzIhs3/Yl4Pvqhb/V7mz d3ZUtV4ArLDKbD2CWmVHkGpUYc6wkzSUcbJWAgmD3AmVlcgg92UVf4gM6W/R0XbeHBjaBt 7HjtyaHaT2Gn6211cNzDWz6aLxvdCBtiEOG40N4B20Mar8F9iYvbF5fvW8Etng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754050194; a=rsa-sha256; cv=none; b=En5FDjlnc8cwRgRlNi9+0E913LKjVdEpxwfSXL79I2GwKhJf8t3d2Q60JmtUZKjq2jrqyT kVTEVuRYIcngix7wWVrCQjfmk1gVjZTxD7oY4Jlqho6bh1aYoGc49xZnfylTL5MBx5qmLS 0MjssuyKFarWwc1//CPtLAPm6SPaBkttOH2mio9kVr8jJR1ffqnqmErLj2+KhvPPrOVKQ3 EOpRX099EOL1grLsXJ6NhX7hnhUsViiofGysSOKrxz9RB3DlC0uiMn1XBreT7Ktt8sS4Dq 5RyLzSNRoFnPZ2O1UV91zsMvwswaVtz0BIbnOtgtFvyCJtJh3f3Z53AmEvJd/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlBV5PdTznS3; Fri, 01 Aug 2025 12:09:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571C9stL097322; Fri, 1 Aug 2025 12:09:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571C9sYF097319; Fri, 1 Aug 2025 12:09:54 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:09:54 GMT Message-Id: <202508011209.571C9sYF097319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 863e8b457b5a - main - arm64: Rename ID_AA64MMFR0_ECV_CNTHCTL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 863e8b457b5a48efd5293a0da52e9b704bf13c23 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=863e8b457b5a48efd5293a0da52e9b704bf13c23 commit 863e8b457b5a48efd5293a0da52e9b704bf13c23 Author: Andrew Turner AuthorDate: 2025-07-30 10:51:41 +0000 Commit: Andrew Turner CommitDate: 2025-07-30 12:46:35 +0000 arm64: Rename ID_AA64MMFR0_ECV_CNTHCTL Rename ID_AA64MMFR0_ECV_CNTHCTL to ID_AA64MMFR0_ECV_POFF as this is the field value when FEAT_ECV_POFF is implemented. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51370 --- sys/arm64/arm64/identcpu.c | 2 +- sys/arm64/include/armreg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 55f7e98a1b1b..bcacea43ad2f 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1161,7 +1161,7 @@ static const struct mrs_field id_aa64isar2_fields[] = { /* ID_AA64MMFR0_EL1 */ static const struct mrs_field_value id_aa64mmfr0_ecv[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR0, ECV, NONE, IMPL), - MRS_FIELD_VALUE(ID_AA64MMFR0_ECV_CNTHCTL, "ECV+CNTHCTL"), + MRS_FIELD_VALUE(ID_AA64MMFR0_ECV_POFF, "ECV POFF"), MRS_FIELD_VALUE_END, }; diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index cd770386f852..38b7f57f7853 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -1287,7 +1287,7 @@ #define ID_AA64MMFR0_ECV_VAL(x) ((x) & ID_AA64MMFR0_ECV_MASK) #define ID_AA64MMFR0_ECV_NONE (UL(0x0) << ID_AA64MMFR0_ECV_SHIFT) #define ID_AA64MMFR0_ECV_IMPL (UL(0x1) << ID_AA64MMFR0_ECV_SHIFT) -#define ID_AA64MMFR0_ECV_CNTHCTL (UL(0x2) << ID_AA64MMFR0_ECV_SHIFT) +#define ID_AA64MMFR0_ECV_POFF (UL(0x2) << ID_AA64MMFR0_ECV_SHIFT) /* ID_AA64MMFR1_EL1 */ #define ID_AA64MMFR1_EL1_REG MRS_REG_ALT_NAME(ID_AA64MMFR1_EL1) From nobody Fri Aug 1 12:09:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlBX3SsWz63q7Q; Fri, 01 Aug 2025 12:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlBX0wj0z3KyR; Fri, 01 Aug 2025 12:09:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754050196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyShqlCLe/c6+deQCBGrcUlMTfTchH/9zYzXNoKB5+E=; b=j9K6NnYzhuO57einFoHBxxqEMDyrlNBZ9RU8/AhJRoE3E/z0BZUoGcsJsNlG1W2GICJ8X1 qBJTWYiruMYQHF7RhDJTu7phmeO3viiZG1Gvnev8qlG0JZkL79abo8Xkp2xgZN85aq1nnK WDKs7J5FSMJqKqAyrSp5I4nTXXRAj+0tZqSrrDE8Fzq6Y3+rhf2v95RrA2XU4ozTbdXpeE fp3i5lxVtpGX9EYLFBEIOJkyK5rgMWi4ZrWynktwo2W3WsMbhqRhoTsBWt5/MMp1VO/FEf arr1Ig8t52379ZbSMK31DxAz+DmG3jXnPQnm0AyTRl/T+woFTYXiREObGzta/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754050196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kyShqlCLe/c6+deQCBGrcUlMTfTchH/9zYzXNoKB5+E=; b=v8PvxCALkC8t/CqbgutQj9JqK8E8SNoO+mWYIBAtoh3F3sL9ywvueCdCzBFsEh2TZNqHp0 7TwoJYpT8bidmaMi+iAbqARZXXfqZYPlh6+5VmSaAtc6rbImdH8hsCQarS+C8i4FsYT+h0 TfMJVW7teNDiBs6B+FedWEXHPvt3hdCPLypypYPioEdqIgtoOEcBblHvz22sM015oJXjbE Mqorrvcek1khNLxnYQumZyRgz2mE2NX3JoqrUhAVnKxRqi6EQgRIsQDBH1qIZlTrPJ065d 7afmpwAhwGv9ndITb8oAmos6WwsG/W+SX5sxtyQKVPIGSOELPwJriyAt7pijNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754050196; a=rsa-sha256; cv=none; b=QHvM8AyNd2tMYpwD6bwniaZU7jwKHdA6PZQjtWSr+ZIkaIjxJwZ/ZgalwGq8FCSZtLJrkD CcqmmagQNiN6bMr0ckWKMBS0FVgeGEBzVTGc2kcLrekz16PA8yKLy0y6Yg9Gf7iR5cX7Zf hkBDVJd6sCOP4vwFLWei4zXmIj+BCDW0N3Qnhn30QnO9TsQOl+iAYLZS24/9Wps5S3AfCh aUSi6IruBVnhlOSKtvvj0zi1+6KfDY1k+9BdHfAglzRNgqphz0sM7wgzGRHR9EVuY5KOaP sfpSaXIl992cVooT8af9QtZVCkwPY829Fhu1jgYbRsc916lLMNuDbIFmAElwGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlBW6L5lznS4; Fri, 01 Aug 2025 12:09:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571C9tii097356; Fri, 1 Aug 2025 12:09:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571C9tDw097353; Fri, 1 Aug 2025 12:09:55 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:09:55 GMT Message-Id: <202508011209.571C9tDw097353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3a4927ad9145 - main - arm64: Add CNTPOFF_EL2 op/CR values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a4927ad9145644a2ca99743a82982a8c60387f5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3a4927ad9145644a2ca99743a82982a8c60387f5 commit 3a4927ad9145644a2ca99743a82982a8c60387f5 Author: Andrew Turner AuthorDate: 2025-07-30 10:53:33 +0000 Commit: Andrew Turner CommitDate: 2025-07-30 12:46:39 +0000 arm64: Add CNTPOFF_EL2 op/CR values Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D51376 --- sys/arm64/include/hypervisor.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index a32e1000d911..e3a880afbe9c 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -51,6 +51,14 @@ #define CNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */ #define CNTHCTL_EVNTEN (1 << 2) /* Enable event stream */ +/* CNTPOFF_EL2 - Counter-timer Physical Offset Register */ +#define CNTPOFF_EL2_REG MRS_REG_ALT_NAME(CNTPOFF_EL2) +#define CNTPOFF_EL2_op0 3 +#define CNTPOFF_EL2_op1 4 +#define CNTPOFF_EL2_CRn 14 +#define CNTPOFF_EL2_CRm 0 +#define CNTPOFF_EL2_op2 6 + /* CPTR_EL2 - Architecture feature trap register */ /* Valid if HCR_EL2.E2H == 0 */ #define CPTR_TRAP_ALL 0xc01037ff /* Enable all traps */ From nobody Fri Aug 1 12:37:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlnw3c4sz63rBr; Fri, 01 Aug 2025 12:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlnw2q4Cz3PlW; Fri, 01 Aug 2025 12:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrmVgKkns9MR4vXlISyS2PPs6+a5ZtBmQwVBozTFxZY=; b=MAMCXSPBLQpDGoyJDBKuq7GnW6jf4WICY3S3b8ibNM5tFjWg1k55KBamIh1z1+7uqgHMja CKJj73qQAsCb9eE2hb0td9+8CuhE3bkN5NezP6XGC8lOxW4JBzisUP4tFonLQMfPFjhzwV ISnniERnEifk2aiyVqBFmuqgeDdZEAPBsVXMALO6seUX1dJ12XRUM+3EgxprPB9CGnoqsf 01vBSWfbYL+ESSl6vUbTA1Y7JMeAPBSHnQoqhY+Mv72NlEPtuY8eDKs/7LHkKMHUDozN90 XV9uNj8iNc1t2MF/R6XhVgV23Tdna79T+mZ2gqnT8v+IhmBLN/PTw8GcX6F+VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LrmVgKkns9MR4vXlISyS2PPs6+a5ZtBmQwVBozTFxZY=; b=xhPMJ1iDD0SfXmG05L+qApPjB2BsttjoBlNbXykAU6u2PLSSOgYMXRwWUBt8DyJaRHLQP3 GOTvh/gxys+4NJPFcohr0T+zWd0Z3Uq6NPE7+CDfbMhYjiuHK8c4/TXteovpOn7nhY4yxe Ng/OF7bDwTahyGPnBJUDg68/Mhmx0Is7AYLG88p2LZoyKJiOVPTZkPsLAQ7oL6PG690SWA 0v5RGPB2llzcMdpOHnGrO1js1M/t8KstgUOgKgtUhBCJXI8oMUPeOxDcAj0QZ+d8wmS6EO g/80S2YQ2TrlHRMcVHsuAAE/tS5la+IuGyFTI7HhLZMF++y+4GdSjvuDeEJ9/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754051828; a=rsa-sha256; cv=none; b=bPEKnw4Xn1RF0JgdpB3kzb+c4ZjSZ0V8ev/DVI0Bvbeou7Ek+d4DMIwrKXIWDdBtVHjDaX hu+hQY1UzWlv+bTC1DJGIImZY9fdD0ZiSe34APGyadC9nqPZHDz2Fs+57oBNI4Giyg2Y0j U27bjnu1OacyV4SL3f9qkOOAKa58wmBNXIH7fLGGOi6jSunf2sCP6izEv5oCkbra9AkrDO FwzjNsYaRyjbwMfqyzumEfX90S7SxTvhGO9KQFBQxrm86lzMY9YJ30TsTJdk3SsNa0c/lO 8Cw9gtcIlDCWorKUZdpglp5BFqWIX9Td8gRNM31lyNBO2STyJF/3RbnfD1EHOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlnw264Lzp9W; Fri, 01 Aug 2025 12:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571Cb89o051925; Fri, 1 Aug 2025 12:37:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571Cb8sH051922; Fri, 1 Aug 2025 12:37:08 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:37:08 GMT Message-Id: <202508011237.571Cb8sH051922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 89e650eacc9b - main - sdhci: Add driver for the cvitek sdhci 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89e650eacc9bb3960b38d704abae06694fad08e6 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=89e650eacc9bb3960b38d704abae06694fad08e6 commit 89e650eacc9bb3960b38d704abae06694fad08e6 Author: Bojan Novković AuthorDate: 2025-01-18 19:03:25 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 12:35:54 +0000 sdhci: Add driver for the cvitek sdhci controller This patch add support for cvitek SDHCI controller (only SD card mode). This controller is present on Milk-V's riscv SoCs. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D48528 --- sys/dev/sdhci/sdhci_fdt_cvitek.c | 144 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/sys/dev/sdhci/sdhci_fdt_cvitek.c b/sys/dev/sdhci/sdhci_fdt_cvitek.c new file mode 100644 index 000000000000..e13e10df0dc2 --- /dev/null +++ b/sys/dev/sdhci/sdhci_fdt_cvitek.c @@ -0,0 +1,144 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Bojan Novković + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "syscon_if.h" +#include "mmcbr_if.h" +#include "sdhci_if.h" + +#include "opt_mmccam.h" +#include "opt_soc.h" + +#define CV181X_SYSCTRL_SD_PWRSW_CTRL 0x1F4 +#define SD_PWRSW_CTRL_RESET_MASK 0x9 +#define CVI_CV181X_SDHCI_VENDOR_OFFSET 0x200 +#define CVI_CV181X_SDHCI_EMMC_CTRL (CVI_CV181X_SDHCI_VENDOR_OFFSET + 0x0) +#define EMMC_CTRL_RESET_MASK 0x302 +#define CVI_CV181X_SDHCI_PHY_TX_RX_DLY (CVI_CV181X_SDHCI_VENDOR_OFFSET + 0x40) +#define PHY_TX_RX_DLY_RESET_MASK 0x1000100 +#define CVI_CV181X_SDHCI_PHY_CONFIG (CVI_CV181X_SDHCI_VENDOR_OFFSET + 0x4C) +#define PHY_CONFIG_RESET_MASK 0x1 + +#define SDHCI_FDT_CVITEK_CV181X_SD 1 + +static struct ofw_compat_data compat_data[] = { + { "cvitek,cv181x-sd", SDHCI_FDT_CVITEK_CV181X_SD }, + { NULL, 0 } +}; + +static int +sdhci_fdt_cvitek_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Cvitek CV181x SDHCI controller"); + return (BUS_PROBE_SPECIFIC); +} + +static int +sdhci_fdt_cvitek_attach(device_t dev) +{ + int error; + uint32_t reg; + phandle_t node; + struct resource *res; + struct syscon *syscon; + struct sdhci_fdt_softc *sc = device_get_softc(dev); + + if (sdhci_fdt_attach(dev)) + return (ENXIO); + + res = sc->mem_res[0]; + node = ofw_bus_find_compatible(OF_finddevice("/"), "syscon"); + error = syscon_get_by_ofw_node(dev, node, &syscon); + if (error != 0) { + device_printf(dev, "Couldn't get syscon handle\n"); + return (error); + } + + SYSCON_WRITE_4(syscon, CV181X_SYSCTRL_SD_PWRSW_CTRL, + SD_PWRSW_CTRL_RESET_MASK); + DELAY(1000); + + reg = bus_read_4(res, CVI_CV181X_SDHCI_EMMC_CTRL); + reg |= EMMC_CTRL_RESET_MASK; + bus_write_4(res, CVI_CV181X_SDHCI_EMMC_CTRL, reg); + bus_write_4(res, CVI_CV181X_SDHCI_PHY_TX_RX_DLY, + PHY_TX_RX_DLY_RESET_MASK); + bus_write_4(res, CVI_CV181X_SDHCI_PHY_CONFIG, + PHY_CONFIG_RESET_MASK); + + return (0); +} + +static device_method_t sdhci_fdt_cvitek_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, sdhci_fdt_cvitek_probe), + DEVMETHOD(device_attach, sdhci_fdt_cvitek_attach), + + DEVMETHOD_END +}; +extern driver_t sdhci_fdt_driver; + +DEFINE_CLASS_1(sdhci_cvitek, sdhci_fdt_cvitek_driver, sdhci_fdt_cvitek_methods, + sizeof(struct sdhci_fdt_softc), sdhci_fdt_driver); +DRIVER_MODULE(sdhci_cvitek, simplebus, sdhci_fdt_cvitek_driver, NULL, NULL); + +#ifndef MMCCAM +MMC_DECLARE_BRIDGE(sdhci_fdt_cvitek); +#endif From nobody Fri Aug 1 12:37:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlnx4wG9z63rBs; Fri, 01 Aug 2025 12:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlnx2qYgz3PjG; Fri, 01 Aug 2025 12:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K2cYuFAufZ9V7r2h056+qV41rhFMezhxtLda0bpmF5g=; b=utPVlfTl6eZqAmXmHoDjfonkWgkVHWJXGXkCa34FGK54cKdu82ArP/a9VOyy4MN+Q62lNb oOJlD2FKIMhWNKiTF0F234ppzFMCYI1fXYGrvsrqdDzmrso+1cKByDbJiz5tdWkAA4Bxi7 b9HVR63rBQ4MN41mUb5u4FK6cSIhE9rrEzSBW2aaf57U23UWZXfOI4xfLAbhZqArhuvDL4 wFZxYyuqXxR+H6e0eLndu+nlIahSBsvfyFTZjljFAfqp1jtu/wthgoM0U+an8YzFYZb1p/ voGiXrZ8xkIrUKo0aFWUY1lMwhQGqc4y7NN8GPwAGltC+/YH+NP94wnt93nftA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K2cYuFAufZ9V7r2h056+qV41rhFMezhxtLda0bpmF5g=; b=lckSzn+ESeGUz5st7IJijNc/N92u7yd6OvfdqxAVYi7YkpBWeGIUasOPL0YylYvDbRDQip zoTJ782hyLtGOG0BcgxmubQVJL4XanNG00wC2LLBwp6wZBa9XKlXxanb/qul/MXEHbOT/J LIbsuXZxya5Owcm+ty66xqqe4fXNVONBKLTmcaqvs/7YVIQIkqAILXiOEYYzrHpis5tOnq M4V0IrbjvqXoVXTODsLkQJ+dJ9g8uFhxL9ra2YX2TGWXZlIZr8Uypq6KH6/5Yc0RBa6VUd 0q22qlLnC/t93lmuNfLa90rcDAOUG8k3Rt4Hy5IqCbEs8MeREc712JXjkhWRyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754051829; a=rsa-sha256; cv=none; b=S7FJbG0kUskovBffRiPBpA5wgkjkRqviWI9nMwNmtCWwBZjghyV7f/jd1G5M3yCM+3NmQq oHY5XA4YAneBG3pajLmytOZ8AiWZD3iSdaf7mhM1m2pvjC71vGPM7pik9Ro1DTuhdVkvLn IPRdsG8fTvDCT/bqzkGEl0OHu22H2ZHSmk17G2R3f/Q60KW4bQtZTEnKAQDDASP+XqYLZI sSpmuTQmQOiRjtpz6EEMEeGQUBOVVoq8F3k5Q7FgNwDljI+Z+1u+2b0yyl+wmvH0US3L+p fAy5MU7iNOyxWlmCx0bj4rblxsQ/PcHhdElCzPLTh5LDUEpRYMkGioZyblhIIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlnx2R1mznVG; Fri, 01 Aug 2025 12:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571Cb9xB051960; Fri, 1 Aug 2025 12:37:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571Cb9bF051957; Fri, 1 Aug 2025 12:37:09 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:37:09 GMT Message-Id: <202508011237.571Cb9bF051957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 19643b415b2b - main - if_dwc: Ignore clk_set_assigned errors if "assigned_clocks" is not specified List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19643b415b2b93d1a1ed619f40f1a7ee2adebc0a Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=19643b415b2b93d1a1ed619f40f1a7ee2adebc0a commit 19643b415b2b93d1a1ed619f40f1a7ee2adebc0a Author: Bojan Novković AuthorDate: 2025-01-18 19:04:37 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 12:35:54 +0000 if_dwc: Ignore clk_set_assigned errors if "assigned_clocks" is not specified dwc_attach will currently fail if clk_set_assigned fails, even if the "assigned_clock" property was not specified. Since there are platforms whose DTS files do not have this property (e.g. if_dwc_aw, if_dwc_socfpga), do not return an error if clk_set_assigned returns ENOENT. Reviewed by: manu Differential review: https://reviews.freebsd.org/D48529 --- sys/dev/dwc/if_dwc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index 33657b33fe25..1b4b4be68747 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -535,7 +535,7 @@ dwc_attach(device_t dev) sc->aal = true; error = clk_set_assigned(dev, ofw_bus_get_node(dev)); - if (error != 0) { + if (error != 0 && error != ENOENT) { device_printf(dev, "clk_set_assigned failed\n"); return (error); } From nobody Fri Aug 1 12:37:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlny71rWz63rBv; Fri, 01 Aug 2025 12:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlny3dbHz3PZc; Fri, 01 Aug 2025 12:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wVSa1vsDhowaiU6oRYg6NBMXg1kKtNptoz4I5SvPZ4E=; b=ObFc/T5hqPS6OrwXZrd+xSJZ9qzZ8qHQga3DKL8d3Er+XcH+1hOsbi0/Gs2wdB42EDcd/K LV6KVGdDDHXfRSAeDov89J1D1mD0ot7oylGTfRkBAhquxtoHsCaQ1rZpr+LBlOq1EqdB2c wtd1p2atb7xNOSmgEAkn49S3U0JpRTVTZnFD62n1crPvPqBCpMyWS2yzT5EaUUbUeqVTod gwe/n5K9TUb8tdUflsiCrsSgjaRQcgdTu0a/Il/DSqu1Y7YmOQgzzD4dnjeYFu1XoipK7g 53yW9fOykeiZ1Zm0j0dTwUYg4jOGR9YChEoNty7Qr/i4XO0Qt5jQD7WQNzAPfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wVSa1vsDhowaiU6oRYg6NBMXg1kKtNptoz4I5SvPZ4E=; b=wuJh9bbYuZcw4fZt53dsfnY6/uZ63khdxhZpl1SqfmgA5GSLKyARZq9XtiODml16xJw5nY eTcAVh/juC+rY4VWlPqpqaCtKgNKYeEh8N76/PJY3gBO2lIFeddlXt0C3tyfni9qa6HiLp /LXb/ZMSpg/O4iX37QSUlCgnF8i9tNuVZb37aS9iCqNeyPI4/Dx+HcuSFHi3ZoHqhPSIFe hktl/+m6eCtBuruZBeKoGeS7jBwSfRHJUnqj2FbhzYrHNydilWk3U7j5yJGrNuSC6J/xf5 W+gL1swNJha/kLL7G2fY6kV/D8d8b9gQ7JQxilg/SGueK65s16hKvA9f9FYpRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754051830; a=rsa-sha256; cv=none; b=sresZUCO6sH64sR3ewpce6st/L48K9rd5xMBe/45A0dDXlyaPgDsaSGuDGBlOv/tNWJDzY FBU3NxPDwS0V9/f57DSLa4x8JuufVqNb7On5/ZM+3fuzD5V/I0yTJR5nTrIMvwCLjNAb+V bmYeYZhNi3UcfftCbeXZ4jlpGGPcQ5LGvYsWxY3DoWkxkR5E+0cOM1pLyb7ODBXivRQEEM rc6bCTWB7DbyPS/xHsNRHXf/a/0Siv83PQfqmx6sWuJWQZi48qjJYxMhOMzpl/hzaOfmAX cUwF6ERiM0dkjRQ9jbpmoj1wr/x3hlg4yLS1Ht3YhA5w1dh3E022pO939PJBzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlny2yy5zp0x; Fri, 01 Aug 2025 12:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571CbAbk051995; Fri, 1 Aug 2025 12:37:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571CbAUm051992; Fri, 1 Aug 2025 12:37:10 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:37:10 GMT Message-Id: <202508011237.571CbAUm051992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 7a9a15eaf917 - main - if_dwc: Add support for cvitek ethernet 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a9a15eaf9170e06533f20d44540ab15af9142ef Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=7a9a15eaf9170e06533f20d44540ab15af9142ef commit 7a9a15eaf9170e06533f20d44540ab15af9142ef Author: Bojan Novković AuthorDate: 2025-01-18 19:10:39 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 12:35:54 +0000 if_dwc: Add support for cvitek ethernet controller This patch adds support for the cvitek flavor of the DWC ethernet controller. This controller is present on the Milk-V riscv SoCs. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D48530 --- sys/dev/dwc/if_dwc_cvitek.c | 89 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/sys/dev/dwc/if_dwc_cvitek.c b/sys/dev/dwc/if_dwc_cvitek.c new file mode 100644 index 000000000000..fd9a844d3fd4 --- /dev/null +++ b/sys/dev/dwc/if_dwc_cvitek.c @@ -0,0 +1,89 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Bojan Novković + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "if_dwc_if.h" + +static int +if_dwc_cvitek_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "cvitek,ethernet")) + return (ENXIO); + device_set_desc(dev, "CVITEK Ethernet Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +if_dwc_cvitek_mii_clk(device_t dev) +{ + /* + * XXX: This is a hack to get the driver working on + * the Milk-V platform. For reference, the u-boot designware + * driver uses the same '150_250M' clock value, but if_dwc + * will not work on Milk-V hardware unless the lowest + * bit of the PHY register address is always set. + */ + return (0x10 | GMAC_MII_CLK_150_250M_DIV102); +} + +static device_method_t dwc_cvitek_methods[] = { + DEVMETHOD(device_probe, if_dwc_cvitek_probe), + + DEVMETHOD(if_dwc_mii_clk, if_dwc_cvitek_mii_clk), + DEVMETHOD_END +}; + +extern driver_t dwc_driver; + +DEFINE_CLASS_1(dwc, dwc_cvitek_driver, dwc_cvitek_methods, + sizeof(struct dwc_softc), dwc_driver); +DRIVER_MODULE(dwc_cvitek, simplebus, dwc_cvitek_driver, 0, 0); +MODULE_DEPEND(dwc_cvitek, dwc, 1, 1, 1); From nobody Fri Aug 1 12:37:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlp02BvCz63r5F; Fri, 01 Aug 2025 12:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlnz3mshz3Plt; Fri, 01 Aug 2025 12:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VUb4aWDq+OfXgCzPZzJoPkmpDEO9L+t3GptYpke9Zw8=; b=cgNIKMVXm83yq5w4Zc4CIwQw0Wc8peh88Qzwcuif6IFB8Ii73UWjzIVAJJVRmwq21MY2zb KL9D8Vpqs2UIjaKrR6kBUQGmg02McVnvG7L+eOuwnFh8cMD3TTV6HNkO7pM/fAWuJQl03e LEakSMkaFZpyv91bEYu7xi2UQujR/VfKWs98aShbX7zCgklNO4/CHvPW0UoNeky/OOuchR 1NVaM5ZoS8tfDO97xOWm76DNc3UIi3MxRmbIJmpqyqgPubHkF5+IvN1R2PT0kB8dtMHzfz jwaWW9s34cVSI1MnVrcht4R+ho+pl7TPQQdCqKR9oBsGbYkc9rgLTBUvztT9KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VUb4aWDq+OfXgCzPZzJoPkmpDEO9L+t3GptYpke9Zw8=; b=BfsKVDTMYVUGE3pDdfrbnHvK3cWfCha4ffhQaGnypDb6Oexs50akMjP1YbDPwPa0bLKhDa gq20GvJl0t9GEecl9mDg1CMYt9+mjgNd2wpXwpSGHGfFhKH5o2Bmfu0pR9PGNVS3NUhQ3P MyKJ4RAL1q3CoNXSRy+1jVQW7yoMkaiCwChPmif0g9LNIcrEcrc6pUDt0z/m7vRDtBJUn6 8nsHbtaS71hCAv3gTwPHESyUZ9h01gUOPYRua8Qex7rS6y2nhjfVDhn+0ZIEuOr82uTEhf aXv5MDRsHZxaUjYz+bscrFMytosU+LQauW8ZqmAb6KBE6xG/EoVekMS3rBrhNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754051831; a=rsa-sha256; cv=none; b=aN42KWiUHSaqadE4wYc7gPh9yAJNkr4uach7TiqyA+enPPrh+DmkYwwbDaN7yrKiWrRjEC ZYdKyE9ETeLBAtTyQhk3lDN98B6G5Y4XTSSLErm5gkCUvgar2UdjZvNMWhQatW8O9XX0ax BiIDmdAy6aGbCeX6Dxwq5ruMVzf8kaMbcNbWDlrgWvEtytLTVJPb2BidtLm1NRlfzBe2fd hPL7oXWGBp3wXAcpuH5U7bh0lt40mGGF0elS2+dFy2bzE25xrfXsjkTZdZ14W9kDHZ/63v 6ITgpA8MFKXPm/60pqwzdGvCQERZg4Je3sQbrmij63y60s01HBcwSckKZxObrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlnz3N7vznqq; Fri, 01 Aug 2025 12:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571CbBBx052031; Fri, 1 Aug 2025 12:37:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571CbBc4052028; Fri, 1 Aug 2025 12:37:11 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:37:11 GMT Message-Id: <202508011237.571CbBc4052028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 25b9b0b6bec9 - main - riscv: Add driver for cvitek reset 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25b9b0b6bec9b4a382a16586a6eb8e57944e8d25 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=25b9b0b6bec9b4a382a16586a6eb8e57944e8d25 commit 25b9b0b6bec9b4a382a16586a6eb8e57944e8d25 Author: Bojan Novković AuthorDate: 2025-01-18 19:11:14 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 12:35:54 +0000 riscv: Add driver for cvitek reset controller This patch adds support for the cvitek reset controller. This controller is present on the Milk-V riscv SoCs. The controller is currently only used by the if_dwc driver. Differential Revision: https://reviews.freebsd.org/D48531 Reviewed by: jrtc27, br --- sys/riscv/cvitek/cvitek_reset.c | 132 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/sys/riscv/cvitek/cvitek_reset.c b/sys/riscv/cvitek/cvitek_reset.c new file mode 100644 index 000000000000..348bbc85c9a9 --- /dev/null +++ b/sys/riscv/cvitek/cvitek_reset.c @@ -0,0 +1,132 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Bojan Novković +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "syscon_if.h" +#include "hwreset_if.h" + +struct cvitek_reset_softc { + device_t dev; + struct mtx mtx; + struct syscon *syscon; +}; + +static int +cvitek_reset_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "cvitek,reset")) { + device_set_desc(dev, "CVITEK reset controller"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +cvitek_reset_attach(device_t dev) +{ + struct cvitek_reset_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + error = syscon_get_by_ofw_property(dev, ofw_bus_get_node(dev), + "syscon", &sc->syscon); + if (error != 0) { + device_printf(dev, "Couldn't get syscon handle\n"); + return (error); + } + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); + + hwreset_register_ofw_provider(dev); + + return (0); +} + +static int +cvitek_reset_assert(device_t dev, intptr_t id, bool reset) +{ + struct cvitek_reset_softc *sc; + uint32_t offset, val; + uint32_t bit; + + sc = device_get_softc(dev); + bit = id % 32; + offset = id / 32; + + mtx_lock(&sc->mtx); + val = SYSCON_READ_4(sc->syscon, offset); + if (reset) + val &= ~(1 << bit); + else + val |= (1 << bit); + SYSCON_WRITE_4(sc->syscon, offset, val); + mtx_unlock(&sc->mtx); + + return (0); +} + +static device_method_t cvitek_reset_methods[] = { + DEVMETHOD(device_probe, cvitek_reset_probe), + DEVMETHOD(device_attach, cvitek_reset_attach), + + DEVMETHOD(hwreset_assert, cvitek_reset_assert), + + DEVMETHOD_END +}; + +static driver_t cvitek_reset_driver = { + "cvitek_reset", + cvitek_reset_methods, + sizeof(struct cvitek_reset_softc) +}; + +DRIVER_MODULE(cvitek_reset, simplebus, cvitek_reset_driver, 0, 0); From nobody Fri Aug 1 12:37:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlp06zJVz63rTY; Fri, 01 Aug 2025 12:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlp058vLz3Pm5; Fri, 01 Aug 2025 12:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PESGlCN3YhsmeqTxyE3Jhqb98hWepPdb701737gCG7o=; b=Ouw0jfNmtXRgIC6I1CXgDfNiti1g+kWMVIVDievFMk25DfoOdDwxYa9yvf9vzSNPDx12BY DAHHx6vusQTvP57KkRZPIlinNpCjrq4BjAb8Uye9DFuqGEl+rdqbNBmWlksdVW5nmBq+El zkgSMRk+5nee9Q4CTm1tHJzACh9AfihbJ8qpFdWUe0bl2ZToRNej7vlWb20mz5Z1TnZ7yI +ky0IDWp7P+D9oGqimropJ07pgEdHB8YFGW8QEBrU6WQAbPlXInIkUkBRG/1cfk5cCyGY9 tGS5nAEizInSx3QFJD/A1gTjuQOl0Y7uqEDdHsxT2kUDu25mTJ95X8ps7tGJ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PESGlCN3YhsmeqTxyE3Jhqb98hWepPdb701737gCG7o=; b=GfqPQrug3mtPTIeCEWLQfwZlFwImhhsRclJ2tPF6K53+TVfuNtD1uoxIImUpA3ed5XMw0J R7wFyKbcqjY/06795Vliun1bVH7kva4r0zM4IsNWL040Ny6rZbEreI6sOiy4sK3yeYA4Jv aWYTxM1321OLCRXavwkOo1tK3+eHDImCY9XOEDvG1WqV5ArcWV9nLZJK6y/yF+7Ot7RiVU buZGzUCAxFZ4ANbXaJkwTRaf7MT0I5bAD4bHvW26rbEjYgQzQJArgWORfX22/EPUrt4UmP Q8bxEw03965CO4u1Mt/9GWLrBRqglS7SKH/LlgVGGw7f2xstGM+sAWbCYWpZIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754051832; a=rsa-sha256; cv=none; b=gNcJZAGkjNLkBazfzvSUqNE3kKvC3sLayLtqcJtm0tMQ4QxNHXMwiHN1SdEA0p5dorLZQW QUNGRCKJ7Gw9E0sjjMpnWoXLx7dDYLhAclnB+FmdPT1ekmnpLA8yhAGpinoWBoe+TnNjW8 Gc/VYrxD5VK8V8JLDeQBe2Ynk5CzhfYoWJ6z2YDidGmFxVXMrAxz5uHsHgHm9I0Amw6lKG uCi+OG8AIOpn9x51Y83pJkeYhnKO477J3ldq7926CHqLRpm5eCZRwUWSBWVSq7ncNLNOyF WZF2hHqJZ6+bjftmJZEhrL51nkUMNMKNzD8UOmR+O9ZCw7g3E/KcCyK6GL5y/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 4btlp04dD4znny; Fri, 01 Aug 2025 12:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571CbCM5052067; Fri, 1 Aug 2025 12:37:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571CbCuL052064; Fri, 1 Aug 2025 12:37:12 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:37:12 GMT Message-Id: <202508011237.571CbCuL052064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: e07254d1483f - main - riscv: Add driver for the cvitek reboot 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e07254d1483fad260dec7e2423043f544dfa85f9 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=e07254d1483fad260dec7e2423043f544dfa85f9 commit e07254d1483fad260dec7e2423043f544dfa85f9 Author: Bojan Novković AuthorDate: 2025-01-18 19:11:39 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 12:35:54 +0000 riscv: Add driver for the cvitek reboot controller This patch adds support for the cvitek reboot controller. This controller is present on the Milk-V riscv SoCs. Reviewed by: br, mhorne, jrtc27 Differential review: https://reviews.freebsd.org/D48532 --- sys/riscv/cvitek/cvitek_restart.c | 158 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/sys/riscv/cvitek/cvitek_restart.c b/sys/riscv/cvitek/cvitek_restart.c new file mode 100644 index 000000000000..53df126d5171 --- /dev/null +++ b/sys/riscv/cvitek/cvitek_restart.c @@ -0,0 +1,158 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Bojan Novković + * + * 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. + */ + +/* + * Driver for cvitek's poweroff/restart controller. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#define RTC_CTRL0_UNLOCK 0x4 +#define RTC_CTRL0_UNLOCK_KEY 0xAB18 + +#define RTC_CTRL0 0x8 +#define RTC_CTRL0_RESERVED_MASK 0xFFFF0800 +#define RTC_CTRL0_REQ_SHUTDOWN 0x01 +#define RTC_CTRL0_REQ_POWERCYCLE 0x08 +#define RTC_CTRL0_REQ_WARM_RESET 0x10 + +#define RTC_BASE_OFFSET 0x1000 +#define RTC_EN_SHDN_REQ (RTC_BASE_OFFSET + 0xC0) +#define RTC_EN_PWR_CYC_REQ (RTC_BASE_OFFSET + 0xC8) +#define RTC_EN_WARM_RST_REQ (RTC_BASE_OFFSET + 0xCC) + +struct cvitek_restart_softc { + int reg_rid; + struct resource *reg; + eventhandler_tag tag; +}; + +static void +cvitek_restart_shutdown_final(device_t dev, int howto) +{ + struct cvitek_restart_softc *sc; + uint32_t val; + + sc = device_get_softc(dev); + val = RTC_CTRL0_RESERVED_MASK; + if ((howto & RB_POWEROFF) != 0) + val |= RTC_CTRL0_REQ_SHUTDOWN; + else if ((howto & RB_POWERCYCLE) != 0) + val |= RTC_CTRL0_REQ_POWERCYCLE; + else + val |= RTC_CTRL0_REQ_WARM_RESET; + + /* Unlock writes to 'rtc_ctrl0'. */ + bus_write_4(sc->reg, RTC_CTRL0_UNLOCK, RTC_CTRL0_UNLOCK_KEY); + bus_write_4(sc->reg, RTC_CTRL0, val); + DELAY(1000); + + device_printf(dev, "Poweroff request failed\n"); +} + +static int +cvitek_restart_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "cvitek,restart")) { + device_set_desc(dev, "Cvitek restart controller"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +cvitek_restart_attach(device_t dev) +{ + struct cvitek_restart_softc *sc; + + sc = device_get_softc(dev); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->reg_rid, + RF_ACTIVE); + if (sc->reg == NULL) { + device_printf(dev, "can't map RTC regs\n"); + return (ENXIO); + } + + /* Enable requests for various poweroff methods. */ + bus_write_4(sc->reg, RTC_EN_SHDN_REQ, 0x1); + bus_write_4(sc->reg, RTC_EN_PWR_CYC_REQ, 0x1); + bus_write_4(sc->reg, RTC_EN_WARM_RST_REQ, 0x1); + + sc->tag = EVENTHANDLER_REGISTER(shutdown_final, + cvitek_restart_shutdown_final, dev, SHUTDOWN_PRI_LAST); + + return (0); +} + +static int +cvitek_restart_detach(device_t dev) +{ + struct cvitek_restart_softc *sc; + + sc = device_get_softc(dev); + if (sc->reg == NULL) + return (0); + + bus_write_4(sc->reg, RTC_EN_SHDN_REQ, 0x0); + bus_write_4(sc->reg, RTC_EN_PWR_CYC_REQ, 0x0); + bus_write_4(sc->reg, RTC_EN_WARM_RST_REQ, 0x0); + + bus_release_resource(dev, SYS_RES_MEMORY, sc->reg_rid, sc->reg); + EVENTHANDLER_DEREGISTER(shutdown_final, sc->tag); + + return (0); +} + +static device_method_t cvitek_restart_methods[] = { + DEVMETHOD(device_probe, cvitek_restart_probe), + DEVMETHOD(device_attach, cvitek_restart_attach), + DEVMETHOD(device_detach, cvitek_restart_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(cvitek_restart, cvitek_restart_driver, cvitek_restart_methods, + sizeof(struct cvitek_restart_softc)); +DRIVER_MODULE(cvitek_restart, simplebus, cvitek_restart_driver, NULL, NULL); From nobody Fri Aug 1 12:37:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlp34FKcz63rWw; Fri, 01 Aug 2025 12:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlp26zsFz3Q3j; Fri, 01 Aug 2025 12:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ell35E8cHXLHdE+DW07GeYCevdxioaorVE9tiKAbkg=; b=v5SstOTxXinPvP6EUP+wfySocthv39aPOoAKsPTTe6brtTTpkB6oNB5cgkuCBLeFfMPYnC fbnLaoYJmPF6Svlcuf3GFwocz5LBlSfaE9zN+wWOUun9hONB+ELbF4FJYdHdwtAU5tKcqE TiG3dMOPK7FByPk01P9hOP7j3AqobSh+rISGJ2SFjJ0x3JN/P+/4NT1y7oItTmVJkvXsxB WxAma55cEMyMlCIHrH6NBBdMVZVjFlvK5ZuB0qZFAZCimNoHv1ClFxuijBGZDLia6x3HId BaePq4vbUZM6f3P4032gCzi1sNnzkS9a2hPZqiftBqUuuZ1snVqpoLPDMN0vrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ell35E8cHXLHdE+DW07GeYCevdxioaorVE9tiKAbkg=; b=sIFnJpauQv8Vd9cCBkZA+fkHSta9IxPj8b7QoUKrS4NldDiAPkecAGbqD9Kn0PMjoKxl9X GzUDEbHAGuJ6E6tMZhBgoqXwlugp/WdXUF9UY7BpQwPjRP1BBfF46USgdhB9KLEiwC3mQx YNrQacPpVVLIQx4EIYcxnNuU42FhCp8d0W4nGA4E+eyVl99gcLWUxb/yy8zBtsY0C55OJG 64aj9f0L7PSFgEN2OKSjyZ26CKSDLdIvndNBWqS24Jj803d8hALIliaVdF7GePzKicovnZ KETwIi8jFuYDGQf10IltCl24twtCJUBhup+fsntkdFH4znYf+rT2PB/vREQx2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754051835; a=rsa-sha256; cv=none; b=S0Ask0aIj/KuXROJa4R83znt9nVp3k10HPi/WttNUZ+WZOQue+pcF5fjal1EthuOjV+CaY 2+qSBJ+qb+o2Uk62Du7P3Lq/t6otL3Naco5WaiWkdOGbBGnJCBbcYIFU1fPWpbE/7B7G6B YsihYPBp/e7VRKKn+PGb5FPXZf9omcZaaELj7l6cM3GCoVrp8JoC7QwxbbBA4SqlkbbhXj jGhnRj4RxPKQDo8mWz6wXBCs6Wl3HOHuOGX78L0wD5E5ilxb838C26HmycunCeD86vtr48 OwNZ5TkZPnNLg8W2Ubshw9275xVAY+GyAXmd3//dauksBZVbh9pOASoPpucSkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlp26YQBznVH; Fri, 01 Aug 2025 12:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571CbEka052137; Fri, 1 Aug 2025 12:37:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571CbEY3052134; Fri, 1 Aug 2025 12:37:14 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:37:14 GMT Message-Id: <202508011237.571CbEY3052134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: e9dd9f95f82f - main - riscv: Add the sdhci_fdt driver to the build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9dd9f95f82f6244a6eafd073531dcf6b6a3953d Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=e9dd9f95f82f6244a6eafd073531dcf6b6a3953d commit e9dd9f95f82f6244a6eafd073531dcf6b6a3953d Author: Bojan Novković AuthorDate: 2025-01-18 19:14:25 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 12:35:54 +0000 riscv: Add the sdhci_fdt driver to the build Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48534 --- sys/modules/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 99c9ec9dcd01..5315d518afd8 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -716,7 +716,8 @@ _rockchip= rockchip .endif .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ + ${MACHINE_CPUARCH} == "riscv" .if !empty(OPT_FDT) _sdhci_fdt= sdhci_fdt .endif From nobody Fri Aug 1 12:37:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btlp23R7Cz63qqF; Fri, 01 Aug 2025 12:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btlp160FQz3Pjm; Fri, 01 Aug 2025 12: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=1754051833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ci9GUwIYHYogBxi9ZD2Eo0ob4+RPT7dFv6orkVBHVUc=; b=uXTuG6I4GkkrXxUhHaJHyHFNv9miydjxl3g8dRiInwtQPsfP32C8QNCu/nclLkVnvOx+D0 3hrirsZ5k0OK3LCJwnMKEgMx+GiVtF0l5EV7jwsJQseZe2ywyQyskxOnUzYyCqnYeDWcxA i42tZE4IX2nnPprqcQBCLcHk+Jx0jZG3Ltllw2nZRytK8yhHK5qwnGclbsogpLzkya3kq2 032BDhjLyaEn/x/604fpCRgffD0QU47sqJelN2kS/53XPpMFK1DLRcGt0iiyazk/fn/jnw h7ljsbW0F+z7K+ZfLGUuFr56ErEpfdrVibjO/VwN0v8E190TPMjuWJCJbpV8KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754051833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ci9GUwIYHYogBxi9ZD2Eo0ob4+RPT7dFv6orkVBHVUc=; b=obOwud1J0rvMeGnZeBSKp4I3NJ9Cy5+jw7xEO4ErGnFEK0ej1KEaYlbGRLRQLq9QQqR15n fbGJ+urrD90ilA/secuxzvXPqX7Se5hUp2cRJOLBSPH7epFMtwpBpReT+YGiVpv0+wg//O vitcWzQQKIJsLTdqUw/yfsu0aMMheoyWSRwmGOi4HTxqRksxgM3ptXtnrp+5uY6QdpmW8W nGOZcm9o+tZ0JsvrsTjLnbYc73b8ehpKXGL216m/dW4kOBhKqitZySg63dl1fM4PXR7M7Z p8oDszOlxldrfih4uUZ9WtIRD8QI2hkZoUVSDQKYxIgSgOqu+u6rq5NCEwshzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754051833; a=rsa-sha256; cv=none; b=SXGXpshWHmvdfyYamc4dTvVsfHTr+8wnGLrl5UQ0NtJ1DHo1C0vmx/gO1+6zgwCzlsmz59 tbsDDixq9Yf+LbqVKmIX1xx/mf9IQHSYXSd2SEbeTQ3VkZVGII7JJnAV/+ObPnGRTk5VqJ 9cvcZf9XpzUwAXOvaSTibSx6Gf7fsstNhqbshROmUfvBoc3aymE3jNGFYRNWCqDsqym7lg NZThTjS5krleMbtpgXYFDNfw+CBbYOVqKBdTin8cJYNN2gODg3nvDMoFeQl+mU2/lqFks3 opfnZsQq9U4nIuuzNbwBLJbV3VWo6Rq+fbBm/vGKwfO1aTcGnuX4l2p7u50BGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btlp15c9qznYH; Fri, 01 Aug 2025 12:37:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571CbD9C052102; Fri, 1 Aug 2025 12:37:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571CbDKR052099; Fri, 1 Aug 2025 12:37:13 GMT (envelope-from git) Date: Fri, 1 Aug 2025 12:37:13 GMT Message-Id: <202508011237.571CbDKR052099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: 092b70dadb1b - main - riscv: Add cvitek SoC files to the build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 092b70dadb1bd511e7b500144aed3d80b32c5f2c Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=092b70dadb1bd511e7b500144aed3d80b32c5f2c commit 092b70dadb1bd511e7b500144aed3d80b32c5f2c Author: Bojan Novković AuthorDate: 2025-01-18 19:13:44 +0000 Commit: Bojan Novković CommitDate: 2025-08-01 12:35:54 +0000 riscv: Add cvitek SoC files to the build Reviewed by: br, jrtc27 Differential Revision: https://reviews.freebsd.org/D48533 --- sys/riscv/conf/GENERIC | 1 + sys/riscv/conf/std.cvitek | 14 ++++++++++++++ sys/riscv/cvitek/files.cvitek | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 7d7d0ca6e79c..a8500fe80019 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -206,6 +206,7 @@ device iicoc # OpenCores I2C controller support # Include SoC specific configuration include "std.allwinner" +include "std.cvitek" include "std.eswin" include "std.sifive" include "std.starfive" diff --git a/sys/riscv/conf/std.cvitek b/sys/riscv/conf/std.cvitek new file mode 100644 index 000000000000..8eb146282462 --- /dev/null +++ b/sys/riscv/conf/std.cvitek @@ -0,0 +1,14 @@ +# +# CVITEK SoC support +# + +device fdt +device dwc +device dwgpio +device uart_snps +device dwc_cvitek +device sdhci_cvitek +device cvitek_reset +device cvitek_restart + +files "../cvitek/files.cvitek" diff --git a/sys/riscv/cvitek/files.cvitek b/sys/riscv/cvitek/files.cvitek new file mode 100644 index 000000000000..bf89ee390403 --- /dev/null +++ b/sys/riscv/cvitek/files.cvitek @@ -0,0 +1,4 @@ +riscv/cvitek/cvitek_restart.c optional fdt cvitek_restart +riscv/cvitek/cvitek_reset.c optional fdt cvitek_reset +dev/dwc/if_dwc_cvitek.c optional fdt dwc_cvitek +dev/sdhci/sdhci_fdt_cvitek.c optional fdt sdhci sdhci_cvitek regulator From nobody Fri Aug 1 13:01:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btmLR3b9Yz63sWQ; Fri, 01 Aug 2025 13:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btmLR2rJ6z3Xqc; Fri, 01 Aug 2025 13:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754053311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AvPsqVaAVPUrtqBRVhAJDSLLseovFN6kEOOf+wligOw=; b=Djuiv1jjTZgAQG/Mp90iR5dXXL9qN4B0ykqSKevp4XHhaqsv+2oNVy2IRxNF16LF5pBihk rEO9JNAdHMMaa0W/568ShFaEJiDbI742xYfgPwO0BewXf/KB46RBrkj4hI2gN41N3edHI7 eciNSk21OvG5414pje46NEKihl9YPA9GIXVaHOzsc8RTr3uVPU9YgTf063WUMGkEwbztUQ UcrtNKO6b0vTERV4W0XRaS4argv2xS/XIuo0ED0QNZIwYzknsFN0UympHwIUuO2NaxL0Ym 1CfrYViNyIBZ8xh3CW5yH5OTh9tdXdXkyqsR1ssJQWeyeAw+b2Ry6ICrQfrgsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754053311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AvPsqVaAVPUrtqBRVhAJDSLLseovFN6kEOOf+wligOw=; b=niWOarzyR1nURQc2SU4WFNn4n4xvL+hTI/6G2V8VRqXA8+rOrJiBpvrITQ2q3ANjxU/vOC CKq5Ocx6yAEhBXLWtCIbxu/+5VDlfyPBpHjt14VLYyFUI+7mIkzAegMh60/0bKlO4XWDdU 0xWNldYWBV8hm0ZP+naPdnCE85vlzWNOByYq9tUuR6yUzdqdSBvdcrvFULgznrR2KW69nG w5ynzYF36rTyFiMsN6xA8fYvylZ2KWBpxDGV7g92W8bVv0EIHCAaqbDkePlGSIlnR+5KOi cDD4HwejcFffmBAsOchJONDrvuLcZaSq9b4fJgrcpOxlzVROIhHAf67dYIu5Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754053311; a=rsa-sha256; cv=none; b=AuPU0PRgLXfUvY8SSkw14adws70UFcH+gmpzG3MkJlI+6Yy+kTmzkeBZlTelw3yiXrIwrw AIoNPFr/3Ulg59NvOaahbSxw86ap4hTcr3IG70C7LRAX3p2YSNx6By34DDm3BeYaC5W3fA Z4mM9wmKm/mr3R3pnNrbOMSxEXUdezk8L6T+fMrx3PEBrreqaZvl99WuLj4D26xIzp/uJr V34JQ9UMhOOvCHxhzjx3WXHEojNgVVAJrs1RLdw58nW6A6AoJGOhxfRhYQYBVQ7rF7LWel kcMyqcm2CCdBUp4PwN+Epv03tHFK4P0IW9mxsuRf00a85ZLzQOv1bOremI1OWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btmLR2RVNzppt; Fri, 01 Aug 2025 13:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571D1phb004431; Fri, 1 Aug 2025 13:01:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571D1oP6004425; Fri, 1 Aug 2025 13:01:50 GMT (envelope-from git) Date: Fri, 1 Aug 2025 13:01:50 GMT Message-Id: <202508011301.571D1oP6004425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 1480c0b3f2da - main - Add 'contrib/libsamplerate/' from commit '69a539a327ef8d78260056c5394363569b5751ef' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1480c0b3f2daa048fb3763f589302f613ff2ae54 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1480c0b3f2daa048fb3763f589302f613ff2ae54 commit 1480c0b3f2daa048fb3763f589302f613ff2ae54 Merge: e9dd9f95f82f 69a539a327ef Author: Christos Margiolis AuthorDate: 2025-08-01 13:01:12 +0000 Commit: Christos Margiolis CommitDate: 2025-08-01 13:01:24 +0000 Add 'contrib/libsamplerate/' from commit '69a539a327ef8d78260056c5394363569b5751ef' Initial import. Needed by upcoming patches which port virtual_oss to base. Sponsored by: The FreeBSD Foundation git-subtree-dir: contrib/libsamplerate git-subtree-mainline: e9dd9f95f82f6244a6eafd073531dcf6b6a3953d git-subtree-split: 69a539a327ef8d78260056c5394363569b5751ef contrib/libsamplerate/COPYING | 25 + contrib/libsamplerate/common.h | 185 + contrib/libsamplerate/fastest_coeffs.h | 2498 + contrib/libsamplerate/high_qual_coeffs.h | 340273 ++++++++++++++++++++++++++++ contrib/libsamplerate/mid_qual_coeffs.h | 22472 ++ contrib/libsamplerate/samplerate.c | 532 + contrib/libsamplerate/samplerate.h | 189 + contrib/libsamplerate/src_linear.c | 303 + contrib/libsamplerate/src_sinc.c | 1254 + contrib/libsamplerate/src_zoh.c | 292 + 10 files changed, 368023 insertions(+) diff --cc contrib/libsamplerate/COPYING index 000000000000,9f82626e6371..9f82626e6371 mode 000000,100644..100644 --- a/contrib/libsamplerate/COPYING +++ b/contrib/libsamplerate/COPYING diff --cc contrib/libsamplerate/common.h index 000000000000,362b29cfc6db..362b29cfc6db mode 000000,100644..100644 --- a/contrib/libsamplerate/common.h +++ b/contrib/libsamplerate/common.h diff --cc contrib/libsamplerate/fastest_coeffs.h index 000000000000,b7a692ff5858..b7a692ff5858 mode 000000,100644..100644 --- a/contrib/libsamplerate/fastest_coeffs.h +++ b/contrib/libsamplerate/fastest_coeffs.h diff --cc contrib/libsamplerate/high_qual_coeffs.h index 000000000000,dc3b8840d425..dc3b8840d425 mode 000000,100644..100644 --- a/contrib/libsamplerate/high_qual_coeffs.h +++ b/contrib/libsamplerate/high_qual_coeffs.h diff --cc contrib/libsamplerate/mid_qual_coeffs.h index 000000000000,6fc4d377e558..6fc4d377e558 mode 000000,100644..100644 --- a/contrib/libsamplerate/mid_qual_coeffs.h +++ b/contrib/libsamplerate/mid_qual_coeffs.h diff --cc contrib/libsamplerate/samplerate.c index 000000000000,44b08e66d622..44b08e66d622 mode 000000,100644..100644 --- a/contrib/libsamplerate/samplerate.c +++ b/contrib/libsamplerate/samplerate.c diff --cc contrib/libsamplerate/samplerate.h index 000000000000,a3d5ae1aa085..a3d5ae1aa085 mode 000000,100644..100644 --- a/contrib/libsamplerate/samplerate.h +++ b/contrib/libsamplerate/samplerate.h diff --cc contrib/libsamplerate/src_linear.c index 000000000000,175be4f5dd1d..175be4f5dd1d mode 000000,100644..100644 --- a/contrib/libsamplerate/src_linear.c +++ b/contrib/libsamplerate/src_linear.c diff --cc contrib/libsamplerate/src_sinc.c index 000000000000,2ed0d7bac88f..2ed0d7bac88f mode 000000,100644..100644 --- a/contrib/libsamplerate/src_sinc.c +++ b/contrib/libsamplerate/src_sinc.c diff --cc contrib/libsamplerate/src_zoh.c index 000000000000,9fb4e50a8cfd..9fb4e50a8cfd mode 000000,100644..100644 --- a/contrib/libsamplerate/src_zoh.c +++ b/contrib/libsamplerate/src_zoh.c From nobody Fri Aug 1 13:02:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btmMC5J5Gz63sMJ; Fri, 01 Aug 2025 13:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btmMC4gF5z3YBX; Fri, 01 Aug 2025 13:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754053351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i/t0bWbhV8v/Mdx8IaVfP390fC3ZoJGiN+zdfjsl1Ns=; b=hOhVy06s4xVZDQJ/0HHq12IS/eHNP432VDzI82NrE+xAZxFgLJkD4WzRbXWNSJL4Cags4a cDPMbo29MbcwKBXE6qqN4xtYZ98pQIigMZqF5rYwjf51jYk7Zv/aYZmBpupuBNe1SiaLwq urn+X9InWfchrFZ0AYcoQ+1Dfo4Ln5PDYcCV5i+jr/hxtvZdD3xCHHkAyEVz4DMfZVR+3X fO8q69aNOyxIRce69NqAGqXsisdXS7mVsc8FTWXW5uWXgaSYnMyRJUpImjJS7ptXmvnB3g t2CHm9pGFf/4Ju1xAW3i5Za1PIGm0z7/KEMmIysUXnYoF1zHQJecxrJWmIJFPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754053351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i/t0bWbhV8v/Mdx8IaVfP390fC3ZoJGiN+zdfjsl1Ns=; b=V273fDZ64agCwGqKylC4D/3M2m5E+QBWHPVfcfmu5PUIEldrHr3qvKE+LfQdJ00uqIJ/QH mXvo8mfd4TPgwIrqoD1vV1iZN8UOix6snvbS6JupIK5fsPb3YHLdbPX2wEmUvXbKBCjJFl T+gW6aGtWkstFcr2kgPOVoWQIzthrGf/pYdpoyJhVQLpGLGB8gC3WzFrZjo7gHNxC6InWu l8nP92JxZsTZCDwlbZjs+DaE5VdYDfwiMSp8HQV7sk96o7JtQT0UzjNWwZM2/+7uhfZNNA zHDFhiCI0RZG5tKg+D0JieDveIUVp6KYC9ZBX0merK3l7nUY/VX7mIs+ayDfVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754053351; a=rsa-sha256; cv=none; b=Vwh9lfVppeP/EM4gQzwqrhgmJQ2TlXzfWRoYHFolTN/y2B6O4iYvYgBLRnxuZJnWypain4 6NIvf+AfNmAB62y7PKQV9e0GmMV5YrT36x42yzuf4ophFtDN8Iv8GWA74IWn99/VMdaLyF viiwL47MI+2uJMoYVIIuw8Xa+qzPJWaYlejJkMU6ftIPdlxOlJpPO8CVD47+0xIyXZD9+H wugi599SGvE6qXQLcrsyLPcr2H8wKhm4FYFSXLGC/L3HErT/SYVIJifXfXYnuUkoJTchDl C3pb4mhYdia03SonyxoWHCpCxKiUvPGtTiEepwNilJI4DrEtLAeLl/iqYrHAuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btmMC47T5zpFR; Fri, 01 Aug 2025 13:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571D2VDQ006661; Fri, 1 Aug 2025 13:02:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571D2Vql006658; Fri, 1 Aug 2025 13:02:31 GMT (envelope-from git) Date: Fri, 1 Aug 2025 13:02:31 GMT Message-Id: <202508011302.571D2Vql006658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 7a6d524a3194 - main - libsamplerate: Build as internal library List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a6d524a3194e0f8c3508f9e65f03c4eabfea020 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7a6d524a3194e0f8c3508f9e65f03c4eabfea020 commit 7a6d524a3194e0f8c3508f9e65f03c4eabfea020 Author: Christos Margiolis AuthorDate: 2025-08-01 13:02:01 +0000 Commit: Christos Margiolis CommitDate: 2025-08-01 13:02:13 +0000 libsamplerate: Build as internal library Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51666 --- lib/Makefile | 1 + lib/libsamplerate/Makefile | 18 ++++++++++++++++++ share/mk/src.libnames.mk | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/lib/Makefile b/lib/Makefile index 3417e7b30cb4..e0aafcad60d4 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -92,6 +92,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ librss \ librt \ librtld_db \ + libsamplerate \ libsbuf \ libsmb \ libstdbuf \ diff --git a/lib/libsamplerate/Makefile b/lib/libsamplerate/Makefile new file mode 100644 index 000000000000..256f2087284f --- /dev/null +++ b/lib/libsamplerate/Makefile @@ -0,0 +1,18 @@ +.PATH: ${SRCTOP}/contrib/libsamplerate + +LIB= samplerate +INTERNALLIB= + +SRCS= samplerate.c \ + src_linear.c \ + src_sinc.c \ + src_zoh.c + +INCS= samplerate.h + +CFLAGS+= -DENABLE_SINC_BEST_CONVERTER \ + -DENABLE_SINC_MEDIUM_CONVERTER \ + -DENABLE_SINC_FAST_CONVERTER \ + -I${SRCTOP}/contrib/libsamplerate + +.include diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 88202aeb78fe..0fe352dffaf4 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -72,6 +72,7 @@ _INTERNALLIBS= \ pfctl \ pkgecc \ pmcstat \ + samplerate \ sl \ sm \ smdb \ @@ -747,6 +748,9 @@ LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a LIBSYS_PICDIR= ${_LIB_OBJTOP}/lib/libsys LIBSYS_PIC?= ${LIBSYS_PICDIR}/libsys_pic.a +LIBSAMPLERATEDIR?= ${_LIB_OBJTOP}/lib/libsamplerate +LIBSAMPLERATE?= ${LIBSAMPLERATEDIR}/libsamplerate${PIE_SUFFIX}.a + # Define a directory for each library. This is useful for adding -L in when # not using a --sysroot or for meta mode bootstrapping when there is no # Makefile.depend. These are sorted by directory. From nobody Fri Aug 1 14:15:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btnyy0T0nz63wFR; Fri, 01 Aug 2025 14:15:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btnyx6qNYz3jtr; Fri, 01 Aug 2025 14:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZqYZSUJJDupzT1emz+tH0InF3X6X7NN3C0P7CubXFA4=; b=HX3VtxJ6Iqzp6WnjJCrBxQSJTJqyKLbER88/7rFmnBnH9/fkU+PN0x8h6CKuzqNAoRwK50 gIFujJJ7A43/0rwdltIyAmjP38LYHdbbU6qR0Me2CqaQLmFIHc79Wokh+eLBkOB/QoH8Rj HUwghJd4cUqSM+BjY4nw9P7YlvZCmzQYcd6D+FyDfx0H3y3VJnC0dlYBX29UefBAK9qmeY JNVTnN6w/5vq7uPbMfreQZYuTaLoyS8YwU89b4boYNhsK2vY+EAgyWrqACwOPAjKePjuXD 379ovfw2+1duQFGfEO0VW+G9MxKspTpe8RsmnteqBD0iF7bCgwN/x0JEgbZFVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZqYZSUJJDupzT1emz+tH0InF3X6X7NN3C0P7CubXFA4=; b=TGLJmJJ6pjFtK8c73T9zGDyB/KJebLMz/tIOKx/ZTzrKuwGX6LJGYGlpPnEFB+qC/mc41x nbCWDXJaDuy6J5dmU1DUSSNkJoPchG/eh/944N3gOj/AjRKZt5sUjPTYypiCoro6H1DYg3 xwye+Y2DTOGhQ9vJDrfQfJEqVuGYgKpS9IfWT8jme6VTDXCWjE7GbzH5r8k1+aiUT4kqSR qSb4OIjC7n2l1r3K9WvAORERiG5XIZu6e/sEZG1q9EJ9J5RqNyxJj+WRphf2qGhNG66Z7v EiS5qCcQQCd+Nd5Jf6+b963ArsEwy1CxvD/UfKy7EnHEmXg1IgHZA0Hhmlu4Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754057706; a=rsa-sha256; cv=none; b=BHNsuyZqRMiO36ktFWdKsZhP79Rb7JVzb9rbN1RMZvuV7pEzoPGJtN2uPcRD4MMmSev02e kvoaLsZcm1AekiTYL/zpDXEaEBPXOyeS+Od94giG7X8R7m6Fx0+UUWi0wkMk7ZgDWesBXa BU0M15Yj8Bes4MZBRKN/SqxYS8L8KI6jrF8j+6GbDZSJuorK6lAnBDepAsqVcoN1VYPRls 5qvQgZbAulgaSmtzaVfh3CBWpDoH/xAsvqHWgAwH2wuWHhYrBygWdZO2xBRTL5/AwmfqBY levJdimMZKVxcY5ISinnOIK+bT+fvv+SPb6/3sLlGrIsdMR8jMB+/UBzynHOdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btnyx6BhZzrj4; Fri, 01 Aug 2025 14:15:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571EF5bg039128; Fri, 1 Aug 2025 14:15:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571EF57N039125; Fri, 1 Aug 2025 14:15:05 GMT (envelope-from git) Date: Fri, 1 Aug 2025 14:15:05 GMT Message-Id: <202508011415.571EF57N039125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 250bb6793a2b - main - bsnmp: fix undefined behaviour List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 250bb6793a2bc4d2530eb304ac4c4f03ea585985 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=250bb6793a2bc4d2530eb304ac4c4f03ea585985 commit 250bb6793a2bc4d2530eb304ac4c4f03ea585985 Author: Lexi Winter AuthorDate: 2025-07-31 11:18:40 +0000 Commit: Lexi Winter CommitDate: 2025-08-01 14:06:39 +0000 bsnmp: fix undefined behaviour Modifying and using a variable without an intervening sequence point is undefined behaviour, which causes an error in the GCC build. Reviewed by: harti, emaste Differential Revision: https://reviews.freebsd.org/D51576 --- contrib/bsnmp/lib/snmpclient.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index 44dfbd5a06b1..01e46480abb8 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -2096,7 +2096,9 @@ get_port(struct snmp_client *sc, const char *port[2]) return (NULL); } - return (port[1] = ++(port[0]) + strlen(port[0])); + ++port[0]; + port[1] = port[0] + strlen(port[0]); + return (port[1]); } /** From nobody Fri Aug 1 14:15:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btnyz1Rhwz63wTZ; Fri, 01 Aug 2025 14:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btnyz0PTQz3jxG; Fri, 01 Aug 2025 14:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3kk/XZll8sd+ayQis0IQyVt8HhqebO2QGKEVcIv+Xa8=; b=dXsCsYTG+YLEX/3b9/1UkWe7qSeEIVWBET+zSwYuKHY1YziQkjtjnrkiNIMCqkH0EXHsm7 viVAXKL2NIaGk8ivagIIY5EABRFKWaWBucFGzcDIsgMM6x5ty2nzYzRhQwfHEnjDP5iGmN 4RTN8J10Sn8zIVUB2ykK5Ow8jFU5JaKUXlKhX9aNPasTlt5oiAxx64/qlA5NN8FLU5Orb0 NV/IaKVd61XgkNoeMdGiyiLVsRT+Uk1WSuQmJt19dxjN26Ypgxhqo7HKUoMKYGutg0+ory MSLubxLzDDnXoON07VNrYfXk9zmUjC9SglCF9lgyEWdGxa/nf2CegT0QtkRnGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3kk/XZll8sd+ayQis0IQyVt8HhqebO2QGKEVcIv+Xa8=; b=Syr4kHwyEje/qeApuEOwg1eDh/yvWb6C4Rh8eotyf0044Jx0uA8jswXwQs4iogbp4Su/P0 EG/Cd5MA5CB63zLTCGybVOzYdWLqnJaczR7Axo3EiuX3/Z72NVrtfcdqSuwvpkYvjo2VuU HTT3sG539fImojr/57spRra84EVeAslbQjoriyrp0KVuwZM/IapG6XWwJCm/sLBkwgWsIA 8l0/moW4sgOHJXlkg+GOfXKqkSf7C4V0Jj5Tl+S91S1CX2CjN6iznelk+pwdprjyN4HF9W hfWDxrvrgCjSsa/TxabQkYH4mFUN6yB6eho2GZ9f2XSFUjJEXVWKOoEk6OGshA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754057707; a=rsa-sha256; cv=none; b=HkgWdGB9pyoR0UtcL2da6bvUZ7CpcwZ+51c/qa/GorSTMJhjRkpHVcmyJOBSlEYcIqIw95 VpoTfzy5ePwnhPpkP8cBtb7Oh1bxXhZzco2vwDKC6mRAO8uLnBsddyaOIK+Tz162L41dN1 muBA3CCyM8LN8JOtVtVGMARSoLhCd8VRrjYDC5BYGh54uMEpmID/g0oPxUR6w91j8bQ771 lsOS0gD6fsmEY3wf0Xz27d7d9UrnCaQrn+H272O0ZgGSukGYo/Ru5FLIoaBm+UFHozV+MD P3K5/K+OAoKJwlOJn69wF6rtgcpzDcvoOhq4gTS+D8lbY3L1IOsFonlVhnOpfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btnyz00h2zqyX; Fri, 01 Aug 2025 14:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571EF6PF039161; Fri, 1 Aug 2025 14:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571EF6cD039158; Fri, 1 Aug 2025 14:15:06 GMT (envelope-from git) Date: Fri, 1 Aug 2025 14:15:06 GMT Message-Id: <202508011415.571EF6cD039158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 7d4a177efc65 - main - ifconfig: Support variable-argument commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d4a177efc653bc60a496ba0adf5cb4e0560fa07 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=7d4a177efc653bc60a496ba0adf5cb4e0560fa07 commit 7d4a177efc653bc60a496ba0adf5cb4e0560fa07 Author: Lexi Winter AuthorDate: 2025-07-31 15:54:53 +0000 Commit: Lexi Winter CommitDate: 2025-08-01 14:06:39 +0000 ifconfig: Support variable-argument commands Add a new type of command, DEF_CMD_VARG, which takes an (argc, argv) pair instead of a fixed number of arguments. This allows commands to do their own argument parsing and accept a variable number of arguments. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51243 --- sbin/ifconfig/ifconfig.c | 7 +++++++ sbin/ifconfig/ifconfig.h | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index a0680d09e54c..1a4d062253dd 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1209,6 +1209,13 @@ top: argc -= 2, argv += 2; } else if (p->c_parameter == SPARAM && p->c_u.c_func3) { p->c_u.c_func3(ctx, *argv, p->c_sparameter); + } else if (p->c_parameter == ARGVECTOR && p->c_u.c_funcv) { + int argsdone; + + argsdone = p->c_u.c_funcv(ctx, argc - 1, + (const char *const *)argv + 1); + argc -= argsdone; + argv += argsdone; } else if (p->c_u.c_func) p->c_u.c_func(ctx, *argv, p->c_parameter); argc--, argv++; diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 555e7dbaca64..468c9b4e80da 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -67,6 +67,7 @@ typedef struct ifconfig_context if_ctx; typedef void c_func(if_ctx *ctx, const char *cmd, int arg); typedef void c_func2(if_ctx *ctx, const char *arg1, const char *arg2); typedef void c_func3(if_ctx *ctx, const char *cmd, const char *arg); +typedef int c_funcv(if_ctx *ctx, int argc, const char *const *argv); struct cmd { const char *c_name; @@ -75,11 +76,13 @@ struct cmd { #define NEXTARG2 0xfffffe /* has 2 following args */ #define OPTARG 0xfffffd /* has optional following arg */ #define SPARAM 0xfffffc /* parameter is string c_sparameter */ +#define ARGVECTOR 0xfffffb /* takes argument vector */ const char *c_sparameter; union { c_func *c_func; c_func2 *c_func2; c_func3 *c_func3; + c_funcv *c_funcv; } c_u; int c_iscloneop; struct cmd *c_next; @@ -121,6 +124,13 @@ void callback_register(callback_func *, void *); .c_iscloneop = 0, \ .c_next = NULL, \ } +#define DEF_CMD_VARG(name, func) { \ + .c_name = (name), \ + .c_parameter = ARGVECTOR, \ + .c_u = { .c_funcv = (func) }, \ + .c_iscloneop = 0, \ + .c_next = NULL, \ +} #define DEF_CMD_SARG(name, sparam, func) { \ .c_name = (name), \ .c_parameter = SPARAM, \ From nobody Fri Aug 1 14:15:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btnz04NCBz63wgM; Fri, 01 Aug 2025 14:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btnz01Rnkz3k0v; Fri, 01 Aug 2025 14:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wTArGO8IVu3Y5BtWnKExxEtBdHbcvtYxZ6IWkvToZZc=; b=OLcqCGqODbKjv5+4UU5+FGG9VTJ+PF7s0hglVLJSxQ8Ok10OQM/OTrXBTxrC1iUhlWB/6n MYhHFXMESPiQur22B37GB2tRsS4Q/HvqboBhHyz56Wk1DkzsRI3qFHLWsp+XpaEGFvVych Ao4Fxgr6lwkFouX2s7R0zsy5mGExAZbhZgBqo2IKpFuuyX7Fy8KrPzB1ZULsspyVccWEKq 3zfUHTnGZsPa/WQi5x7Xw2Uird/DneN88e+NK7th+/rJaVY5SNVEpkCo3ok/p/ip1noujw RZIoHoPZ674pe/NP1fumDY35JjD+K298KNRrwn3fntOm0x4y87oO/VrIP8gCUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wTArGO8IVu3Y5BtWnKExxEtBdHbcvtYxZ6IWkvToZZc=; b=q5F6qagQSyBsxYcnRC2K+BMpz1iFA/4/pLoPMRTjsIzyVHWHYFE2m/kNXRjlXmTjSxMOe/ UqmgMcf/ODC0h6TkJfE48CW93fxgaY5B7+SgpZhv++8X89MH+1pZ8CmMPGknrl/hEv+U6M STi968wt7x+6X8RbsSHgZXoYu6+zm+h4DLmsGSRDCKma+WXAuFW1Q5ZRwZI/eLo3j62nWC hnwG0wneC3xFQFL6aV7FRhuvBPbSIzcGSK0x/1KVEjNR0EKQQjMSIxgM73qea2puUm7vuZ NGZRSnAGzyvOUXZIYISpJZvspBIGfJLHZzVF4O/mDLxbPmBMZUDG4jWtVLdNrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754057708; a=rsa-sha256; cv=none; b=bOu/LRMujIEXb+K3ZYcScgRl+EssW0B8MgrxoQdSMRXrbz6A1rvmnUd38v70ALdpQbU8PT ehX5uFyrS2xg3jBF9NMPLPy4Lz7Vlb4JBxfAanNAzf4d+m64Aya8TaWrvBnct2xzuvzfi+ uZoNXTzmJA/7TA+QmBTbWCsdLHf5fz+qv+hu0gePulvmMTrP241ad6Ab+tPphkqkq+dJlg XIUkUkJxw95TRl5+rdNJw54F7PzLyt4KQSxaxyMMR8IkrljIC/3P4CmaS34ozYUuKqFwPU pPDqJs57dvA5T6sCQx6bck0A7XrUh10Socj+fR6HaphVhbBdddBKAggcagdJ5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btnz011JbzrCp; Fri, 01 Aug 2025 14:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571EF8Wn039196; Fri, 1 Aug 2025 14:15:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571EF8DR039193; Fri, 1 Aug 2025 14:15:08 GMT (envelope-from git) Date: Fri, 1 Aug 2025 14:15:08 GMT Message-Id: <202508011415.571EF8DR039193@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 3650722abf29 - main - ifconfig: Support VLAN ID in static/deladdr List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3650722abf2922893540361a1369b54abc5ff8d2 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=3650722abf2922893540361a1369b54abc5ff8d2 commit 3650722abf2922893540361a1369b54abc5ff8d2 Author: Lexi Winter AuthorDate: 2025-07-31 15:56:51 +0000 Commit: Lexi Winter CommitDate: 2025-08-01 14:06:39 +0000 ifconfig: Support VLAN ID in static/deladdr Add an optional "vlan " argument to the bridge static and deladdr commands to allow addresses to be added to / removed from a particular vlan. No changes to if_bridge are required as the kernel API already supports this, it just wasn't exposed in ifconfig. Add tests for the new functionality, and improve the test for the existing "static" command. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D51243 --- sbin/ifconfig/ifbridge.c | 71 +++++++++++++++++++++++++++++++---------- sbin/ifconfig/ifconfig.8 | 18 ++++++++--- tests/sys/net/if_bridge_test.sh | 70 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 136 insertions(+), 23 deletions(-) diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index a75c37e640a2..1a8c4c6e9c3e 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -435,43 +435,80 @@ setbridge_flushall(if_ctx *ctx, const char *val __unused, int dummy __unused) err(1, "BRDGFLUSH"); } -static void -setbridge_static(if_ctx *ctx, const char *val, const char *mac) +static int +setbridge_static(if_ctx *ctx, int argc, const char *const *argv) { struct ifbareq req; struct ether_addr *ea; + int arg; + + if (argc < 2) + errx(1, "usage: static
[vlan ]"); + arg = 0; memset(&req, 0, sizeof(req)); - strlcpy(req.ifba_ifsname, val, sizeof(req.ifba_ifsname)); + req.ifba_flags = IFBAF_STATIC; - ea = ether_aton(mac); - if (ea == NULL) - errx(1, "%s: invalid address: %s", val, mac); + strlcpy(req.ifba_ifsname, argv[arg], sizeof(req.ifba_ifsname)); + ++arg; + ea = ether_aton(argv[arg]); + if (ea == NULL) + errx(1, "invalid address: %s", argv[arg]); memcpy(req.ifba_dst, ea->octet, sizeof(req.ifba_dst)); - req.ifba_flags = IFBAF_STATIC; - req.ifba_vlan = 0; /* XXX allow user to specify */ + ++arg; + + req.ifba_vlan = 0; + if (argc > 2 && strcmp(argv[arg], "vlan") == 0) { + if (argc < 3) + errx(1, "usage: static
" + "[vlan ]"); + ++arg; + + if (get_vlan_id(argv[arg], &req.ifba_vlan) < 0) + errx(1, "invalid vlan id: %s", argv[arg]); + ++arg; + } if (do_cmd(ctx, BRDGSADDR, &req, sizeof(req), 1) < 0) - err(1, "BRDGSADDR %s", val); + err(1, "BRDGSADDR"); + return arg; } -static void -setbridge_deladdr(if_ctx *ctx, const char *val, int dummy __unused) +static int +setbridge_deladdr(if_ctx *ctx, int argc, const char *const *argv) { struct ifbareq req; struct ether_addr *ea; + int arg; + + if (argc < 1) + errx(1, "usage: deladdr
[vlan ]"); + arg = 0; memset(&req, 0, sizeof(req)); - ea = ether_aton(val); + ea = ether_aton(argv[arg]); if (ea == NULL) - errx(1, "invalid address: %s", val); - + errx(1, "invalid address: %s", argv[arg]); memcpy(req.ifba_dst, ea->octet, sizeof(req.ifba_dst)); + ++arg; + + req.ifba_vlan = 0; + if (argc >= 2 && strcmp(argv[arg], "vlan") == 0) { + if (argc < 3) + errx(1, "usage: deladdr
[vlan ]"); + ++arg; + + if (get_vlan_id(argv[arg], &req.ifba_vlan) < 0) + errx(1, "invalid vlan id: %s", argv[arg]); + ++arg; + } if (do_cmd(ctx, BRDGDADDR, &req, sizeof(req), 1) < 0) - err(1, "BRDGDADDR %s", val); + err(1, "BRDGDADDR"); + + return arg; } static void @@ -824,8 +861,8 @@ static struct cmd bridge_cmds[] = { DEF_CMD_ARG("-autoptp", unsetbridge_autoptp), DEF_CMD("flush", 0, setbridge_flush), DEF_CMD("flushall", 0, setbridge_flushall), - DEF_CMD_ARG2("static", setbridge_static), - DEF_CMD_ARG("deladdr", setbridge_deladdr), + DEF_CMD_VARG("static", setbridge_static), + DEF_CMD_VARG("deladdr", setbridge_deladdr), DEF_CMD("addr", 1, setbridge_addr), DEF_CMD_ARG("maxaddr", setbridge_maxaddr), DEF_CMD_ARG("hellotime", setbridge_hellotime), diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index b6e7d3ff2c63..6a50a91880ef 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 14, 2025 +.Dd July 30, 2025 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2520,15 +2520,23 @@ is zero, then address cache entries will not be expired. The default is 1200 seconds. .It Cm addr Display the addresses that have been learned by the bridge. -.It Cm static Ar interface-name Ar address -Add a static entry into the address cache pointing to +.It Cm static Ar interface-name Ar address Op Cm vlan Ar vlan-id +Add a static entry into the address cache for pointing to .Ar interface-name . +If +.Ar vlan-id +is specified, the entry is added for that VLAN, otherwise it is added +for VLAN 0. +.Pp Static entries are never aged out of the cache or re-placed, even if the address is seen on a different interface. -.It Cm deladdr Ar address +.It Cm deladdr Ar address Op Cm vlan Ar vlan-id Delete .Ar address -from the address cache. +from the address cache. If +.Ar vlan-id +is specified, the entry is deleted from that VLAN's address table, +otherwise it is deleted from the VLAN 0 address table. .It Cm flush Delete all dynamically-learned addresses from the address cache. .It Cm flushall diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index c0c085f22273..31299c562510 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -245,7 +245,8 @@ static_body() jexec one ifconfig ${bridge} static ${epair}a 00:01:02:03:04:05 # List addresses - atf_check -s exit:0 -o ignore \ + atf_check -s exit:0 \ + -o match:"00:01:02:03:04:05 Vlan0 ${epair}a 0 flags=1" \ jexec one ifconfig ${bridge} addr # Delete with bad address format @@ -266,6 +267,72 @@ static_cleanup() vnet_cleanup } +atf_test_case "vstatic" "cleanup" +vstatic_head() +{ + atf_set descr 'Bridge VLAN static address test' + atf_set require.user root +} + +vstatic_body() +{ + vnet_init + vnet_init_bridge + + epair=$(vnet_mkepair) + bridge=$(vnet_mkbridge) + + vnet_mkjail one ${bridge} ${epair}a + + ifconfig ${epair}b up + + jexec one ifconfig ${bridge} up + jexec one ifconfig ${epair}a up + jexec one ifconfig ${bridge} addm ${epair}a + + # Wrong interface + atf_check -s exit:1 -o ignore -e ignore jexec one \ + ifconfig ${bridge} static ${epair}b 00:01:02:03:04:05 vlan 10 + + # Bad address format + atf_check -s exit:1 -o ignore -e ignore jexec one \ + ifconfig ${bridge} static ${epair}a 00:01:02:03:04 vlan 10 + + # Invalid VLAN ID + atf_check -s exit:1 -o ignore -e ignore jexec one \ + ifconfig ${bridge} static ${epair}a 00:01:02:03:04:05 vlan 5000 + + # Correct add + atf_check -s exit:0 -o ignore jexec one \ + ifconfig ${bridge} static ${epair}a 00:01:02:03:04:05 vlan 10 + + # List addresses + atf_check -s exit:0 \ + -o match:"00:01:02:03:04:05 Vlan10 ${epair}a 0 flags=1" \ + jexec one ifconfig ${bridge} addr + + # Delete with bad address format + atf_check -s exit:1 -o ignore -e ignore jexec one \ + ifconfig ${bridge} deladdr 00:01:02:03:04 vlan 10 + + # Delete with unlisted address + atf_check -s exit:1 -o ignore -e ignore jexec one \ + ifconfig ${bridge} deladdr 00:01:02:03:04:06 vlan 10 + + # Delete with wrong vlan id + atf_check -s exit:1 -o ignore -e ignore jexec one \ + ifconfig ${bridge} deladdr 00:01:02:03:04:05 vlan 20 + + # Correct delete + atf_check -s exit:0 -o ignore jexec one \ + ifconfig ${bridge} deladdr 00:01:02:03:04:05 vlan 10 +} + +vstatic_cleanup() +{ + vnet_cleanup +} + atf_test_case "span" "cleanup" span_head() { @@ -1250,6 +1317,7 @@ atf_init_test_cases() atf_add_test_case "stp" atf_add_test_case "stp_vlan" atf_add_test_case "static" + atf_add_test_case "vstatic" atf_add_test_case "span" atf_add_test_case "inherit_mac" atf_add_test_case "delete_with_members" From nobody Fri Aug 1 14:15:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btnz16w7Jz63wTc; Fri, 01 Aug 2025 14:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btnz120lcz3jxj; Fri, 01 Aug 2025 14:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yov85r3Y29bwjkM2Si/G5iRBeAlQLCaJykP8WMFeieY=; b=ROpBT8vtrhM3DAZ26CM6NjikCnI4yKcX2Xa2V/2eq8jicmWG6szDukOJjvYYFJRKW5LQao 14V2azdJ2AtucG4XFY1++YPumMHCyn7gjILMj+8XMO87T/ShT7TubISYgv6EGUd7N2VzA2 TQz8ew+N0mMLEDSCdDTihXuLcZVX3qzZ9/PttEK4ADuYa6Pzo9rR62M/ap6EpRGWOeWpA0 GNDl++TqrO7559Vfk2LX/AoRR6WxTUXDs0N8H+k+VB3DDlS0m+g5slnHVpwPWVjQfmrDQK e6cS5ZApi+RfTw+2JHvgNafK++IFOJqc/aHL1V4NZ6nMOssCtInAkdtTs0Pg3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754057709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yov85r3Y29bwjkM2Si/G5iRBeAlQLCaJykP8WMFeieY=; b=aTxlBv6NtxEi4Lr9kDDa7B6bW3YwcOkVi7yAM+gPiqmv/RclsTlpnx+2nUeJmY25m567sz mOkCvasoZA//bKhoce/EjNABehrlRluI6xipc8wWSbBgPXZVPZU9CbZXQJ9hl9Utc26zGh 9jSTWkYVXI1wlKHqxrKaCCx1t4HucUaYC208k8JM1H0uQxYl5gLCO/DwMJvDR7iaBGI6G+ Apk6KfObYCMayEi7p5WZEX25Sek5LxTeZXa1YBD9gJY3/y5NyoXLbiGvvp6/xwythkdVVO PgwxfLa1vphWA79hKdrq//XV0SIN7rTaCRZyv9rsGzIwTTZV5twOfIL/gpOAUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754057709; a=rsa-sha256; cv=none; b=P57ARqgoBaQkBvvxjzCtZCdcjvwUVCmuGVM68m2e1aiMIsCZgIuuIgB1An47QKxhm/xep7 ABo3wsZ9W7fgw5iUIfxozPyQTlZXAt5YWCTA7mH3nUC0kh2UfKlj/6JvpnJbyI7lIMNV/9 JcFBaQsokGZZVhu9FKGsSJr28rdslyIMAUrMfcPfocvqPDR0/zBEC/yy/FzS9cTq6sJxXH naof5el/kTS39IkZoY5BJ+sonMWZkY3tmK9iH366Cco4Ft8ryOUi/cLuixByvuSriavUiw 7Ekhk/MCDhM+WI/E7xHRgNjKFBgaN+ZJ1Qii3Q3+QFsYkyWggf/dDLQCoikJ8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btnz11cY0zrlw; Fri, 01 Aug 2025 14:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571EF9Wk039232; Fri, 1 Aug 2025 14:15:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571EF92k039229; Fri, 1 Aug 2025 14:15:09 GMT (envelope-from git) Date: Fri, 1 Aug 2025 14:15:09 GMT Message-Id: <202508011415.571EF92k039229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 62473ce8ccba - main - pam_krb5: fix the GCC build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62473ce8ccba20bad3e34f63448dba13433816e8 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=62473ce8ccba20bad3e34f63448dba13433816e8 commit 62473ce8ccba20bad3e34f63448dba13433816e8 Author: Lexi Winter AuthorDate: 2025-08-01 14:05:58 +0000 Commit: Lexi Winter CommitDate: 2025-08-01 14:06:39 +0000 pam_krb5: fix the GCC build GCC doesn't recognise -Wno-error=incompatible-pointer-types-discards-qualifiers. Remove it and just fix the error instead: our pam_message does not have a const msg member. Reviewed by: cy, emaste Differential Revision: https://reviews.freebsd.org/D51575 --- contrib/pam-krb5/module/prompting.c | 2 +- lib/libpam/modules/pam_krb5/Makefile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/pam-krb5/module/prompting.c b/contrib/pam-krb5/module/prompting.c index 506fb8fd2b22..8f9d8ef40d8e 100644 --- a/contrib/pam-krb5/module/prompting.c +++ b/contrib/pam-krb5/module/prompting.c @@ -157,7 +157,7 @@ pamk5_conv(struct pam_args *args, const char *message, int type, return PAM_CONV_ERR; pmsg = &msg; msg.msg_style = type; - msg.msg = (PAM_CONST char *) message; + msg.msg = (char *) message; pamret = conv->conv(1, &pmsg, &resp, conv->appdata_ptr); if (pamret != PAM_SUCCESS) return pamret; diff --git a/lib/libpam/modules/pam_krb5/Makefile b/lib/libpam/modules/pam_krb5/Makefile index c1792b5fb61d..7634930a7202 100644 --- a/lib/libpam/modules/pam_krb5/Makefile +++ b/lib/libpam/modules/pam_krb5/Makefile @@ -63,7 +63,6 @@ MLINKS= pam-krb5.8 pam_krb5.8 CFLAGS= -I${SRCDIR} \ -I${.CURDIR} \ -fno-strict-aliasing \ - -Wno-error=incompatible-pointer-types-discards-qualifiers \ -DHAVE_CONFIG_H WARNS?= 3 From nobody Fri Aug 1 14:58:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btpxC1DLqz63ySl; Fri, 01 Aug 2025 14:58:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btpxC0Mr5z3qRQ; Fri, 01 Aug 2025 14:58:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754060319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+VGoLOSJxLuWvYexXf4/Ar3d8en93YXAGUOWubUqq5Y=; b=OAFtp0DY1n7HoRksob/QE9IssuL32ICCi0Q6l049JoUCWEIXWGW+ZsUGu91HVWfxd8tRA4 ek7k5FmLwHOzvrbYX6NMJy0SXLJj3IFIBzKq9rHSq4xd9ihCSVJ++0y/J84xIs8KV2f6fu 4ulXhF37xYq5PaekGQKjs5sYAsrM+B37KEvaNzTQHDrFd+6oGkCjw1nkmjlqhlEIfy6K5S 2U2OZktLUxfz1HPnfZkxqIqSZ+JHuXKCL6I7SZi1OeKWLwUDBaiUckpD5NkPT2yGDRUh/N QJKO2KCwyR72W3RipXBVgca5BPUZnjE9EpCPbwJUewcuJVDaiqp319SNtdsRbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754060319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+VGoLOSJxLuWvYexXf4/Ar3d8en93YXAGUOWubUqq5Y=; b=NZ3v/5OWQeTtLDefyny8tSEgFddQaaNh2waZ4B4qWIrdV8lN9jqhgEg0prwFCuIX0ZZM5S M3pxSNxc8xnqHGMofcK1QPp5Wz73LV9htolwODoSpyt9ONvqv0Zz3Uax7MyPtA9JRxcB+Z bTPD3sY0HDc3w6x1Pv889aMfWxwMdywZAMgub37F+tP3u2F293qxUWsrAOIYWyOIzyWw4Y uqIHg6aUzXJu19l2U6GCfQB9BZdTRiYkfiStK44tU0GEi3jeWDSz6jCF5wTMQpk4g88b2z R2S9JEGtc1P2ouVKcNnzOdynnVqDbphWiwfD4jePB2PCR2EFoEZvpstw4owJSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754060319; a=rsa-sha256; cv=none; b=WF5pBgtdAwER/AzbI9ssRgu3Bo5UWhXJvcNJlXdnUDIWSGARUKrZxzj6PNFsN/cuRkaiGC 4q91U1VZpJxV1ubwEILolTwL4e21Ii62Ew8H1+ix8UScJO1Zr2EElq/bdby+4ZiTcKdps3 WdZTMT7i48ZXKYFqTwsjwKPqcxS865ZJjyrGHvx+/151N2YFG7jB389PndP65hnECY+T62 MqwiFe4Vh6KbfDA1YD3RDEN71RDdS9lUXHry89EtKXXNkiiJloDf/pieItHJgrtOkF2NDn Tw5PF16QyKoQKvTNsyggpdSkwSsy0vjjQ2SxPYZXt0fLZ3L/jnrsRLx976Z7uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btpxB71qwzsMn; Fri, 01 Aug 2025 14:58:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571EwcNt015239; Fri, 1 Aug 2025 14:58:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571EwcmQ015236; Fri, 1 Aug 2025 14:58:38 GMT (envelope-from git) Date: Fri, 1 Aug 2025 14:58:38 GMT Message-Id: <202508011458.571EwcmQ015236@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: 406fffde9c45 - main - syscalls: make __sysctl's first argument const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 406fffde9c45a3302fdb5f971f30b62cabc4801e Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=406fffde9c45a3302fdb5f971f30b62cabc4801e commit 406fffde9c45a3302fdb5f971f30b62cabc4801e Author: Brooks Davis AuthorDate: 2025-08-01 14:14:12 +0000 Commit: Brooks Davis CommitDate: 2025-08-01 14:54:12 +0000 syscalls: make __sysctl's first argument const This matches the sysctl(3) prototype. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51669 --- sys/kern/syscalls.master | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 90559fab6086..a8815afee866 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1223,7 +1223,7 @@ } 202 AUE_SYSCTL STD|CAPENABLED { int __sysctl( - _In_reads_(namelen) int *name, + _In_reads_(namelen) const int *name, u_int namelen, _Out_writes_bytes_opt_(*oldlenp) void *old, _Inout_opt_ size_t *oldlenp, From nobody Fri Aug 1 14:58:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btpxD3PTgz63y9Y; Fri, 01 Aug 2025 14:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btpxD1p2Fz3qXM; Fri, 01 Aug 2025 14:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754060320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWPL6MOpwQiRUAjXxSDXcd3gh2Kc4I7w9uEGcF7esaM=; b=x8eLry3O0bhnIVZf9QJwRkmZkt+Hf8zAtg48yYmksWT9+Ue+hM5irJE9VZSznkVEBEcgek t8He+3PoFbWtn16rkcEMs4An9DQsignQKQVLnkvGwcTAKtU6vg1BazLcjOBuyOx9jGZPCP vSW0OHNNVV5lcJ3VIrf3uX6qQC14F7n8cufwjn1ZdhR05KOHaUQvTbQ2m4LZtkaVC/yGCJ bGj243wIrYqnmfKvGKuQ2tlMM/bpkRKnQFRgEY2Kdlf8/tjU0hMLgQC7LSVcZhMmLI5wo1 spiSdKC0mREF92p5/lGGE5i/64kQHBtH0Qm6E2xQfOTVbQYRoeEyr1AW08zFZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754060320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWPL6MOpwQiRUAjXxSDXcd3gh2Kc4I7w9uEGcF7esaM=; b=ScbVAPan+G/LUceUtaM9QQ4cMhDx71Yi7gzS1GQryrKGlIwBO37dGl2u//g9owTt7hoQry /TR5M+ax+ipp+x7LYjt0yqsTxtfleQFoG4tPAtZ/7JNzZVK2SdL4ja0KW0/hFHO23TZOL3 p7bKqfS4wdoyDtRVFjoZsU4CN6qUkUvtrfUZPqGPVgWkh/pCizL+CQtv3XsEKnOZ3pUuBj YG6eGv/0cMafRKGVFGniqJriEzkrER8n5vHGIkrwa1p5aBe3tTT7grck1PjERmTpFt0Yzz JRE9JGmHle8iMzBzL4vEIJB0QNGrj3DoqeKPd1Vw9kTg5JbqQvHJX7LTx6PAow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754060320; a=rsa-sha256; cv=none; b=X+8HiUNr4s1+zHovBsfD53ZVQ4bdwoMmPGRgm3DGyvoiMNEM3Lc1r/p9BQ+OYlVKPKLQCV k1WtAWwCmAEYC99kZuF8MurqMvLfbvBVM2yPKf1KkFmBMqHeWaysTGGpldAADJUv2sy7d6 jvtA0td/J1XwK3MtcBF2kxQXglUikCaxkmfWnCRlyFbi1kMTovhAxKnxSU8Okxnj4i1Fek fZQEWNHVtXGNt/9LEr99tOtsMOeQaXIV/SebdyOyg3e4xaqFmMy8sFQxbLEkYlauxCFs69 HF/0lw9rPUGfzN4GHWayQoJtFxCmk3RDrMcWSkxGsd+gQ3nlw2tuhRpxeiW4BA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btpxD1D7Rzs8W; Fri, 01 Aug 2025 14:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571EweMS015273; Fri, 1 Aug 2025 14:58:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571Eweot015270; Fri, 1 Aug 2025 14:58:40 GMT (envelope-from git) Date: Fri, 1 Aug 2025 14:58:40 GMT Message-Id: <202508011458.571Eweot015270@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: bfebc6deb4b9 - main - sysent: regen for const __sysctl argument List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: bfebc6deb4b92f86fcd9797e658ad697cd0ad6c5 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=bfebc6deb4b92f86fcd9797e658ad697cd0ad6c5 commit bfebc6deb4b92f86fcd9797e658ad697cd0ad6c5 Author: Brooks Davis AuthorDate: 2025-08-01 14:15:43 +0000 Commit: Brooks Davis CommitDate: 2025-08-01 14:54:12 +0000 sysent: regen for const __sysctl argument --- lib/libsys/_libsys.h | 4 ++-- sys/compat/freebsd32/freebsd32_proto.h | 2 +- sys/compat/freebsd32/freebsd32_systrace_args.c | 4 ++-- sys/kern/systrace_args.c | 4 ++-- sys/sys/sysproto.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libsys/_libsys.h b/lib/libsys/_libsys.h index 1799906eb885..7a1685cca2d1 100644 --- a/lib/libsys/_libsys.h +++ b/lib/libsys/_libsys.h @@ -180,7 +180,7 @@ typedef int (__sys_pathconf_t)(const char *, int); typedef int (__sys_fpathconf_t)(int, int); typedef int (__sys_getrlimit_t)(u_int, struct rlimit *); typedef int (__sys_setrlimit_t)(u_int, struct rlimit *); -typedef int (__sys___sysctl_t)(int *, u_int, void *, size_t *, const void *, size_t); +typedef int (__sys___sysctl_t)(const int *, u_int, void *, size_t *, const void *, size_t); typedef int (__sys_mlock_t)(const void *, size_t); typedef int (__sys_munlock_t)(const void *, size_t); typedef int (__sys_undelete_t)(const char *); @@ -584,7 +584,7 @@ int __sys_pathconf(const char * path, int name); int __sys_fpathconf(int fd, int name); int __sys_getrlimit(u_int which, struct rlimit * rlp); int __sys_setrlimit(u_int which, struct rlimit * rlp); -int __sys___sysctl(int * name, u_int namelen, void * old, size_t * oldlenp, const void * new, size_t newlen); +int __sys___sysctl(const int * name, u_int namelen, void * old, size_t * oldlenp, const void * new, size_t newlen); int __sys_mlock(const void * addr, size_t len); int __sys_munlock(const void * addr, size_t len); int __sys_undelete(const char * path); diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h index ee634943a4f5..5c0efc64f8a7 100644 --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -157,7 +157,7 @@ struct freebsd32_ntp_adjtime_args { char tp_l_[PADL_(struct timex32 *)]; struct timex32 * tp; char tp_r_[PADR_(struct timex32 *)]; }; struct freebsd32___sysctl_args { - char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; + char name_l_[PADL_(const int *)]; const int * name; char name_r_[PADR_(const int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; char oldlenp_l_[PADL_(uint32_t *)]; uint32_t * oldlenp; char oldlenp_r_[PADR_(uint32_t *)]; diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 37564a737a62..df445b15f86f 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -932,7 +932,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32___sysctl */ case 202: { struct freebsd32___sysctl_args *p = params; - uarg[a++] = (intptr_t)p->name; /* int * */ + uarg[a++] = (intptr_t)p->name; /* const int * */ uarg[a++] = p->namelen; /* u_int */ uarg[a++] = (intptr_t)p->old; /* void * */ uarg[a++] = (intptr_t)p->oldlenp; /* uint32_t * */ @@ -4901,7 +4901,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 202: switch (ndx) { case 0: - p = "userland int *"; + p = "userland const int *"; break; case 1: p = "u_int"; diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index 90b21616a558..467caa71f20d 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -955,7 +955,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __sysctl */ case 202: { struct __sysctl_args *p = params; - uarg[a++] = (intptr_t)p->name; /* int * */ + uarg[a++] = (intptr_t)p->name; /* const int * */ uarg[a++] = p->namelen; /* u_int */ uarg[a++] = (intptr_t)p->old; /* void * */ uarg[a++] = (intptr_t)p->oldlenp; /* size_t * */ @@ -5033,7 +5033,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 202: switch (ndx) { case 0: - p = "userland int *"; + p = "userland const int *"; break; case 1: p = "u_int"; diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index 94b5a0a7a95e..c7420ac6bb8c 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -546,7 +546,7 @@ struct setrlimit_args { char rlp_l_[PADL_(struct rlimit *)]; struct rlimit * rlp; char rlp_r_[PADR_(struct rlimit *)]; }; struct __sysctl_args { - char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; + char name_l_[PADL_(const int *)]; const int * name; char name_r_[PADR_(const int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; char oldlenp_l_[PADL_(size_t *)]; size_t * oldlenp; char oldlenp_r_[PADR_(size_t *)]; From nobody Fri Aug 1 15:19:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btqNv5Wn1z640FN; Fri, 01 Aug 2025 15:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btqNv4g4dz3sHt; Fri, 01 Aug 2025 15:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754061551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lrsRExY4RQtTBgZR7IR3XBl+GtvqEjgZmiUIBeCLnqE=; b=GNbIEVNzHkOb5iRKCGFwJyGQnaRph5oUXa4RGnUdOXPKFl5JGji1fXlQOx+ZjYeC6rbct9 eFCqqwjQll0TpvK1koKkjOW0tqHSxHqU5mbHkHfutC/pb7CTUBqIYLANxqa9kzT/3VbkfI oWE2plvAs3zgdHyOA7PTppYcX/8lDqhN0XmzXvGuqnYZ56zsCO3lccG/78Gn8TVISM7oqM cZGUmp+/nNAlC3u4mhwgMw2oXAyaBBOYoAtWciIIpCezPypF/H3ylnb+3cALguIvv2YrVo M3A3eR2coo8x+QFXWwMxtL29Qo9d9un+75XciZ/qeFjVAg6ATz1N4RhZPP3e2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754061551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lrsRExY4RQtTBgZR7IR3XBl+GtvqEjgZmiUIBeCLnqE=; b=igB0d5v+CxbWX29Ug9QhPFBqKxeYfaIl69QfTurS/6Euml74Y6UG1nco9RVbKXnA6yXQ4E NVjrp0qdfuczkfcyw8fly7Zhl0k7YI5dzZbA64G2BKoBWc9yDsnSfyeXJtyZ/4MV2lnvvy +ImLuileDQJyza8PUyZkZfKPYLTdJOycincAJL5gMV2jCe87dASV1pZON9vDw1BqwDbUkH IL7Nj2vFUtD6kK1zuSbWO9n5T1VMynPvCgMQPn+Q0LvXvW4AYN0FOmmTmmyMCgM0/30lq2 y3QqS8RloK2bkqMHjzqMRBFGMpfgXlOxj5weH9QQ76ZGfFuVsK39NdP35pHwzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754061551; a=rsa-sha256; cv=none; b=jvlAkQ50euA5MtkMmW8HwQJZWTb1vsApHuTsPd/7JwpXsi8AIoBd8gJvpBgkPtaDY61qH4 iTwNYjz61bt2pSRh3MouuiE3PIgGmlkh3DkiQs9iTCcKThAk4wNINm+5+cX3KcbWbn1DX7 UN01nO9okiy4a2UXx9y96kEX9kWw/FGQkW2GkXWywwM9w/RO3I8U3OSTCfhPSPTL/a99Ko ltCzERnqCCETm74cIMEocj8he6RJVqLlXQCRrs64uzfeNYd+NyNF0yMBv88SLcdLctA7vY 1JWwgDveWnwqRmMjmMguP42a7baySnB47j/gzWWEGX9NzFZalHkQoolFyx8sUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btqNv40FvzsPN; Fri, 01 Aug 2025 15:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571FJBOI053527; Fri, 1 Aug 2025 15:19:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571FJBm3053524; Fri, 1 Aug 2025 15:19:11 GMT (envelope-from git) Date: Fri, 1 Aug 2025 15:19:11 GMT Message-Id: <202508011519.571FJBm3053524@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 04c8bba8c867 - main - sysctl.3: Reference kinfo_getvmmap(3), kinfo_getfile(3), and kinfo_getproc(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04c8bba8c8672d186837e353d4f2335a26f0c3c1 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=04c8bba8c8672d186837e353d4f2335a26f0c3c1 commit 04c8bba8c8672d186837e353d4f2335a26f0c3c1 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-07-31 16:06:08 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-08-01 15:15:13 +0000 sysctl.3: Reference kinfo_getvmmap(3), kinfo_getfile(3), and kinfo_getproc(3) It seems to be a good place to help the user discover those useful wrappers. Reviewed by: christos MFC after: 3 days Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51654 --- lib/libc/gen/sysctl.3 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index 95e33dc802be..ef897c653728 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 16, 2023 +.Dd July 31, 2025 .Dt SYSCTL 3 .Os .Sh NAME @@ -527,8 +527,12 @@ The path of the process' text file is returned. The in-kernel call stacks for the threads of the specified process. .It Dv KERN_PROC_VMMAP The description of the map entries for the process. +Also refer to +.Xr kinfo_getvmmap 3 . .It Dv KERN_PROC_FILEDESC The file descriptors for files opened in the specified process. +Also refer to +.Xr kinfo_getfile 3 . .It Dv KERN_PROC_GROUPS Groups associated with the process. .It Dv KERN_PROC_ENV @@ -949,6 +953,7 @@ A process without appropriate privilege attempts to set a value. .El .Sh SEE ALSO .Xr confstr 3 , +.Xr kinfo_getproc 3 , .Xr kvm 3 , .Xr sysconf 3 , .Xr sysctl 8 From nobody Fri Aug 1 15:24:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btqVv3kv7z640XV; Fri, 01 Aug 2025 15:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btqVv35Vqz3t42; Fri, 01 Aug 2025 15:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754061863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/JTODy3btLW79M9QRvCu+ZrfdXeUR1wiXsF2UN8Rdg=; b=IkdDLtJ1vSlZG/4cjNnoQqlPZL0xX6l9S7bFJ8YfO4+srj9p/U3sIU7E2RtrGTuI6RrbQi zFfE3tzJpaCPiTeXb33+gHrUW8hwJ2I/IW26uurEmJCRLFpXfntUOb0PHfZUYLiPWuOIG5 mW1Sak7ArcP5wFupV7LcaifBEHmt+SPHumwAjhp9KYhouq9Gymt3u8+24EYeOt5fNCGjnb T3MzqjVePWKAQGlM+Mp0U/S3IQCKvZuPLOB74tpeiXMV6Do1ikZ6mYNff4FEdgl2BAueZ9 UmtPHVabF2M6xu5xcMe6n9bPYcxC/futG7kSy8WydgGF/vpZy2M9PPi/4qlb3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754061863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/JTODy3btLW79M9QRvCu+ZrfdXeUR1wiXsF2UN8Rdg=; b=WzLbNEJynndlf+TxrOTxhPwiRb5jTOhMl3zX9nWUuegaZi2c5ZjyeaGP7F4GjEC1iqCLRd N1bHkHLSkvD8qek2RMnerqYXt17sayuH5YdS8jYcY7PrM74iy69DSDzLHJz0UFMjwcwTkf niepQPLHywIcTdbn3npfncCIH//WQS3PIyQPB/k0mZUkvkXcWgZ6VOlf94/qwBwXpUIQuu xo1Te6+6pV1coKynvAC6Rs1hnUqdJnLf+5isslay9WrQfh4r1oXIBYy/wIUJx6S7PlSof0 fu/Zkuq/oaWKgM8rEub97/K9T74vGpRAjBoj4J4sDPX/MB85AApJqn8g3RYU7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754061863; a=rsa-sha256; cv=none; b=PQ+rpcQYRnUYk7a4QUEmYbDdnosoVkV7r+y5IvJaMz4GHgxIdboPi33uWOxR5/VgybHccL KZH91uezzvVvlwMmW3Mkn8IvqO1ZihBH2x6T8Un4IS64tzAw6F3Q2R2RgeneQaoja2B1gl TI8W+CI1XKiLJNTTJHq7JSfD5xV73EdagbRojT3DIv6Y57j4kZJ/QVWMPnaUAt+tFjKYff 9lqPok76AXveIsJRVcPNfzv8jE33E5TooVw39MBrvgWD1O7qf9zF77iOlWrRcZtb2+dKYa +jNS03hP9PUCwU/KKMArGXUyk73Hh5MCZCMQiguqa0Qv/HJyriC1f702/nTHAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btqVv2gjjztJh; Fri, 01 Aug 2025 15:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571FON4O070695; Fri, 1 Aug 2025 15:24:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571FONLG070692; Fri, 1 Aug 2025 15:24:23 GMT (envelope-from git) Date: Fri, 1 Aug 2025 15:24:23 GMT Message-Id: <202508011524.571FONLG070692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1acfb873cf2e - main - dtrace.1: Document security.bsd.allow_destructive_dtrace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1acfb873cf2e59f9ddf53602cbc67fa810c878a6 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=1acfb873cf2e59f9ddf53602cbc67fa810c878a6 commit 1acfb873cf2e59f9ddf53602cbc67fa810c878a6 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-08-01 15:23:20 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-08-01 15:23:20 +0000 dtrace.1: Document security.bsd.allow_destructive_dtrace PR: 288284 Reviewed by: bcr, markj MFC after: 3 days Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51633 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index da8cbd9ffe50..e263b936700d 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2025 +.Dd July 30, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -537,6 +537,17 @@ option is not specified, .Nm does not permit the compilation or enabling of a D program that contains destructive actions. +.Pp +Set the +.Va security.bsd.allow_destructive_dtrace +.Xr loader 8 +tunable +to +.Ql 0 +to disallow the possibility of enabling destructive actions system-wide at any point at all. +Any attempts to enable destructive actions will cause +.Nm +to exit with a runtime error. .It Fl x Ar arg Op Ns = Ns value Enable or modify a DTrace runtime option or D compiler option. Boolean options are enabled by specifying their name. @@ -1265,6 +1276,18 @@ failed or that the specified request could not be satisfied. .It 2 Invalid command line options or arguments were specified. .El +.Sh DIAGNOSTICS +.Bl -diag +.It dtrace: could not enable tracing: Permission denied +This can happen when +.Nm +fails to enable destructive actions because +.Va security.bsd.allow_destructive_dtrace +is set to +.Ql 0 +in +.Xr loader.conf 5 . +.El .Sh SEE ALSO .Xr cpp 1 , .Xr dwatch 1 , From nobody Fri Aug 1 16:09:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btrWg6RCRz62ncl for ; Fri, 01 Aug 2025 16:10:07 +0000 (UTC) (envelope-from 199841@rhotelcentral.emktlw-02.com) Received: from mail2257.delibird-emkt0001.lwdlv.com.br (mail2257.delibird-emkt0001.lwdlv.com.br [179.188.22.57]) by mx1.freebsd.org (Postfix) with ESMTP id 4btrWf4bYMz41VW for ; Fri, 01 Aug 2025 16:10:01 +0000 (UTC) (envelope-from 199841@rhotelcentral.emktlw-02.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=emktlw-02.com header.s=emktlw header.b="KRdqG/iF"; spf=pass (mx1.freebsd.org: domain of 199841@rhotelcentral.emktlw-02.com designates 179.188.22.57 as permitted sender) smtp.mailfrom=199841@rhotelcentral.emktlw-02.com; dmarc=pass (policy=quarantine) header.from=rhotelcentral.emktlw-02.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=emktlw; d=emktlw-02.com; h=Date:From:Reply-To:To:Subject:Mime-Version:Content-Type:List-Unsubscribe: Message-ID; bh=oXrn/ETECN0V0NwLVd1ClUm7pV604SSFuBK5WGAABk0=; b=KRdqG/iFIlce6S0BQFrtzlKyFKUKHDmm5VFzbcstg0Ie+Tac1mVxxa5djc8OPYF4bnhml4xH+Wul zEu7bKYxPQ+xI7zqt9FDKRooKj+Y72Xane93yi9ApZCRnrD5cZ2B3U24vQORthAdXCOmoj59D01K l3sLnk9GeHqjK+4GPMg= Received: from localhost (191.252.190.4) by mail2257.delibird-emkt0001.lwdlv.com.br id hhjjb42n8lgn for ; Fri, 1 Aug 2025 13:09:20 -0300 (envelope-from <199841@rhotelcentral.emktlw-02.com>) Date: Fri, 1 Aug 2025 13:09:20 -0300 From: BRT Reply-To: reservas@hotelcentral-ro.com.br To: dev-commits-src-all@freebsd.org Subject: brtConsolidadora List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_688ce6bf267f1_1d8db3ff60d41880c28142fc"; charset=UTF-8 List-Unsubscribe: , Precedence: bulk x-account-id: 199841 x-contact-id: 3606 x-envelope-id: 2 x-message-id: 2 x-locaweb-id: 7JeUCgYehpPWjLrMV5PPTVFGrjCIgH8bLwkkBZe33e3yGLd-ZpSfSuCBKDmHSeaRrpSxyI17IWKezVIYM_rWlAZlRBTJYasl8Xm2xm1EvdyXrQinkDUCjA74Sz0JZ03XSlB_Y6yTdQx6wWtgDPVMEtbp8ZXxk06PEtphGM1idqmElfjfMEbnivJm24_67302 x-locaweb-id2: NDI1MjU0MjAzYzcyNjU3MzY1NzI3NjYxNzM0MDcyNjg2Zjc0NjU2YzYzNjU2ZTc0NzI2MTZjMmU2NTZkNmI3NDZjNzcyZDMwMzIyZTYzNmY2ZDNl Feedback-ID: 199841:2:c:emktlw Message-ID: <0.9.0.59.1DC02FEA3BB51B6.29F97@mail2257.delibird-emkt0001.lwdlv.com.br> X-Spamd-Result: default: False [-2.11 / 15.00]; URI_COUNT_ODD(1.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[rhotelcentral.emktlw-02.com,quarantine]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[reservas@rhotelcentral.emktlw-02.com,199841@rhotelcentral.emktlw-02.com]; R_DKIM_ALLOW(-0.20)[emktlw-02.com:s=emktlw]; R_SPF_ALLOW(-0.20)[+ip4:179.188.22.0/26:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_NO_TLS_LAST(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RECEIVED_HELO_LOCALHOST(0.00)[]; ARC_NA(0.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[emktlw-02.com:+]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_NONE(0.00)[]; FROM_NEQ_ENVFROM(0.00)[reservas@rhotelcentral.emktlw-02.com,199841@rhotelcentral.emktlw-02.com]; PRECEDENCE_BULK(0.00)[]; REPLYTO_DOM_NEQ_TO_DOM(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; ASN(0.00)[asn:27715, ipnet:179.188.20.0/22, country:BR]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; HAS_REPLYTO(0.00)[reservas@hotelcentral-ro.com.br] X-Rspamd-Queue-Id: 4btrWf4bYMz41VW X-Spamd-Bar: -- ----==_mimepart_688ce6bf267f1_1d8db3ff60d41880c28142fc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Voc=C3=AA recebeu um documento para an=C3=A1lise e assinatura=0D Documento enviado atrav=C3=A9s do sistema de assinaturas do Grupo BRT=0D ANALISAR DOCUMENTO=0D =C2=A0=0D Prezados,=0D Favor rubricar e assinar o Contrato de Presta=C3=A7=C3=A3o de Servi=C3=A7= os, nos lugares indicados.=0D Caso haja alguma informa=C3=A7=C3=A3o divergente, por favor nos informe p= ara corre=C3=A7=C3=A3o antes de assinar.=0D Solicitamos que seja assinado no prazo de 5 dias para regulariza=C3=A7=C3= =A3o/abertura do cadastro.=0D Obrigado!=0D Depto. de Cadastro=0D Grupo BRT=0D Importante Este documento possui validade jur=C3=ADdica e deve ser tratad= o com confidencialidade.=0D N=C3=A3o compartilhe este e-mail=0D Este e-mail cont=C3=A9m um link seguro para documentos do Grupo BRT. N=C3= =A3o compartilhe este e-mail, link ou c=C3=B3digo de acesso com outras pe= ssoas.=0D Perguntas sobre o documento?=0D Se voc=C3=AA precisar modificar o documento ou tiver d=C3=BAvidas, entre = em contato diretamente com o remetente.=0D =C2=A9 2023 Grupo BRT - Todos os direitos reservados=0D Este e-mail foi enviado pelo sistema de assinaturas eletr=C3=B4nicas do G= rupo BRT=0D Se voc=C3=AA n=C3=A3o deseja mais receber nossos e-mails, cancele sua ins= cri=C3=A7=C3=A3o atrav=C3=A9s do link %{link}= ----==_mimepart_688ce6bf267f1_1d8db3ff60d41880c28142fc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =0D =0D =0D Documento para Assinatura - Grupo BRT=0D =0D =0D =0D =0D
=0D
3D"Grupo
=0D =0D =0D
=0D

Voc=C3=AA recebeu um= documento para an=C3=A1lise e assinatura

=0D =0D

Documento enviado atrav=C3=A9s d= o sistema de assinaturas do Grupo BRT

=0D ANALISAR DOCUMENTO
=0D =0D =0D
=0D
=0D
 
=0D
=0D =0D

Prezados,

=0D =0D

Favor rubricar e assinar o Contrato de Presta=C3=A7=C3=A3o de Servi=C3= =A7os, nos lugares indicados.

=0D =0D

Caso haja alguma informa=C3=A7=C3=A3o divergente, por favor nos inform= e para corre=C3=A7=C3=A3o antes de assinar.

=0D =0D

Solicitamos que seja assinado no prazo de 5 dias para regulariza=C3=A7= =C3=A3o/abertura do cadastro.

=0D =0D

Obrigado!

=0D =0D

Depto. de Cadastro
=0D Grupo BRT

=0D =0D

Importante Este documento possui validade jur=C3=ADdica = e deve ser tratado com confidencialidade.

=0D
=0D =0D =0D
=0D

N=C3=A3o compartilhe este e-mail
=0D Este e-mail cont=C3=A9m um link seguro para documentos do Grupo BRT. N=C3= =A3o compartilhe este e-mail, link ou c=C3=B3digo de acesso com outras pe= ssoas.

=0D =0D

Perguntas sobre o documento?
=0D Se voc=C3=AA precisar modificar o documento ou tiver d=C3=BAvidas, entre = em contato diretamente com o remetente.

=0D =0D
3D"Grupo=0D

=C2=A9 2023 Gru= po BRT - Todos os direitos reservados
=0D Este e-mail foi enviado pelo sistema de assinaturas eletr=C3=B4nicas do G= rupo BRT

=0D
=0D
=0D
=0D

Se voc=C3=AA n=C3=A3o = deseja mais receber nossos e-mails, cancele a su= a inscri=C3=A7=C3=A3o.

3D""=0D =0D ----==_mimepart_688ce6bf267f1_1d8db3ff60d41880c28142fc-- From nobody Fri Aug 1 16:34:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bts3J6Yfzz62q1K; Fri, 01 Aug 2025 16:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bts3J5lzhz43R4; Fri, 01 Aug 2025 16:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QR/1dzhYjTD8sqEOqXNv85qkiH1hwFgV0VmLb3EBhuM=; b=m8gT1Y39xu7/1FkY94dfapln5yuer3su1JeuMuMCT0QJRVwHeQ0sIlhz6WPFnSrEiYCwn3 t85gRCg4LVRhEyxX3pI6ya1NLtSkGxcSq7LgZp1FYauEchpb02yldqhUVv3xxJWOuJx2uF NFrNal8sXPdY9rH8Ia3NvIgFAQuRTo91KtKlNmkllVs8795dELvtBZadUqxocRi50BX7xj 2NvLnAUgBVhVsuaKnZAeulxUDXnKFRNWrdO+4neS+yeOfLz8YUvDwaNlSCuAYlLYrVsWUi KwOnvJGOdhSOhDWORsGdo7su83RCPxPakPkDgqTdii6AfwfnsCQLM7mQjVOlEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QR/1dzhYjTD8sqEOqXNv85qkiH1hwFgV0VmLb3EBhuM=; b=eC0QocjOMdUYAyFgoqI+4zYefL1xlTwvk6cl74trcdHr3IlVSh/SPApoVDQCrTHcgHyxyK NlsyRVWz2AALBCwpVFAJiQIKofZLNzY5Trzcqxff5PQ3xA5l4Ww1AKQhOLeimPggwWYhCB D0KJD1K89HlUQKQqAjNhi9j0B/SmkcUo44/p51+rXIwupesjveIxs212EAIPrTcvyiNE9f Ampwk0d94Q+7HHfUtDH3vlue0NQtrjtOSUruompK5aNuqLp+JJekbJXnFGt/0AUidt5KH6 xsxawrzWEfbm9eFe8lJIX/3jm4MQSZ7A2Z30D2osB5xqscyNpce7TwxWoT0YJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754066044; a=rsa-sha256; cv=none; b=MNzeuA6XcuOw5+ncMxMzxUTDw7VoQs4J25NMHbgrSQTRztSQglPl0oWPRyOAxlQ18O36CX ZznWFllgAeKi2vCGZipiIrCDOGnIqp0oZ7yzKavlXKjecAm6IYqNElAavPgJK1Zl4zgK+K LOrdK011nKJZYW084Gm4OsVJL1EtcKbo+vtn4s6qKTF1X6NaIG28zjlC+wZTHLjs2/A/Ql SrSenIbYl2WDDvu3NL/+Jd9j6nPK/Q63wRLOIKvz+JmeicSRFci+vpy8lSHqP5wlyrNF16 Vw89uuMN+lA7+VHbHNjoLD+P8S9fWqaqxI1uz7EclS7mS91GGKB/QuHbDGfTbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bts3J5KTpzvGj; Fri, 01 Aug 2025 16:34:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571GY40i001949; Fri, 1 Aug 2025 16:34:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571GY4lK001946; Fri, 1 Aug 2025 16:34:04 GMT (envelope-from git) Date: Fri, 1 Aug 2025 16:34:04 GMT Message-Id: <202508011634.571GY4lK001946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 8632e4e73a69 - main - ifconfig: Garbage collect unused parameter swabips List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8632e4e73a6934f3f9996a18932e36b04e6a3faf Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8632e4e73a6934f3f9996a18932e36b04e6a3faf commit 8632e4e73a6934f3f9996a18932e36b04e6a3faf Author: Zhenlei Huang AuthorDate: 2025-08-01 16:33:09 +0000 Commit: Zhenlei Huang CommitDate: 2025-08-01 16:33:09 +0000 ifconfig: Garbage collect unused parameter swabips and the macro EN_SWABIPS. The macro EN_SWABIPS is identical to IFF_LINK0 (also historically IFF_LLC0) and we already have the parameter link0 to toggle IFF_LINK0. These were inherited from 386BSD 0.1 and have never been used since the very first FreeBSD release. Reviewed by: adrian, #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51368 --- sbin/ifconfig/ifconfig.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 1a4d062253dd..3f998b7f2b52 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -2094,11 +2094,6 @@ static struct cmd basic_cmds[] = { DEF_CMD("-alias", -IFF_UP, notealias), DEF_CMD("delete", -IFF_UP, notealias), DEF_CMD("remove", -IFF_UP, notealias), -#ifdef notdef -#define EN_SWABIPS 0x1000 - DEF_CMD("swabips", EN_SWABIPS, setifflags), - DEF_CMD("-swabips", EN_SWABIPS, clearifflags), -#endif DEF_CMD_ARG("netmask", setifnetmask), DEF_CMD_ARG("metric", setifmetric), DEF_CMD_ARG("broadcast", setifbroadaddr), From nobody Fri Aug 1 16:34:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bts3L0yb8z62qDw; Fri, 01 Aug 2025 16:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bts3L01FZz43H8; Fri, 01 Aug 2025 16:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u6O63cIyEhbuELxRKU63Wbb27ZeciHDtc517WfQ9KBg=; b=sfosoQaN1TZjyAfImtko2BLrkSPfgaVpNLFrSGUijQJT4VKOpV6W1dduEneLLe7zZ9YrOR LY+hA2BivVW/R8fEnEYLa6wqUQJG92UQXgVIclvflzYietnEQS+7M8KLxl4myfNMia55qy jLdwA5TfeSGZlvaNcUvgZk3AuDNuJHQj7P+Lu9SoiL4+4+SpzvT4MyUZTA+QtCun8vYrCf iQQB8Gy9l6eWzq1H0SclQwTy4/4GIenshG3Cbv+PbEs9k/MXnpDT0FXoCZUgAh706R83YI BLclN2joH5saNLf35i1QpMvEPGOXTCZXhffHk+YThJrYvVTxF0+IfZEkydezEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u6O63cIyEhbuELxRKU63Wbb27ZeciHDtc517WfQ9KBg=; b=XboyeCoHn4/S5BeRWEh8CSe0DR4lDAkDkuo6YGTkSsJYuDL8Yk82OJemFU3kbaG60pPlvj u3ScU8QLK+V+TbIiQUCbGgNjIg68JoRgoQts9YfcAws+i5rc3RG0BjSkBAl1Fs5yw9dni7 dBltCo/cXs3aD7WX7IwEG/hHgTopid4GyCT1k+hB6hDYOM0Tk0QFniGvAeVRkDKVq9hrax cDY0UbU/EVShDV85AtlO09Sa1dgwPJ7uebw85fHlwjmCvafWcUItQnZeHKZ8/j19LtzaoP NKfLpBmvPUw0ii8JzxHIRDOQN4Ag7LmJVlOH7j06dKbWMyDT5h6MjMatIQ2Tfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754066046; a=rsa-sha256; cv=none; b=S8rrws3En7SkIWfFSs8cCra/osMFJzEMI7xV0ajvlCcPbwuDUlbVcePGG8EsIpJ4dNQoHL mG3HBGFvTsPKDGRrIGnq7iJTDO0D1RJMcnXLVY/KtJxq9WVihjAX4o/2Bupf1bPM632lEp 14+AQ1QIZyUyQHhVrwd3BNkPaosu3oMm/6LNythEHb/QGS0VECoQRlT8a/YLX7AuejQiem aubgcCWApqpsVrymEvcTZdprq6GCUiunOJavU9a+fXZRU7rOZnsOn2y76DxPWqFdz9BrIm 3ov3lACbv2nEngFU0X3AuFMgkEjjJcn7ezD/qqexBbdYOrl5bm0BVfWDU12zFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bts3K6bqXzvc8; Fri, 01 Aug 2025 16:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571GY5Jn001990; Fri, 1 Aug 2025 16:34:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571GY5SW001987; Fri, 1 Aug 2025 16:34:05 GMT (envelope-from git) Date: Fri, 1 Aug 2025 16:34:05 GMT Message-Id: <202508011634.571GY5SW001987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 62439516cc9b - main - tests: gif(4): Add tests to cover all IPv[46] in IPv[46] setups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62439516cc9bba32ed2406f340326c4d37e4cc59 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=62439516cc9bba32ed2406f340326c4d37e4cc59 commit 62439516cc9bba32ed2406f340326c4d37e4cc59 Author: Zhenlei Huang AuthorDate: 2025-08-01 16:33:10 +0000 Commit: Zhenlei Huang CommitDate: 2025-08-01 16:33:10 +0000 tests: gif(4): Add tests to cover all IPv[46] in IPv[46] setups While here, rename basic to 4in4 to be consistent with other tests. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51566 --- tests/sys/net/if_gif.sh | 147 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 141 insertions(+), 6 deletions(-) diff --git a/tests/sys/net/if_gif.sh b/tests/sys/net/if_gif.sh index 16b0b1a6fca0..5c7278d17e8f 100644 --- a/tests/sys/net/if_gif.sh +++ b/tests/sys/net/if_gif.sh @@ -26,14 +26,14 @@ . $(atf_get_srcdir)/../common/vnet.subr -atf_test_case "basic" "cleanup" -basic_head() +atf_test_case "4in4" "cleanup" +4in4_head() { - atf_set descr 'Basic gif(4) test' + atf_set descr 'IPv4 in IPv4 tunnel' atf_set require.user root } -basic_body() +4in4_body() { vnet_init if ! kldstat -q -m if_gif; then @@ -65,12 +65,147 @@ basic_body() jexec two ping -c 1 198.51.100.1 } -basic_cleanup() +4in4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "6in4" "cleanup" +6in4_head() +{ + atf_set descr 'IPv6 in IPv4 tunnel' + atf_set require.user root +} + +6in4_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a 192.0.2.1/24 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone tunnel 192.0.2.1 192.0.2.2 + jexec one ifconfig $gone inet6 no_dad 2001:db8:1::1/64 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b 192.0.2.2/24 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo tunnel 192.0.2.2 192.0.2.1 + jexec two ifconfig $gtwo inet6 no_dad 2001:db8:1::2/64 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.0.2.2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8:1::2 + atf_check -s exit:0 -o ignore \ + jexec two ping -6 -c 1 2001:db8:1::1 +} + +6in4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "4in6" "cleanup" +4in6_head() +{ + atf_set descr 'IPv4 in IPv6 tunnel' + atf_set require.user root +} + +4in6_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a inet6 no_dad 2001:db8::1/64 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone inet6 tunnel 2001:db8::1 2001:db8::2 + jexec one ifconfig $gone inet 198.51.100.1/24 198.51.100.2 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b inet6 no_dad 2001:db8::2/64 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo inet6 tunnel 2001:db8::2 2001:db8::1 + jexec two ifconfig $gtwo inet 198.51.100.2/24 198.51.100.1 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8::2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec two ping -c 1 198.51.100.1 +} + +4in6_cleanup() +{ + vnet_cleanup +} + +atf_test_case "6in6" "cleanup" +6in6_head() +{ + atf_set descr 'IPv6 in IPv6 tunnel' + atf_set require.user root +} + +6in6_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a inet6 no_dad 2001:db8::1/64 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone inet6 tunnel 2001:db8::1 2001:db8::2 + jexec one ifconfig $gone inet6 no_dad 2001:db8:1::1/64 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b inet6 no_dad 2001:db8::2/64 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo inet6 tunnel 2001:db8::2 2001:db8::1 + jexec two ifconfig $gtwo inet6 no_dad 2001:db8:1::2/64 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8::2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8:1::2 + atf_check -s exit:0 -o ignore \ + jexec two ping -6 -c 1 2001:db8:1::1 +} + +6in6_cleanup() { vnet_cleanup } atf_init_test_cases() { - atf_add_test_case "basic" + atf_add_test_case "4in4" + atf_add_test_case "6in4" + atf_add_test_case "4in6" + atf_add_test_case "6in6" } From nobody Fri Aug 1 16:41:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btsCL1CKKz62qlc; Fri, 01 Aug 2025 16:41:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btsCK3pBsz44M9; Fri, 01 Aug 2025 16:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGD1ywU6xbcEuYRzyZSlRaY75FOxL7k5FxaaY9BPNhY=; b=VCf6W24HTG1opfhTtIPif92ptrS/ID9AIib4WZPb6WaAnroGWiPY3y0ZKwlUFZwiK1ltB1 fsw+V9AohR3WnyHxYsrpdTiCsJKTJEZmAk2IS1Xh980mihBqVJd/yJ2rQWfv7RjNfi/3gP 8Sy8p1cNFlE1H6sF4xR9bscaOcpmCFFZZ/EduQWEMxS7mV2y8DT3hfEhvXNdIH/MR/GWMp 6DgeeYFcVea0VA7OWyNnQVK77z9SNWnRPV71OOW4GXYSHfDSjYLVuSOcWiwP2wb95uSj// m64Qf2jfYryW2ZnWIpqIQqDJCUpuXlE5X+B0/HjJjXfpVS7qnnFcb2hG8Y/FTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGD1ywU6xbcEuYRzyZSlRaY75FOxL7k5FxaaY9BPNhY=; b=C2U2ZlG3q1VuEhYS1AHqES+XOyhc4UmgQQ2dS0CXvryrT8SM2ZA0oyVHrCnmRyZDdcUpQC XhZFdizAbR30kStUnyqXbQySPdInWBxLZd/j8s1Lp6hf2IEYiLRlR2uV82MUvrKVs+RlOn ZTrkIZ6c0PsZ+tXqQqYAQp6v8IICONpoqd0aL70htFClF92PXEtzuwj6Zm22KRQUIumn0Q zHMrkU/NMp1CaUFI1ZdaZJdL0kbrFkavPpCIDwTXdizLkkbZNr4cm6F1mhVEalNMvKuIWN BL/oqytN+FeCclP4SxLZt805bb/ZOwjUg6Z/bcN3u0rd9MFrAKFP5jyTftjT7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754066461; a=rsa-sha256; cv=none; b=KaC27q2Nyuia0rX0ZNcBiNxeJkfGPwM381OZAIh3rjQaRvPnt+P/Jx47dMeFufhPh0ERLU cW7W/xftW/M2iA1LRVHHhAd9vlDdFdZ70Ti17pQ9RYGSBeyN3zecrIeVle3s+0o/O9YwsK 0lmQenk5FkKUAuT8oYv5kem9k3By6rgTOLNaEkO+W9qqAXN2mhcrED0l+YQsoYsNYu0zGR s57s1UZVyWs4mLmdvq7LB3C6Tox2zvR/dz4ozxZ3duZ0h9W/MGaUKGCyJcgFZcDcU1XtOJ cP+7ZnU1rb2yY90N5DuOiQkAajHIzbCRfqg5WUMtrW1gWf/tRm3++fb765poPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btsCK32fDzvvC; Fri, 01 Aug 2025 16:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571Gf1NC014102; Fri, 1 Aug 2025 16:41:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571Gf1wS014099; Fri, 1 Aug 2025 16:41:01 GMT (envelope-from git) Date: Fri, 1 Aug 2025 16:41:01 GMT Message-Id: <202508011641.571Gf1wS014099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: d5ec97156d33 - main - amd64: include opt_kstack_pages.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5ec97156d3314f979629968f76151c2d35a1e62 Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=d5ec97156d3314f979629968f76151c2d35a1e62 commit d5ec97156d3314f979629968f76151c2d35a1e62 Author: Ka Ho Ng AuthorDate: 2025-08-01 16:29:58 +0000 Commit: Ka Ho Ng CommitDate: 2025-08-01 16:40:54 +0000 amd64: include opt_kstack_pages.h This fixes an early KASAN initialization panic in pmap_san_enter_early_alloc_4k, when a non-default value is specified for KSTACK_PAGES in the build config file. Also, rearrange amd64/locore.S's #include order to match the counterparts of other architectures. And amd64/locore.S now also explicitly include opt_kstack_pages.h as well. Sponsored by: Juniper Networks, Inc. MFC after: 7 days Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51676 --- sys/amd64/amd64/locore.S | 5 +++-- sys/amd64/amd64/pmap.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 2be555b25160..62f5ee2a6998 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -30,13 +30,14 @@ * SUCH DAMAGE. */ +#include "assym.inc" +#include "opt_kstack_pages.h" + #include #include #include #include -#include "assym.inc" - /* * Compiled KERNBASE location */ diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8df082f6c5dc..6369498210d9 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -104,6 +104,7 @@ */ #include "opt_ddb.h" +#include "opt_kstack_pages.h" #include "opt_pmap.h" #include "opt_vm.h" From nobody Fri Aug 1 16:49:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btsNY5g0Wz62rGJ; Fri, 01 Aug 2025 16:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btsNY3Lxdz45Hq; Fri, 01 Aug 2025 16:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q4DjLSmfXmhSHXArDgd0IxTTnxVa9+skBKaDKeUfg3U=; b=N3hE5AylsYIN6fNCS4olMg6MphGxR8uHvT3fV+jwPbw7hK1nSvWIsPua8WEKFDeDpaKPYb zLal7fNvNBNf8l/QGvgz/w1djuZ3e5lLegmI4HJ1Iot6T9ZCYXTCzJndtz5i63lxs9Bt7C 0g5ohDdgw6YgEXv5VQNwmaciAqezaOkjV455grWtBPRDdcPhFnZIGoNMjyPYO5Hb5+8qz6 ZN67IBwY4D7fsFQUCnwNcS7JnQ1YOmOEXbSj8gVE8golchQgwDVRtkLrg3JPw/ltp4eWt3 lnzQN88yGw+KduKXkNzrqLVLsoP4191ixX1UIAI2+/KTbSs/siWo5oxtgLki1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754066941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q4DjLSmfXmhSHXArDgd0IxTTnxVa9+skBKaDKeUfg3U=; b=DejiQbGH6gLJhn8qhHDHql/aITALPw/2TLNXPlJPwV5SPNo8vBLr/8uIYCCV5ChzQuUfFZ 51InWVY8u8TqVMi5ghyigUvcJbdKhSlf7LESylfLCy9VSUn3HuU3knmr3NnNzCYN6kOzQz UGdTWyqx0/mCG9gXBl18VcvPBIg6UfsBBq4YQ/VH1bFXV4nFUr7lZqKyVuwJfjUNUUIQ6l eC9CQ2oOcMCecYEVPlJ9Sh1ZQf0TQ/p2J6X8O4fd/bIl3u5jrA5bJMfAogDZ8dyAXrIxz/ FW2hXOqLrV92RSzf23gqfm+NciOoDEd9+/paZ8bwRYYZkE9N8A2j1NF0FzqLmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754066941; a=rsa-sha256; cv=none; b=yF11ufjTh+tPkPOV7bsPLxhLqeqSLNgOXtua0nKio3VBt/b+IadvUPuuOwbKon/imrUc2X 302lW7ru8M4IiLcfSn/IYh9Z4uTHwKANnnrI/Qk/4VTHOGPQg8UpS/w5ifB4rexI4VtgUC oCiDI2Xk6lKkYTjoolI1wTg+m04dQ9vvqwz6Rx3T7B7tL9JUda40ah9rdeJHFMpsYIyaEt XsTBSsLGZSUsq/hsKQ+7ieUNjULRRhJmM8wtMsjEThaWAnFUVmhFzs66QwIO+3/CTXkEKL CRxp590FdnifLpfxQHeyFZK5ocJE6wX1S0rVWnxH81xo1AMZViqRm5P44mTkxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btsNY2PJnzwHM; Fri, 01 Aug 2025 16:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571Gn154023129; Fri, 1 Aug 2025 16:49:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571Gn16q023126; Fri, 1 Aug 2025 16:49:01 GMT (envelope-from git) Date: Fri, 1 Aug 2025 16:49:01 GMT Message-Id: <202508011649.571Gn16q023126@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: 011efaa5cd24 - main - devfs readdir: handle short buffer same as UFS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 011efaa5cd246a67bbe6e37364baa18178a9f7bd Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=011efaa5cd246a67bbe6e37364baa18178a9f7bd commit 011efaa5cd246a67bbe6e37364baa18178a9f7bd Author: Konstantin Belousov AuthorDate: 2025-08-01 08:22:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-01 16:48:53 +0000 devfs readdir: handle short buffer same as UFS Return EINVAL if this is the first dirent encountered with the short buffer, or EJUSTRETURN if something was already copied out. This is needed to pass eof check in vop_readdir_post(): we are not at eof but resid was not advanced. Reported and tested by: pho (previous version) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51667 --- sys/fs/devfs/devfs_vnops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 1d744e6593c0..3a64c205186f 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1450,6 +1450,7 @@ devfs_readdir(struct vop_readdir_args *ap) struct devfs_mount *dmp; off_t off; int *tmp_ncookies = NULL; + ssize_t startresid; if (ap->a_vp->v_type != VDIR) return (ENOTDIR); @@ -1482,6 +1483,7 @@ devfs_readdir(struct vop_readdir_args *ap) error = 0; de = ap->a_vp->v_data; off = 0; + startresid = uio->uio_resid; TAILQ_FOREACH(dd, &de->de_dlist, de_list) { KASSERT(dd->de_cdp != (void *)0xdeadc0de, ("%s %d\n", __func__, __LINE__)); if (dd->de_flags & (DE_COVERED | DE_WHITEOUT)) @@ -1494,8 +1496,13 @@ devfs_readdir(struct vop_readdir_args *ap) de = dd; dp = dd->de_dirent; MPASS(dp->d_reclen == GENERIC_DIRSIZ(dp)); - if (dp->d_reclen > uio->uio_resid) + if (dp->d_reclen > uio->uio_resid) { + /* Nothing was copied out, return EINVAL. */ + if (uio->uio_resid == startresid) + error = EINVAL; + /* Otherwise stop. */ break; + } dp->d_fileno = de->de_inode; /* NOTE: d_off is the offset for the *next* entry. */ dp->d_off = off + dp->d_reclen; From nobody Fri Aug 1 17:10:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btst15f8cz62sYR; Fri, 01 Aug 2025 17:11:05 +0000 (UTC) (envelope-from phil@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btst04VcFz472y; Fri, 01 Aug 2025 17:11:04 +0000 (UTC) (envelope-from phil@juniper.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=juniper.net header.s=PPS1017 header.b=0+wVOYzM; dkim=none ("invalid DKIM record") header.d=juniper.net header.s=selector1 header.b=hN+adVa1; spf=pass (mx1.freebsd.org: domain of phil@juniper.net designates 208.84.65.16 as permitted sender) smtp.mailfrom=phil@juniper.net; dmarc=pass (policy=reject) header.from=juniper.net; arc=pass ("microsoft.com:s=arcselector10001:i=1") Received: from pps.filterd (m0108157.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 571Fn8Et017757; Fri, 1 Aug 2025 10:11:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=PPS1017; bh=+/ v3UTYI56ONzRGwB5VthAwS3SJ97jpdAvpqxHScy7w=; b=0+wVOYzM95cq2Gm5Ud dW7V9uIqFWShPsu0RJT03kncqVoIyUwsisBgydeXz75Y5JG2PeWuKr87+ARk6rK4 nmITE6d21ed7vgM4Qo1Mb83qQmBabgqxoj+AsJjKBCSygiftC7G1qQeEBn6Bmbei wkUiDa9KPc+rqpZ52Ri9hLKMRbki0wX0MjGBHFrYIG0WKP8fNH/PhxcquiStwtXY 5JvUrIjXzhdBV4vMMwXbsaD1njHMBiKq5TAJX4QM3r9QdKsyjTZqjZlepzmOEuKs rA2vFM0NcLLMNnfL+AKCbLSVeM0549adIk3u7HOp+WO+qjr2daxz8/1ndQ15VIcf 8vMQ== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazon11022106.outbound.protection.outlook.com [52.101.43.106]) by mx0a-00273201.pphosted.com (PPS) with ESMTPS id 488ssjs2ky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 Aug 2025 10:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e7jOHAlQIzw7ZTPJOMQoXqNtdyT5mxA2jI2Hl85YHf6RsyS/iktsrsFOOjMnlekspOb7r9/EqWWDRhBCibbLd8Ic/Aj7WmS1b/LIUrYPdgnhVBZ+z+kMEKKmfcUeZX/ymLjyWG0WEOISncjWaAe+1vXG5EDSz+fXWL5GYsyfLPUALBrja+9h30TkqkErMX4ab559x52JyQTr8pnHqGkxTPd70RrW2fHMzFq2mIFz88PpMB49mCLWQnVVNXwVGhP5nNPsRq4Z4/NnVcPxdGf+JiPyR364g4P1ZNWS9XSOgzIHnyjgaNS3AGq91kk5bArDNrOuDldvX5QSrChaLynLtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+/v3UTYI56ONzRGwB5VthAwS3SJ97jpdAvpqxHScy7w=; b=G+wiUXPKblZLF/uYx/H4dvQV39uxPjEj7Zf2nYBz8UjalWRo/YB6iNhakb3PkqPqyhj4dNI6oCLJAX7y2PE7mP8flLP+D+q/dYbRGGL9b7lYaGXR05H4Pe5fTond9LX3cTNSrpr8E+HElzyhWNkCy5Sq8l6/vgkJAzA1y5/xbFL5nlYfCvzfm39B+PjcuBTbTTYG2zCC/8RsxGY6qKWKn1nSsB4/EHuXFKOg5lemdIDVKeSMoaaLgk5Y55GLtw5RZhKpIUA1cf/nC742UJQEk9H0fVQZC/Nvp5051p5tUxtnewdXXZCVdMZl2+b93BLeDipT93JblHKlHm10/64Tpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.15) smtp.rcpttodomain=freebsd.org smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+/v3UTYI56ONzRGwB5VthAwS3SJ97jpdAvpqxHScy7w=; b=hN+adVa1PFedn7Kc2BZQmPS2iY2iPTjUEmFsEENwL/Zgoc7agU+cHjUMlREbvuPeTmhajU0Ax9Rr0B9V2Hoq8YZd0+KVFTinnEJVqCZN9F7QLoA/X0r9k7VOGhayqL1m6BiQwgt5BFaXwkgRTwdJ67+EQb7ETBduxSL9MSwkv+M= Received: from PH8PR05CA0013.namprd05.prod.outlook.com (2603:10b6:510:2cc::13) by SA1PR05MB7918.namprd05.prod.outlook.com (2603:10b6:806:1a4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.14; Fri, 1 Aug 2025 17:11:00 +0000 Received: from CY4PEPF0000EE39.namprd03.prod.outlook.com (2603:10b6:510:2cc:cafe::19) by PH8PR05CA0013.outlook.office365.com (2603:10b6:510:2cc::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9009.8 via Frontend Transport; Fri, 1 Aug 2025 17:11:00 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.15) smtp.mailfrom=juniper.net; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from p-exchfe-eqx-02.jnpr.net (66.129.239.15) by CY4PEPF0000EE39.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.8 via Frontend Transport; Fri, 1 Aug 2025 17:10:59 +0000 Received: from p-exchbe-eqx-02.jnpr.net (10.104.9.15) by p-exchfe-eqx-02.jnpr.net (10.104.9.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Fri, 1 Aug 2025 12:10:58 -0500 Received: from p-mailhub01.juniper.net (10.104.20.6) by p-exchbe-eqx-02.jnpr.net (10.104.9.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Fri, 1 Aug 2025 12:10:58 -0500 Received: from idleski.juniper.net (idleski.juniper.net [172.25.4.10]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 571HAvau013125; Fri, 1 Aug 2025 10:10:58 -0700 (envelope-from phil@juniper.net) Received: from [10.0.0.3] (localhost [127.0.0.1]) by idleski.juniper.net (8.18.1/8.18.1) with ESMTP id 571HBCaa002316; Fri, 1 Aug 2025 13:11:12 -0400 (EDT) (envelope-from phil@juniper.net) From: Phil Shafer To: Alan Somers CC: , , Subject: Re: git: 7b35b4d19630 - main - sockstat: add libxo support Date: Fri, 1 Aug 2025 13:10:55 -0400 X-Mailer: MailMate (1.14r5937) Message-ID: <8F928557-328D-46E9-BB53-BDE216693BFC@juniper.net> In-Reply-To: <202507302027.56UKRhb5011315@gitrepo.freebsd.org> References: <202507302027.56UKRhb5011315@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE39:EE_|SA1PR05MB7918:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a023290-e152-45a1-1906-08ddd11e62df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1WsJVGagiRQo9HZ9TNT/aLjgNMzR8wJI0K+nZaObX12b4J7RHhXnGEuYi1tH?= =?us-ascii?Q?6SpPHd5GfKmA8ETB5InKW4j6KPN2ioJ//um+FsHvhqe2OURU9/wFi2RRnhR0?= =?us-ascii?Q?nrFpuDCoqNPvrvmP+PSQB5tWt8iiJS1Cjhmo9WoO15OMH/uyKFssdBOboxwX?= =?us-ascii?Q?fPm8yUsVKzrDjiEl3AbZoH3rLAnr57Wk+GUTEBS+ggAN4/Y1vMmH0kr63L7R?= =?us-ascii?Q?thf+C0Ae/Wu/kXSnJU0WoNcBLPhs3p5NfdIroS+H8UBdAGHlNo73/TReeT/n?= =?us-ascii?Q?LAK7wO7ftoW3+rvlSW2W1KMRYJtZYxabKGiH4Zl66+wXeVYROGk3TvKrtvSh?= =?us-ascii?Q?M3Ju0rqzNsyA5ZB3bfTiv/9bDzO6i/A3bp1dcsvVh6pBWkYKCDH/d0s2w5ms?= =?us-ascii?Q?USfjzn6yfKBDUR7+devHwH1nVOtdVlXN8IDwFvyn507qQ+NPnih8hTZbJHvd?= =?us-ascii?Q?j1l/FEZX70vTT1+XZxce/wDqO+WC9YKtAQDDsqcKvFb0eu+LNFUWp5YdHdzg?= =?us-ascii?Q?ZzD8dT2o1/NN6QRf/UOKMxlT+Oy7w6gnOJiyyli/+E+Y38OPVE39L6S6/7aV?= =?us-ascii?Q?6NM3QxVskWv3+k2I7HAjAP3FRBY3cNU/0aXvVqXgcPvPtvdAaDzVz54Nn8ML?= =?us-ascii?Q?Tnx2SgXQMzipBCwJouV7sGkFcVQbdH6PkE+noFKoH/rk1EzL1ssWjKad+Ck3?= =?us-ascii?Q?oCxCvzbpvVMPLV0RztQUFEF/ulSznbY+wTCpvvRthMnCzvWMOxcXtIFbHGKk?= =?us-ascii?Q?/JmqAmE5lCK4HR/ro7tAOfmUljHXLCoV+UQQaVnbrTe2MiCOMh17t5R72zNd?= =?us-ascii?Q?KQSY6N6gq2BOt19jFoebYY8y9wg/xNWO5uQeTK2TtFUYv7tCDW2TGamyvtW/?= =?us-ascii?Q?63c8brd/XzXbBDFjNN4WA/f4T5T1IDNyCHOxMXFQcYRR0EfqfaAAj1FwDo0C?= =?us-ascii?Q?Wta3Ck3FGImTSCAKpB51BTLqaDWGWuWHdmfzfzpwbYNd11J8rsK+54LByRLS?= =?us-ascii?Q?M4JYbzr4BVcW23pOI4Kf5TohzbWVhGGrmjZca/h3x4KDVQ+4d10Za9mx8f4v?= =?us-ascii?Q?3AUAVWTqzFhCHKfVIXi92b7gcGvq7FeCkM0uG9N3lDEukLs7dtuOlKfrDpT8?= =?us-ascii?Q?EB315dPEY7sYC9AULQCeEr0t3LWNgxJ399CEjqYO3VuNPgH+HcFYI3pWD1VJ?= =?us-ascii?Q?f/X5U11wAEb5zv/KU/MfTeAEMIx0+I0ubfSDKTeT7RxGsEGx+POeg86B0Dyx?= =?us-ascii?Q?UiLv6iYiBt3yN2njOksPN8GaZAdiLTx2RrDxUJsa6QqHFFsqw+rexlYxIAr8?= =?us-ascii?Q?HhbzLNxFYXYNUY7P2vfGOdCZYOLVoATSaM7XrZnahOz3gGnaekJzDumT6Kk0?= =?us-ascii?Q?CGA+IQY7fN4XHtzAQ5mntqFm44tGTqLWFh1rEfrU+mfbR0Exf9vd8ScXt5x3?= =?us-ascii?Q?V+zUgW6+aqHTKUQmUt/BFi8B/Lu2QdZb9ZTi36UBct7un1kVaWps+ZHQ+5n2?= =?us-ascii?Q?cCi9pWbPmVXP19bqJJgeaX6X3TSigHRpC7ZW?= X-Forefront-Antispam-Report: CIP:66.129.239.15;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:p-exchfe-eqx-02.jnpr.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1102; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2025 17:10:59.3889 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a023290-e152-45a1-1906-08ddd11e62df X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4;Ip=[66.129.239.15];Helo=[p-exchfe-eqx-02.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE39.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR05MB7918 X-Authority-Analysis: v=2.4 cv=bOUWIO+Z c=1 sm=1 tr=0 ts=688cf526 cx=c_pps a=6iYJ5OEDqVuPLaleVyjC8A==:117 a=YQU41r7WENJiSYrYYNJVsQ==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=h8e1o3o8w34MuCiiGQrqVE4VwXA=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=2OwXVqhp2XgA:10 a=s63m1ICgrNkA:10 a=rhJc5-LppCAA:10 a=2a77PQvT4v1nvKM8looA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODAxMDEzMyBTYWx0ZWRfX9MH41BT0ZtvO lttZSuWmTQQoQoN+3uGLz/Dh8/g8tAtV+fV+ygjpIR58aRLNUhe73UVIhqyKZUowcymWRpkqqOY hNH+AYtl7NGU0VMcgvkvDiC/mxgAqxGRcQD+vRE2LAzFq45A8HFG55et4dVzwo9tm0GC4jjWDdG ri58AFhZvdCcZqW96stilW0hHNQBG8JBw+bbuY/BPp2Q1mligMLXQYCLttDWKTGkxffEVHjG+dJ AwTF8E+gzBh36SHFwTgignCalff2T7YpMlE28MZDx5RNkTA+f19bvLCtfD82Ybdjev6vzqVh3R0 r2NHMyM26VoZub1z1soIA0Mz7Ly5Eia1IX7qqtnZgi5xERory83Gc4YehxQLM1/CS33zrBoFvYS oTcoPISQy3t43SsHlbQB2Tt6ePlUnkBzgO1hrgCOdBRfdVRRLtmjV9xLReH6Z0nIunvjb8MZ X-Proofpoint-ORIG-GUID: wbwsFf0NeyNKfXR4NgM2o8XSdsxc-YOE X-Proofpoint-GUID: wbwsFf0NeyNKfXR4NgM2o8XSdsxc-YOE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-01_05,2025-08-01_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 clxscore=1011 adultscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 phishscore=0 impostorscore=0 bulkscore=0 suspectscore=0 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2508010133 X-Spamd-Result: default: False [-4.60 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector10001:i=1]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017]; R_SPF_ALLOW(-0.20)[+ip4:208.84.65.16]; RCVD_IN_DNSWL_LOW(-0.10)[208.84.65.16:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_PERMFAIL(0.00)[juniper.net:s=selector1]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[juniper.net:+,juniper.net:~]; RCPT_COUNT_THREE(0.00)[4]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; ASN(0.00)[asn:26211, ipnet:208.84.65.0/24, country:US]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[phil]; DKIM_MIXED(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[52.101.43.106:received]; RCVD_COUNT_SEVEN(0.00)[9] X-Rspamd-Queue-Id: 4btst04VcFz472y X-Spamd-Bar: ---- This looks good. Some issues below: On 30 Jul 2025, at 16:27, Alan Somers wrote: > @@ -1345,65 +1380,104 @@ display_sock(struct sock *s, struct col_widths= *cw, char *buf, size_t bufsize) > ... >> + } else if (laddr->address.ss_len =3D=3D 0 && > + faddr->conn =3D=3D 0 && is_text_style) = { > + xo_emit(" {:/%-*.*s}", cw->local_addr, > + cw->local_addr, "(not connected= )"); > + } else if (is_text_style) { > + xo_emit(" {:/%-*.*s}", cw->local_addr, > + cw->local_addr, "??"); > + } These calls are missing a field name; you should have seen warning for th= is, something like: foo: missing field name: %-*.*s ?? You'll need something like "{:local-address/%*.*s}". Please be sure to test with "--libxo:W", which will report many issues. = Also there's "xolint" for checking source code. Longer term, I'd like to make some sort of clang plugin to report formatt= ing issues at build time. > @@ -1436,47 +1510,52 @@ display_sock(struct sock *s, struct col_widths = *cw, char *buf, size_t bufsize) > s->proto =3D=3D IPPROTO_TCP) { > switch (s->proto) { > case IPPROTO_SCTP: > - printf(" %-*s", cw->con= n_state, > - sctp_conn_state(s->= state)); > + xo_emit(" {:path-state/= %-*s}", > + cw->path_state,= > + sctp_path_state= ( > + faddr->= state)); > break; Is the change from conn_state to path_state intentional? > + if (xo_get_style(NULL) =3D=3D XO_STYLE_TEXT) { > + cw =3D (struct col_widths) { > ... Here and elsewhere: when you check for XO_STYLE_TEXT for formatting, you'= ll also care about XO_STYLE_HTML and other future styles. I have a funct= ion in libxo that's currently private/static: /* * Indicate if the style is an "encoding" one as opposed to a "display" = one. */ static int xo_style_is_encoding (xo_handle_t *xop) { if (xo_style(xop) =3D=3D XO_STYLE_JSON || xo_style(xop) =3D=3D XO_STYLE_XML || xo_style(xop) =3D=3D XO_STYLE_SDPARAMS || xo_style(xop) =3D=3D XO_STYLE_ENCODER) return TRUE; return FALSE; } I can make that public, allowing you to say "if (!xo_style_is_encoding(NU= LL)) { ... }", but for now, you'll need to explicitly test for XO_STYLE_H= TML. > + xo_error( > +"usage: sockstat [--libxo] [-46ACcfIiLlnqSsUuvw] [-j jid] [-p ports]\n= " > +" [-P protocols]\n"); > + exit(1); I don't have a real convention for this, but maybe "[--libxo ...]" would = convey that there's content with the option? Thanks, Phil From nobody Fri Aug 1 19:24:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btwrP6H5zz631LX; Fri, 01 Aug 2025 19:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btwrP5K33z4L2Y; Fri, 01 Aug 2025 19:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754076293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vn+4EQ0BwrMMTtD/d3FcCbFAtZ6drGNveAMnTYCn0V0=; b=XfWe7fQ/OcQSieSbK2CFNeKO/D4pRdEyT7y2Rkf8/0SIH5HTYI4OwCjGl/oSxlz/vq5hZX vkbbwnOu1GlxNeC35bMbN6LLfb3QhqOaNnhPXhSMQoOW7BXyCjBHgCM9VEH968hqtn0CFt mr3GwGUGSM/WigGZfXkU2shHuZnSjox60x0b7zd5aqn8CUnTBJjexi3cGShZnDcn+0huUh ZOinXDELXqE/jTll+zGmweob0OQKwv0RIjdpujpLXW2ptxRI/wASYuyev4zvZ4Pxnr0beG oy6Lz3IMvKwplL2h0izszHOb8bOupEsFeqnL7djdikw9SfWNmfHCNrXZ2Ag4gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754076293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vn+4EQ0BwrMMTtD/d3FcCbFAtZ6drGNveAMnTYCn0V0=; b=IAgsNBf3mrq+u6RGCNYYkDXWIfydeH8jmYUZXsiLmHqiKS1FZD8XNjZF8Xmj4Kcsb55MqD Zb2gmtjoH+Yrje5ED4p9G74FEQiaeWP+X2JyGyZxUwpbH+dHS6ta6K4r+6T0AsBzTmFH4m oIdAdzKrsjIzaEpp/3s/h1DtTiSFixIDp4nbiVbX5pe3cnKgJO8vCkdw961pfxZ0hyST1w Rx0k9FBT4IYP3wdTD2EJZWVv1KXdSvhGui53GPWE9cHHGOqrmU80k5UiUJcAedFe/lpaTt 0ujOUWJey9v15HzIJPLQtKRoacC8fpeI/K+w4jWTd+03dvji9a2Pc80IEvx1hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754076293; a=rsa-sha256; cv=none; b=jJiN7m0Ju8Fz3z6ykZ4NP1rBs7GAigS8i7EhFOGny+B2Zws78BRbe77SlKag6fu02/bHi6 SR/tVsMSIShMYtME7O3CDqsqCEyRKCXxM+oWTOxbY/EtiP3csrwwvj5QwuOdMQg89LIs7H DdKN+tTWf4E78kL6JVCT3Nw1gf6i6zBFpo2rdVj2CvPUFNJne1s+YJaYBOstRgP9+tKaTV +s8c+SibdY6kLub81J2/jY5TUwniMPMxHkcs3bn8Yacpk9f20nsycXe7Mp1kkUkVJOSw4y AWN8y9Lf1NqKn0yLo6/oh7cZM4S9DMZVIhHP2x+7NB+EFgz5A7B7EFQX6SnCFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btwrP4NCnz11HM; Fri, 01 Aug 2025 19:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571JOrgl020472; Fri, 1 Aug 2025 19:24:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571JOrg3020469; Fri, 1 Aug 2025 19:24:53 GMT (envelope-from git) Date: Fri, 1 Aug 2025 19:24:53 GMT Message-Id: <202508011924.571JOrg3020469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 79059e0ec9b1 - main - tcp: Fix wrap around comparison bug List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79059e0ec9b1d3273ce32fdd028802fcad4b85ab Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=79059e0ec9b1d3273ce32fdd028802fcad4b85ab commit 79059e0ec9b1d3273ce32fdd028802fcad4b85ab Author: Nick Banks AuthorDate: 2025-08-01 21:21:42 +0000 Commit: Michael Tuexen CommitDate: 2025-08-01 21:21:42 +0000 tcp: Fix wrap around comparison bug The variables p_curtick and p_lasttick are not in usecs. Reviewed by: tuexen MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_hpts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 22fc99496d34..b77ebc928809 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1163,8 +1163,7 @@ again: hpts->p_wheel_complete = 0; HPTS_MTX_ASSERT(hpts); slots_to_run = hpts_slots_diff(hpts->p_prev_slot, hpts->p_cur_slot); - if (((hpts->p_curtick - hpts->p_lasttick) > - ((NUM_OF_HPTSI_SLOTS-1) * HPTS_USECS_PER_SLOT)) && + if (((hpts->p_curtick - hpts->p_lasttick) > (NUM_OF_HPTSI_SLOTS - 1)) && (hpts->p_on_queue_cnt != 0)) { /* * Wheel wrap is occuring, basically we From nobody Fri Aug 1 20:09:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btxqc098dz633f4; Fri, 01 Aug 2025 20:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btxqb6HFcz4Q3k; Fri, 01 Aug 2025 20:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754078955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gWBwtcursSAmCQwcHX/HOIQ7SxNRB+0i8Qu7Uqfo4GU=; b=toJ7Hoy5hftBfyCyAxfOjxuo4B3ODaq5oPjCIA5CwkoMvo9e3KYmSetywI2yt77pswKTDG 2ew2+8ns0YIorox1WCFGjdM9/3G4BAn3vGEGTJ2UCXpEQEu7WfaEt6rkc66JeW/oDlm3vv WtXlDltjb4FrK/DsCVSH4/5I9EoywxxLGOd5wcEyeJ3x/Orcx/+WAxqWjJsRjDS/cT/4ut 6QVzJBGuntweuCbr/pSEVRR+y6XzdIybN8b7UnudSVg+vY51pDJmJnk0t1c3YhsLc+G7QF 97cB+RyqCA/bi2bn4ehNiklhb5e6/QnWTL/J/8ozd5RfaQC9FOIDZFdVvDVbIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754078955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gWBwtcursSAmCQwcHX/HOIQ7SxNRB+0i8Qu7Uqfo4GU=; b=QUbNcM5U1wYLp9YaLhE0l5OrU8hOs0cIeEYD8oyX7bSYNer7G7mjzMvVFIDZTVGecCNdLW /RJLTAp0MYNBxMPKT5Y7znkzwgCnNqI7oKtWH9D//CqKMQY6YahYINFr2n0oGArY9Nx9vh J6b8rqFdYOOFYLdmOTySJCHv9UUkt7P6LDiZoM/fgWUP+icnFLmwPyxy9F3SaaNKchgc6Y Z706IiO7wmiUDNbgf9uwWDFUJXrsTVAcAA+KmMR6hALwHkT+Y+kHk0lu1JpfYdWiEZtG3A 2e5QY7BKAIhnL9iHuQCX6ngno61koYY9zgRa3emuixaSTeCQlREDarmgkXxgvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754078955; a=rsa-sha256; cv=none; b=vNIwXNinubR4vmERUzA0bbz9vWCS+YR4TcC0eb6aSCV6pHyIob3mVRz55Hbll6tN2gsBme TcmpsszP+BXBI+UsuJDSBKfaJQRPZYR7UkvNU8vm8NiambbYHD+uUSdxjjA6NkztDEPvxO yYAHaWEpmCBVR7zSjNpu40pXVnv/3/IsmS8WHuE0wuj563GjgJ4awMAsrLsshrLQ7ATp1A EWqybw5JNl3lZbGn4WlIRJKuhMkPNUQrLqrfeDOPYyBrtXluc6MzKEC6Ap69ZjhBON0KqT RtZPov0elW/x20Yn7GjgMiwm62BTiSOhFLDqGkI0PjclZWfQGYSbVfqijc1Sow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btxqb5nYKz12kq; Fri, 01 Aug 2025 20:09:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571K9Fnn097695; Fri, 1 Aug 2025 20:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571K9FBP097692; Fri, 1 Aug 2025 20:09:15 GMT (envelope-from git) Date: Fri, 1 Aug 2025 20:09:15 GMT Message-Id: <202508012009.571K9FBP097692@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: 96a550e9dd89 - main - genet: Add a detach routine List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 96a550e9dd892f24a479da00ead93fbfaafb7733 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=96a550e9dd892f24a479da00ead93fbfaafb7733 commit 96a550e9dd892f24a479da00ead93fbfaafb7733 Author: John Baldwin AuthorDate: 2025-08-01 20:07:30 +0000 Commit: John Baldwin CommitDate: 2025-08-01 20:07:30 +0000 genet: Add a detach routine PR: 288309 Co-authored by: Mike Belanger MFC after: 2 weeks --- sys/arm64/broadcom/genet/if_genet.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/sys/arm64/broadcom/genet/if_genet.c b/sys/arm64/broadcom/genet/if_genet.c index 182b5582fb7c..013573f1551b 100644 --- a/sys/arm64/broadcom/genet/if_genet.c +++ b/sys/arm64/broadcom/genet/if_genet.c @@ -201,6 +201,7 @@ struct gen_softc { static void gen_init(void *softc); static void gen_start(if_t ifp); +static void gen_stop(struct gen_softc *sc); static void gen_destroy(struct gen_softc *sc); static int gen_encap(struct gen_softc *sc, struct mbuf **mp); static int gen_parse_tx(struct mbuf *m, int csum_flags); @@ -379,6 +380,39 @@ gen_destroy(struct gen_softc *sc) } } +static int +gen_detach(device_t dev) +{ + struct gen_softc *sc; + int error; + + sc = device_get_softc(dev); + + GEN_LOCK(sc); + gen_stop(sc); + GEN_UNLOCK(sc); + callout_drain(&sc->stat_ch); + ether_ifdetach(sc->ifp); + + /* Detach the miibus */ + error = bus_generic_detach(dev); + if (error != 0) + return (error); + + /* clean up dma */ + gen_bus_dma_teardown(sc); + + /* Release bus resources. */ + bus_teardown_intr(sc->dev, sc->res[_RES_IRQ1], sc->ih); + bus_teardown_intr(sc->dev, sc->res[_RES_IRQ2], sc->ih2); + bus_release_resources(sc->dev, gen_spec, sc->res); + + if (sc->ifp != NULL) + if_free(sc->ifp); + mtx_destroy(&sc->mtx); + return (0); +} + static int gen_get_phy_mode(device_t dev) { @@ -1805,6 +1839,7 @@ static device_method_t gen_methods[] = { /* Device interface */ DEVMETHOD(device_probe, gen_probe), DEVMETHOD(device_attach, gen_attach), + DEVMETHOD(device_detach, gen_detach), /* MII interface */ DEVMETHOD(miibus_readreg, gen_miibus_readreg), From nobody Fri Aug 1 20:20:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bty4c5Tlxz634KV; Fri, 01 Aug 2025 20:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bty4c4kcJz3CW7; Fri, 01 Aug 2025 20:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754079632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f6uOXJ4LwgfUsnWPOuIBfkmoZ5W0RwsqAz9/siBH6F0=; b=nRg5lPuhGggbhJnGyxv6sQ87LYmnMjnK5TQ++eaukJnyebyagn205qpB8Flv11twFxf4UW 9+eMULPm14tMnQspBuyrVec0BhrjZd2zuPyz6Gp6Hs7w01l5bQnvcj5v5/q0pMNRwkl9l9 Q39dEgI8L+It8tDx7S35NkfN6M3XDwgCOKYbxe5LhpjzXS4zp0rhVOk+gipDHxJQDxl7oz Ldu5K/UUrAi/BjDhJVAAIrouUYwMhzBo+KR9Xm+DC0637mH6MvknJJak+n8B1Za0fLblZ6 0G1DYTL8uvfuk8aAwp65bVALfBju/xcLWwkwozystNmRCLAJFChMkH/+3LvDVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754079632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f6uOXJ4LwgfUsnWPOuIBfkmoZ5W0RwsqAz9/siBH6F0=; b=ssJQAQybQmgUWdUAy96L4LCNQNKHkB/k0UAdslzwf+V3MhDJMvhsRE/WYpPkRzeeHgtSlw k692exmG3D/HJ4XwKz6M7aSTNKvSBsyssqdcpLZ3zNpEdc0wpSvFxRO0HBMmK1FNMSyCy+ mqjmvm+kU5GyGYvvg2Erzri/8SJPUK1QCPmKA6PeXKtsOS6B4Opid4ZgdKMMmArE4rO/8Q 6x2XFZdbbXkNxevIUs46j7ubAfzyqLOOWWj8NlISJvEIfHjsvso268vcBQ9xK+C8kh8JjD 7b1Uad/iUQbK2xFIs2HlISRXYzEreXBvsvZ+72ko7Qt7JoT5A/4bCpcHTdLxRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754079632; a=rsa-sha256; cv=none; b=Oc6fVEEJLoOK2kplkojYcJYogdKJcUSZxjpVk3kHTaS+O8swKkWOtJ3xxDry8k+fRJVoat dnYTIJ7mghWWjSeSuxoJZQXNVvgeDVsRWm3iKZMCp2bY/AGfa3rtbaNP86K5r51pszmZu8 Eg3QFv0kBAIXcpu+5zfRVu0+p+Je/6tyb3ATjUJdJXqIE+QRtzufyf7c+YIPE3MbrGSlte gcu4mdCT8wlm4jxCkdupaDbyaJT+2h/foXlydh7QCsdSo6Kicf5IfWshzbs8TvR5WEsuZw X3ssyZlZuS94/z9hXCbSknWbBv9wVonS61uRVXoVSsJLSVQySGFHHDRMegENGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bty4c3Y4Pz12Y1; Fri, 01 Aug 2025 20:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571KKWww025586; Fri, 1 Aug 2025 20:20:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571KKW5w025583; Fri, 1 Aug 2025 20:20:32 GMT (envelope-from git) Date: Fri, 1 Aug 2025 20:20:32 GMT Message-Id: <202508012020.571KKW5w025583@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: 095f6305772b - main - vm_pageout: Scan inactive dirty pages less aggressively List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 095f6305772be1dae27e7af9d87db0387625440d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=095f6305772be1dae27e7af9d87db0387625440d commit 095f6305772be1dae27e7af9d87db0387625440d Author: Mark Johnston AuthorDate: 2025-01-06 18:15:28 +0000 Commit: Mark Johnston CommitDate: 2025-08-01 20:15:28 +0000 vm_pageout: Scan inactive dirty pages less aggressively Consider a database workload where the bulk of RAM is used for a fixed-size file-backed cache. Any leftover pages are used for filesystem caching or anonymous memory. In particular, there is little memory pressure and the inactive queue is scanned rarely. Once in a while, the free page count dips a bit below the setpoint, triggering an inactive queue scan. Since almost all of the memory there is used by the database cache, the scan encounters only referenced and/or dirty pages, moving them to the active and laundry queues. In particular, it ends up completely depleting the inactive queue, even for a small, non-urgent free page shortage. This scan might process many gigabytes worth of pages in one go, triggering VM object lock contention (on the DB cache file's VM object) and consuming CPU, which can cause application latency spikes. Observing this behaviour, my observation is that we should abort scanning once we've encountered many dirty pages without meeting the shortage. In general we've tried to make the page daemon control loops avoid large bursts of work, and if a scan fails to turn up clean pages, there's not much use in moving everything to laundry queue at once. In particular, pacing this work ensures that the page daemon isn't frequently acquiring and releasing the VM object lock over long periods, especially when multiple page daemon threads are in use. Modify the inactive scan to abort early if we encounter enough dirty pages without meeting the shortage. If the shortage hasn't been met, this will trigger shortfall laundering, wherein the laundry thread will clean as many pages as needed to meet the instantaneous shortfall. Laundered pages will be placed near the head of the inactive queue, so will be immediately visible to the page daemon during its next scan of the inactive queue. Reviewed by: alc, kib MFC after: 1 month Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D48337 --- sys/vm/swap_pager.c | 2 +- sys/vm/swap_pager.h | 1 + sys/vm/vm_pageout.c | 61 +++++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index c01b9e45a32b..676e585a6b53 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -386,7 +386,7 @@ swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) } static bool swap_pager_full = true; /* swap space exhaustion (task killing) */ -static bool swap_pager_almost_full = true; /* swap space exhaustion (w/hysteresis) */ +bool swap_pager_almost_full = true; /* swap space exhaustion (w/hysteresis) */ static struct mtx swbuf_mtx; /* to sync nsw_wcount_async */ static int nsw_wcount_async; /* limit async write buffers */ static int nsw_wcount_async_max;/* assigned maximum */ diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 3287886026f7..da1457762c0b 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -68,6 +68,7 @@ struct swdevt { #ifdef _KERNEL +extern bool swap_pager_almost_full; extern int swap_pager_avail; extern int nsw_cluster_max; diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index b500eb8156bc..3f1be78342c9 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -80,6 +80,7 @@ #include #include #include +#include #include #include #include @@ -183,26 +184,33 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_oom_seq, CTLFLAG_RWTUN, &vm_pageout_oom_seq, 0, "back-to-back calls to oom detector to start OOM"); -static int act_scan_laundry_weight = 3; - static int -sysctl_act_scan_laundry_weight(SYSCTL_HANDLER_ARGS) +sysctl_laundry_weight(SYSCTL_HANDLER_ARGS) { - int error, newval; + int error, val; - newval = act_scan_laundry_weight; - error = sysctl_handle_int(oidp, &newval, 0, req); - if (error || req->newptr == NULL) + val = *(int *)arg1; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) return (error); - if (newval < 1) + if (val < arg2 || val > 100) return (EINVAL); - act_scan_laundry_weight = newval; + *(int *)arg1 = val; return (0); } -SYSCTL_PROC(_vm, OID_AUTO, act_scan_laundry_weight, CTLFLAG_RWTUN | CTLTYPE_INT, - &act_scan_laundry_weight, 0, sysctl_act_scan_laundry_weight, "I", + +static int act_scan_laundry_weight = 3; +SYSCTL_PROC(_vm, OID_AUTO, act_scan_laundry_weight, + CTLTYPE_INT | CTLFLAG_RWTUN, &act_scan_laundry_weight, 1, + sysctl_laundry_weight, "I", "weight given to clean vs. dirty pages in active queue scans"); +static int inact_scan_laundry_weight = 1; +SYSCTL_PROC(_vm, OID_AUTO, inact_scan_laundry_weight, + CTLTYPE_INT | CTLFLAG_RWTUN, &inact_scan_laundry_weight, 0, + sysctl_laundry_weight, "I", + "weight given to clean vs. dirty pages in inactive queue scans"); + static u_int vm_background_launder_rate = 4096; SYSCTL_UINT(_vm, OID_AUTO, background_launder_rate, CTLFLAG_RWTUN, &vm_background_launder_rate, 0, @@ -1417,7 +1425,8 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int page_shortage) struct vm_pagequeue *pq; vm_object_t object; vm_page_astate_t old, new; - int act_delta, addl_page_shortage, starting_page_shortage, refs; + int act_delta, addl_page_shortage, dirty_count, dirty_thresh; + int starting_page_shortage, refs; object = NULL; vm_batchqueue_init(&rq); @@ -1431,6 +1440,18 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int page_shortage) */ addl_page_shortage = 0; + /* + * dirty_count is the number of pages encountered that require + * laundering before reclamation is possible. If we encounter a large + * number of dirty pages, we may abort the scan without meeting the page + * shortage in the hope that laundering will allow a future scan to meet + * the target. + */ + dirty_count = 0; + dirty_thresh = inact_scan_laundry_weight * page_shortage; + if (dirty_thresh == 0) + dirty_thresh = INT_MAX; + /* * Start scanning the inactive queue for pages that we can free. The * scan will stop when we reach the target or we have scanned the @@ -1443,7 +1464,7 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int page_shortage) pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; vm_pagequeue_lock(pq); vm_pageout_init_scan(&ss, pq, marker, NULL, pq->pq_cnt); - while (page_shortage > 0) { + while (page_shortage > 0 && dirty_count < dirty_thresh) { /* * If we need to refill the scan batch queue, release any * optimistically held object lock. This gives someone else a @@ -1617,8 +1638,20 @@ free_page: page_shortage--; continue; } - if ((object->flags & OBJ_DEAD) == 0) + if ((object->flags & OBJ_DEAD) == 0) { vm_page_launder(m); + + /* + * If the page would be paged out to a swap device, and + * no devices are configured or they are all nearly + * full, then don't count it against our threshold, + * since it most likely can't be used to meet our + * target. + */ + if ((object->flags & OBJ_SWAP) == 0 || + !atomic_load_bool(&swap_pager_almost_full)) + dirty_count++; + } skip_page: vm_page_xunbusy(m); continue; From nobody Fri Aug 1 20:36:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btyRQ21V7z635D1; Fri, 01 Aug 2025 20:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4btyRQ1K5xz3DV4; Fri, 01 Aug 2025 20:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754080610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CteVwA0ayAMtJfCygwiJcaf/QFeSkKeDFwpbgmDha/4=; b=fgjYaoTO3QLicnn4kOq2aUOY+YYppwzHfGCwAsV6s1UffpempU0vULqF0hXgW4+eXn+61h hQxTwI6EDPX0ZJjIzjrmih1vY+C1B4pyUGyzA11begpv/31imi7VcxQYxfhp1YPHLuQrGN wf0rFm/smlOpNHGZVEyx4xNwAaJvBn9ON7VJk4ej+NU5yQakh7zlEVRjpl4EEBxFNZvv7o pdr14ErYNL9xM5knF2tf8oK0eKX9TdHL90zAUO3ZD0Yscp6B8qTCP4+SMMOTABINbgFQZ/ KJ5hADcW97/pAsjEMnAqiCFR4d6+dPIQrXx8BqKOsiWNBYZa+V5ncgsV2FOeDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754080610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CteVwA0ayAMtJfCygwiJcaf/QFeSkKeDFwpbgmDha/4=; b=FjaoQ//K40nGDVihFjH124Rg8v669jKd85YF/sv7poq71K7v7vV9te7GtAlSCU2gDBJ6DE aF1d0Rzx2OqjlXmzz3DmAS55nQJERhuJftNSvu6v8/RJUQ8NBcjZw22JLVJiOWrPzmzrYn hkMUT2ViMqpYOy/lohRgwt8DCnUHzSE1k8QPEMMkuGlt+16WLB9nuoCUsL0ejIchfvuZCs OajBFVWQMMwelR8N4NI3WXbTRhR6fZ0Ai839vNkFxNmpWzNgkeZgZQvipShsirxEPfO0pC tV9M1Y4EKBbhHYfanUfrSE3koccNj9ML5xVHt60EYYw4DDulQ7MeK7NwWm7/Fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754080610; a=rsa-sha256; cv=none; b=pwELmsPP3/l2sDiEws6WqDRO0N6YJWyUtjjAdM0XLPn7dJtw0UArcTDZjjh4EAp7zgg9JA HO7IYlyXzrH1ZarA9VPkwAste5Q8XnWNqfS5l6+scrWdPY7epgGjXbCe9dpjmINb47qnnM kDEEppiUyuYCbVYU395+8rqhsViMN5Ci/GprRkY+Pg2XLs6uTjngC+lA0LH8MuWeVy+lGs NwpzP3YEyTUBGzmDvv8e9VIrsdD6mIG5DWeCvBGucNeODSHLQSsC7+673+5/EnnfEbXV9f jQtSpLja5E0+lwRS2j5RN+L6VEpw2N4tOGpLQcMK/SuQrhV3cdsOrPqlCZuisg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4btyRQ0Xgkz12nt; Fri, 01 Aug 2025 20:36:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571Kan3h051968; Fri, 1 Aug 2025 20:36:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571Kanje051965; Fri, 1 Aug 2025 20:36:49 GMT (envelope-from git) Date: Fri, 1 Aug 2025 20:36:49 GMT Message-Id: <202508012036.571Kanje051965@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: e6c623e9bad5 - main - chroot: Improve error message for unprivileged use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: e6c623e9bad56271d6c5fffaaf994d27b65404e5 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e6c623e9bad56271d6c5fffaaf994d27b65404e5 commit e6c623e9bad56271d6c5fffaaf994d27b65404e5 Author: Ed Maste AuthorDate: 2025-08-01 19:53:00 +0000 Commit: Ed Maste CommitDate: 2025-08-01 20:35:07 +0000 chroot: Improve error message for unprivileged use When the security.bsd.unprivileged_chroot sysctl is set, chroot(2) can be used by unprivileged users as long as the PROC_NO_NEW_PRIVS_CTL process control is set. chroot(8) has a -n command line flag to set this process control. Add an explicit error for EPERM from chroot(2) if the -n flag is necessary, but not present. Before: $ chroot / /bin/sh chroot: /: Operation not permitted After: $ chroot / /bin/sh chroot: unprivileged use requires -n Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51687 --- usr.sbin/chroot/chroot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/chroot/chroot.c b/usr.sbin/chroot/chroot.c index bd4932ee9b48..c978fc019c95 100644 --- a/usr.sbin/chroot/chroot.c +++ b/usr.sbin/chroot/chroot.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -158,8 +159,13 @@ main(int argc, char *argv[]) err(1, "procctl"); } - if (chdir(argv[0]) == -1 || chroot(".") == -1) + if (chdir(argv[0]) == -1) err(1, "%s", argv[0]); + if (chroot(".") == -1) { + if (errno == EPERM && !nonprivileged && geteuid() != 0) + errx(1, "unprivileged use requires -n"); + err(1, "%s", argv[0]); + } if (gids && setgroups(gids, gidlist) == -1) err(1, "setgroups"); From nobody Fri Aug 1 21:56:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv0Cd3VLDz639nT; Fri, 01 Aug 2025 21:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv0Cd2q00z3LVH; Fri, 01 Aug 2025 21:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754085405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9gTr37DfmpK9S8A/ubIXYthYfqOkig5hew8VviEoVpY=; b=PiDZdAknFQmQIvavYI7znQJ709JjWSKS/aMAdqkEqrSLNvalVE+mPIQuW2eTrQPdYFULzW y4mthg7BiJQiEQIwrLYxx7WVWPmiYObQYysP2G88vHDiDlr8Zl65teFEk6llvkPxISohF3 rqJwM6Wr4DWicMZNNAwIDP2bKifqDZZcdkDlSmzYinBNOImXb6sSOR5bVorez6Ql8ya1pB OtD0Af6nYfiA72EHwmFgpPtTiub2VH7Zc1b43tGtNv5uOKD+pXFhg7GKs7hQbpiJlMr6hV /EKUt5NIWB7Ps4Hcp+o4EQzQfZEbt5Z1TLyx9l2LSruwqXrs3Yw6b2gmPBzpig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754085405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9gTr37DfmpK9S8A/ubIXYthYfqOkig5hew8VviEoVpY=; b=fMpKhsaZ1gvGeeY/1wO8hh4/u9xvENRh1DK4GJbZr+4Rf/RO0K5NOH6OJRLhT3uJmuL5OV +OfyGmtYHjchOQzL7oCse5ZkyYTDQju3SWlRPQcvCGlMoLs74IR6LHDEy8lR52SOUoc+sz +FZhcr/4lWI3AIcplcChZBKnqUL887HjnGzB7EumQATSgZ5UtOuFEBueYqApd9QeLN701S 3M2u7g254cj4Fv2h5MlDZT4o2kyzWLkyMXl7V+J2TtbnwBaYIEgbTPLvsm7pfRICvrM37o UxLJ6TGdvc4PZmP9kanbY0Akz6ebqKOD5zZZYOsqCqijoBHDtvQek7ODTMM0wQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754085405; a=rsa-sha256; cv=none; b=sewb9yzXscffHhc0tNJvIGGUTx/muWY1DO4oT8m6HjQdsewDe0vBUK7cuQbWLn/D+QcNAc 5XjT5e3WtoonTQNVMqOywLdXdUpW9JsczgXpiGbb4p5Y0jWd5u5qay1ZEW6yKfMIFUanis zRMbw9LaV+wLtTPO3rpPFWirUqY3fxJiXYT9bnn951RsOc5eXuMhmU7UWVozcxBhyFjQOF PsoNRgUKMDW6WpfV3IoTuzrMW6qJSrkXi16SnkAplCq4X+8THPFxubIQ1RWOQn6N6sGmWM jcJ/hJfv9MdrJnI6l+ArbG9X/Gu3UT0DL5xL9cxdEqjLmduA9IFR2A1MrpJkqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bv0Cd2BJtz14vH; Fri, 01 Aug 2025 21:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571LujwZ003463; Fri, 1 Aug 2025 21:56:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571LujDE003461; Fri, 1 Aug 2025 21:56:45 GMT (envelope-from git) Date: Fri, 1 Aug 2025 21:56:45 GMT Message-Id: <202508012156.571LujDE003461@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: c2230ad3b121 - main - inotify: Avoid calling vrele() with a namecache mutex held List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: c2230ad3b121bd1e57fdb2c466f5b826aad5f730 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c2230ad3b121bd1e57fdb2c466f5b826aad5f730 commit c2230ad3b121bd1e57fdb2c466f5b826aad5f730 Author: Mark Johnston AuthorDate: 2025-08-01 18:16:17 +0000 Commit: Mark Johnston CommitDate: 2025-08-01 21:44:25 +0000 inotify: Avoid calling vrele() with a namecache mutex held In cache_vop_inotify(), we call inotify_log() with a namecache hash lock held. inotify_log() looks at all watches registered with the vnode to see if any of them are interested in the event. In some cases, we have to detach and free the watch after logging the event. This means we must vrele() the watched vnode, and this must not be done while a non-sleepable lock held. Previously, I deferred the vrele() to until the inotify softc and vnode pollinfo locks were dropped. However, this is not enough since we may still be holding the aforementioned namecache lock. Go further and use a taskqueue thread to release vnode references. Introduce a set of detached watches, and queue a threaded task which releases the vnode reference. Reported by: syzbot+c128f121cb22df95559b@syzkaller.appspotmail.com Reviewed by: kib Fixes: f1f230439fa4 ("vfs: Initial revision of inotify") Differential Revision: https://reviews.freebsd.org/D51685 --- sys/kern/vfs_inotify.c | 71 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index d3cd0d1f9832..746a5a39208e 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -168,6 +169,8 @@ struct inotify_softc { size_t nbpending; /* bytes available to read */ uint64_t ino; /* unique identifier */ struct inotify_watch_tree watches; /* active watches */ + TAILQ_HEAD(, inotify_watch) deadwatches; /* watches pending vrele() */ + struct task reaptask; /* task to reap dead watches */ struct selinfo sel; /* select/poll/kevent info */ struct ucred *cred; /* credential ref */ }; @@ -374,6 +377,13 @@ inotify_unlink_watch_locked(struct inotify_softc *sc, struct inotify_watch *watc vn_irflag_unset(vp, VIRF_INOTIFY); } +static void +inotify_free_watch(struct inotify_watch *watch) +{ + vrele(watch->vp); + free(watch, M_INOTIFY); +} + /* * Assumes that the watch has already been removed from its softc. */ @@ -389,9 +399,24 @@ inotify_remove_watch(struct inotify_watch *watch) mtx_lock(&vp->v_pollinfo->vpi_lock); inotify_unlink_watch_locked(sc, watch); mtx_unlock(&vp->v_pollinfo->vpi_lock); + inotify_free_watch(watch); +} - vrele(vp); - free(watch, M_INOTIFY); +static void +inotify_reap(void *arg, int pending) +{ + struct inotify_softc *sc; + struct inotify_watch *watch; + + sc = arg; + mtx_lock(&sc->lock); + while ((watch = TAILQ_FIRST(&sc->deadwatches)) != NULL) { + TAILQ_REMOVE(&sc->deadwatches, watch, vlink); + mtx_unlock(&sc->lock); + inotify_free_watch(watch); + mtx_lock(&sc->lock); + } + mtx_unlock(&sc->lock); } static int @@ -403,6 +428,7 @@ inotify_close(struct file *fp, struct thread *td) sc = fp->f_data; + /* Detach watches from their vnodes. */ mtx_lock(&sc->lock); (void)chginotifycnt(sc->cred->cr_ruidinfo, -1, 0); while ((watch = RB_MIN(inotify_watch_tree, &sc->watches)) != NULL) { @@ -411,6 +437,17 @@ inotify_close(struct file *fp, struct thread *td) inotify_remove_watch(watch); mtx_lock(&sc->lock); } + + /* Make sure that any asynchronous vrele() calls are done. */ + mtx_unlock(&sc->lock); + taskqueue_drain(taskqueue_thread, &sc->reaptask); + mtx_lock(&sc->lock); + KASSERT(RB_EMPTY(&sc->watches), + ("%s: watches not empty in %p", __func__, sc)); + KASSERT(TAILQ_EMPTY(&sc->deadwatches), + ("%s: deadwatches not empty in %p", __func__, sc)); + + /* Drop pending events. */ while (!STAILQ_EMPTY(&sc->pending)) { rec = inotify_dequeue(sc); if (rec != &sc->overflow) @@ -456,6 +493,8 @@ inotify_create_file(struct thread *td, struct file *fp, int flags, int *fflagsp) sc->nextwatch = 1; /* Required for compatibility. */ STAILQ_INIT(&sc->pending); RB_INIT(&sc->watches); + TAILQ_INIT(&sc->deadwatches); + TASK_INIT(&sc->reaptask, 0, inotify_reap, sc); mtx_init(&sc->lock, "inotify", NULL, MTX_DEF); knlist_init_mtx(&sc->sel.si_note, &sc->lock); sc->cred = crhold(td->td_ucred); @@ -560,17 +599,16 @@ inotify_queue_record(struct inotify_softc *sc, struct inotify_record *rec) return (true); } -static int +static void inotify_log_one(struct inotify_watch *watch, const char *name, size_t namelen, int event, uint32_t cookie) { struct inotify_watch key; struct inotify_softc *sc; struct inotify_record *rec; - int relecount; bool allocfail; - relecount = 0; + mtx_assert(&watch->vp->v_pollinfo->vpi_lock, MA_OWNED); sc = watch->sc; rec = inotify_alloc_record(watch->wd, name, namelen, event, cookie, @@ -599,20 +637,22 @@ inotify_log_one(struct inotify_watch *watch, const char *name, size_t namelen, /* * Remove the watch, taking care to handle races with - * inotify_close(). + * inotify_close(). The thread that removes the watch is + * responsible for freeing it. */ key.wd = watch->wd; if (RB_FIND(inotify_watch_tree, &sc->watches, &key) != NULL) { RB_REMOVE(inotify_watch_tree, &sc->watches, watch); inotify_unlink_watch_locked(sc, watch); - free(watch, M_INOTIFY); - /* Defer vrele() to until locks are dropped. */ - relecount++; + /* + * Defer the vrele() to a sleepable thread context. + */ + TAILQ_INSERT_TAIL(&sc->deadwatches, watch, vlink); + taskqueue_enqueue(taskqueue_thread, &sc->reaptask); } } mtx_unlock(&sc->lock); - return (relecount); } void @@ -620,25 +660,18 @@ inotify_log(struct vnode *vp, const char *name, size_t namelen, int event, uint32_t cookie) { struct inotify_watch *watch, *tmp; - int relecount; KASSERT((event & ~(IN_ALL_EVENTS | IN_ISDIR | IN_UNMOUNT)) == 0, ("inotify_log: invalid event %#x", event)); - relecount = 0; mtx_lock(&vp->v_pollinfo->vpi_lock); TAILQ_FOREACH_SAFE(watch, &vp->v_pollinfo->vpi_inotify, vlink, tmp) { KASSERT(watch->vp == vp, ("inotify_log: watch %p vp != vp", watch)); - if ((watch->mask & event) != 0 || event == IN_UNMOUNT) { - relecount += inotify_log_one(watch, name, namelen, event, - cookie); - } + if ((watch->mask & event) != 0 || event == IN_UNMOUNT) + inotify_log_one(watch, name, namelen, event, cookie); } mtx_unlock(&vp->v_pollinfo->vpi_lock); - - for (int i = 0; i < relecount; i++) - vrele(vp); } /* From nobody Fri Aug 1 23:12:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv1vb38QPz63Fp3; Fri, 01 Aug 2025 23:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv1vb2bX9z3VHf; Fri, 01 Aug 2025 23:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbHjgw+1XnQnqj9MG8yO67mkTjLh5nhVRYEQryJc4lQ=; b=EUS2Gr8md6RcdQc6K6fBkBAyAJE9oXeTHDXFsO68wG1PRpzZqDwXDqIQCFVwBbxQD6c8Va LFXjq4fgOpkYR2QZfLDqzpSw3YW2y3s0eCrIYuJmpfH8OSyGZH17w6QxHw4iTO3Jofizjg hK7Wa7K1iK559wSj/t0NgR8sSOAx6+XLhMqxJoRaC+O/XTnlBl1JZWLHhrpVeSeMOpBlsb YtmqHDGcvTArpUENWHV6LWeQqlp3chGdlZvRWo1Bk2rdHS4cB2eKAmRvSBOmDJ/YPuYn/f REneuexUXfz2H7xTrfIbyukyZaRqmQmZYBlV5QsOmB/Q3igBbrV9qbp/fzmUGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbHjgw+1XnQnqj9MG8yO67mkTjLh5nhVRYEQryJc4lQ=; b=V9nc9E+hMud9UUeF5+CUp7gBFF0aF/y+eoLM/sqhVmsJPVCrSom3xEhMUDtYYqsf67VICC MKJ07F5PU19A8ycHLWJ/IyyfExqG4Q1SfoaTauYxn25ygvvf+pNJPkek1QRu88YJrfR3Oj fJ2nOFAjmoskQ5uiwugNh8qOsebMQruSglPpKQawZvTuEkgF7KebW1W0+7wXqwYnK3rgIC ksDTThTblm5Ab6A21oEqf+PS7JINIn/wTH6YY80kKREMO4RPSIFof66OnhnSTCT54mmnd4 +j+lZ8jvA4JoVgl4l9kM++aTJ8dFU30ENRyExINpj6jOKRhabG6jsPY5u7f6sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754089979; a=rsa-sha256; cv=none; b=bQyaStD+lhTI+65DDRqLbJIJNrlZg3nPRYhQyxUJppZzTGfJXlcxmF7xqaMagdusCKo6D8 eyMF/V/iBQnqSjdHDkkvHKAf00lBmxqrr7QtWhq1Ixm3U5DqBS0dB/TxAwG1I0ojfELnqU HoeDjBWlQTRdI/TCxEGhC6bVoeH0QoEA2Y7B05E2M1DdXjuU6KY/aT+hZ4k0+78HErIv9Y /WmsCh0gquapkqo2ooZzoV0kDEkRI0XBfXBiQybX2XyCynX3Dmmdalnc4PDxdwiLBwE8eK aEG/C3o15hiOEx/rdAJyvaJi9RmyDmmqmK990LlraQbhMci1eSzkDUCm/cuzvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bv1vb26z9z17D6; Fri, 01 Aug 2025 23:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571NCxOi053403; Fri, 1 Aug 2025 23:12:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571NCxaB053400; Fri, 1 Aug 2025 23:12:59 GMT (envelope-from git) Date: Fri, 1 Aug 2025 23:12:59 GMT Message-Id: <202508012312.571NCxaB053400@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: bf304a40cde8 - main - bsnmpd: Fix an error message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf304a40cde836435a55e938865fc12ce81cf0fe Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=bf304a40cde836435a55e938865fc12ce81cf0fe commit bf304a40cde836435a55e938865fc12ce81cf0fe Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-01 23:11:56 +0000 bsnmpd: Fix an error message MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51678 --- usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c index 8b7e4608d673..f7484e90189b 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c @@ -372,7 +372,7 @@ swins_get_packages(void) } if (errno != 0) { - syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:" + syslog(LOG_ERR, "hrSWInstalledTable: readdir(\"%s\") failed:" " %m", pkg_dir); ret = -1; } else { From nobody Fri Aug 1 23:13:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv1vc4Wmzz63G4x; Fri, 01 Aug 2025 23:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv1vc3TBvz3VWN; Fri, 01 Aug 2025 23:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=siHxAsdSI0u+HTugJKpmPRsqmKOP1JHLjPMJhQnjQJc=; b=PrCZ1tAjrXnQPOvVWJ/lPUrf4hKwVuPuzsfmT9zx1sMHdHzNf8r0dmd3o3u/aYEVXzMZXu xX6DP8Typz6ypiPM8ClvjVgOjCC+c0FqaCbc0teVrJ2d5lreLt+jhEPvUXmLC76U7/obJQ LZiL+reHuIZ5Dim28m6Ltwy5D+v7egHMKN5s4Vx2ewm28A6DQEjujgR94ALA/u8V4ssDXw DggwFJrhcSPw3C+mO6YaJC1ZolMDHMeu8KmmJPFkYxbkSz2JHeZxaoWEhp607Uk/ZX0u52 MEN+nS8HZg2blV3XduS0JBCd1gf3Dw0qEo3KzHbZFouWQ5+W0/v6q32m6qpZHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=siHxAsdSI0u+HTugJKpmPRsqmKOP1JHLjPMJhQnjQJc=; b=esWToEeQSPd7mswuMkARCQH1aVeBgdKP3q1jGEJQmF58gYqS7f9xWynse8xaV7OX4QNrUd nDxtR6bX4LCKMUFpzJQultXZE0+jwUh1aiZLBE10TkdY6lYZvlj7Vmpfy2AiaRmPB5xBXC jx7TByzowpqczh6fBhCIj2RH0WtvXJ9j1jfnkGtGul7k1XqW+48nXdXGaYXSoWCNC2oNvz 8kI1CKAEv7IaFLB2FMZ+wpkSOpIEjb3/gPPNcVdOKj8tXtjZWHZEbd4A1VhAg/sklz13ls 3eklTvOh/u9uVqGQ5D4NaeG9ftlkQqnnJS4mykHyXgnkEhE+G0tEnTCWM557WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754089980; a=rsa-sha256; cv=none; b=nnhskVvYUxp8Mx/aTT60ODXaBjbH0SumPlHYmWyYRPaohVZO/4RoTFqUAgbaUiTaJjghb2 19aggDsVfrY32XJr3TCHITua+V9gseEDiEkeOBOhxlGcogdrXAumzu4tU5WFt2J6nSBGia zxLvcH1gUPJFPyMgU9ueENLMJwroxGUao+LA+GPuSN/pKVb8uaABVZIezaTrWmiAK0EYiH Q3az+BCwR9NmwLzQl7Q9bY/7LbdfcMvDy4x5XQO2crkdOLMd8QwwcME6iXj7EbZI+wEujZ dHdmBd1wFoyp6c7prCBNk5wBIqz9GWytv67EdeR4h5BbX6la8ae5j8CP+8DB3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bv1vc33nqz17Tv; Fri, 01 Aug 2025 23:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571ND0FU053447; Fri, 1 Aug 2025 23:13:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571ND0YG053444; Fri, 1 Aug 2025 23:13:00 GMT (envelope-from git) Date: Fri, 1 Aug 2025 23:13:00 GMT Message-Id: <202508012313.571ND0YG053444@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: 01e42ce81f75 - main - libarchive: Stop using readdir_r() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 01e42ce81f751ccbeeddc4bc2716e6bd634cf5f8 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=01e42ce81f751ccbeeddc4bc2716e6bd634cf5f8 commit 01e42ce81f751ccbeeddc4bc2716e6bd634cf5f8 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-01 23:11:56 +0000 libarchive: Stop using readdir_r() It cannot be used safely, though libarchive goes to ridiculous lengths to attempt to do so. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D51679 --- lib/libarchive/config_freebsd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index a3a0216169bf..1601adddd0de 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -165,7 +165,6 @@ #define HAVE_POSIX_SPAWNP 1 #define HAVE_PTHREAD_H 1 #define HAVE_PWD_H 1 -#define HAVE_READDIR_R 1 #define HAVE_READLINK 1 #define HAVE_READLINKAT 1 #ifndef __linux__ From nobody Fri Aug 1 23:13:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv1vf1lYsz63Fp9; Fri, 01 Aug 2025 23:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv1vd4fGMz3VHm; Fri, 01 Aug 2025 23:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AM7kF7qtvM59CU9QwuCpfifXrP6yb2D/BQynWLyMRUY=; b=dV0RaXNSmBLh8C+5Hx+o6TA6dz4XMD9aKTp6WT+TUnQT6EjPhgnOHO1MqEKnxliGAtxHeq h9VsUerD3tnG38YuZ3961z6opa2MnBB3K0YA8VrtL/VGeP367mnGCynZyf81vUNxToWK2W 3cGv045lN58z1Ono3dH888SarRYwyMjowbcbb6H02Tk2tBzwDb/fr/BTzB4Fm+YIQQcARO pe2QxLZtnglB/0GOL9zy6Q6DnRuP0pUo4K96y0dlVKRf9jVthZ0p1r++9TsmVqyfN3IEvA jkkvDrX240U8mKT6hX1/6w7mMUjSguE8M5bHQRIN4B0sqMyIKWouPbJ8kGew7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AM7kF7qtvM59CU9QwuCpfifXrP6yb2D/BQynWLyMRUY=; b=RrdiTE52Ap/fbPL6M7NrsNgFDboPK46NiClT6gnWxx2JzkOXLd+5Bfr69EYnUmFZOoCQoA uwKYVDH7xbRvfEh142PI5GpwxcACihien9N/UK1e26qf6wWSd+P+mFJTeujOFIMMTI0Ofd Wd/D9g6gYtG+vJNQShEl7QaDyw8PORvcXw7R7lZf7yqh54VX3/tOIwYsPJYYk7aQ3SBW1b 4Iucc2iXs4yEpNlRIz/z9IZULTFP5JkxZPBcM92Ma2PHucds8q7uT9sQuNdIWY3Zd1WqW+ sdGWl0EvrR3CYNLR9ELt17KW16lSVdF8Hro8V4oR0qal4mMEn0pPYwSVzUf7Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754089981; a=rsa-sha256; cv=none; b=jIbnYv4lOq1Ju8KXmqO8JAT1uXWMuBBvrFMezN7a4KiiZr5cUr2cFlzyDVuhDFcGC5at7J oLBPLxiRXD889gdf5tioruDLBtUIPhCvdW/mFmlKbnH2illGfjObcg+oPQPrvIzjSAybaG snHYISGyTGtqqV9N3wNfdTzvP8pi852awDCH9M1QwQRBpOoQS6HmViXqq8kcP/xe7Dps0Q tK3VbM2dPEwV/5x+sujw40BuHE90JlamdQUomdHhDcswEYutrFScRa9LPskrtdGx5ahc45 MIY3MIRHa8HNbVWrjp9Dq5Hb6AXV2W4JUP96ZkFNtDWthR7gcRGO3YNvdl7KlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bv1vd3bFqz17Tw; Fri, 01 Aug 2025 23:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571ND1tq053484; Fri, 1 Aug 2025 23:13:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571ND11E053481; Fri, 1 Aug 2025 23:13:01 GMT (envelope-from git) Date: Fri, 1 Aug 2025 23:13:01 GMT Message-Id: <202508012313.571ND11E053481@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: 65bae451c23b - main - kyua: Stop using readdir_r() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 65bae451c23b8d61b2433259d8e707250660eeff Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=65bae451c23b8d61b2433259d8e707250660eeff commit 65bae451c23b8d61b2433259d8e707250660eeff Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:26 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-01 23:11:56 +0000 kyua: Stop using readdir_r() It cannot be used safely, and Kyua doesn't even pretend to try. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: igoro Differential Revision: https://reviews.freebsd.org/D51680 --- contrib/kyua/utils/fs/directory.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/contrib/kyua/utils/fs/directory.cpp b/contrib/kyua/utils/fs/directory.cpp index f82fe88f86dc..b73741aa544d 100644 --- a/contrib/kyua/utils/fs/directory.cpp +++ b/contrib/kyua/utils/fs/directory.cpp @@ -127,16 +127,9 @@ struct utils::fs::detail::directory_iterator::impl : utils::noncopyable { /// not. A null pointer means an invalid iterator. ::DIR* _dirp; - /// Raw representation of the system directory entry. - /// - /// We need to keep this at the class level so that we can use the - /// readdir_r(3) function. - ::dirent _dirent; - /// Custom representation of the directory entry. /// - /// This is separate from _dirent because this is the type we return to the - /// user. We must keep this as a pointer so that we can support the common + /// We must keep this as a pointer so that we can support the common /// operators (* and ->) over iterators. std::unique_ptr< directory_entry > _entry; @@ -192,22 +185,23 @@ struct utils::fs::detail::directory_iterator::impl : utils::noncopyable { /// It is possible to use this function on a new directory_entry object to /// initialize the first entry. /// - /// \throw system_error If the call to readdir_r fails. + /// \throw system_error If the call to readdir fails. void next(void) { ::dirent* result; - if (::readdir_r(_dirp, &_dirent, &result) == -1) { + errno = 0; + if ((result = ::readdir(_dirp)) == NULL && errno != 0) { const int original_errno = errno; - throw fs::system_error(F("readdir_r(%s) failed") % _path, + throw fs::system_error(F("readdir(%s) failed") % _path, original_errno); } if (result == NULL) { _entry.reset(); close(); } else { - _entry.reset(new directory_entry(_dirent.d_name)); + _entry.reset(new directory_entry(result->d_name)); } } }; From nobody Fri Aug 1 23:13:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv1vg0D60z63FHn; Fri, 01 Aug 2025 23:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv1vf4xkRz3VcS; Fri, 01 Aug 2025 23:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hkwk+T0752hv1UMod0OntV6OI4G1WUu4AkKkUIPzSyQ=; b=aUA3DhVCK76XHg6sKFEFkdX5pNcobLwqmRz3v+Hn+VU45xrJhDXSNibaWiI/qCNb0gwmcG oi4+Jn6G30iHw8ZvxIInqu7xMaHw9Q47+/tFLJ+QjroKZn26e/+vHIP8zU87wFFFe20X94 alrjcK/Ix+MTcTy2x7EXc4Ayt/0ms05evArP+iojqrUNeNn9KxC+nF5KTiPtkcSPnGolJz w4jmPa2fTCJSZRslfmC+lGizhf7mA5vc7NdAq3zrAod5gGgzGU+Vv6kID5W5Px4eBp9aJt V8iqhSyI0GsY/PfseMFJ+5Scpt9/egyKCWbBFpL+Wx/0hMA4KmqZyDdNO1+enw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hkwk+T0752hv1UMod0OntV6OI4G1WUu4AkKkUIPzSyQ=; b=ixF54j0s1g9/lTXRohPsT4rYLkTURSyIjft7hMSfglDFXihWA4lX7XCZ0TSqkq0yt091pL A9tal/DlsO5RNt1inLDPEupVl0C2nwB+uts1995izfZOZaLeyRr7sYgmkTkX2D51pj26Mq Ov1/S7bl4Bz9MpGUUNCLg6145PFIvD3OS/qh/zT6jJRPmz91CKyih/GmuPlhUpi8742z1W 8dIdjodb6ZNij762BXARafjs/DzLq6aIrO/Jueb6iXXxHW1QDxfau66/c/F+4UTS084ZPZ agYTgZwd4U2l4XPEZ27jnFxVhwM748oEBAX32ykpuEctisj72H2aIWiy+EUP8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754089982; a=rsa-sha256; cv=none; b=YFskxIXFr47bZkGVB0pPnpcbL7BJEYC0anjgxy+WLFhviEnBkET9g47pBN9rNjA4pDqf8m 26Qvs8h3WfD+MG0Vt8Csmy0MdvQjmi8jK+rw7LUOOzCEbWRFraYnXJeKIwMm9xXNWJiagt Rjlih4mSrBfzU77hQSwLd4IHq7RGs+hmss0bGIBi4Ekau2SRhq6t6abIvxfDGrZOAspHdK eRElo5Ytzi6lseMhlpFvHh39KiYJJ1wNaS5z9AUgy7P9Z9rQTxPs7jDEb8dQWejnTiWqNC +VeJ//oNmWimdepRUsz0tj+Gi63qsUNzJvU7NTlFePiSNXVb7EUYmmxneYlcFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bv1vf4YCTz17D7; Fri, 01 Aug 2025 23:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571ND2kh053521; Fri, 1 Aug 2025 23:13:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571ND2Nu053518; Fri, 1 Aug 2025 23:13:02 GMT (envelope-from git) Date: Fri, 1 Aug 2025 23:13:02 GMT Message-Id: <202508012313.571ND2Nu053518@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: 2bd157bc732a - main - libc: Deprecate readdir_r() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2bd157bc732a1939cb71314e48de6118b91e0ad0 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2bd157bc732a1939cb71314e48de6118b91e0ad0 commit 2bd157bc732a1939cb71314e48de6118b91e0ad0 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-01 23:11:56 +0000 libc: Deprecate readdir_r() This function was never safe to use. We marked it deprecated in the manual page in 2016, and it is marked obsolete in POSIX 2024. Add a linker warning and annotate the prototype. Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D51681 --- include/dirent.h | 3 ++- lib/libc/gen/readdir.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/dirent.h b/include/dirent.h index dff0e8675722..7fcdceb10b23 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -116,7 +116,8 @@ DIR *fdopendir(int); struct dirent * readdir(DIR *); #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 -int readdir_r(DIR *, struct dirent *, struct dirent **); +int readdir_r(DIR *, struct dirent *, struct dirent **) + __deprecated1("Does not take variable {NAME_MAX} into account"); #endif void rewinddir(DIR *); #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700 diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index b70102954df1..94d2b2e8d877 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -134,3 +134,5 @@ __readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) } __strong_reference(__readdir_r, readdir_r); +__warn_references(readdir_r, + "warning: this program uses readdir_r(), which is unsafe."); From nobody Fri Aug 1 23:13:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv1vh6zn1z63FxT; Fri, 01 Aug 2025 23:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv1vg5wM7z3VTl; Fri, 01 Aug 2025 23:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7tzxl7Fjl3kv8lc040N0d9GodXINIszgY/PjGdM0778=; b=JNN6l/PfX8EkYyINSBI+OTDuzCya8uc6BOUHpeETq04u+9m9aMAvji6mSeOX2xR9/Rz5XT ajM60sTJOLXjRUZk5iFRwOLU96aYn2OUMFR3z6xprfduyBQOp1+WcFGpRsWyMZCCCQgo2R +W+DrUCRfLXYr6hvOnXQqfso6TJfVquqjzxRqmYbk/E7AMhxHPhenvLhbQdubw2AUmTSuJ 7AsN0AV6tW6AIfXnphDXLXFcK6PIWRseGzKmk5gJk2xCalPxB2UYmy353viOx+U7f80sPa s1wGvBY1V8+Ap0DJrGoPYeMDWeoMIiJs4BI1QJInqtnjD0DKv63tO2AFbj2c1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754089983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7tzxl7Fjl3kv8lc040N0d9GodXINIszgY/PjGdM0778=; b=PGKUoKxYmy2fnH+nv4KF5K0fWjCUeVNV7jVi8caLnd0Sm8Qt51LimtZLp/58ujCX9z9aio HkhECvdAmnOOU+OvoWby8Ls9vyk4N1dG0BG+KzHSKksYtJNqtSttscDwSQ9G1ughwlkoyI xVwAWiOVMmvMMDj8eSo7obVV/pcmSP+aGR91/o5gL+fxBJchrpgAnNaDTmauGqV+u2MLhF r7IAn2bLU8jAfRCZdfW1jGIOcdUi9tPwN4dwlzoqpj82T99XM0FEXUH40pge3NfeTSEAXa anxkQrnbzVutuYRoCxqnm1Xqy3wySyelKA+FfTO48qHqReKgJpcEmBn8JQghDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754089983; a=rsa-sha256; cv=none; b=dqnuLI9+VeMJZCzD3z7d5hzpx0Mmb429rGXpqX0Rpgz2kvWJC1sYk6z2X41dSfCjrqDZYi lBzzEWiESYgRWBbnu1Y2HWKvk6z03zhvrYMaP7VIYNvi6FUBszbJ1X24qrO7VZRzccvZng YE7IKrX981k0u/oTKEyhjN+Xd9UtFA0LQAXyJ6ykAW94P6uQoXNBhQUeoivppDVIRHDKMD J+qowmbdqIjvd4aR9yNAlRzHS8PAc4anaXQWZ+YBjXfPeY9iNO/KSfFUewm9AwMmYDHkPT 6DtqHn7x04LRv90u0Q+TvAhOmogBmWHS+kv16sHNSxK/1PDIZC4Qy48QKBQgvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bv1vg5VFjz17D8; Fri, 01 Aug 2025 23:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571ND3ph053561; Fri, 1 Aug 2025 23:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571ND3Zb053558; Fri, 1 Aug 2025 23:13:03 GMT (envelope-from git) Date: Fri, 1 Aug 2025 23:13:03 GMT Message-Id: <202508012313.571ND3Zb053558@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: 7f04c09fe745 - main - rc.subr: Fix wait_for_pids List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 7f04c09fe74535c1646a4af120f8f1342fe1c328 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7f04c09fe74535c1646a4af120f8f1342fe1c328 commit 7f04c09fe74535c1646a4af120f8f1342fe1c328 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-01 23:11:57 +0000 rc.subr: Fix wait_for_pids It looks like this function was intended to loop and print an update whenever at least one of the waited-for processes terminates. However, the default behavior of pwait is to block until none of the watched processes exist. Use pwait -o instead so it only blocks until at least one process terminates, and add a test. Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: siderop1_netapp.com, kevans Differential Revision: https://reviews.freebsd.org/D51691 --- libexec/rc/rc.subr | 4 ++-- libexec/rc/tests/rc_subr_test.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index a2e2e98a5087..06b1bd51384c 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -800,7 +800,7 @@ wait_for_pids() fi _prefix= while true; do - _nlist=""; + _nlist="" for _j in $_list; do if kill -0 $_j 2>/dev/null; then _nlist="${_nlist}${_nlist:+ }$_j" @@ -813,7 +813,7 @@ wait_for_pids() _list=$_nlist echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " - pwait $_list 2>/dev/null + pwait -o $_list 2>/dev/null done if [ -n "$_prefix" ]; then echo "." diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh index 9931389e7a02..e8398c8d9b12 100644 --- a/libexec/rc/tests/rc_subr_test.sh +++ b/libexec/rc/tests/rc_subr_test.sh @@ -1,5 +1,8 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause # # Copyright 2022 Mateusz Piotrowski <0mp@FreeBSD.org> +# Copyright (c) 2025 Klara, Inc. # # SPDX-License-Identifier: BSD-2-Clause # @@ -104,8 +107,32 @@ oomprotect_yes_body() /bin/sh "$__script" "$__name" "$__pidfile" onestop } +atf_test_case wait_for_pids_progress +wait_for_pids_progress_head() +{ + atf_set "descr" "Verify that wait_for_pids prints progress updates" +} +wait_for_pids_progress_body() +{ + cat >>script <<'EOF' +. /etc/rc.subr +sleep 15 & +a=$! +sleep 10 & +b=$! +sleep 5 & +c=$! +wait_for_pids $a $b $c +EOF + re="^Waiting for PIDS: [0-9]+ [0-9]+ [0-9]+" + re="${re}, [0-9]+ [0-9]+" + re="${re}, [0-9]+\.$" + atf_check -s exit:0 -o match:"${re}" /bin/sh script +} + atf_init_test_cases() { atf_add_test_case oomprotect_all atf_add_test_case oomprotect_yes + atf_add_test_case wait_for_pids_progress } From nobody Fri Aug 1 23:20:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv24106Qfz63GH9; Fri, 01 Aug 2025 23:20:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv2406Mwrz3XHc; Fri, 01 Aug 2025 23:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754090416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z5K9pxaXTWPvSL1osDhHs2J3Cwr54Y9F9QSUwNCb2jA=; b=hXl/FTnWTKkeyuc8tg9z2yM3Jaef3tSgcgLGquwZ6wgm8K4qXy8SL6qgctEf73zLAX756+ a5F34yh1Rz+/8Z/ldJNFj8jBL4nad+0jdcwBPzVpwLyOIEIO9oHFId+2XtgELHxNofL5MN b6iQNVZpw6q+ol8pN1isTWl7Vr+WjtzItrjntL6GtEPW46xVytS1mj0IygsDJXul59FBs+ olF18ii/oCTMwxJCHloLq+fmxmVssqjExZbznVtXKhIYiJ+UW41FR7zpRzgZosN8hUlxST vpUkJh+IdR4WPEetqI7juKcNPZBF8ea0hqw7D8Sm4Fc44Qu43bXXOvObkQ4hTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754090416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z5K9pxaXTWPvSL1osDhHs2J3Cwr54Y9F9QSUwNCb2jA=; b=kmTWYM0lsySbo1OM8jy1Al9Gderv3/x4xB0SjopgTpF+h1Qvuv0tvDwoooOnCtZxE8iPKT 9ENpTC4RHI3vzOQ8qThONQN4Plk5BLsfshAQZKXpGhARCjZB5RBQn/11EVgEA0zRSAJDsf LFyNDZb6cnryy8nW7yozhLdCFJLfOHlKcsJagSAd6AU0qeG7l0BasZ62+RJ3RyPYDI1mkJ 7glWPNtjo2ygEqnyBSgdsl/BoQfRHY2ww2YrnpYx5GZiqdWFfNgYWZjZNWPImdKDZeutlW sEUBMwk/trPL7MVKVAA973HNzazXqWkrInBbU5ll2HoygqmsbSMKQywKWZplqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754090416; a=rsa-sha256; cv=none; b=MMsGw7DifHXj3/myuK2NqqQ7tzjqX283b81kX2FqbuKT9wM2rgjqg+6oY+cn+AdzUf6XnY Vm6x5oaRThzmbowpdMhORHLZv8nxljU7lnvWxtHOFB4PBRnLkRTADqomJExkP+dGMHEuLM k5PwdiM7qpg8tZ5XloKg1fCJe1uLf3NkmtCc04RC9Ag7ULr+YkiUceH6W/WbOzDxALY6+A Qe5HuziR33G6byXvZAIoQNw3ETN7O40TBBke88jHxm0TyGA/DLDjN+cjImZaku8u+Nl1Nf ci1rTpyNvg42T4c/sFvC+GNNU5E8kBH681s7M6EdhQrU2tsiczsOwn0o3qc1QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bv2405nj5z172T; Fri, 01 Aug 2025 23:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 571NKGOJ063769; Fri, 1 Aug 2025 23:20:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 571NKG4D063757; Fri, 1 Aug 2025 23:20:16 GMT (envelope-from git) Date: Fri, 1 Aug 2025 23:20:16 GMT Message-Id: <202508012320.571NKG4D063757@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: ac641d55ea06 - main - rc.subr: Drop duplicate SPDX tag in test script List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: ac641d55ea0622f06baa60b9d22ef4880007d8c4 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ac641d55ea0622f06baa60b9d22ef4880007d8c4 commit ac641d55ea0622f06baa60b9d22ef4880007d8c4 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:18:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-01 23:19:37 +0000 rc.subr: Drop duplicate SPDX tag in test script I added a tag in the correct place in the previous commit, and somehow managed to miss that there was already one in the wrong place. Fixes: 7f04c09fe745 Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. --- libexec/rc/tests/rc_subr_test.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/libexec/rc/tests/rc_subr_test.sh b/libexec/rc/tests/rc_subr_test.sh index e8398c8d9b12..fe6d3b8264c9 100644 --- a/libexec/rc/tests/rc_subr_test.sh +++ b/libexec/rc/tests/rc_subr_test.sh @@ -4,8 +4,6 @@ # Copyright 2022 Mateusz Piotrowski <0mp@FreeBSD.org> # Copyright (c) 2025 Klara, Inc. # -# SPDX-License-Identifier: BSD-2-Clause -# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: From nobody Sat Aug 2 01:00:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv4HS2TQvz63MNh; Sat, 02 Aug 2025 01:00:20 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv4HS1rhWz3k11; Sat, 02 Aug 2025 01:00:20 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754096420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5qTPl3v8BHqbVlg1fZRA/D5Lx0ehU13PKeofg+htorg=; b=Sx6QiZYkNoNtHG8FzaxGVmJN4/GAM+L7E8Xb2EzTtza+fHEihOjKtMBNCTVp6aXq+03CZM 6IzFHSt6WYTXY/E4SRzSaXuhnwVrxOdDuwQe8uyuGPBivaH/oZ99lpTYOMMeY9BzeJCsJz Wj6jN+cJSfQ5GOV8bMJ9hl6OXDvcmVRHqfGA9pGMNVRHXSzHSvq55iK/LV1O/1ergGAmDv BUn1T3ejRvTolCClKSEaTA2Qa8+EdSGk9yFg6rsfVDYDukq4TqWnwsvlikHk6Uf5mVQF0r jNllJuWo9POvsBDw9Jg91WmsO+kR4He1fC0+mEfeO07zlm9mr7+khOwdZM6owA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754096420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5qTPl3v8BHqbVlg1fZRA/D5Lx0ehU13PKeofg+htorg=; b=gRjKs6FiAc0s3JjJ56DK6LIDIrCKNo1wtA8nvwvTwGrWKNDMax2kPgYIyrWDObVM5w8V7P +tJJcaFPn5JIcjuSVFXF2fa0buxZfLcGPxM4lZ+z5rM8k7iPTlZr29A6PKZ9H/rzZQiiq7 +rXgpGGQRcFeQxrYR9Gkm6KfuvPTuUTEHEid5CEADtn1UGqoqaCI/M2GBTM9GdzORoXc9Y L7pPkO8X27GXBGeUr1kQ+6NrfZLfQPtolMGfBpolKYBR1uBmZ4z6OVMvhCWBI881OfPlPJ RO2TF5ji6soUUiVI4ZYo9gzPVYSFa+s9eqjzax5XM0C8iv1aN2Ch/hOfXPfMmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754096420; a=rsa-sha256; cv=none; b=vEAzyH3MoMNjG6cwervBKyhpJeqtw7tIyMsM5MNvlnjkoncTJ6/Rw9R5nH3I3575x5d6ox I1Fc70ndTzH7YM7400Ilft6bj9v5BN3JfyLSrx43Ojs+vXrYQCswigIosl6WspKkh+I4Em YWX5iBAjiYREG3Kt3/ph2IGoHdPbQpY5sGRE6HlfAKSrzboHNq2FC9odZ0TnQX5iFbB+jk qLVrSh+gAN5MAuYuOzDjXp7+tEkPpvwgpQ4eeE8b2Mi7Qs4iMuS8JuZfVz+oVBqGTl/G2g mHbBTvpBSHf1j+gxtObAh/QNtPQNcczMB+9YW5xPpmyqc374vwlC4P5phkhRgg== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bv4HQ13ytz46T; Sat, 02 Aug 2025 01:00:17 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: 96a550e9dd89 - main - genet: Add a detach routine From: Zhenlei Huang In-Reply-To: <202508012009.571K9FBP097692@gitrepo.freebsd.org> Date: Sat, 2 Aug 2025 09:00:07 +0800 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202508012009.571K9FBP097692@gitrepo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3696.120.41.1.10) > On Aug 2, 2025, at 4:09 AM, John Baldwin wrote: >=20 > The branch main has been updated by jhb: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D96a550e9dd892f24a479da00ead93fbf= aafb7733 >=20 > commit 96a550e9dd892f24a479da00ead93fbfaafb7733 > Author: John Baldwin > AuthorDate: 2025-08-01 20:07:30 +0000 > Commit: John Baldwin > CommitDate: 2025-08-01 20:07:30 +0000 >=20 > genet: Add a detach routine >=20 > PR: 288309 > Co-authored by: Mike Belanger > MFC after: 2 weeks > --- > sys/arm64/broadcom/genet/if_genet.c | 35 = +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) >=20 > diff --git a/sys/arm64/broadcom/genet/if_genet.c = b/sys/arm64/broadcom/genet/if_genet.c > index 182b5582fb7c..013573f1551b 100644 > --- a/sys/arm64/broadcom/genet/if_genet.c > +++ b/sys/arm64/broadcom/genet/if_genet.c > @@ -201,6 +201,7 @@ struct gen_softc { >=20 > static void gen_init(void *softc); > static void gen_start(if_t ifp); > +static void gen_stop(struct gen_softc *sc); > static void gen_destroy(struct gen_softc *sc); > static int gen_encap(struct gen_softc *sc, struct mbuf **mp); > static int gen_parse_tx(struct mbuf *m, int csum_flags); > @@ -379,6 +380,39 @@ gen_destroy(struct gen_softc *sc) > } > } >=20 > +static int > +gen_detach(device_t dev) > +{ > + struct gen_softc *sc; > + int error; > + > + sc =3D device_get_softc(dev); > + ~~~~~~ > + GEN_LOCK(sc); > + gen_stop(sc); > + GEN_UNLOCK(sc); > + callout_drain(&sc->stat_ch); > + ether_ifdetach(sc->ifp); ~~~~~~ I guess the above logic want be wrapped by condition = `device_is_attached(dev)` . > + > + /* Detach the miibus */ > + error =3D bus_generic_detach(dev); > + if (error !=3D 0) > + return (error); > + > + /* clean up dma */ > + gen_bus_dma_teardown(sc); > + > + /* Release bus resources. */ > + bus_teardown_intr(sc->dev, sc->res[_RES_IRQ1], sc->ih); > + bus_teardown_intr(sc->dev, sc->res[_RES_IRQ2], sc->ih2); > + bus_release_resources(sc->dev, gen_spec, sc->res); > + > + if (sc->ifp !=3D NULL) > + if_free(sc->ifp); > + mtx_destroy(&sc->mtx); > + return (0); > +} > + > static int > gen_get_phy_mode(device_t dev) > { > @@ -1805,6 +1839,7 @@ static device_method_t gen_methods[] =3D { > /* Device interface */ > DEVMETHOD(device_probe, gen_probe), > DEVMETHOD(device_attach, gen_attach), > + DEVMETHOD(device_detach, gen_detach), >=20 > /* MII interface */ > DEVMETHOD(miibus_readreg, gen_miibus_readreg), From nobody Sat Aug 2 03:02:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bv70b0kJtz63TTR; Sat, 02 Aug 2025 03:02:39 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bv70Z4SVvz3vGg; Sat, 02 Aug 2025 03:02:38 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-af91a6b7a06so464757266b.2; Fri, 01 Aug 2025 20:02:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754103757; x=1754708557; 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=TcH+slRu8bFf0XMgqSeKAQL99MOOxrB9RCjw7d6iD+A=; b=uqgm8E7kVZTDD11GDOhu1TIv7zLuCx9JpLKhrPo4L+FCzq4V5R69r70cv2FJzNY9nS e+xIbJNbtQdBh5lOIAbOOd2Wysw+daqMUsSyTrrPh9PG2eOofjFf6wPn8kDrSzhXu9xf +4LlfiVJX/Ho8V4mFJNhonJf5p1wInUfxY6FPI5BbnIv7/cyUPxKdkfmqpKBFqyXeAJN x1dyvIH3z6TFOEFnVFjm4F1oPlvOfz0lNCfy4xowMmcklak9iMcQV8U/pQOgiwiZr4+e bptc4rADy7GvWiOo3OkPG/KIp9KG5j6VbQzqLCOJPeqfYE2qytISboIsMXg/WteQZeBv c1+A== X-Forwarded-Encrypted: i=1; AJvYcCUlG8Yra4SHxWl+kqY/d96TVHkwzUixjwYvTOKNEZ5s/UvJ2issUI7yk0R2w9yPpJvCDcEKqWiQJiBtJu5oajUY3Ut+4ug=@freebsd.org, AJvYcCVLT4wUshGSh7+76LbkWeQ/nK2mNlJH1mqGTK+wQGJ3sOQrc2+eVdx0VU1OGq1KSaluwuTGMeshyHQ+eqMknl+fjkkm@freebsd.org, AJvYcCWPyymfH9lN2LcjkBYfTUk2Hq6UwTHAXYGafktZLR4RoMmku7CrXzxl835zpskV+6E/ABfi1g==@freebsd.org X-Gm-Message-State: AOJu0Yydgs0wiEExYk32XSitjYJDElcPiw+U8l+bhT7byrW15FBrhVYn AOFrP9SKl1BRJ7Y6Q+GuTRLr6AyvXV/4Vru+Ow5Tc/uE9XoSDrExVqe88VW4nSzdqkR+mPcJOGs FT3nLQGKlyna0pEZ3xDDPj5Bk+w9RL1c= X-Gm-Gg: ASbGncvqj+t4yNTBg5f088SOCahbTWa9sb+nC71GD1KsCpX+dPcTi765ug47fM50aRS vzy/ZTZ4ELZsOR6yMfFRnRKmgiKdcpAOuG8D3als54xxYYWOU0PrC6ErRLRQOaxKvIeGLX8RMYr D651SzG1zJ2+K8IT22ZRPfWwpwUMPrSai35wm4H07qUN26OKEVs/M/YcUc/z5OPpaIukRFZiCMM AYFQ7s= X-Google-Smtp-Source: AGHT+IHP0Pulv3caViVrgMzAktIUalQ7RNxBHftwZREXMA2ofQCQjxQFXmUVTiJd502eTBBAr5MBBLWV8COAY1gryH8= X-Received: by 2002:a17:907:96ac:b0:ad5:74cd:1824 with SMTP id a640c23a62f3a-af9401877f6mr190965666b.38.1754103756708; Fri, 01 Aug 2025 20:02:36 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507302027.56UKRhb5011315@gitrepo.freebsd.org> <8F928557-328D-46E9-BB53-BDE216693BFC@juniper.net> In-Reply-To: <8F928557-328D-46E9-BB53-BDE216693BFC@juniper.net> From: Alan Somers Date: Fri, 1 Aug 2025 21:02:24 -0600 X-Gm-Features: Ac12FXyegoO5SfVWnPoKySeHtSo9jH6y6ppigJY8OlRwX1uz045W4nFrG-ZJpDE Message-ID: Subject: Re: git: 7b35b4d19630 - main - sockstat: add libxo support To: Phil Shafer Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Damin Rido Content-Type: multipart/alternative; boundary="0000000000005160c5063b591b61" X-Rspamd-Queue-Id: 4bv70Z4SVvz3vGg X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] --0000000000005160c5063b591b61 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable CC'ing Damin Rido. I haven't had time to look at all of Phil's observations yet, but I probably will this weekend. On Fri, Aug 1, 2025 at 11:11=E2=80=AFAM Phil Shafer wrot= e: > This looks good. Some issues below: > > On 30 Jul 2025, at 16:27, Alan Somers wrote: > > @@ -1345,65 +1380,104 @@ display_sock(struct sock *s, struct col_widths > *cw, char *buf, size_t bufsize) > > ... > >> + } else if (laddr->address.ss_len =3D=3D 0 && > > + faddr->conn =3D=3D 0 && is_text_style) = { > > + xo_emit(" {:/%-*.*s}", cw->local_addr, > > + cw->local_addr, "(not > connected)"); > > + } else if (is_text_style) { > > + xo_emit(" {:/%-*.*s}", cw->local_addr, > > + cw->local_addr, "??"); > > + } > > These calls are missing a field name; you should have seen warning for > this, something like: > > foo: missing field name: %-*.*s > ?? > > You'll need something like "{:local-address/%*.*s}". > > Please be sure to test with "--libxo:W", which will report many issues. > Also there's "xolint" for checking source code. > I can't trigger any warnings, with any combination of options. Probably I don't have the same type of socket that you do. What kind of socket is triggering warnings for you? > > Longer term, I'd like to make some sort of clang plugin to report > formatting issues at build time. > > > @@ -1436,47 +1510,52 @@ display_sock(struct sock *s, struct col_widths > *cw, char *buf, size_t bufsize) > > s->proto =3D=3D IPPROTO_TCP) { > > switch (s->proto) { > > case IPPROTO_SCTP: > > - printf(" %-*s", > cw->conn_state, > > - > sctp_conn_state(s->state)); > > + xo_emit(" > {:path-state/%-*s}", > > + cw->path_state, > > + sctp_path_state= ( > > + > faddr->state)); > > break; > > Is the change from conn_state to path_state intentional? > > > > + if (xo_get_style(NULL) =3D=3D XO_STYLE_TEXT) { > > + cw =3D (struct col_widths) { > > ... > > Here and elsewhere: when you check for XO_STYLE_TEXT for formatting, > you'll also care about XO_STYLE_HTML and other future styles. I have a > function in libxo that's currently private/static: > > /* > * Indicate if the style is an "encoding" one as opposed to a > "display" one. > */ > static int > xo_style_is_encoding (xo_handle_t *xop) > { > if (xo_style(xop) =3D=3D XO_STYLE_JSON > || xo_style(xop) =3D=3D XO_STYLE_XML > || xo_style(xop) =3D=3D XO_STYLE_SDPARAMS > || xo_style(xop) =3D=3D XO_STYLE_ENCODER) > return TRUE; > return FALSE; > } > > I can make that public, allowing you to say "if > (!xo_style_is_encoding(NULL)) { ... }", but for now, you'll need to > explicitly test for XO_STYLE_HTML. > > > + xo_error( > > +"usage: sockstat [--libxo] [-46ACcfIiLlnqSsUuvw] [-j jid] [-p ports]\n= " > > +" [-P protocols]\n"); > > + exit(1); > > I don't have a real convention for this, but maybe "[--libxo ...]" would > convey that there's content with the option? > > Thanks, > Phil > --0000000000005160c5063b591b61 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj5DQyYjMzk7aW5nIERhbWluIFJpZG8uwqAgSSBoYXZlbiYjMzk7 dCBoYWQgdGltZSB0byBsb29rIGF0IGFsbCBvZiBQaGlsJiMzOTtzIG9ic2VydmF0aW9ucyB5ZXQs IGJ1dCBJIHByb2JhYmx5IHdpbGwgdGhpcyB3ZWVrZW5kLjwvZGl2PjxkaXY+PGJyPjwvZGl2Pjxk aXYgY2xhc3M9ImdtYWlsX3F1b3RlIGdtYWlsX3F1b3RlX2NvbnRhaW5lciI+PGRpdiBkaXI9Imx0 ciIgY2xhc3M9ImdtYWlsX2F0dHIiPk9uIEZyaSwgQXVnIDEsIDIwMjUgYXQgMTE6MTHigK9BTSBQ aGlsIFNoYWZlciAmbHQ7PGEgaHJlZj0ibWFpbHRvOnBoaWxAanVuaXBlci5uZXQiPnBoaWxAanVu aXBlci5uZXQ8L2E+Jmd0OyB3cm90ZTo8YnI+PC9kaXY+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWls X3F1b3RlIiBzdHlsZT0ibWFyZ2luOjBweCAwcHggMHB4IDAuOGV4O2JvcmRlci1sZWZ0OjFweCBz b2xpZCByZ2IoMjA0LDIwNCwyMDQpO3BhZGRpbmctbGVmdDoxZXgiPlRoaXMgbG9va3MgZ29vZC7C oCBTb21lIGlzc3VlcyBiZWxvdzo8YnI+DQo8YnI+DQpPbiAzMCBKdWwgMjAyNSwgYXQgMTY6Mjcs IEFsYW4gU29tZXJzIHdyb3RlOjxicj4NCiZndDsgQEAgLTEzNDUsNjUgKzEzODAsMTA0IEBAIGRp c3BsYXlfc29jayhzdHJ1Y3Qgc29jayAqcywgc3RydWN0IGNvbF93aWR0aHMgKmN3LCBjaGFyICpi dWYsIHNpemVfdCBidWZzaXplKTxicj4NCiZndDsgLi4uPGJyPg0KJmd0OyZndDsgK8KgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgfSBlbHNlIGlmIChsYWRkci0mZ3Q7YWRkcmVzcy5z c19sZW4gPT0gMCAmYW1wOyZhbXA7PGJyPg0KJmd0OyArwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBmYWRkci0mZ3Q7Y29ubiA9PSAwICZhbXA7JmFtcDsgaXNf dGV4dF9zdHlsZSkgezxicj4NCiZndDsgK8KgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgeG9fZW1pdCgmcXVvdDsgezovJS0qLipzfSZxdW90OywgY3ctJmd0O2xv Y2FsX2FkZHIsPGJyPg0KJmd0OyArwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBjdy0mZ3Q7bG9jYWxfYWRkciwgJnF1b3Q7KG5vdCBjb25u ZWN0ZWQpJnF1b3Q7KTs8YnI+DQomZ3Q7ICvCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoH0gZWxzZSBpZiAoaXNfdGV4dF9zdHlsZSkgezxicj4NCiZndDsgK8KgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgeG9fZW1pdCgmcXVvdDsgezovJS0qLipz fSZxdW90OywgY3ctJmd0O2xvY2FsX2FkZHIsPGJyPg0KJmd0OyArwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBjdy0mZ3Q7bG9jYWxfYWRk ciwgJnF1b3Q7Pz8mcXVvdDspOzxicj4NCiZndDsgK8KgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgfTxicj4NCjxicj4NClRoZXNlIGNhbGxzIGFyZSBtaXNzaW5nIGEgZmllbGQgbmFt ZTsgeW91IHNob3VsZCBoYXZlIHNlZW4gd2FybmluZyBmb3IgdGhpcywgc29tZXRoaW5nIGxpa2U6 PGJyPg0KPGJyPg0KwqAgZm9vOiBtaXNzaW5nIGZpZWxkIG5hbWU6ICUtKi4qczxicj4NCsKgICZs dDttaXNzaW5nLWZpZWxkLW5hbWUmZ3Q7Pz/CoCDCoCDCoCAmbHQ7L21pc3NpbmctZmllbGQtbmFt ZSZndDs8YnI+DQo8YnI+DQpZb3UmIzM5O2xsIG5lZWQgc29tZXRoaW5nIGxpa2UgJnF1b3Q7ezps b2NhbC1hZGRyZXNzLyUqLipzfSZxdW90Oy48YnI+DQo8YnI+DQpQbGVhc2UgYmUgc3VyZSB0byB0 ZXN0IHdpdGggJnF1b3Q7LS1saWJ4bzpXJnF1b3Q7LCB3aGljaCB3aWxsIHJlcG9ydCBtYW55IGlz c3Vlcy7CoCBBbHNvIHRoZXJlJiMzOTtzICZxdW90O3hvbGludCZxdW90OyBmb3IgY2hlY2tpbmcg c291cmNlIGNvZGUuPGJyPjwvYmxvY2txdW90ZT48ZGl2Pjxicj48L2Rpdj48ZGl2PkkgY2FuJiMz OTt0IHRyaWdnZXIgYW55IHdhcm5pbmdzLCB3aXRoIGFueSBjb21iaW5hdGlvbiBvZiBvcHRpb25z LsKgIFByb2JhYmx5IEkgZG9uJiMzOTt0IGhhdmUgdGhlIHNhbWUgdHlwZSBvZiBzb2NrZXQgdGhh dCB5b3UgZG8uwqAgV2hhdCBraW5kIG9mIHNvY2tldCBpcyB0cmlnZ2VyaW5nIHdhcm5pbmdzIGZv ciB5b3U/PC9kaXY+PGRpdj7CoDwvZGl2PjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIg c3R5bGU9Im1hcmdpbjowcHggMHB4IDBweCAwLjhleDtib3JkZXItbGVmdDoxcHggc29saWQgcmdi KDIwNCwyMDQsMjA0KTtwYWRkaW5nLWxlZnQ6MWV4Ij4NCjxicj4NCkxvbmdlciB0ZXJtLCBJJiMz OTtkIGxpa2UgdG8gbWFrZSBzb21lIHNvcnQgb2YgY2xhbmcgcGx1Z2luIHRvIHJlcG9ydCBmb3Jt YXR0aW5nIGlzc3VlcyBhdCBidWlsZCB0aW1lLjxicj4NCjxicj4NCiZndDsgQEAgLTE0MzYsNDcg KzE1MTAsNTIgQEAgZGlzcGxheV9zb2NrKHN0cnVjdCBzb2NrICpzLCBzdHJ1Y3QgY29sX3dpZHRo cyAqY3csIGNoYXIgKmJ1Ziwgc2l6ZV90IGJ1ZnNpemUpPGJyPg0KJmd0O8KgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgcy0mZ3Q7cHJvdG8gPT0g SVBQUk9UT19UQ1ApIHs8YnI+DQomZ3Q7wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBzd2l0Y2ggKHMtJmd0O3Byb3RvKSB7PGJyPg0K Jmd0O8KgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgY2FzZSBJUFBST1RPX1NDVFA6PGJyPg0KJmd0OyAtwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBwcmlu dGYoJnF1b3Q7ICUtKnMmcXVvdDssIGN3LSZndDtjb25uX3N0YXRlLDxicj4NCiZndDsgLcKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgc2N0cF9jb25uX3N0YXRlKHMtJmd0O3N0YXRlKSk7PGJyPg0KJmd0OyAr wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqB4b19lbWl0KCZxdW90OyB7OnBhdGgtc3RhdGUvJS0qc30mcXVvdDssPGJy Pg0KJmd0OyArwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBjdy0mZ3Q7cGF0aF9zdGF0ZSw8YnI+ DQomZ3Q7ICvCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoHNjdHBfcGF0aF9zdGF0ZSg8YnI+DQom Z3Q7ICvCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoGZhZGRyLSZndDtzdGF0 ZSkpOzxicj4NCiZndDvCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoGJyZWFrOzxicj4NCjxicj4NCklzIHRoZSBj aGFuZ2UgZnJvbSBjb25uX3N0YXRlIHRvIHBhdGhfc3RhdGUgaW50ZW50aW9uYWw/PGJyPg0KPGJy Pg0KPGJyPg0KJmd0OyArwqAgwqAgwqAgwqBpZiAoeG9fZ2V0X3N0eWxlKE5VTEwpID09IFhPX1NU WUxFX1RFWFQpIHs8YnI+DQomZ3Q7ICvCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoGN3ID0gKHN0cnVj dCBjb2xfd2lkdGhzKSB7PGJyPg0KJmd0OyAuLi48YnI+DQo8YnI+DQpIZXJlIGFuZCBlbHNld2hl cmU6IHdoZW4geW91IGNoZWNrIGZvciBYT19TVFlMRV9URVhUIGZvciBmb3JtYXR0aW5nLCB5b3Um IzM5O2xsIGFsc28gY2FyZSBhYm91dCBYT19TVFlMRV9IVE1MIGFuZCBvdGhlciBmdXR1cmUgc3R5 bGVzLsKgIEkgaGF2ZSBhIGZ1bmN0aW9uIGluIGxpYnhvIHRoYXQmIzM5O3MgY3VycmVudGx5IHBy aXZhdGUvc3RhdGljOjxicj4NCjxicj4NCsKgIMKgIMKgIMKgIC8qPGJyPg0KwqAgwqAgwqAgwqAg wqAqIEluZGljYXRlIGlmIHRoZSBzdHlsZSBpcyBhbiAmcXVvdDtlbmNvZGluZyZxdW90OyBvbmUg YXMgb3Bwb3NlZCB0byBhICZxdW90O2Rpc3BsYXkmcXVvdDsgb25lLjxicj4NCsKgIMKgIMKgIMKg IMKgKi88YnI+DQrCoCDCoCDCoCDCoCBzdGF0aWMgaW50PGJyPg0KwqAgwqAgwqAgwqAgeG9fc3R5 bGVfaXNfZW5jb2RpbmcgKHhvX2hhbmRsZV90ICp4b3ApPGJyPg0KwqAgwqAgwqAgwqAgezxicj4N CsKgIMKgIMKgIMKgIMKgIMKgIGlmICh4b19zdHlsZSh4b3ApID09IFhPX1NUWUxFX0pTT048YnI+ DQrCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCB8fCB4b19zdHlsZSh4b3ApID09IFhPX1NUWUxFX1hN TDxicj4NCsKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIHx8IHhvX3N0eWxlKHhvcCkgPT0gWE9fU1RZ TEVfU0RQQVJBTVM8YnI+DQrCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCB8fCB4b19zdHlsZSh4b3Ap ID09IFhPX1NUWUxFX0VOQ09ERVIpPGJyPg0KwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgcmV0dXJu IFRSVUU7PGJyPg0KwqAgwqAgwqAgwqAgwqAgwqAgcmV0dXJuIEZBTFNFOzxicj4NCsKgIMKgIMKg IMKgIH08YnI+DQo8YnI+DQpJIGNhbiBtYWtlIHRoYXQgcHVibGljLCBhbGxvd2luZyB5b3UgdG8g c2F5ICZxdW90O2lmICgheG9fc3R5bGVfaXNfZW5jb2RpbmcoTlVMTCkpIHsgLi4uIH0mcXVvdDss IGJ1dCBmb3Igbm93LCB5b3UmIzM5O2xsIG5lZWQgdG8gZXhwbGljaXRseSB0ZXN0IGZvciBYT19T VFlMRV9IVE1MLjxicj4NCjxicj4NCiZndDsgK8KgIMKgIMKgeG9fZXJyb3IoPGJyPg0KJmd0OyAr JnF1b3Q7dXNhZ2U6IHNvY2tzdGF0IFstLWxpYnhvXSBbLTQ2QUNjZklpTGxucVNzVXV2d10gWy1q IGppZF0gWy1wIHBvcnRzXVxuJnF1b3Q7PGJyPg0KJmd0OyArJnF1b3Q7wqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgWy1QIHByb3RvY29sc11cbiZxdW90Oyk7PGJyPg0KJmd0OyArwqAgwqAgwqBleGl0 KDEpOzxicj4NCjxicj4NCkkgZG9uJiMzOTt0IGhhdmUgYSByZWFsIGNvbnZlbnRpb24gZm9yIHRo aXMsIGJ1dCBtYXliZSAmcXVvdDtbLS1saWJ4byAuLi5dJnF1b3Q7IHdvdWxkIGNvbnZleSB0aGF0 IHRoZXJlJiMzOTtzIGNvbnRlbnQgd2l0aCB0aGUgb3B0aW9uPzxicj4NCjxicj4NClRoYW5rcyw8 YnI+DQrCoFBoaWw8YnI+DQo8L2Jsb2NrcXVvdGU+PC9kaXY+PC9kaXY+DQo= --0000000000005160c5063b591b61-- From nobody Sat Aug 2 05:31:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvBJ11Tm7z63cFd; Sat, 02 Aug 2025 05:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvBJ05yn3z3CsC; Sat, 02 Aug 2025 05:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754112672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EnYDCtkPHrbQOuJeLGf0BIPby9ubWGidKwsSTdgBfgQ=; b=ZFlcJx4uWqsD0/1srD+rbrB0WdH/0VXu8q8UefsFzs4VgzD80k/Mb6vMonpMJY7yoQocWk bFE7A2eIRp3ANRofCfYCM5MJOOe8ZRvb2a17xbl/XfWFrM37RoU6iZoEeMEL2IiIJGH6IX ZMxK6gn9fvATJlrdSPNnevw/IGIT12Y6Dxfxjlfbo4+hgz9gqON89ULAUAGXY00GyQbY8/ xjQqZpEGJwhfiwUHy8/45dZjmxruT2g5q6v2PJ/6i4ZGt4E6sKKoOjGyk9vzL+DX/KmVp1 hZDsDHVa5mrfIzPPwiozyylxXt5s5Wek4Z3WOZ/2iofzgT/5og9adj8OQWJ80w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754112672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EnYDCtkPHrbQOuJeLGf0BIPby9ubWGidKwsSTdgBfgQ=; b=T+9OO8t2F+tJ+HxxMCe+FgiVLIdehbm3PU4w5MOf7xK7bk5XwpHFDlaZk1U5MNgfNo/1Cb vq/e/FYxsvTqd8ShCqFOwm8e1SR9rltcDeupd1CWogffmeiV9zuWTaCgB2v+/FMAgOW/A5 9Rm3+UJKuMEz8M1aepe0nLUtsEv/r6eNIEEkB5o+5G8vOBMfFfZMXDDYEX9OZmev2y5Vix IGfFrP1MlvJdrUr8YvytsY2svHUozKsTCIXDxsd5FNdTnACC5fwOdtQEDWe4Wkgcg3jO4g ij8I4FHF7emRArc8rmtXXgy+2rQ8kv1FZWr7r65pWYFb5XG3wnHoRYFP2iLnSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754112672; a=rsa-sha256; cv=none; b=oiRaU3Y73oi2Pc6d+CsjT2xMdJhEzNYmWX6zHLzWtJCaPA831Z6y7svu8+HpCnXbAo2L+L 38qkqEfNbefI1XV01KkSMcSfm+wFqnxS1IgwOb8FfA8I9MbEUU+2qEtFRVC+IIehnD5l42 NiPfxjCj8EW6TFRf2MbxCWjf83+1pM8IdcZZS6Ew2OYzpiJygXYcb+yR2ashU5oBwMIW8T 39HNqy8+BpWMR0ycc2ZRcfkVKwEeNiQc72XzEOC2bhqvy2eJCJPA4lM+Q+7b3SwyrEz6dE l+fIIQ/xwlNdvWVZ4/0WTnq13XuIXNlD8o/VzIPWKkjLHgNcYXI//87GA/wMDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvBJ05RGwz1Jxt; Sat, 02 Aug 2025 05:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5725VCYN065952; Sat, 2 Aug 2025 05:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5725VCap065949; Sat, 2 Aug 2025 05:31:12 GMT (envelope-from git) Date: Sat, 2 Aug 2025 05:31:12 GMT Message-Id: <202508020531.5725VCap065949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Romain =?utf-8?Q?Tarti=C3=A8re?= Subject: git: 8d4464377219 - stable/14 - vm_page: Fix loading bad memory addresses from file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: romain X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8d4464377219dcf45e87510b73767c9ec3515bc2 Auto-Submitted: auto-generated The branch stable/14 has been updated by romain: URL: https://cgit.FreeBSD.org/src/commit/?id=8d4464377219dcf45e87510b73767c9ec3515bc2 commit 8d4464377219dcf45e87510b73767c9ec3515bc2 Author: Romain Tartière AuthorDate: 2025-07-25 18:31:57 +0000 Commit: Romain Tartière CommitDate: 2025-08-02 05:30:18 +0000 vm_page: Fix loading bad memory addresses from file When loading bad memory addresses from a file, we are passed an end pointer that points on the first byte after the buffer. We want the buffer to be null-terminated (by changing the last byte to \0 if it is reasonable to do so), so adjust the end pointer to be on that byte. Approved by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51433 (cherry picked from commit 202f8bde836dc86627be2b5b98174d9a0fb2eaba) --- sys/vm/vm_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ac922f4a3bc8..f013cbc84c25 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -393,7 +393,7 @@ vm_page_blacklist_load(char **list, char **end) } *list = ptr; if (ptr != NULL) - *end = ptr + len; + *end = ptr + len - 1; else *end = NULL; return; From nobody Sat Aug 2 05:32:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvBJy39zNz63c1t; Sat, 02 Aug 2025 05:32:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvBJx4SQWz3D2X; Sat, 02 Aug 2025 05:32:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754112721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5OHW39W9OBPWZtqELXnd6kaIjNOTUjCNUjRzgG0vOHM=; b=ayU03OzfHR5EWMGr9GkpHKiprNpoG0raT6uSG5c1l27rv+mBVBRrroEIt4b3PPr9AwALWM QqQiPncNbPPtcfyXcfBtxST1fk+5P60yyCH2wNS+P+1ek7QN1O0YV4Jo7XNJwaf+k20KHk pvfdKIY5/piHeD+eh7aO1mXS8jGbyrXd8Y9RP6zuBHOPlQu3bXhWepQ4VveGb5QrbU+vIU 2I4p3JQmcjnLJstUuMAN2u9fzHS/RVsOSZEMVNzVxO62Kd2hlSnmJaGFxAw58C/S4sl24f Xi+x41PqwIyv4rwwtdyA+Sg0AV9aKWjdoAPu5bOhBrJPeWKG/V249r7r3WXyBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754112721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5OHW39W9OBPWZtqELXnd6kaIjNOTUjCNUjRzgG0vOHM=; b=QadB/kbEFYmtxTcJBtDN1NLoJGU02qJMv4VWncp/RNtPRDde+Lp/4secpDCoLWx4lS7CfB qL/mTGrlb9PUiDhDbOVf8ijjEHV52FeW92UALp7yufjpcSNDqd29m13V4CDb1c+CixhJ2E SvQoZOpM6OWaMXGPtw50/J6FQkcUyeypSTLjwhU2Al8dhRgi6nTNWPtbuqhkwyZkSBI2Pj 00zc7xTSA+84higtYR83jmUXUpHxm5l7veplzsWO49IFWqSBfAgzSGmzLHAWqUn85cfllW RGBREd1I42ZBDc1HpNoBILDB8bgrh7eO7E/tU0gnX1JBxPZkvQjAiYevaZhTrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754112721; a=rsa-sha256; cv=none; b=U8d+5IHfjBtcnP8xeN0L/n/5iL1e8qIvWmhp2rF7Q9GQuVCopXJWmUw5z16QMP+DFUMIU2 yJyHvCFWHaSxTO2My4xVwbtC4Gctn6b3FlJwfKDMeLljz0OvAwS+cOUKc4amU2/zqeyybA 8a/0AgI0eU1FaaWiqUYEcT++N/goJcpzuwF8yM6VJfNuLHbZ/jUUq+496vBy8uzvsUA9WL bLsg3wBhwDA+padOfeJzMM6bas9WRLzSiV3lqYtMTdaXIciG09E7RHDweBVpieWuokshYx w3XhQThx7NpPlpPYFD9jvQPlFh5ODzgLA5vDd0qsdVC4fXK8C3BbSKOtvrSMBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvBJx2wh0z1KP6; Sat, 02 Aug 2025 05:32:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5725W1G7069227; Sat, 2 Aug 2025 05:32:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5725W18b069209; Sat, 2 Aug 2025 05:32:01 GMT (envelope-from git) Date: Sat, 2 Aug 2025 05:32:01 GMT Message-Id: <202508020532.5725W18b069209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Romain =?utf-8?Q?Tarti=C3=A8re?= Subject: git: e4624465c16a - stable/13 - vm_page: Fix loading bad memory addresses from file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: romain X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4624465c16adb0e60a6b0edeb570dc103b40831 Auto-Submitted: auto-generated The branch stable/13 has been updated by romain: URL: https://cgit.FreeBSD.org/src/commit/?id=e4624465c16adb0e60a6b0edeb570dc103b40831 commit e4624465c16adb0e60a6b0edeb570dc103b40831 Author: Romain Tartière AuthorDate: 2025-07-25 18:31:57 +0000 Commit: Romain Tartière CommitDate: 2025-08-02 05:31:38 +0000 vm_page: Fix loading bad memory addresses from file When loading bad memory addresses from a file, we are passed an end pointer that points on the first byte after the buffer. We want the buffer to be null-terminated (by changing the last byte to \0 if it is reasonable to do so), so adjust the end pointer to be on that byte. Approved by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51433 (cherry picked from commit 202f8bde836dc86627be2b5b98174d9a0fb2eaba) --- sys/vm/vm_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index d21022930396..ed43a05f0e64 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -393,7 +393,7 @@ vm_page_blacklist_load(char **list, char **end) } *list = ptr; if (ptr != NULL) - *end = ptr + len; + *end = ptr + len - 1; else *end = NULL; return; From nobody Sat Aug 2 05:32:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvBK85ly1z63cSR; Sat, 02 Aug 2025 05:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvBK76qPgz3DWH; Sat, 02 Aug 2025 05:32:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754112732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WiNrjptN+UElnBMAAJT6uoFwDYB5mIYwm9h93f7+g3c=; b=UxdA3nW84kd2fNt2qEE34O2hmD/VaD2x6seoM8clCsjCxGmJfzokH4ztT+dPgT5pGJm35c jbMLABSptxCmBaQeD6hoUyYjLFN9v/leLkrBLviJgeGhdZoUFWGZoAYAis0fbNELWRrIVL ofspUyEvECa+C0ypJn7FLHEAqMn9IDSQNGiPvZEckbG1TqEfw0I3tle31sHY4ZJaPIyQ87 FHnLwxScZ+PaICFyXW3oNoAJkXqjUdQcRCy8SfZvIWQY0VbQLo51ThV77WwqYcvJEC4yIR XY7B0/RHkDBBBKdE640eZ+c4cjyVBp2SD3f/fv2fPCRwTSdHEy4nrfiZubzhJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754112732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WiNrjptN+UElnBMAAJT6uoFwDYB5mIYwm9h93f7+g3c=; b=tebJFtyl9WAIbIVkehwTw8Lvq0VmpIFiUbhr4+N+Z13EkOXF8hIKS9AWs+3/VjF9NCutNZ qJaM5B2xUaXkK2wIf3ATO/VN7WwNiR6Ov8y7Wy5iqvaVQ2rR36UMqtbyuQTEtCCApaSYE+ x+XRxNsA7QZ5xrhDNls6azcnOizmclDqsBpSEz02mXls2Py+fxkYsMdsDvUC4TCWYLLJ91 wG+8Lt4IJB55MsN3++owYhZ8jjCte5WHojD5zSm+MIg1gFXW6rZGOZJavaZ0NF+0k+j0mO MUBjm/KFNzYTUOuvZGGV4DoiBOdewFY+gnpNqkRRg2Mw/sckJbOCKcIZxUQ3ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754112732; a=rsa-sha256; cv=none; b=b1t6Jyc9pvqIkOJmQDvc+h3S38eauCK+wRW/zskFLFawOwPlP0A8pTLQYwgjilly4yN9Bl 9G1gq3VF1qxfzJd0YSxgzeRa1sUA7WvQbD7TjIqtObsDtTwKhO7A9QZYdqWuFkyNPYfRQJ egR44078ilDiTUY/Sv3T/sH97iu9P+XtjrgDqW0p7Qi9BAwezNaLbmtv8xrtsLmzUWboUV v9BSRwzuraw3DB+6XuPhTsJuq6OCNAoAi2X30rqtJFENpJnai+eQuGbPLgYM+0/cZcXIga W/rThhJnCBtAHyY67Wrf3rNquMoHhLmk1fEHJY9acBSSw4qk2b7xtJs45yNmpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvBK76Qyhz1KFQ; Sat, 02 Aug 2025 05:32:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5725WBux070242; Sat, 2 Aug 2025 05:32:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5725WB6a070239; Sat, 2 Aug 2025 05:32:11 GMT (envelope-from git) Date: Sat, 2 Aug 2025 05:32:11 GMT Message-Id: <202508020532.5725WB6a070239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: d1095367eb51 - main - krb5: Rename the ALIGN macro in aestab.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1095367eb5116a0b9a1b9fb6eb913a77eeb5e5d Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=d1095367eb5116a0b9a1b9fb6eb913a77eeb5e5d commit d1095367eb5116a0b9a1b9fb6eb913a77eeb5e5d Author: Lexi Winter AuthorDate: 2025-08-02 05:25:02 +0000 Commit: Lexi Winter CommitDate: 2025-08-02 05:30:17 +0000 krb5: Rename the ALIGN macro in aestab.h This conflicts with ALIGN() from . Rather than trying to excise from all of krb5, rename the macro. Reviewed by: des (previous version), cy Differential Revision: https://reviews.freebsd.org/D51574 --- crypto/krb5/src/lib/crypto/builtin/aes/aestab.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/crypto/krb5/src/lib/crypto/builtin/aes/aestab.h b/crypto/krb5/src/lib/crypto/builtin/aes/aestab.h index 8fe32d1800d6..87d7097ba0ec 100644 --- a/crypto/krb5/src/lib/crypto/builtin/aes/aestab.h +++ b/crypto/krb5/src/lib/crypto/builtin/aes/aestab.h @@ -86,10 +86,11 @@ extern "C" { # define EXTERN extern #endif +/* Renamed from ALIGN in MIT source to avoid a conflict with machine/param.h */ #if defined(_MSC_VER) && defined(TABLE_ALIGN) -#define ALIGN __declspec(align(TABLE_ALIGN)) +#define AES_ALIGN __declspec(align(TABLE_ALIGN)) #else -#define ALIGN +#define AES_ALIGN #endif #if defined( __WATCOMC__ ) && ( __WATCOMC__ >= 1100 ) @@ -99,13 +100,13 @@ extern "C" { #endif #if defined(DO_TABLES) && defined(STATIC_TABLES) -#define d_1(t,n,b,e) EXTERN ALIGN CONST XP_DIR t n[256] = b(e) -#define d_4(t,n,b,e,f,g,h) EXTERN ALIGN CONST XP_DIR t n[4][256] = { b(e), b(f), b(g), b(h) } -EXTERN ALIGN CONST uint32_t t_dec(r,c)[RC_LENGTH] = rc_data(w0); +#define d_1(t,n,b,e) EXTERN AES_ALIGN CONST XP_DIR t n[256] = b(e) +#define d_4(t,n,b,e,f,g,h) EXTERN AES_ALIGN CONST XP_DIR t n[4][256] = { b(e), b(f), b(g), b(h) } +EXTERN AES_ALIGN CONST uint32_t t_dec(r,c)[RC_LENGTH] = rc_data(w0); #else -#define d_1(t,n,b,e) EXTERN ALIGN CONST XP_DIR t n[256] -#define d_4(t,n,b,e,f,g,h) EXTERN ALIGN CONST XP_DIR t n[4][256] -EXTERN ALIGN CONST uint32_t t_dec(r,c)[RC_LENGTH]; +#define d_1(t,n,b,e) EXTERN AES_ALIGN CONST XP_DIR t n[256] +#define d_4(t,n,b,e,f,g,h) EXTERN AES_ALIGN CONST XP_DIR t n[4][256] +EXTERN AES_ALIGN CONST uint32_t t_dec(r,c)[RC_LENGTH]; #endif #if defined( SBX_SET ) From nobody Sat Aug 2 05:59:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvBxR371yz63dL5; Sat, 02 Aug 2025 06:00:11 +0000 (UTC) (envelope-from daminrido139@gmail.com) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvBxR0VWYz3G2Y; Sat, 02 Aug 2025 06:00:11 +0000 (UTC) (envelope-from daminrido139@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-3322d10e29dso18796771fa.0; Fri, 01 Aug 2025 23:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754114403; x=1754719203; 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=+YJqxbSdqkdQXrdJnYn6/TGoYwswKaukAPdRWW24YBc=; b=ndVF6/61Jz8L8KHLDGKrPALp/4C3mQsj325/evyvjDO3Ce+cW/MY5vbOzveGRW1wgP oL3HqmWFAlC+3hrLvU5e+VgA9MmLbzg0/nb60x2MmYGgxFjohTGOvOhPZGu9f2o9cCF1 l2mwY4P0smCeUOh6WQWAJZSfsbsfOTm2k1n564izGFOZ0R++VHWeMQ8+WhVFYda+uydv ZzDZLRm8PjodAKIcchLxuB6xisrOvtKq8ZY6I4B9/ZxzNY6Ek7B5H0P3cb1n9JpQIBMW cpTn7s4MLfKdkGAZL67+sVXgOp6UQ7tE1GksDO+VtPiVXA7IA6yM1Kb9T4plEBjMCnqG jp4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754114403; x=1754719203; 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=+YJqxbSdqkdQXrdJnYn6/TGoYwswKaukAPdRWW24YBc=; b=jJvV+z4lK7uWju37oOdd0uM6wGDda01wqusEBWx7LlpcYhaENq/UgLJYvFgfjBr3nf cpZ9jEvbHfjGz2JLI4mI5G35j/Jpd8l4Rdkdux9787Xv51AJPSk573m50Doq3FW4lvP7 IP/lT1iWej6JIUkm4j2d5BjvBDiIj8rpJ60yTejzeYKDpIj3DG3pel+McxFW9q6XZk0G Bjv8dpbTIGbaWhQMNbwQTW5z/wkF/RvRYkjtreGQ3h93rbYHgDjRVz99u2B9SvqUimdO EYhg3q3nMuUSNpN8LoAnTUGLhVwhCniDr1LRgwoHOZ2KNucT9feGmS7vITQw39ySxGVx 85tQ== X-Forwarded-Encrypted: i=1; AJvYcCU7k+pjfnJwLPfIoixP8VEIw4PfTHC3fxdLnjj5MWKexXpMGxBRJXwluRGiMO8IzQka6J+zCQ==@freebsd.org, AJvYcCV3qscCCxx9baSu64pOOGNMJrUcYaRWGzPyvyYGnOgUqXm8UtCtZOUWXI1FMw6BhUkKpt0fEnWEFUsb7pKFUG8XYay8NxA=@freebsd.org, AJvYcCVAUgyLsXp6BZw3BTOYiZfHugIbtu4ZQXuWPdnquO0BWuHUU3Il5Gv7d1TVqeVPNv/yV+8T4WnfG4c8mDTvOYs=@freebsd.org, AJvYcCXqtnPCMgzCNw2Y/8qph7TFxOyXLlNvNmsgNgwGcpckEhhviwKW0ZyCVHQM6JTb+NUus2O0XqQLVXbZlSTaE8rlM+Aa@freebsd.org X-Gm-Message-State: AOJu0YzDQPQOKQ4HC3XcubVvzhJ+hKsSW80saX9Q2pOgG7YKSQdr5W4A 5QvZXSlZ3+5kvEGr/b1vgf+EAraf4mlHEo1cKJjOPC20nO6tCc78W42C4Ozw3KCWQrJeOoqaRFj Nh02XvoqP2yqx1fG7X3GFk0kkhd++hoPOud2rSZChIw== X-Gm-Gg: ASbGncsnhOPgqdXuvL1VL6PazhTQ+H21skTS+Gj2ix6Ajoynr7mCR87uSAfnIMjKdtN FPKaV3Equ90qvlCMeQxGFwPYv6cYNQQ4fgikJCyaQbXhdXcrL1J1zJ5f1PLWDunCdGubaiqnn4B jUihIUFsuFs8nrntSY8UnUDB443djKevf5wwT0HPNdVUvpZOA5jFm5QVi9V73i5wvj0C2cdE6Kc kf+AiuGqucdYXunNyUIheR0mrsChzM= X-Google-Smtp-Source: AGHT+IGVLZBkpgN4XyB8cNi+7qcFhNK3jQVfUnP6KYe8OXJwQvsS2fMlwut3fcwNpqoepqd2nRBWjVosWf8P1EFMldQ= X-Received: by 2002:a05:6512:308e:b0:55a:e1f6:bd98 with SMTP id 2adb3069b0e04-55b97abd6dcmr567973e87.6.1754114402703; Fri, 01 Aug 2025 23:00:02 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507302027.56UKRhb5011315@gitrepo.freebsd.org> <8F928557-328D-46E9-BB53-BDE216693BFC@juniper.net> In-Reply-To: From: Damin Rido Date: Sat, 2 Aug 2025 11:29:49 +0530 X-Gm-Features: Ac12FXweD79cqmQTpT-ynD8Quw5F80WVh1J0fBKqjbf_cDHeFjkBVgEXjg1B3fQ Message-ID: Subject: Re: git: 7b35b4d19630 - main - sockstat: add libxo support To: Alan Somers Cc: Phil Shafer , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Damin Rido Content-Type: multipart/alternative; boundary="000000000000de5d04063b5b9587" X-Rspamd-Queue-Id: 4bvBxR0VWYz3G2Y X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --000000000000de5d04063b5b9587 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you for your valuable feedback. > @@ -1345,65 +1380,104 @@ display_sock(struct sock *s, struct col_widths >> *cw, char *buf, size_t bufsize) >> > ... >> >> + } else if (laddr->address.ss_len =3D=3D 0 && >> > + faddr->conn =3D=3D 0 && is_text_style)= { >> > + xo_emit(" {:/%-*.*s}", cw->local_addr, >> > + cw->local_addr, "(not >> connected)"); >> > + } else if (is_text_style) { >> > + xo_emit(" {:/%-*.*s}", cw->local_addr, >> > + cw->local_addr, "??"); >> > + } >> >> These calls are missing a field name; you should have seen warning for >> this, something like: >> >> foo: missing field name: %-*.*s >> ?? >> >> You'll need something like "{:local-address/%*.*s}". >> >> Please be sure to test with "--libxo:W", which will report many issues. >> Also there's "xolint" for checking source code. >> > I deliberately omitted field names in some xo_emit calls when the output style was XO_STYLE_TEXT, since I assumed field names wouldn't matter for human-readable formats. I also couldn=E2=80=99t trigger any warnings with --libxo:W. However, to stay consistent with xolint expectations and ensure correctness across all styles, I=E2=80=99ll add proper field names in my ne= xt commit. > >> > @@ -1436,47 +1510,52 @@ display_sock(struct sock *s, struct col_widths >> *cw, char *buf, size_t bufsize) >> > s->proto =3D=3D IPPROTO_TCP) { >> > switch (s->proto) { >> > case IPPROTO_SCTP: >> > - printf(" %-*s", >> cw->conn_state, >> > - >> sctp_conn_state(s->state)); >> > + xo_emit(" >> {:path-state/%-*s}", >> > + cw->path_state= , >> > + sctp_path_stat= e( >> > + >> faddr->state)); >> > break; >> >> Is the change from conn_state to path_state intentional? >> > The change from conn-state to path-state was a mistake. Thanks for catching that. I=E2=80=99ll revert it in my next commit. > >> > + if (xo_get_style(NULL) =3D=3D XO_STYLE_TEXT) { >> > + cw =3D (struct col_widths) { >> > ... >> >> Here and elsewhere: when you check for XO_STYLE_TEXT for formatting, >> you'll also care about XO_STYLE_HTML and other future styles. I have a >> function in libxo that's currently private/static: >> >> /* >> * Indicate if the style is an "encoding" one as opposed to a >> "display" one. >> */ >> static int >> xo_style_is_encoding (xo_handle_t *xop) >> { >> if (xo_style(xop) =3D=3D XO_STYLE_JSON >> || xo_style(xop) =3D=3D XO_STYLE_XML >> || xo_style(xop) =3D=3D XO_STYLE_SDPARAMS >> || xo_style(xop) =3D=3D XO_STYLE_ENCODER) >> return TRUE; >> return FALSE; >> } >> >> I can make that public, allowing you to say "if >> (!xo_style_is_encoding(NULL)) { ... }", but for now, you'll need to >> explicitly test for XO_STYLE_HTML. >> >> I initially assumed that only TEXT is intended for human-readable output, and that XML, JSON, and HTML are all machine-readable formats. That=E2=80= =99s why I treated TEXT separately in my formatting logic. Also, I use space-padding specifically for XO_STYLE_TEXT to produce a neat, structured, table-like output, which I assumed wouldn=E2=80=99t be necessary for HTML or other for= mats. Could you please clarify why HTML should be handled similarly to TEXT in this case? > > + xo_error( >> > +"usage: sockstat [--libxo] [-46ACcfIiLlnqSsUuvw] [-j jid] [-p ports]\= n" >> > +" [-P protocols]\n"); >> > + exit(1); >> >> I don't have a real convention for this, but maybe "[--libxo ...]" would >> convey that there's content with the option? >> >> Sure, that makes sense. I=E2=80=99ll update it to use "[--libxo ...]" to in= dicate that there are options. Thanks for the suggestion! --000000000000de5d04063b5b9587 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you for your valuable feedback.

=
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex"> > @@ -1345,65 +1380,104 @@ display_sock(struct sock *s, struct col_width= s *cw, char *buf, size_t bufsize)
> ...
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0} else if (laddr->address.ss_len =3D=3D 0 &&=
> +=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=A0faddr->conn =3D=3D 0 &&= ; is_text_style) {
> +=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=A0xo_emit(" {:/%-*.*s}", = cw->local_addr,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cw-&g= t;local_addr, "(not connected)");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0} else if (is_text_style) {
> +=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=A0xo_emit(" {:/%-*.*s}", = cw->local_addr,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cw-&g= t;local_addr, "??");
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0}

These calls are missing a field name; you should have seen warning for this= , something like:

=C2=A0 foo: missing field name: %-*.*s
=C2=A0 <missing-field-name>??=C2=A0 =C2=A0 =C2=A0 </missing-field-= name>

You'll need something like "{:local-address/%*.*s}".

Please be sure to test with "--libxo:W", which will report many i= ssues.=C2=A0 Also there's "xolint" for checking source code.<= br>

I deliberately= omitted field names in some xo_emit calls when the output style was XO_STY= LE_TEXT, since I assumed field names wouldn't matter for human-readable= formats. I also couldn=E2=80=99t trigger any warnings with --libxo:W. Howe= ver, to stay consistent with xolint expectations and ensure correctness acr= oss all styles, I=E2=80=99ll add proper field names in my next commit.
=C2=A0

> @@ -1436,47 +1510,52 @@ display_sock(struct sock *s, struct col_widths= *cw, char *buf, size_t bufsize)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0s->proto = =3D=3D IPPROTO_TCP) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0switch (s->proto) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0case IPPROTO_SCTP:
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0printf(" %-*s", cw->conn_state,
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sctp_conn_state(s->state));
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0xo_emit(" {:path-state/%-*s}",
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cw->path_state,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sctp_path_state(
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0faddr->state));
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;

Is the change from conn_state to path_state intentional?

The change from conn-state to pa= th-state was a mistake. Thanks for catching that. I=E2=80=99ll revert it in= my next commit.
=C2=A0

> +=C2=A0 =C2=A0 =C2=A0 =C2=A0if (xo_get_style(NULL) =3D=3D XO_STYLE_TEX= T) {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cw =3D (struct= col_widths) {
> ...

Here and elsewhere: when you check for XO_STYLE_TEXT for formatting, you= 9;ll also care about XO_STYLE_HTML and other future styles.=C2=A0 I have a = function in libxo that's currently private/static:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Indicate if the style is an "encod= ing" one as opposed to a "display" one.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 =C2=A0 static int
=C2=A0 =C2=A0 =C2=A0 =C2=A0 xo_style_is_encoding (xo_handle_t *xop)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (xo_style(xop) =3D=3D XO_STYLE= _JSON
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || xo_style(xop) = =3D=3D XO_STYLE_XML
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || xo_style(xop) = =3D=3D XO_STYLE_SDPARAMS
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || xo_style(xop) = =3D=3D XO_STYLE_ENCODER)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return TRUE;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return FALSE;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

I can make that public, allowing you to say "if (!xo_style_is_encoding= (NULL)) { ... }", but for now, you'll need to explicitly test for = XO_STYLE_HTML.


I initially a= ssumed that only TEXT is intended for human-readable output, and that XML, = JSON, and HTML are all machine-readable formats. That=E2=80=99s why I treat= ed TEXT separately in my formatting logic. Also, I use space-padding specif= ically for XO_STYLE_TEXT to produce a neat, structured, table-like output, = which I assumed wouldn=E2=80=99t be necessary for HTML or other formats. Co= uld you please clarify why HTML should be handled similarly to TEXT in this= case?
=C2=A0
> +=C2=A0 =C2=A0 =C2=A0xo_error(
> +"usage: sockstat [--libxo] [-46ACcfIiLlnqSsUuvw] [-j jid] [-p po= rts]\n"
> +"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [-P pro= tocols]\n");
> +=C2=A0 =C2=A0 =C2=A0exit(1);

I don't have a real convention for this, but maybe "[--libxo .= ..]" would convey that there's content with the option?


Sure, that makes sense. I=E2=80= =99ll update it to use "[--libxo ...]" to indicate that there=C2= =A0are options. Thanks for the suggestion!
--000000000000de5d04063b5b9587-- From nobody Sat Aug 2 14:06:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvPkd37y9z6394f; Sat, 02 Aug 2025 14:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvPkd2CPfz3x5c; Sat, 02 Aug 2025 14:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754143593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dy2OCy02S1ELyscQqHCg682vpPig0EQBKtkLJcs0qH0=; b=o3Lov7ST/TWnWjCaEoHmLllu9KDzW9P1AxhE+9I7PNj0eJudAcPYbKUlp0NzuR1ccgkvVT g6wJ2hTv1zvUMvHt4D3ASqrp4ujPYreg5NouN/7ycPCXptxQKcKYnGN6rv08IB1jQkm8ZZ chkotmh/oOJIWW1/nzr5v0sK6NDi4y2kTb0UV9Q6+nbuaaYXjHZAAisiQoonaa9yojtYwY /O3UPR5Lu2B2vZ7LKbzjloBJPZvdG0kHrW3dOsTmAC3OOMmRJzH9wxb2T9mcRftqMsjgFn nUw7CjjTfQDqokQ/01bo2B5gGyYhOD1bSWlvn/VYDDaeefFk4WGnThlxbj4rrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754143593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dy2OCy02S1ELyscQqHCg682vpPig0EQBKtkLJcs0qH0=; b=iDLRLJLKQSBYGfyAYiFWnRFXFm6/wOvfPo7OkIQq2ybWomKfrJHCIym35TcQt/C8nuuQbv NxSPtmNEXMXL0UUIhvYHyo5SE06+plcxRiLed46hDIve+Td9d9h1ntQBCFkwiCBMm/kzLk +PX3kyp4p1ZZyo3AtQPq/fQlEROG572Oet5sABtjudUjNcXVx8ZomfQSKDfVpIyGeGxgxO 4djcKUAZWEbJ3nCX7g8mIGFb2IsoQ4p5Pji5vy1uo77GOeJYfrWMs6WmlguMHCALJGQSR/ 54XtJshE7Y4X3HoIBDnxq9B6/RuaUG83rDxhlirNIeplrqHK3oqPOQaG3EfglA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754143593; a=rsa-sha256; cv=none; b=qRF58EWuMJK49NaE9RtWvwF3cqqSv5oWTwwqr/hTqYarBeBLapDJs2fKy4WT10UfRFY2Xf invManeeq/I3GtEnfXGdPi9t1JR6lmG+GxoJ69zg9lqowOfHqKcb/qEmI9BZS3JhliVrfL 9EhDDMNkRbG1CFfEPPyirBGZaQOP2BKt7ANfNrLcQYEMbmD4vVl165qUj/L7iM37OQAonb hnFTKP8Q6esLUzm8+5yinusVrXCYRY2L5N+DoYWVEyDSCbD6vVB8RqO2D7ceQNse6UMQ5U Fmr9qXJGGwaYR4W+ZMCO2XWVN8r5S22NHbKg9ie/cFe9Bq67IFfO5ZhgMDl1bA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvPkd1fLHz5cZ; Sat, 02 Aug 2025 14:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572E6X7B034359; Sat, 2 Aug 2025 14:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572E6Xvc034356; Sat, 2 Aug 2025 14:06:33 GMT (envelope-from git) Date: Sat, 2 Aug 2025 14:06:33 GMT Message-Id: <202508021406.572E6Xvc034356@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: 0c381b7f0570 - main - libutil: Add symbol versioning List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 0c381b7f0570cb118b5d82c3d1777f8b1fdeffd1 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0c381b7f0570cb118b5d82c3d1777f8b1fdeffd1 commit 0c381b7f0570cb118b5d82c3d1777f8b1fdeffd1 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-02 14:05:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-02 14:05:31 +0000 libutil: Add symbol versioning Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51694 --- ObsoleteFiles.inc | 3 ++ lib/libutil/Makefile | 5 +- lib/libutil/Symbol.map | 127 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 99a528806695..0a4a7a073dcf 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250802: libutil bumped to 10 +OLD_LIBS+=lib/libutil.so.9 + # 20250801: libopencsd libraries moved to /usr/lib and made private OLD_FILES+=lib/libopencsd.so.0 OLD_FILES+=usr/lib/libopencsd.a diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 2d92c5ba1916..d445bc5dec3b 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -7,7 +7,7 @@ PACKAGE= runtime .PATH: ${SRCTOP}/lib/libc/gen # for pw_scan.c LIB= util -SHLIB_MAJOR= 9 +SHLIB_MAJOR= 10 SRCS= _secure_path.c auth.c cpuset.c expand_number.c flopen.c fparseln.c \ ftime.c getlocalbase.c gr_util.c \ @@ -29,6 +29,9 @@ CFLAGS+= -DINET6 CFLAGS+= -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/ +VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map + MAN+= cpuset.3 expand_number.3 flopen.3 fparseln.3 ftime.3 getlocalbase.3 \ hexdump.3 humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ kinfo_getproc.3 kinfo_getvmmap.3 kinfo_getvmobject.3 kld.3 \ diff --git a/lib/libutil/Symbol.map b/lib/libutil/Symbol.map new file mode 100644 index 000000000000..d4bac5b5f53e --- /dev/null +++ b/lib/libutil/Symbol.map @@ -0,0 +1,127 @@ +FBSD_1.8 { + _secure_path; + auth_cat; + auth_checknologin; + auth_getval; + auth_hostok; + auth_timeok; + auth_ttyok; + build_iovec_argf; + build_iovec; + checkpath_allow_file; + checkpath; + chkdoreload; + cpuset_parselist; + domainset_parselist; + expand_number; + flopen; + flopenat; + forkpty; + fparseln; + free_iovec; + ftime; + getlocalbase; + getmnt_silent; + getmntopts; + getmntpoint; + gr_add; + gr_copy; + gr_dup; + gr_equal; + gr_fini; + gr_init; + gr_lock; + gr_make; + gr_mkdb; + gr_scan; + gr_tmp; + hexdump; + humanize_number; + in_lt; + in_ltm; + in_ltms; + in_lts; + kinfo_getallproc; + kinfo_getfile; + kinfo_getproc; + kinfo_getswapvmobject; + kinfo_getvmmap; + kinfo_getvmobject; + kld_isloaded; + kld_load; + login_close; + login_getcapbool; + login_getcapenum; + login_getcaplist; + login_getcapnum; + login_getcapsize; + login_getcapstr; + login_getcaptime; + login_getclass; + login_getclassbyname; + login_getpath; + login_getpwclass; + login_getstyle; + login_getuserclass; + login_hostok; + login_setcryptfmt; + login_str2inlist; + login_strinlist; + login_timelist; + login_tty; + login_ttyok; + openpty; + parse_lt; + pidfile_close; + pidfile_fileno; + pidfile_open; + pidfile_remove; + pidfile_signal; + pidfile_write; + properties_free; + properties_read; + property_find; + pw_copy; + pw_dup; + pw_edit; + pw_equal; + pw_fini; + pw_init; + pw_initpwd; + pw_lock; + pw_make_v7; + pw_make; + pw_mkdb; + pw_scan; + pw_tempname; + pw_tmp; + quota_check_path; + quota_close; + quota_convert; + quota_fsname; + quota_maxid; + quota_off; + quota_on; + quota_open; + quota_qfname; + quota_read; + quota_write_limits; + quota_write_usage; + realhostname_sa; + realhostname; + rmslashes; + setclasscontext; + setclasscpumask; + setclassenvironment; + setclassresources; + setusercontext; + trimdomain; + uu_lock_txfr; + uu_lock; + uu_lockerr; + uu_unlock; +}; + +FBSDprivate_1.0 { + __pw_initpwd; +}; From nobody Sat Aug 2 14:06:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvPkg0dvMz638y1; Sat, 02 Aug 2025 14:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvPkf4tYnz3xGZ; Sat, 02 Aug 2025 14:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754143594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkP+rjK7c5x4vS6CcclmFyOZdQ901Mhw3dXKR9KGfHs=; b=r3kjtP8cIVEtnkfwSh0sr9Bc1pWkhitppE2XIci4pqx3UpD4bgIPhxLkt3ruRZY6EObQYW hXbWCztReOnLPhUEDhJ6qu96aFW71CFruOIPycy/hBWuiSKe1wp1gHV+f5UIJ/JIXqkQ3K TNu6xS2Bn7fYVbd81R9B3lxrIVPc94d5wjHFs+F/wWk8aYEp6kmLmFbrlxNlOaNLQeWgjg e5rz1tnFg1/E7AUb7CePTsSBYUVV7Q46NRMqtzFKX591vEqHBthDeGf04Ur849IoJGvslE W7OEZh1KDu6bKraJ1zRccKq4dM20OK3uWw77JQaft6fXq6dO+LIqWAnR7e6aXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754143594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkP+rjK7c5x4vS6CcclmFyOZdQ901Mhw3dXKR9KGfHs=; b=vfD5mxPOdthVYVe7fEENHjJTosgB39Dk4IU6/bcq6dtv7r6p6sCZsi4ZPWkWrRRupym78g Y1y1ARUWGSkWDQFIdSxsIgyt33g77FgVs5ME0PIRr4KRC6C3JMGiF8EFSYaYW0BIjkUSg0 a1FGd+5L60xNjwX/hDTrETkASZcJnlktyn3U8OeobkIQpwFq9ImYXtEbeK23tb18WiuTMe 0bNR5W93cIFK6Q4r1TGeUEXc5g1CdJ6ehLvmSme/cU/fKLTvqx9eeTGxymn3QHUYBYu7zj rKFqNTcZuehL4trtLhLkHfUqL5UseOuox9V4YCEeqAi5KigM6+hJdvNv7IE8sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754143594; a=rsa-sha256; cv=none; b=P8MsmI3Y1gq72A6Rfs0ItcU/4p2mTKQUpUAgfV+UslglvDXzL/p/sR8tGxt/rYsEdZihyh 3HJ8sVuN7a5YuJu0jwrbP1sPx+Tx09BaBdXbcA/5ix7jttgBEIYjbEFD53limyWgV5Tg33 U53vGptzqyEK9RwZiTjKyPxTG9juw2wXGxC+HuAsDrkUHQJ7wqBpDU6E8UV5jc+bI+djF2 CmWasWYYX/lj9ok+k4H9n5b1HGKpWLYnkVR+5gTdZ9Zhz+FfMLiaa/ljcnk1L2B3qM/eDY 4ENrogpDWwgMTfx4h+eDoUQwfHgQKHjEDXed9T24EX5rb3E1xK21NHvWoek2Ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvPkf2Ztcz5qt; Sat, 02 Aug 2025 14:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572E6YW7034396; Sat, 2 Aug 2025 14:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572E6Y5t034393; Sat, 2 Aug 2025 14:06:34 GMT (envelope-from git) Date: Sat, 2 Aug 2025 14:06:34 GMT Message-Id: <202508021406.572E6Y5t034393@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: 2e0caa7c7e14 - main - libutil: Really fix expand_number(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e0caa7c7e14d7bdc89ec43be9bc848abe1ca264 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2e0caa7c7e14d7bdc89ec43be9bc848abe1ca264 commit 2e0caa7c7e14d7bdc89ec43be9bc848abe1ca264 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-02 14:05:36 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-02 14:05:36 +0000 libutil: Really fix expand_number(3) It is unclear whether this function was originally intended to support negative numbers. The original implementation used signed integers, but actually giving it a negative number as input would have invoked undefined behavior, and the comments (since removed) only mentioned positive numbers. Fifteen years ago, I “fixed” this by changing the type from signed to unsigned. However, it would still have accepted an input with a leading minus sign (though it would have returned its absolute value). Fifteen years on, change the type back to signed and fix the logic so it correctly handles both positive and negative numbers without invoking undefined behavior. This makes it a better match for humanize_number(3), which it is supposed to complement. Fixes: bbb2703b4f46 Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51542 --- lib/libutil/expand_number.3 | 56 +++++++++++++++++++------------ lib/libutil/expand_number.c | 82 ++++++++++++++++++++++++++++++++++----------- lib/libutil/libutil.h | 2 +- usr.sbin/ctld/conf.cc | 12 ++++--- usr.sbin/ctld/parse.y | 26 +++++++------- 5 files changed, 118 insertions(+), 60 deletions(-) diff --git a/lib/libutil/expand_number.3 b/lib/libutil/expand_number.3 index 3609b1ad3939..1b932400de69 100644 --- a/lib/libutil/expand_number.3 +++ b/lib/libutil/expand_number.3 @@ -1,5 +1,6 @@ .\" Copyright (c) 2007 Eric Anderson .\" Copyright (c) 2007 Pawel Jakub Dawidek +.\" Copyright (c) 2025 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -23,43 +24,49 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 13, 2023 +.Dd July 25, 2025 .Dt EXPAND_NUMBER 3 .Os .Sh NAME .Nm expand_number -.Nd format a number from human readable form +.Nd parse a number from human readable form .Sh LIBRARY .Lb libutil .Sh SYNOPSIS .In libutil.h .Ft int .Fo expand_number -.Fa "const char *buf" "uint64_t *num" +.Fa "const char *buf" "int64_t *num" .Fc .Sh DESCRIPTION The .Fn expand_number -function parses the +function parses the number in the string pointed to by its .Fa buf -string and stores a unsigned 64-bit quantity at -.Fa *num . +argument and stores the number it represents as a signed 64-bit +quantity in the location pointed to by its +.Fa *num +argument. .Pp -The -.Fn expand_number -function -is case-insensitive and -follows the SI power of two convention. +The input string must consist of a decimal number, optionally preceded +by a +.Sq + +or +.Sq - +sign, and optionally followed, without intervening whitespace, by a +suffix indicating a power-of-two multiplier to apply. +Any amount of whitespace at the beginning of the string will be +ignored. .Pp -The suffixes are: +Recognized suffixes are: .Bl -column "Suffix" "Description" "1000000000000000000" -offset indent .It Sy "Suffix" Ta Sy "Description" Ta Sy "Multiplier" -.It Li K Ta No kilo Ta 1024 -.It Li M Ta No mega Ta 1048576 -.It Li G Ta No giga Ta 1073741824 -.It Li T Ta No tera Ta 1099511627776 -.It Li P Ta No peta Ta 1125899906842624 -.It Li E Ta No exa Ta 1152921504606846976 +.It Li K Ta No kilo Ta 1,024 +.It Li M Ta No mega Ta 1,048,576 +.It Li G Ta No giga Ta 1,073,741,824 +.It Li T Ta No tera Ta 1,099,511,627,776 +.It Li P Ta No peta Ta 1,125,899,906,842,624 +.It Li E Ta No exa Ta 1,152,921,504,606,846,976 .El .Pp For historical reasons, the @@ -68,7 +75,11 @@ function accepts and ignores a single .Dq B suffix at the end of the .Fa buf -string. +string (i.e. +.Dq 5b +is interpreted as 5, and +.Dq 5kb +is interpreted as 5,120). However, the usage of this suffix is discouraged. .Sh RETURN VALUES .Rv -std @@ -78,11 +89,12 @@ The function will fail if: .Bl -tag -width Er .It Bq Er EINVAL -The given string contains no digits. +The given string does not contain a valid number. .It Bq Er EINVAL -An unrecognized suffix was given. +An unrecognized suffix was encountered. .It Bq Er ERANGE -Result doesn't fit into 64 bits. +The given string represents a number which does not fit into a +.Vt int64_t . .El .Sh SEE ALSO .Xr humanize_number 3 diff --git a/lib/libutil/expand_number.c b/lib/libutil/expand_number.c index fc2ea8e8b17c..f4c19d7867a3 100644 --- a/lib/libutil/expand_number.c +++ b/lib/libutil/expand_number.c @@ -3,6 +3,7 @@ * * Copyright (c) 2007 Eric Anderson * Copyright (c) 2007 Pawel Jakub Dawidek + * Copyright (c) 2025 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,79 +29,120 @@ */ #include + #include #include #include #include +#include #include int -expand_number(const char *buf, uint64_t *num) +expand_number(const char *buf, int64_t *num) { char *endptr; - uintmax_t umaxval; - uint64_t number; - unsigned shift; + uintmax_t number; + unsigned int shift; + bool neg; int serrno; + /* + * Skip whitespace and optional sign. + */ + while (isspace((unsigned char)*buf)) + buf++; + if (*buf == '-') { + neg = true; + buf++; + } else { + neg = false; + if (*buf == '+') + buf++; + } + + /* + * The next character should be the first digit of the number. If + * we don't enforce this ourselves, strtoumax() will allow further + * whitespace and a (second?) sign. + */ + if (!isdigit((unsigned char)*buf)) { + errno = EINVAL; + return (-1); + } + serrno = errno; errno = 0; - umaxval = strtoumax(buf, &endptr, 0); - if (umaxval > UINT64_MAX) - errno = ERANGE; + number = strtoumax(buf, &endptr, 0); if (errno != 0) return (-1); errno = serrno; - number = umaxval; switch (tolower((unsigned char)*endptr)) { case 'e': shift = 60; + endptr++; break; case 'p': shift = 50; + endptr++; break; case 't': shift = 40; + endptr++; break; case 'g': shift = 30; + endptr++; break; case 'm': shift = 20; + endptr++; break; case 'k': shift = 10; + endptr++; break; - case 'b': - shift = 0; - break; - case '\0': /* No unit. */ - *num = number; - return (0); default: - /* Unrecognized unit. */ - errno = EINVAL; - return (-1); + shift = 0; } /* * Treat 'b' as an ignored suffix for all unit except 'b', * otherwise there should be no remaining character(s). */ - endptr++; - if (shift != 0 && tolower((unsigned char)*endptr) == 'b') + if (tolower((unsigned char)*endptr) == 'b') endptr++; if (*endptr != '\0') { errno = EINVAL; return (-1); } + /* + * Apply the shift and check for overflow. + */ if ((number << shift) >> shift != number) { /* Overflow */ errno = ERANGE; return (-1); } - *num = number << shift; + number <<= shift; + + /* + * Apply the sign and check for overflow. + */ + if (neg) { + if (number > 0x8000000000000000LLU /* -INT64_MIN */) { + errno = ERANGE; + return (-1); + } + *num = -number; + } else { + if (number > INT64_MAX) { + errno = ERANGE; + return (-1); + } + *num = number; + } + return (0); } diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h index 7d8bfdf67fac..6d36a0c291c6 100644 --- a/lib/libutil/libutil.h +++ b/lib/libutil/libutil.h @@ -89,7 +89,7 @@ __BEGIN_DECLS char *auth_getval(const char *_name); void clean_environment(const char * const *_white, const char * const *_more_white); -int expand_number(const char *_buf, uint64_t *_num); +int expand_number(const char *_buf, int64_t *_num); int extattr_namespace_to_string(int _attrnamespace, char **_string); int extattr_string_to_namespace(const char *_string, int *_attrnamespace); int flopen(const char *_path, int _flags, ...); diff --git a/usr.sbin/ctld/conf.cc b/usr.sbin/ctld/conf.cc index e86b44ee5004..f3285ebf9d56 100644 --- a/usr.sbin/ctld/conf.cc +++ b/usr.sbin/ctld/conf.cc @@ -409,7 +409,8 @@ lun_set_blocksize(size_t value) bool lun_set_device_type(const char *value) { - uint64_t device_type; + const char *errstr; + int device_type; if (strcasecmp(value, "disk") == 0 || strcasecmp(value, "direct") == 0) @@ -421,9 +422,12 @@ lun_set_device_type(const char *value) strcasecmp(value, "dvd") == 0 || strcasecmp(value, "dvdrom") == 0) device_type = T_CDROM; - else if (expand_number(value, &device_type) != 0 || device_type > 15) { - log_warnx("invalid device-type \"%s\" for lun \"%s\"", value, - lun->l_name); + else { + device_type = strtonum(value, 0, 15, &errstr); + if (errstr != NULL) { + log_warnx("invalid device-type \"%s\" for lun \"%s\"", value, + lun->l_name); + } return (false); } diff --git a/usr.sbin/ctld/parse.y b/usr.sbin/ctld/parse.y index 56455d33bd27..c0146262e895 100644 --- a/usr.sbin/ctld/parse.y +++ b/usr.sbin/ctld/parse.y @@ -105,7 +105,7 @@ statement: debug: DEBUG STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -120,7 +120,7 @@ debug: DEBUG STR timeout: TIMEOUT STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -135,7 +135,7 @@ timeout: TIMEOUT STR maxproc: MAXPROC STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -172,7 +172,7 @@ isns_server: ISNS_SERVER STR isns_period: ISNS_PERIOD STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -187,7 +187,7 @@ isns_period: ISNS_PERIOD STR isns_timeout: ISNS_TIMEOUT STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -432,7 +432,7 @@ portal_group_redirect: REDIRECT STR portal_group_tag: TAG STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -448,7 +448,7 @@ portal_group_tag: TAG STR portal_group_dscp : DSCP STR { - uint64_t tmp; + int64_t tmp; if (strcmp($2, "0x") == 0) { tmp = strtol($2 + 2, NULL, 16); @@ -488,7 +488,7 @@ portal_group_dscp portal_group_pcp: PCP STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -704,7 +704,7 @@ target_lun: LUN lun_number lun_number: STR { - uint64_t tmp; + int64_t tmp; if (expand_number($1, &tmp) != 0) { yyerror("invalid numeric value"); @@ -720,7 +720,7 @@ lun_number: STR target_lun_ref: LUN STR STR { - uint64_t tmp; + int64_t tmp; bool ok; if (expand_number($2, &tmp) != 0) { @@ -778,7 +778,7 @@ lun_backend: BACKEND STR lun_blocksize: BLOCKSIZE STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -816,7 +816,7 @@ lun_device_type: DEVICE_TYPE STR lun_ctl_lun: CTL_LUN STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); @@ -866,7 +866,7 @@ lun_serial: SERIAL STR lun_size: SIZE STR { - uint64_t tmp; + int64_t tmp; if (expand_number($2, &tmp) != 0) { yyerror("invalid numeric value"); From nobody Sat Aug 2 14:06:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvPkg6FXgz638hB; Sat, 02 Aug 2025 14:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvPkg4BK8z3xVJ; Sat, 02 Aug 2025 14:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754143595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BzK8h7/SAeUhW2BfQ1EcBzm7PgpwZZJ6vG/iYeA2UWo=; b=vBMWM/LCZQu4hz1kOnIaWve5S/3fROUNG9nuzn3mTaUmPLdES6nyIZolx4SFyg2KmGgDqh Cq5NDBpjeJv7M93KejWwubSepNPiTqgvBGp9BsBm5AkSUhsZK3HVKAcWXUE+QKBxrMrw7i ttAV76E6s1jB3rOqqk+yBiZUa71ljzSkStQrJWyyonf/lfXxdO3RXYOeBP2KZsaRlcU7zt 5GHwitfyc8f9UCYTgMi4SekPFujyIH7JiKJMFZhecTkW6r/ph/nyYGyPSlVFKtMdjdU8BJ MSJsn1ZYwoskDoGl2hBpd9JIHT4BbRzgy29/gg2t1CMpFT1E3xOwf4J3ed2/LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754143595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BzK8h7/SAeUhW2BfQ1EcBzm7PgpwZZJ6vG/iYeA2UWo=; b=OiRA0DHCEuffVY7YAM5diaMJGIAaFbcfZUrZOGvldp+3NC8NgK9pRYe8pcnX0x5YZcHwrM kiHWJOKsbpkQicKfW1l3rkgn3m2OCGWvGwKKN0yTtO/Jle+PSxsi2HGWfseVXVWR0OoVD0 Ob6beiW+gHbqSFAUwBnwa3qa8rzJQS+JMxELIz6zYAZpSV51pPII8LsOOfHN8EZ5xZ85s7 yWQAC8aHifIUQHnicKDW7JgUEHl2dmh7zIr9ORdCMcY8gFhy9JbY6ru6dfFBDzS/gU7TEP gqC2qRSz1fEAGDMnIQO0FyYabutfvuYeWZAeEpJ+Pjd6CitLIS4k2QpaEvN4iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754143595; a=rsa-sha256; cv=none; b=LV/YlR8mW5i9BcXdUZT8bebc5oe2a8Vyt9QUSoaj9Z+LRUkM1+HWqNX0H0aC9SEFPzJXn6 5PZCXcYYi4cqSrfCzaUA+OhrTXtLyNFSXrUZiWJfSH6+5gFHnpbU1tztPEc5c+1DQpBb0P YF64WEcFqfD3F7IaZsTCZHB193v4iOFMRMTnLT5Wr9Je6VbvNOEHjcNE6z1ZXWiCa/V8lK /95uvc6GdK8KSZKzC/IzgYqhb+6xewgQPmaSSxHjUXBMLNg10epCMk2wzu9TjrObhcOydk SGChsWZFEpWNUUU4jy7IReIjgc7bXwrGP6dKL5tCzl3su28V48f8ik6rXjpwxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvPkg3Y5dz5qv; Sat, 02 Aug 2025 14:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572E6Zag034433; Sat, 2 Aug 2025 14:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572E6ZRv034430; Sat, 2 Aug 2025 14:06:35 GMT (envelope-from git) Date: Sat, 2 Aug 2025 14:06:35 GMT Message-Id: <202508021406.572E6ZRv034430@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: 301dee770efe - main - libutil: Better tests for expand_number(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 301dee770efe9c520ac001add39b9180897aafbb Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=301dee770efe9c520ac001add39b9180897aafbb commit 301dee770efe9c520ac001add39b9180897aafbb Author: Dag-Erling Smørgrav AuthorDate: 2025-08-02 14:05:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-02 14:05:44 +0000 libutil: Better tests for expand_number(3) Replace the current tests with jhb's earlier, more extensive proposal, updated to take into account the switch back to signed integers. Reviewed by: pstef Differential Revision: https://reviews.freebsd.org/D20796 --- lib/libutil/tests/expand_number_test.c | 219 ++++++++++++++++++++++++++------- 1 file changed, 175 insertions(+), 44 deletions(-) diff --git a/lib/libutil/tests/expand_number_test.c b/lib/libutil/tests/expand_number_test.c index 6bf3ff082ee4..8e7458994de4 100644 --- a/lib/libutil/tests/expand_number_test.c +++ b/lib/libutil/tests/expand_number_test.c @@ -1,7 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2023 Google LLC + * Copyright (c) 2019 John Baldwin + * Copyright (c) 2025 Dag-Erling Smørgrav * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,60 +26,190 @@ * SUCH DAMAGE. */ -#include +#include #include #include +#include -#include +static void +require_success(const char *str, int64_t exp_val) +{ + int64_t val; -ATF_TC_WITHOUT_HEAD(positivetests); -ATF_TC_BODY(positivetests, tc) + ATF_REQUIRE_MSG(expand_number(str, &val) == 0, + "Failed to parse '%s': %m", str); + ATF_REQUIRE_MSG(val == exp_val, + "String '%s' parsed as %jd instead of expected %jd", str, + (intmax_t)val, (intmax_t)exp_val); +} + +static void +require_error(const char *str, int exp_errno) { - int retval; - uint64_t num; - -#define positive_tc(string, value) \ - do { \ - ATF_CHECK_ERRNO(0, (retval = expand_number((string), &num)) == 0); \ - ATF_CHECK_EQ(retval, 0); \ - ATF_CHECK_EQ(num, (value)); \ - } while (0) - - positive_tc("123456", 123456); - positive_tc("123456b", 123456); - positive_tc("1k", 1024); - positive_tc("1kb", 1024); - positive_tc("1K", 1024); - positive_tc("1KB", 1024); - positive_tc("1m", 1048576); - positive_tc("1M", 1048576); - positive_tc("1g", 1073741824); - positive_tc("1G", 1073741824); - positive_tc("1t", 1099511627776); - positive_tc("1T", 1099511627776); - positive_tc("1p", 1125899906842624); - positive_tc("1P", 1125899906842624); - positive_tc("1e", 1152921504606846976); - positive_tc("1E", 1152921504606846976); - positive_tc("15E", 17293822569102704640ULL); + int64_t val; + + ATF_REQUIRE_MSG(expand_number(str, &val) == -1, + "String '%s' parsed as %jd instead of error", str, (intmax_t)val); + ATF_REQUIRE_MSG(errno == exp_errno, + "String '%s' failed with %d instead of expected %d", str, errno, + exp_errno); +} + +ATF_TC_WITHOUT_HEAD(expand_number__ok); +ATF_TC_BODY(expand_number__ok, tp) +{ + /* Bare numbers. */ + require_success("-0", 0); + require_success(" 0", 0); + require_success("+0", 0); + require_success("-1", -1); + require_success(" 1", 1); + require_success("+1", 1); + require_success("-10", -10); + require_success(" 10", 10); + require_success("+10", 10); + + /* Uppercase suffixes. */ + require_success("1B", 1); + require_success("1K", 1LL << 10); + require_success("1M", 1LL << 20); + require_success("1G", 1LL << 30); + require_success("1T", 1LL << 40); + require_success("1P", 1LL << 50); + require_success("1E", 1LL << 60); + + /* Lowercase suffixes. */ + require_success("2b", 2); + require_success("2k", 2LL << 10); + require_success("2m", 2LL << 20); + require_success("2g", 2LL << 30); + require_success("2t", 2LL << 40); + require_success("2p", 2LL << 50); + require_success("2e", 2LL << 60); + + /* Suffixes with a trailing 'b'. */ + require_success("3KB", 3LL << 10); + require_success("3MB", 3LL << 20); + require_success("3GB", 3LL << 30); + require_success("3TB", 3LL << 40); + require_success("3PB", 3LL << 50); + require_success("3EB", 3LL << 60); + + /* Negative numbers. */ + require_success("-1", -1); + require_success("-10", -10); + require_success("-1B", -1); + require_success("-1K", -(1LL << 10)); + require_success("-1M", -(1LL << 20)); + require_success("-1G", -(1LL << 30)); + require_success("-1T", -(1LL << 40)); + require_success("-1P", -(1LL << 50)); + require_success("-1E", -(1LL << 60)); + require_success("-2b", -2); + require_success("-2k", -(2LL << 10)); + require_success("-2m", -(2LL << 20)); + require_success("-2g", -(2LL << 30)); + require_success("-2t", -(2LL << 40)); + require_success("-2p", -(2LL << 50)); + require_success("-2e", -(2LL << 60)); + require_success("-3KB", -(3LL << 10)); + require_success("-3MB", -(3LL << 20)); + require_success("-3GB", -(3LL << 30)); + require_success("-3TB", -(3LL << 40)); + require_success("-3PB", -(3LL << 50)); + require_success("-3EB", -(3LL << 60)); + + /* Maximum values. */ + require_success("7E", 7LL << 60); + require_success("8191P", 8191LL << 50); + require_success("8388607T", 8388607LL << 40); + require_success("8589934591G", 8589934591LL << 30); + require_success("8796093022207M", 8796093022207LL << 20); + require_success("9007199254740991K", 9007199254740991LL << 10); + require_success("9223372036854775807", INT64_MAX); + + /* Minimum values. */ + require_success("-7E", -(7LL << 60)); + require_success("-8191P", -(8191LL << 50)); + require_success("-8388607T", -(8388607LL << 40)); + require_success("-8589934591G", -(8589934591LL << 30)); + require_success("-8796093022207M", -(8796093022207LL << 20)); + require_success("-9007199254740991K", -(9007199254740991LL << 10)); + require_success("-9223372036854775808", INT64_MIN); } -ATF_TC_WITHOUT_HEAD(negativetests); -ATF_TC_BODY(negativetests, tc) +ATF_TC_WITHOUT_HEAD(expand_number__bad); +ATF_TC_BODY(expand_number__bad, tp) { - uint64_t num; - - ATF_CHECK_ERRNO(EINVAL, expand_number("", &num)); - ATF_CHECK_ERRNO(EINVAL, expand_number("x", &num)); - ATF_CHECK_ERRNO(EINVAL, expand_number("1bb", &num)); - ATF_CHECK_ERRNO(EINVAL, expand_number("1x", &num)); - ATF_CHECK_ERRNO(EINVAL, expand_number("1kx", &num)); - ATF_CHECK_ERRNO(ERANGE, expand_number("16E", &num)); + /* No digits. */ + require_error("", EINVAL); + require_error("b", EINVAL); + require_error("k", EINVAL); + require_error("m", EINVAL); + require_error("g", EINVAL); + require_error("t", EINVAL); + require_error("p", EINVAL); + require_error("e", EINVAL); + require_error("-", EINVAL); + require_error("-b", EINVAL); + require_error("-k", EINVAL); + require_error("-m", EINVAL); + require_error("-g", EINVAL); + require_error("-t", EINVAL); + require_error("-p", EINVAL); + require_error("-e", EINVAL); + + require_error("not_a_number", EINVAL); + + /* Invalid suffixes. */ + require_error("1a", EINVAL); + require_error("1c", EINVAL); + require_error("1d", EINVAL); + require_error("1f", EINVAL); + require_error("1h", EINVAL); + require_error("1i", EINVAL); + require_error("1j", EINVAL); + require_error("1l", EINVAL); + require_error("1n", EINVAL); + require_error("1o", EINVAL); + require_error("1q", EINVAL); + require_error("1r", EINVAL); + require_error("1s", EINVAL); + require_error("1u", EINVAL); + require_error("1v", EINVAL); + require_error("1w", EINVAL); + require_error("1x", EINVAL); + require_error("1y", EINVAL); + require_error("1z", EINVAL); + + /* Trailing garbage. */ + require_error("1K foo", EINVAL); + require_error("1Mfoo", EINVAL); + + /* Overflow. */ + require_error("8E", ERANGE); + require_error("8192P", ERANGE); + require_error("8388608T", ERANGE); + require_error("8589934592G", ERANGE); + require_error("8796093022208M", ERANGE); + require_error("9007199254740992K", ERANGE); + require_error("9223372036854775808", ERANGE); + + /* Multiple signs */ + require_error("--1", EINVAL); + require_error("-+1", EINVAL); + require_error("+-1", EINVAL); + require_error("++1", EINVAL); + + /* Whitespace after the sign */ + require_error(" - 1", EINVAL); + require_error(" + 1", EINVAL); } ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, positivetests); - ATF_TP_ADD_TC(tp, negativetests); + ATF_TP_ADD_TC(tp, expand_number__ok); + ATF_TP_ADD_TC(tp, expand_number__bad); + return (atf_no_error()); } From nobody Sat Aug 2 16:36:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvT3Z6CXnz63Jft; Sat, 02 Aug 2025 16:36:26 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvT3Z5WF9z3C7f; Sat, 02 Aug 2025 16:36:26 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754152586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XlrpNNq/k6VqzA+rOkXQGIgsmMCx/dOAmYMDnuoVrSU=; b=KKar2NUXObjmvrME6Th9vPp8fQUR+Rdlc2LctsTf0c+OL9kTU9j0Y1Al3xw9vg0ZNCTYXa ajV2uAaDNFAXX1eN29S1MCa3tYO6/T1jT48ddHzELW+pEll00uyDtEBooKG1IxhGmXz0os CvA+QXXJdXiJPkEIWAOrjvEOG3MMazbmsn2Vk83o4Q01wr4iIafURWgOA8+fDnEihNSaWW hxEvnFbsWtR1wgMQnGPtmeccu0wNYsQU8yaHLx7MXiVb2mVgJR/teECQ4jCPPUVNKUSVDf ZPSMeZxH6dsgDyYXVnWerl0oXkeac3jbUFEFcX4w6lTMI5wzgVWdAwK2u21PQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754152586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XlrpNNq/k6VqzA+rOkXQGIgsmMCx/dOAmYMDnuoVrSU=; b=dngL5fy0t8ZTKes6OvKS0J6QbMFwPwhkO1kYrMSViVXc9bDkleyA1C0FToh/e1I4CKoc2a /H/XuurZxMsY+63TwDBFkRJT9YBo3luYT21Tfd7GoT5sV75nDndB7xR3sn0UuxqLDtByhX jbVHRamWbzvuFhY114nl3ytbHqVT90ybxZja0doa+gSA40TBcuC0fQ9y23BvM/nXeR1ZK+ nvt0fZSb7fbVMcsLk0xpRgJfyEFDaN+WXG7AvfYlb3U5mfL8L70/I6hbLczLrt6YA+0n3L yzujlcVXegyZTb1AvOVSug61t700s7ljzM76Ls6dmT7UhxLqMKjqOPXfN2ba1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754152586; a=rsa-sha256; cv=none; b=ls/io7rd/IWdYcHEiewOtjfZz2QPG8wlF0FXdpVOHejU21TSWFg2oYeLhBqv94PMUwHxi3 P/rty2QUSEDYMFfpS3k//WwGOC7tnmawEuriSteWUlgTXQq3Lt8zWXnS+vuMGT/yOgM9J5 Uuexx8BBpG/vjAvFj3v5jIiQNC4G67PEzR/uJC78WgtejCq3/hM1XF1kQjh8gFQ8TRtrBG cN8uzt4ISbAi5qPNz6/VZRSHJDs4EZ/k/1w0tc7Yz7J/DorLCo3WGUMyflKz31eQ/Kjspm a7mzTPYxBbPNdz9V8jf0CHHHZ3F75zN8vM1w54eLszzSGWLzDzR8++9f4hk0wA== Received: from ltc.des.dev (88-177-82-251.subs.proxad.net [88.177.82.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bvT3Z48dWzM9h; Sat, 02 Aug 2025 16:36:26 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 6738012D58; Sat, 02 Aug 2025 18:36:25 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ka Ho Ng Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: d5ec97156d33 - main - amd64: include opt_kstack_pages.h In-Reply-To: <202508011641.571Gf1wS014099@gitrepo.freebsd.org> (Ka Ho Ng's message of "Fri, 1 Aug 2025 16:41:01 GMT") References: <202508011641.571Gf1wS014099@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 02 Aug 2025 18:36:25 +0200 Message-ID: <86ldo17kae.fsf@ltc.des.dev> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ka Ho Ng writes: > commit d5ec97156d3314f979629968f76151c2d35a1e62 > Author: Ka Ho Ng > AuthorDate: 2025-08-01 16:29:58 +0000 > Commit: Ka Ho Ng > CommitDate: 2025-08-01 16:40:54 +0000 > > amd64: include opt_kstack_pages.h >=20=20=20=20=20 > This fixes an early KASAN initialization panic in > pmap_san_enter_early_alloc_4k, when a non-default value is specified = for > KSTACK_PAGES in the build config file. >=20=20=20=20=20 > Also, rearrange amd64/locore.S's #include order to match the > counterparts of other architectures. And amd64/locore.S now also > explicitly include opt_kstack_pages.h as well. >=20=20=20=20=20 > Sponsored by: Juniper Networks, Inc. > MFC after: 7 days > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D51676 This breaks the build: In file included from /workspace/src/sys/amd64/amd64/locore.S:34: ./opt_kstack_pages.h:1:9: error: 'KSTACK_PAGES' macro redefined [-Werro= r,-Wmacro-redefined] 1 | #define KSTACK_PAGES 5 | ^ ./assym.inc:24:9: note: previous definition is here 24 | #define KSTACK_PAGES 0x5 | ^ 1 error generated. It also makes no sense as locore.S gets KSTACK_PAGES from assym.inc which is generated at build time with the correct value (genassym.c includes opt_kstack_pages.h). If you somehow managed to build a kernel with inconsistent values of KSTACK_PAGES, it means something else you did caused genassym not to get rebuilt and rerun. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Sat Aug 2 17:07:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvTlK3xcfz63LM8; Sat, 02 Aug 2025 17:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvTlK3C7fz3G26; Sat, 02 Aug 2025 17:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754154445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=34nHjU7Uxk5lIT2BzCgq1WaT/MTugBS57KDPcJv5cRg=; b=fxH5srBE7xrArMfN6wzDBzgEJPoMd1sJUR5cYKlKzl1u95AE4WROhp5guOpxdzUvMgjacN KoI4+x7fd8jvE8e5MwhnbnPX/1+63GxDY2ydGNJ3rOkQAREZ0eLmgyjJaC7IuB7/3a2dIm +ERTAVK9vlHD/G1uM8W2mLnQEeD8fICOvIzU2DkyQ9c9Lwa/r5Yt38G5NSO9uD8sXuBRDi KXdjSM7ZaZjPgKrhksLZZt+0hXrOgxeZTKtixvS4PaKXR7sB61WtYjEmAiug0JaXv3WH0S 7uj2Kjz78wCtEy2XrYVfKh+dIfSlZqRcphJ9N1m+0t9TOpb/JneZcU920W/1LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754154445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=34nHjU7Uxk5lIT2BzCgq1WaT/MTugBS57KDPcJv5cRg=; b=cq7Lorltl1C2sghl2ac1xxh/SWC6KeGEw0GNwtrxPpDXCdCVC3WP7lKTWWn8ohKIk3cPsw OuxIVqz/s1lKGTExwU6iMDi9NidOmQRw0FDtiwSjZgmIV/QGcM6UiLLcTdiMEU96smqQjs RPGfauRRECMuwpP9xLo3ZdLn7rgh1h8OZvlIK4/XfGBExmylqUgc+Ip2pKeNSyO7ZDzYZi jOalozzj/sAb1dd2kUgPLb6qSJHuXBlFWRsuc6P5fKuL0UH+bcNsn0teN+QdAo7nCMuwCd ZhWWDFwOFRxoYiXBFIdgjndIOOrm1R0doAR/19ZRfk3bZvrQri5hidwZQYpM8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754154445; a=rsa-sha256; cv=none; b=vD8NsNTnzy9G2xUFjZSI07TM8qgiLkCjiUrrb5MW4zDzDW39wGB6ChTdYtLeMyOK27l9WC Zw+1QydS+lH6mF6T/z5Mp05ljZLEGmHOIT22ywLFrigJGceIXG5+gKXxje5Yk8SXEW87eE HSimF9zCOxLSA25pJuhHqOz0dfAZscBm1kHlZETwGj/Dz31dC+fKYHRPbac4LqzV7WLsn5 0NgtvYnNg0uTi68iytNVZGFLxJ8M8YaXo38ftstG7OMLpamHTW9nwGJ1eBdVo2nS/l7bbv Hg1cQeQ+HeJ0UC8CynIq1H7TC95cUnl9yBBQQAKC13cFIyklXnF3VUyU6taLmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvTlK2pGgzBF8; Sat, 02 Aug 2025 17:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572H7Pps073507; Sat, 2 Aug 2025 17:07:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572H7PQA073504; Sat, 2 Aug 2025 17:07:25 GMT (envelope-from git) Date: Sat, 2 Aug 2025 17:07:25 GMT Message-Id: <202508021707.572H7PQA073504@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: d0144563a0c1 - main - UPDATING: Correct typo in hw.usb.usbhid.enable tunable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0144563a0c1454c59daac57fc52ad9f09ab1d8e Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d0144563a0c1454c59daac57fc52ad9f09ab1d8e commit d0144563a0c1454c59daac57fc52ad9f09ab1d8e Author: Ed Maste AuthorDate: 2025-08-02 17:06:18 +0000 Commit: Ed Maste CommitDate: 2025-08-02 17:07:14 +0000 UPDATING: Correct typo in hw.usb.usbhid.enable tunable I accidentally had usbhid_enable. Reported by: Ralf Wenk --- UPDATING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 28ff08e65ef5..55cb4181ce30 100644 --- a/UPDATING +++ b/UPDATING @@ -35,7 +35,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: additional issues prior to FreeBSD 15.0. To revert to the previous USB HID driver behavior, set the loader - tunable hw.usb.usbhid_enable=0. + tunable hw.usb.usbhid.enable=0. 20250727: bmake (i.e., /usr/bin/make and /usr/share/mk) has moved to a new From nobody Sat Aug 2 17:15:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvTw52GSmz63Lby; Sat, 02 Aug 2025 17:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvTw51GSQz3GWs; Sat, 02 Aug 2025 17:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754154901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wmPSxCTiy8tiJXFn5jk0rhTLYIiYdl+/MWY8wECmq90=; b=yB3TfazDxc4l5LBgmpc7B32txEZfMxe90i1XxfC3teir+O8vMejYFC8cUBiaxhB2vo3ANr 45qDtJ+ieXWy/XOfKCfi70MSPZtyEdPPvU63DZKU3u0ID+EpH5LDeif72agAoyc2vWa1Eb Dt3ESEVOURkR16n+v3DE1OtREeKPQZBx4RoEt4wm7szWYKAxpBm0Ty4VEbF4YeDkGOdSdB i1TRC/S6UcrriuMjD5jcNVR7HBfOenfyeHx08EBt+Ff+T9+mrljTY0IueS7bIGQVJELJ8n 86nGJcje27eVvOPqqjmTl/C7L33tj5v3a0MtZcwgRNTo7GjVo4V0lyzpQ1lx0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754154901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wmPSxCTiy8tiJXFn5jk0rhTLYIiYdl+/MWY8wECmq90=; b=frDmIw1dxVSndnjDQ32nR8AG1N/nt2AP3Vu4JzGip4MdWMt8a85QXe2KidhOzDFrUPUd24 QoBshG8FBolEg+xErtNqnVzXQ/5EXtqPhQvk/02gvMCTKEeUnIdS7tI4XsgF8HYfZ6sY36 lemUurbyebJUB4sCy6jflTzeptoz5DobKjrwZYlOQSVW0sn4jZLexRg3B5ZuLisMJIghVH klwdIhnsQT9RlX6ZvVRn3nDmzvWtL7zkIgaA8WnYVXUg55FIrYezdPWrud+OpHBhqM26th Pyhint9fysYmeDdeJQcePKPuK5g4klr0meNrKRuYt0gYoqD6bRnK4OMYF9LEJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754154901; a=rsa-sha256; cv=none; b=PcD/O0Iw+GAirTiIOSa8qLRkRtDC+aZ1kQ2g1qz4+jXyE1i2pToC4agKX4W/IWy+q20zuC y50UZlxKW2oeEMw0MMybI6QCFM++hbl+WjIzeEt833QO1ksAoRTlFW9XMpRYL5ZOIuGiqO 46qwi4W2neLtdJciXK+B+6OafAvIDIIQBfxCGNcoDyob+T7SNSQ/sAlraDSbNZiMiU8ev3 IsOrz78YxROejOCkZqfAgDHLcobDTjP1RrZyxb+Y9VdTQwX6Tv0m9ZBS58W+WgaS/RUJDf GUoztNXned8c6GLswUZBhz0Cy6kVrU6A29OwgupqJgXrG3ZEDmANBi3xto/9nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvTw50sKJzBdc; Sat, 02 Aug 2025 17:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572HF1Rp091037; Sat, 2 Aug 2025 17:15:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572HF1Q7091034; Sat, 2 Aug 2025 17:15:01 GMT (envelope-from git) Date: Sat, 2 Aug 2025 17:15:01 GMT Message-Id: <202508021715.572HF1Q7091034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 6fb848f2ff91 - main - amd64 pmap: Use INVPCID_CTXGLOB on Ryzen processors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fb848f2ff91337dbb26024ab41103ee2b036021 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=6fb848f2ff91337dbb26024ab41103ee2b036021 commit 6fb848f2ff91337dbb26024ab41103ee2b036021 Author: Alan Cox AuthorDate: 2025-07-07 02:45:11 +0000 Commit: Alan Cox CommitDate: 2025-08-02 17:14:39 +0000 amd64 pmap: Use INVPCID_CTXGLOB on Ryzen processors Recent AMD Ryzen processors support a limited form of the invpcid instruction, even when they do not support PCID functionality. In particular, they support the type 2 form of the instruction, what we call INVPCID_CTXGLOB. This is faster than toggling PGE in cr4. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51565 --- sys/amd64/amd64/machdep.c | 7 ++--- sys/amd64/amd64/pmap.c | 76 +++++++++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 37c7056f649c..9ff60439d1ec 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1336,12 +1336,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) pti = pti_get_default(); TUNABLE_INT_FETCH("vm.pmap.pti", &pti); TUNABLE_INT_FETCH("vm.pmap.pcid_enabled", &pmap_pcid_enabled); - if ((cpu_feature2 & CPUID2_PCID) != 0 && pmap_pcid_enabled) { - invpcid_works = (cpu_stdext_feature & - CPUID_STDEXT_INVPCID) != 0; - } else { + if ((cpu_feature2 & CPUID2_PCID) == 0) pmap_pcid_enabled = 0; - } + invpcid_works = (cpu_stdext_feature & CPUID_STDEXT_INVPCID) != 0; /* * Now we can do small core initialization, after the PCID diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 6369498210d9..243a6625bece 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2904,6 +2904,9 @@ pmap_update_pde_invalidate(pmap_t pmap, vm_offset_t va, pd_entry_t newpde) /* * Promotion: flush every 4KB page mapping from the TLB, * including any global (PG_G) mappings. + * + * This function is only used on older processors that + * do not support the invpcid instruction. */ invltlb_glob(); } @@ -3050,13 +3053,13 @@ pmap_update_pde_invalidate(pmap_t pmap, vm_offset_t va, pd_entry_t newpde) * local user page: INVLPG * local kernel page: INVLPG * local user total: reload %cr3 - * local kernel total: invltlb_glob() + * local kernel total: INVPCID(CTXGLOB) or invltlb_glob() * remote user page, inactive pmap: - * remote user page, active pmap: IPI:INVLPG * remote kernel page: IPI:INVLPG * remote user total, inactive pmap: - * remote user total, active pmap: IPI:(reload %cr3) - * remote kernel total: IPI:invltlb_glob() + * remote kernel total: IPI:INVPCID(CTXGLOB) or invltlb_glob() * Since on return to user mode, the reload of %cr3 with ucr3 causes * TLB invalidation, no specific action is required for user page table. * @@ -3356,7 +3359,8 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) } static inline void -pmap_invalidate_all_pcid_cb(pmap_t pmap, bool invpcid_works1) +pmap_invalidate_all_cb_template(pmap_t pmap, bool pmap_pcid_enabled1, + bool invpcid_works1) { struct invpcid_descr d; uint64_t kcr3; @@ -3370,57 +3374,63 @@ pmap_invalidate_all_pcid_cb(pmap_t pmap, bool invpcid_works1) invltlb_glob(); } } else if (pmap == PCPU_GET(curpmap)) { - CRITICAL_ASSERT(curthread); - - pcid = pmap_get_pcid(pmap); - if (invpcid_works1) { - d.pcid = pcid; - d.pad = 0; - d.addr = 0; - invpcid(&d, INVPCID_CTX); + if (pmap_pcid_enabled1) { + CRITICAL_ASSERT(curthread); + + pcid = pmap_get_pcid(pmap); + if (invpcid_works1) { + d.pcid = pcid; + d.pad = 0; + d.addr = 0; + invpcid(&d, INVPCID_CTX); + } else { + kcr3 = pmap->pm_cr3 | pcid; + load_cr3(kcr3); + } + if (pmap->pm_ucr3 != PMAP_NO_CR3) + PCPU_SET(ucr3_load_mask, ~CR3_PCID_SAVE); } else { - kcr3 = pmap->pm_cr3 | pcid; - load_cr3(kcr3); + invltlb(); } - if (pmap->pm_ucr3 != PMAP_NO_CR3) - PCPU_SET(ucr3_load_mask, ~CR3_PCID_SAVE); } } static void -pmap_invalidate_all_pcid_invpcid_cb(pmap_t pmap) +pmap_invalidate_all_pcid_invpcid_cb(pmap_t pmap, vm_offset_t addr1 __unused, + vm_offset_t addr2 __unused) { - pmap_invalidate_all_pcid_cb(pmap, true); + pmap_invalidate_all_cb_template(pmap, true, true); } static void -pmap_invalidate_all_pcid_noinvpcid_cb(pmap_t pmap) +pmap_invalidate_all_pcid_noinvpcid_cb(pmap_t pmap, vm_offset_t addr1 __unused, + vm_offset_t addr2 __unused) { - pmap_invalidate_all_pcid_cb(pmap, false); + pmap_invalidate_all_cb_template(pmap, true, false); } static void -pmap_invalidate_all_nopcid_cb(pmap_t pmap) +pmap_invalidate_all_nopcid_invpcid_cb(pmap_t pmap, vm_offset_t addr1 __unused, + vm_offset_t addr2 __unused) { - if (pmap == kernel_pmap) - invltlb_glob(); - else if (pmap == PCPU_GET(curpmap)) - invltlb(); + pmap_invalidate_all_cb_template(pmap, false, true); } -DEFINE_IFUNC(static, void, pmap_invalidate_all_cb, (pmap_t)) +static void +pmap_invalidate_all_nopcid_noinvpcid_cb(pmap_t pmap, vm_offset_t addr1 __unused, + vm_offset_t addr2 __unused) { - if (pmap_pcid_enabled) - return (invpcid_works ? pmap_invalidate_all_pcid_invpcid_cb : - pmap_invalidate_all_pcid_noinvpcid_cb); - return (pmap_invalidate_all_nopcid_cb); + pmap_invalidate_all_cb_template(pmap, false, false); } -static void -pmap_invalidate_all_curcpu_cb(pmap_t pmap, vm_offset_t addr1 __unused, - vm_offset_t addr2 __unused) +DEFINE_IFUNC(static, void, pmap_invalidate_all_curcpu_cb, (pmap_t, vm_offset_t, + vm_offset_t)) { - pmap_invalidate_all_cb(pmap); + if (pmap_pcid_enabled) + return (invpcid_works ? pmap_invalidate_all_pcid_invpcid_cb : + pmap_invalidate_all_pcid_noinvpcid_cb); + return (invpcid_works ? pmap_invalidate_all_nopcid_invpcid_cb : + pmap_invalidate_all_nopcid_noinvpcid_cb); } void From nobody Sat Aug 2 17:56:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvVrX0CSpz63NrC; Sat, 02 Aug 2025 17:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvVrW6fNvz3KQW; Sat, 02 Aug 2025 17:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0kRBNkW/w3KXxEHId7L2K/O1OoNlVNliJ2wa1GvAiNk=; b=hY2JvhPgNSC/hx6KcPmAUESasWunUegZuaRw3Xr0HHa1nM/SCOny5upqrUWZlJ/CixT6UO 75xFdgnew5ebpEYQrqkIkd8jzeFbYosHBuyegfet6mhxrRyvCQZZaxBy5nKruPNFDkabvg tpkfusqtAeDtHUx96awBuPzNquESg7ZSS/UP0CFeyI9qDnNWJVGXk9el+UQ2CC5I4X8ZQO JKVwIeWayzmeT58k1D9WMzw7UQS+H04AaS7ZvxNawWzBU6PtChJkQlgVHvwkB5R1Yb8TvN QU4I7pJ684OADl8rJjPtsbWC1QiwQLPFHmlZKKJvsqADg3AuQEFBTHbgIPBtMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0kRBNkW/w3KXxEHId7L2K/O1OoNlVNliJ2wa1GvAiNk=; b=IEACPMRRluyQEa/HxeqdVFMUSWXI7XXqHpz+1/j3//U0fQ6jrOcp9sPRsFn8WfACDsIWN/ hUURO38rPV5+4oOeXV1aMjB2/QrNZnhkXO+jmytXXconPAFh4vACDWtEhLMwsFFB7GSCYn fbnGu5zWnjNe2P3OFre9wc754KNTeIhQOPJy6FzZ1HFIjz/qnmzNje/LWbIP3BNFROkf8H Pt9QcYkAIjeCaErZOKhhG0dvPaoFF1sbo2xrYlagywL4i7DQFwmHIHE02cFREP+LdhMiK2 Em0egyKP5wXhTR8ApA0aonAGhm158DR8Fc4g64TVOGQ+o8n3DWSye0ljVvVmFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754157419; a=rsa-sha256; cv=none; b=uurktQK9Gyg0LS0BeZRt8ZsMR3WdzS4IzFUrVvH+VKuGIS97IF4FoyvB4WY8MpvGnQygn6 Ab7xaoWOwgkO9D4vK3+eM/BpFhuS4vGrGSTkQoY6kv75V/UO0u/XxtS+nLHi3mC31KtsSC 5+klsfsb9KFkYRUjvYBPcL8q+KsoAnhVG5AAolEG98A8eQATGqjHyj/OUtYSyez+jWgqE1 MFsgvNrSZ6b3qPIDEVZykl/6nrlkQRKwFNdDHWq6X8tCnc2hKL5sN3Y28tgKEIIiuvjNE0 Ohj2ZZQQf4wgvt4zct2qrA2/D0wo8jalD7MKM+u/wGYF3ga440ppz99POKlxgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvVrW68FszC5c; Sat, 02 Aug 2025 17:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572HuxmY066171; Sat, 2 Aug 2025 17:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572HuxZv066168; Sat, 2 Aug 2025 17:56:59 GMT (envelope-from git) Date: Sat, 2 Aug 2025 17:56:59 GMT Message-Id: <202508021756.572HuxZv066168@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: 294a4b72ca27 - main - RELNOTES: Mention deprecation of readdir_r(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 294a4b72ca2768acd40cc5f84ab104f5a30745a8 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=294a4b72ca2768acd40cc5f84ab104f5a30745a8 commit 294a4b72ca2768acd40cc5f84ab104f5a30745a8 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-02 14:31:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-02 17:56:35 +0000 RELNOTES: Mention deprecation of readdir_r(3) --- RELNOTES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELNOTES b/RELNOTES index 9ab511b7a3d3..42ca5282a79d 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +2bd157bc732a: + The readdir_r(3) function is deprecated and may be removed in future + releases. Using it in a program will result in compile-time and + link-time warnings. + 9ba51cce8bbd: bsnmpd(1) no longer supports legacy UDP transport. Users, that have not updated their /etc/snmpd.config since 12.0-RELEASE or older will From nobody Sat Aug 2 17:57:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvVrY1k7Gz63NXf; Sat, 02 Aug 2025 17:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvVrY0DJcz3K8H; Sat, 02 Aug 2025 17:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CO7kpB9TveoasdEq9f2EhIZUTa7ngxYqVqkQZ643qyI=; b=Or3Yrck/lfxYVU2uc2Ytwpm5owXdvdY+/jSTJmcKdssW+O6rMJFkQi5epdmaVS+CFgKmaq V8yKaceqio5mYOT0FYidvQnopmXptfNiTR3PwfYlljz16Fh3U3dPmFyHr+t9QbqtLmtVSn 4mWCV1DmDbWOCD5eUS30apVKiuwt2Bfbnq+BJRHLxJi7ope4Rg121N+Px4AT9gYdHGMafF 6xi7adVNr/+uQsH9yPu4jYuNsx6NJ8Kiat/5Qu3EaFSoeiNW8TUCUq8e76L70adz4UD/BO ema+KQBuxq07XNCYt84JUxNhvwy+8/3qlzla8008YUatDPCZZ1u+JsajWoDHzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CO7kpB9TveoasdEq9f2EhIZUTa7ngxYqVqkQZ643qyI=; b=MMLJ40N0kIT2aCDL43psbK0P/0Upd5hyo/kkHIrdMoIBvfyAk8cefw/dktc68sxEP5kFsH 9ZEHKpel12FmVjR3sx2KVYzbgS+pQoDuo0jeGsXccgBvH3Bqlo+vwanwvv53KmUdE/NU77 yIF+SDsdHGekFnP+mzlV2YA4oi8mlhq8uKD0zVrbvEc+VVxHz67oltDDsMW5Lgnmlf284C TECuHS9W1mlk7+y3qsywo1aTvsLyGYgRlg01uySpNaLyFIZxt6CWzQ/wtj4rPHTx10hgF1 FmuMRBg4rmMq7MT5D2U1Z9kPJibXwwCr4yge5QwfBVO1gkk/AAeoiVWruwFwFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754157421; a=rsa-sha256; cv=none; b=sqw0CGuYm/2Q22iBEc56yKElnB6z8sZz6UxLFK4pFLvTXe3kKosXCDhpAoKOZpRxUq0bVT azn56Q893gXptOhV2ygIPWWRp7EojpSBDQsBEIJgTjfIvDFUKSAcdGeZQGUpxZCSWIoxD4 HvNPTnLDD4scVvHZicdit9DUhhKjd6307PkCU7WYdGMKyEzhf74pWxunF/nYUoknUBBfWA nsk1wvHL2Q4V4eT7GFw7TDhp/hdHlc0x7/OSSCzrH6ocXkR88JCA7tCSDGTscvOS5cSMMV M/A3zaBOQdA8dsXS5oJKEocMXQzBgmfJIO6dHFRzSIyi4f1WjSg7BdJ5kgZcVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvVrX6xzCzC5d; Sat, 02 Aug 2025 17:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572Hv03P066214; Sat, 2 Aug 2025 17:57:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572Hv0QM066211; Sat, 2 Aug 2025 17:57:00 GMT (envelope-from git) Date: Sat, 2 Aug 2025 17:57:00 GMT Message-Id: <202508021757.572Hv0QM066211@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: 7cde6868f80b - main - libc: Drop gets() from symbol map List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 7cde6868f80b07be449c12e180e81545347d6279 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7cde6868f80b07be449c12e180e81545347d6279 commit 7cde6868f80b07be449c12e180e81545347d6279 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-02 17:56:09 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-02 17:56:35 +0000 libc: Drop gets() from symbol map We have an explicit __sym_compat() entry for the legacy implementation. Fixes: 7381dcc9eeb7 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D51701 --- lib/libc/stdio/Symbol.map | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libc/stdio/Symbol.map b/lib/libc/stdio/Symbol.map index d491b83c11fb..e44ea6554d46 100644 --- a/lib/libc/stdio/Symbol.map +++ b/lib/libc/stdio/Symbol.map @@ -44,7 +44,6 @@ FBSD_1.0 { fwscanf; getc; getchar; - gets; getw; getwc; getwchar; From nobody Sat Aug 2 17:57:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvVrZ6Xpyz63NVV; Sat, 02 Aug 2025 17:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvVrZ1BZKz3K8L; Sat, 02 Aug 2025 17:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K1fgTXrB2KmukwDcWlKYm7hIg2pcLlvv8ckkj7FbNBg=; b=JAtEMKEGTgjpPN1WW5gDV9GAFShemzHiyD0x2tDXtTHo2KOSKlKE6xFSPXM+21lIgb7d70 bKdtO4TXwZoz1EBMZsmm4Kmh0lqyC8OhZuEWSrBlqyVLiMoRbac5NfyD1dQ+f2+j2wFcL7 lTPhKAY/4kGK/5jY7Sw5iR3IgV/wrFFnPvFbq7wUOITaCRaTsqvWD+FfuyT81gxMWehhL3 aLdc8yW7vOYAyetZ+RRjFaIoCsyhcl+Rfg1VSdwEKL27ZKO4HwGGjw2B91UUNUc9+WgFkx P6V4/IkRycfUxIwU/ZTA6chRGH1GyuadJuNNt8KBL8h4rdZEK+TSDvJcAyYkvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K1fgTXrB2KmukwDcWlKYm7hIg2pcLlvv8ckkj7FbNBg=; b=e1Jsz/VRXL+Cc+ku0gd3nU4pFu+NIFIbD0z7dRZB297GvxYygljB9Ww0jWAYLQU9O+X21j mMl8s3WYSHV/Cn07xLA8uOKa8YzRZQIHKnqWNagaBGzPdgd2K0PGZgGVfH+mAfsDUpxqsk 6V4Iq5cL6x7QpXvtQ6W0Tg9+ephIq5HgoO9PwCgFqSyKhUKdOBUL1FFP0Nv5VJoFywYFRZ kG7GwiS2KghjhLA9wTSmclqfIjWGZbKa14j4whb1msXUUJnp303FwSW7IMQHejgQxje/Fl pTw+YIiiE0O1MYfTuo/8ccBPWyNnS//Oq8ZaxZpeevnHAA6S0Fadj7RqMAErpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754157422; a=rsa-sha256; cv=none; b=P6OTNbcWz6q7B67KzxGW5kNg/6jnNEG8W9A0JrllSlm4vsQ3TzJDpKC3SVSXPm8MuF+0/c qyQDC3Oj3hl3/cC5fWK6WjIenJrYF5QlSWRwHRd6CRYRKUK7zNk9DIFEBQhvqF3JNfwFbZ k8zkUFwh1wyBvJU27UooO2vDx70XPvYetCXgXPoidoAjfMVqAWxuaznGnLaQxMkjokmUAN v2u89drDEDldBPzd6dIEdQ3pqKvJhwYAJnFmr1prog1wT8TQJ3Q3OH4baaRfKDgvcRhaAa x4e4UBWKgh3scwq9WX1flD84lCA9zpWAluY7WHDBgy6M4jNjAl+Ur4fQpOky0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvVrZ0mDzzC5f; Sat, 02 Aug 2025 17:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572Hv20x066251; Sat, 2 Aug 2025 17:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572Hv2Ox066248; Sat, 2 Aug 2025 17:57:02 GMT (envelope-from git) Date: Sat, 2 Aug 2025 17:57:02 GMT Message-Id: <202508021757.572Hv2Ox066248@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: 8d8a745c456c - main - libutil: Drop auth_getval() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 8d8a745c456cacf706689febee9639f5e8292fc8 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8d8a745c456cacf706689febee9639f5e8292fc8 commit 8d8a745c456cacf706689febee9639f5e8292fc8 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-02 17:56:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-02 17:56:35 +0000 libutil: Drop auth_getval() This function has been an empty stub for years; now that we're bumping the library version, we can finally get rid of it. Fixes: 0c381b7f0570 Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D51704 --- lib/libutil/Makefile | 2 +- lib/libutil/Symbol.map | 1 - lib/libutil/auth.c | 44 -------------------------------------------- lib/libutil/libutil.h | 1 - 4 files changed, 1 insertion(+), 47 deletions(-) diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index d445bc5dec3b..12ac623aec6b 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -9,7 +9,7 @@ PACKAGE= runtime LIB= util SHLIB_MAJOR= 10 -SRCS= _secure_path.c auth.c cpuset.c expand_number.c flopen.c fparseln.c \ +SRCS= _secure_path.c cpuset.c expand_number.c flopen.c fparseln.c \ ftime.c getlocalbase.c gr_util.c \ hexdump.c humanize_number.c kinfo_getfile.c \ kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \ diff --git a/lib/libutil/Symbol.map b/lib/libutil/Symbol.map index d4bac5b5f53e..8c8fff451cd1 100644 --- a/lib/libutil/Symbol.map +++ b/lib/libutil/Symbol.map @@ -2,7 +2,6 @@ FBSD_1.8 { _secure_path; auth_cat; auth_checknologin; - auth_getval; auth_hostok; auth_timeok; auth_ttyok; diff --git a/lib/libutil/auth.c b/lib/libutil/auth.c deleted file mode 100644 index 3414fc8e26e7..000000000000 --- a/lib/libutil/auth.c +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Simple authentication database handling code. - * - * Copyright (c) 1998 - * Jordan Hubbard. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this - * point in the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR HIS PETS 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, LIFE 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 - -char * -auth_getval(const char *name) -{ - - (void)name; - return (NULL); -} diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h index 6d36a0c291c6..d27262e44daf 100644 --- a/lib/libutil/libutil.h +++ b/lib/libutil/libutil.h @@ -86,7 +86,6 @@ struct termios; struct winsize; __BEGIN_DECLS -char *auth_getval(const char *_name); void clean_environment(const char * const *_white, const char * const *_more_white); int expand_number(const char *_buf, int64_t *_num); From nobody Sat Aug 2 17:58:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvVtM1Vwpz63Nnc; Sat, 02 Aug 2025 17:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvVtM0wJpz3LML; Sat, 02 Aug 2025 17:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OdPawpRWihg702geVBP3BSXy0mXReWEZz8IpRxYczes=; b=FYf/ebCDdj+6fS0pXd9R86hz6OvHOj0VOD9Io6YJXB63zilnmF8Ffw2LObYaoHG5crrWXL A7Uh7BPCNKziiL8BBtzNGYnNCUmnTTf93tULdwvYKT1rocYCN2zgOvS5eBJO4ASBeVGv54 qCen1MprrAyrplucLx+Davl6VF+8tp6lnR/Bsr/x7DvgWy6dnc4O6wf05kXXxZL5jfkaTu xqTunbd/pfoqwj2BCfmj5M/jYTCR51Gok26LsViSQ47gSbmKi7wqNZIEHD3Lot7LYBHMIj cgIcydY9c7TA5UhGN5DfJgLyx9jFGoGacKsES7DUzt+FsMXtVlIaV+QejBl7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754157515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OdPawpRWihg702geVBP3BSXy0mXReWEZz8IpRxYczes=; b=ql5Hp+uoP/VY0ILzmzBI9y6fXv7sOInELIlHG7rqmMJh1CtHHV4LA2JCFYsOjkys3qD9UF +sv3s6fiT13dxfgEObiwnozFQ3HWSo6+v54dcToZrhfya2Lxfw/3DcwfLVBwsAr8tUeQhI PzuOTml8XFA7vSkxsrTWE6E+lGQi/V8kKcfuVHEIKkizOspMso+0PaIdQOZaQhskaKIp6y 3mD3a/ipkZ8I2ZylkjF6LSN5EfVGak2YBiZDBX9LSZGbQ4Ab4G9Xd3cCNsPcfw0uxo/DR4 aeI3tHsJ9PVdXK5Fj8sGME6MHm3EUdo1nfH+g8tfjKuSHNSKnpZRJizOq6orxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754157515; a=rsa-sha256; cv=none; b=DSvN/sR5j9i8dUXKCkuYVegycXEs8c9tGMXV+xeAWOBfqGAGp/2FOplQnElYfdfx5Y26wB V5O6Cg5fR6hrij4CRdIOaKSg86j6CmnYQW6FxifnAbK7Vd2n8zi0/u0/NDGDGsMimWNTMl teU92HPPJHZCZglXd67qY1DTy0bEkubXi6VsbKw0/9FDSs1Xv6ixd4nANpfld+6Zvtuyrw Hh3DZEKb/R3MW3R/7vHKEZM7PmvtcKeuSJMwew4LiZrvV6kKbTOpfWu89CmFXQw+QYclaw LNOuSVSlDTdUkrM7J9DmwfA/1jWa/u0dVQHwLdu5VlRupMzJ5Q8l4GRQExtdgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvVtM0G9mzC8G; Sat, 02 Aug 2025 17:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572HwY2r066805; Sat, 2 Aug 2025 17:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572HwYrR066801; Sat, 2 Aug 2025 17:58:34 GMT (envelope-from git) Date: Sat, 2 Aug 2025 17:58:34 GMT Message-Id: <202508021758.572HwYrR066801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: ee09ce3f1f2e - main - Revert "amd64: include opt_kstack_pages.h" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee09ce3f1f2e8d98d48c65f6af74d269f71b0d48 Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=ee09ce3f1f2e8d98d48c65f6af74d269f71b0d48 commit ee09ce3f1f2e8d98d48c65f6af74d269f71b0d48 Author: Ka Ho Ng AuthorDate: 2025-08-02 17:57:07 +0000 Commit: Ka Ho Ng CommitDate: 2025-08-02 17:58:13 +0000 Revert "amd64: include opt_kstack_pages.h" This reverts commit d5ec97156d3314f979629968f76151c2d35a1e62. The commit broke the build. Reported by: des --- sys/amd64/amd64/locore.S | 5 ++--- sys/amd64/amd64/pmap.c | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 62f5ee2a6998..2be555b25160 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -30,14 +30,13 @@ * SUCH DAMAGE. */ -#include "assym.inc" -#include "opt_kstack_pages.h" - #include #include #include #include +#include "assym.inc" + /* * Compiled KERNBASE location */ diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 243a6625bece..4cf77ee75871 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -104,7 +104,6 @@ */ #include "opt_ddb.h" -#include "opt_kstack_pages.h" #include "opt_pmap.h" #include "opt_vm.h" From nobody Sat Aug 2 18:44:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvWvQ6GVPz63RSx; Sat, 02 Aug 2025 18:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvWvQ52WZz3TNS; Sat, 02 Aug 2025 18:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754160274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5tasQGXomBopTwksVow/W5SpDlCqwvyEHetkTvZDX2E=; b=wXCqeH3U1X3zilabcKJ0RJOyrYmbzTWa482y7ow2MHMqQaBq6Owmx82uJBav9unCuZqSll BMXL89VG2LmuTfiG4Hd++8JRltRz0QgI44MXIcLmLro4O3fWlscf4Q6QsaSqckzcBgymt8 o9l3EXf7iUSUiFKhKKBBxuuEW7IQPQgXhqi0SlkXdWPng3776NtrzDx9RZJVqBFZF91fFX 4b1NpfPvw1Z0C8/esdnEFTCD7Ug46dM6i2y16+ui1Bb4EeOCNam2jErFQUFxBIKsYhmvew LS6LP+AaLgithRt/R6BK1QPs8MDZbGKAOAJNexmMKw1go/l22oy4zDW2XCR1Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754160274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5tasQGXomBopTwksVow/W5SpDlCqwvyEHetkTvZDX2E=; b=qwLHzYIL/Tb1x48QfKuesf3L6obkgUPk0+ponZYT8fPcNqvgsTURSSJecpuExWuN5NsHZQ xEhmZ636Km4KEXusEcmhtPIubAAuEt9cN2XVS7/vXqffVudzZFQLrkGvYTVSKA9fhGFgqg j470tQSFBj3z2L/74wBYWqBwf34lSiizyaa9gINnAAjR/TvDS6aIqgV26+f6khG8CX+Rnw FfbrC+PhdCtJEcq/6qFrahQMAFu7w/CcVisBTXIF1vi8N2ogfMwzwrlVcwrLByySZNurWo fDgBQ6rgyVtFE/zMBxG+kClcZDLmyu5rycgE2++hssuh8ZPfg+Ic5qg+p3U43g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754160274; a=rsa-sha256; cv=none; b=diqbDFvglszKMQPdl2y8OSeO5Qb/vuvyHb9TNeSzT7se1fQc+BTjnX1lqZLzE3uFiFR/Lq llu4TCvLjvPra9uCi1tLZTsisPKC0usmV7QuZDv7usBVBHzZYMAm+YMLPT9+BeXudZMYZw goYJ3kBXFeYH5U2OMjpxwxVv9pRF6mVBPSabaogLCylTGATDBKhLS4EgivJNxCV4O1AXTw vqBel2pr3jgNNktLfw6MPZNH8qKzPQZHQnU2hkD9/C1H2dACDLP9oYEY9IJa5kLCsH/jGX RK1SE3H6Vb3/eM/F3mcM0RDonEq7GRPu5M3Mn3OgZEI3Q/nM01+1XYtE+aaC6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvWvQ4cy1zTsH; Sat, 02 Aug 2025 18:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572IiYO9060156; Sat, 2 Aug 2025 18:44:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572IiY2V060153; Sat, 2 Aug 2025 18:44:34 GMT (envelope-from git) Date: Sat, 2 Aug 2025 18:44:34 GMT Message-Id: <202508021844.572IiY2V060153@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: 95f8c3e1ed0c - main - chroot.2: Update errors and unprivileged use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 95f8c3e1ed0c3075411444381a5a4baef4ed8fda Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=95f8c3e1ed0c3075411444381a5a4baef4ed8fda commit 95f8c3e1ed0c3075411444381a5a4baef4ed8fda Author: Ed Maste AuthorDate: 2025-08-02 17:17:40 +0000 Commit: Ed Maste CommitDate: 2025-08-02 18:43:36 +0000 chroot.2: Update errors and unprivileged use Include errors common to chroot and fchroot in a single list, followed by errors unique to each. Unprivileged chroot is permitted if the security.bsd.unprivileged_chroot sysctl is set to 1. Make note of this and update the EPERM description. Reported by: kevans Reviewed by: kevans, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51703 --- lib/libsys/chroot.2 | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/lib/libsys/chroot.2 b/lib/libsys/chroot.2 index 4c06e3673e03..3347df5cceee 100644 --- a/lib/libsys/chroot.2 +++ b/lib/libsys/chroot.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 15, 2024 +.Dd August 2, 2025 .Dt CHROOT 2 .Os .Sh NAME @@ -61,7 +61,12 @@ It should be noted that .Fn chroot has no effect on the process's current directory. .Pp -This call is restricted to the super-user. +This call is restricted to the super-user, unless the +.Ql security.bsd.unprivileged_chroot +sysctl variable is set to 1 +and the process has enabled the +.Dv PROC_NO_NEW_PRIVS_CTL +.Xr procctl 2 . .Pp Depending on the setting of the .Ql kern.chroot_allow_open_directories @@ -106,14 +111,37 @@ except it takes a file descriptor instead of path. .Sh ERRORS The .Fn chroot +and +.Fn fchroot +system calls +will fail and the root directory will be unchanged if: +.Bl -tag -width Er +.It Bq Er EPERM +The effective user ID is not the super-user and the +.Ql security.bsd.unprivileged_chroot +sysctl is 0. +.It Bq Er EPERM +The effective user ID is not the super-user and the +process has not enabled the +.Dv PROC_NO_NEW_PRIVS_CTL +.Xr procctl 2 . +.It Bq Er EPERM +One or more filedescriptors are open directories and the +.Ql kern.chroot_allow_open_directories +sysctl is not set to permit this. +.It Bq Er EIO +An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. +.El +.Pp +The +.Fn chroot system call will fail and the root directory will be unchanged if: .Bl -tag -width Er .It Bq Er ENOTDIR A component of the path name is not a directory. -.It Bq Er EPERM -The effective user ID is not the super-user, or one or more -filedescriptors are open directories. .It Bq Er ENAMETOOLONG A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters. @@ -128,10 +156,6 @@ The .Fa dirname argument points outside the process's allocated address space. -.It Bq Er EIO -An I/O error occurred while reading from or writing to the file system. -.It Bq Er EINTEGRITY -Corrupted data was detected while reading from the file system. .El .Pp The @@ -146,15 +170,8 @@ file descriptor. The argument .Fa fd is not a valid file descriptor. -.It Bq Er EIO -An I/O error occurred while reading from or writing to the file system. -.It Bq Er EINTEGRITY -Corrupted data was detected while reading from the file system. .It Bq Er ENOTDIR The file descriptor does not reference a directory. -.It Bq Er EPERM -The effective user ID is not the super-user, or one or more -filedescriptors are open directories. .El .Sh SEE ALSO .Xr chdir 2 , From nobody Sat Aug 2 23:35:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvfLz6bzQz63jWv; Sat, 02 Aug 2025 23:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvfLz5nGFz3x7S; Sat, 02 Aug 2025 23:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754177723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a+/MlE1CVIyNIAa6WGHJ+yXXbLOAHhkE9xFCBeM6VVY=; b=S6dwETXqAXwEat0KI3y48Xt04g3AsYRhFdLq7mHFooQIU05zSUYvAfW9gEtEE41I7ihiAG r0jz+Mm3J3qhOMLOLj+beVWrodXxJxCiMtAx4O54GaC8T2nE7+Kdc3N/awial+xNU9WMOV /VBaOR+zmdBLEzsXxEaMPEXh5onZSKyAcE+n0eZ+36wNHlhLoJzaUOdic2CvN4DMNPsZa6 s/CTzeWFPVFlV9UwfT1lc3GLeVs7J5qE4NyGJf69gSJmDeGAvVRURuFiw1VybdNzuYCBPb RbGiZ/+kNt+Ek6HuBpKURXvmFQiPkErsNRDwdk3+ckcXfAb/Q2jAUgBgOxpU8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754177723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a+/MlE1CVIyNIAa6WGHJ+yXXbLOAHhkE9xFCBeM6VVY=; b=HTkCycgUj8M/wQwJOADQ29uQ8x2GeqhMu2hhonBT6DYxplZwdMFix34VCTkRkwZuVvDdwp Y+wZo0/1P0fwQGBPJxkUZrue3uoAVhs6GUlSoQAlENbcyBsqcAUWv8hVG907772ejvNtrY edzr88H6lVy52lbFusK4kPqe8jdR3B5KXVqCA7ZUIJhbkd1PCV+511aGNmIFtUqa30q5Vq b5yRXMNd5AEttkT3Jno+Vs/bzSJpIgSb7eNfdHExNR6xLFd2FEOZbtCZ9r6rFROX4ZQnyg FDj/gp+0W/QXrbXjoHtSBoBElc/xbb0AeBq8JObcel94AjAMOLqCT9JFMu0+LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754177723; a=rsa-sha256; cv=none; b=VhVjrBVkaZIwbIKZxGaRBsdJKhp0hpf5lyBFJzJzJjNfcCAUQN+Y8rigJ3nJrjh55vqEpp cKSPkYQkrAAyF17LQMxO9x0GnbLZOlv7xgT4DvheiBWoRlVEDP5ClglT+LfY8JIy+yE18i 5gt1YPJBIRo/9oSH79mfcb/Jxc3kOOo6tlsbNKx45DbED7Ab8P4yXZHxtGQHenK6i8kO65 4RQBw/e1MShUiOHpHoSfP+O+ubVYLkqrNRWt/VCL8GqFBoHtlneMy7HwnAK2DESoiG8it5 Lou52OSM+gbpJlUHRQHjUDVcw0wcIp8LPyc9NSTgneVbv3QQh5h4tvNjBIadzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvfLz5NjRzg20; Sat, 02 Aug 2025 23:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572NZNmV004655; Sat, 2 Aug 2025 23:35:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572NZNkP004652; Sat, 2 Aug 2025 23:35:23 GMT (envelope-from git) Date: Sat, 2 Aug 2025 23:35:23 GMT Message-Id: <202508022335.572NZNkP004652@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: a523d882a467 - main - vfs_syscall.c: do not take process lock around the read of P2_NO_NEW_PRIVS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: a523d882a4671040aba57549492f8df6676cb855 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a523d882a4671040aba57549492f8df6676cb855 commit a523d882a4671040aba57549492f8df6676cb855 Author: Konstantin Belousov AuthorDate: 2025-08-02 17:57:44 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-02 23:02:43 +0000 vfs_syscall.c: do not take process lock around the read of P2_NO_NEW_PRIVS The flag is write-only, and if we raced with reading the action of setting the flag, we can as well get it under the lock. Reviewed by: emaste, kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D51708 --- sys/kern/vfs_syscalls.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 25d40a9806cb..a0e56a8fd8a7 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -982,13 +982,10 @@ kern_chroot(struct thread *td, struct vnode *vp) error = priv_check(td, PRIV_VFS_CHROOT); if (error != 0) { p = td->td_proc; - PROC_LOCK(p); if (unprivileged_chroot == 0 || (p->p_flag2 & P2_NO_NEW_PRIVS) == 0) { - PROC_UNLOCK(p); goto e_vunlock; } - PROC_UNLOCK(p); } error = change_dir(vp, td); From nobody Sat Aug 2 23:35:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvfM12fFqz63jGh; Sat, 02 Aug 2025 23:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvfM070pZz3xCv; Sat, 02 Aug 2025 23:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754177725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tVMOB6Dt+kaI7YDkuf43T+xz9gSYmHFAGHwlbyRNCB8=; b=ISnf6vYTYg1mdZ2n1ll+LRPvMcKzsn57EW1/9q5ZWZWKMEUn+CN2PBcp4ewbs8QXOF+0aV boCzLRFihDSYyjIWPlneM2Jgw7s7Bb84spPjv5AFWKRArLoaSgCpXdiSWKOoF8RoOlpHRc 3H1ePxuOgsfp316912MSNZCUemXb27Y4jCI2CpGxMT/vmkVa8d5G4y5adWOAYy4ikHWj+4 MCuhf3poKsQxjMupTs6A87fNkC9Z/DF1/WbgipMXzv4oRRADhgnk8bWrlMDOULy2KxLwr8 6GwE/DZew4r8T2SEDoY1oFk0SsWOD9BzQMgXKWWUvb7MGZKrt1hVhMZ/8Xd8tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754177725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tVMOB6Dt+kaI7YDkuf43T+xz9gSYmHFAGHwlbyRNCB8=; b=god3A8KDoIJHOvoMxRyJuH3229EV06X3SvGX7wQ3MoD1heHFfdy02No/VzJF7o6sTNLLRM h2ujBPEFMn+GO7zYDjOYYDcasIbKkXYrg9YhC3lPHiilQtXQiaDGWcJitgMkAyS8RqhBlj mpXZD2pNftVDIalDUixaNLbMRQVxLdSrF1s9s0DQfPVEoNl9Y2dODp7ImYdeWHvIiVG5UK Yal42DVe8YbowL/DeXUEMDplHZV8kDURw++z3QbZIu/P0rOWM3u4WxzIgSYlyb3YYz+ZF1 XowoBQPmifx5XQlIyF5YHigEf95usOFroDp9QB4LIlF6D3cK51rD3GV8tgm5IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754177725; a=rsa-sha256; cv=none; b=SsVEJOgNiCOp7rVGnUfmTXQfEWepkktul9FnDmHq0hLAdlQQ0BUCgfKovSaAFgVkkBbY+C Kg6tmca6aZe1iQ+QNVRbhHpIyuM289lFLwJX/2MUxRDfYH4idgf8cKE/xFgufiMvXl846K LobqU81x+Fr74VbgnX1mIDFPh72hLL6Vrx4u7kNGQoubuuAYg6fRZUkrIhuY2OKD1BJ1TC wvuownw0XaLXL7/ZkXOpakDHygR9ulh08gJTQWziokooSwN6DfDzxVhJ3Il+Fa9h1bsk4M +FjHD6A26knv3oLBwFo9kL/aWEJyhGAkvijXbGXvkvSEk2FGsJRRuTsxUdfSwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvfM06K0qzfyW; Sat, 02 Aug 2025 23:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572NZOrF004694; Sat, 2 Aug 2025 23:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572NZOgs004691; Sat, 2 Aug 2025 23:35:24 GMT (envelope-from git) Date: Sat, 2 Aug 2025 23:35:24 GMT Message-Id: <202508022335.572NZOgs004691@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: cf0f693f0361 - main - vfs_syscall.c: EXTERROR-ise EPERM from chroot(2) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf0f693f0361e76517cabc234321ce7870fa8f9f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf0f693f0361e76517cabc234321ce7870fa8f9f commit cf0f693f0361e76517cabc234321ce7870fa8f9f Author: Konstantin Belousov AuthorDate: 2025-08-02 18:01:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-08-02 23:28:00 +0000 vfs_syscall.c: EXTERROR-ise EPERM from chroot(2) Reviewed by: emaste, kevans Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D51708 --- sys/kern/vfs_syscalls.c | 12 ++++++++++-- sys/sys/exterr_cat.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index a0e56a8fd8a7..9704e9c160a8 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -37,6 +37,7 @@ #include "opt_capsicum.h" #include "opt_ktrace.h" +#define EXTERR_CATEGORY EXTERR_CAT_VFSSYSCALL #include #ifdef COMPAT_FREEBSD11 #include @@ -46,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -982,8 +984,14 @@ kern_chroot(struct thread *td, struct vnode *vp) error = priv_check(td, PRIV_VFS_CHROOT); if (error != 0) { p = td->td_proc; - if (unprivileged_chroot == 0 || - (p->p_flag2 & P2_NO_NEW_PRIVS) == 0) { + if (unprivileged_chroot == 0) { + error = EXTERROR(EPERM, + "security.bsd.unprivileged_chroot sysctl not enabled"); + goto e_vunlock; + } + if ((p->p_flag2 & P2_NO_NEW_PRIVS) == 0) { + error = EXTERROR(EPERM, + "PROC_NO_NEW_PRIVS not enabled"); goto e_vunlock; } } diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index 80cff53b3576..43f31e1d5dd6 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -20,6 +20,7 @@ #define EXTERR_CAT_GENIO 6 #define EXTERR_CAT_BRIDGE 7 #define EXTERR_CAT_SWAP 8 +#define EXTERR_CAT_VFSSYSCALL 9 #endif From nobody Sat Aug 2 23:59:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvfvG3W29z63kVV; Sat, 02 Aug 2025 23:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvfvG2vYTz41VS; Sat, 02 Aug 2025 23:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754179194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aiObrVAqHJYUFTJUyV4vMpeIztDAJDfJxwAMwLfnIOo=; b=Ph0VsvCEpB6llbh5+/Mb8RqOuqr3o9W8tdYRSTSUAWt57wgter/EIJsZNic7W5YkFhlBzJ ABYIomz1JP9JBEo9qJ2Q/TAePVmXWcC31gyG9DWJ4ys7VQbs2bkJgqp3EHrH5cSfOT7dbE pXBnkot+xg9SbhDjSMWfcerPTJepWtDjwIeJ1TeM2c1noFktWg2KZFdRX9PsIDwsXebhEf AHDxexeJeBrfVslt3Y/ZVH9u34MGPrSCDCgl3xTCSoKkAukJPicHwWe3qNixkNC2FzRV77 sx0z2IUr/qak1P+5j5oczrB6i/IafGJeRBdbaLkJ1CiHLvOAqgYJdbEc+5wmbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754179194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aiObrVAqHJYUFTJUyV4vMpeIztDAJDfJxwAMwLfnIOo=; b=sbFSiHZev1hr0ViqnJI3tnzaYTdA3G5ihNIFKOGq3XymnSmEel0eF3J0EnitErOsZ33UNd V7fMK0rqh3PWwr6s7HKoxYSkXVJalz7mHKwgOaMJYcmQpyOutgKBosFt2TUvSsQtZCjvto TUyqFntJO/xXtR4GghPrCy8eWAcXjdOeLPvL7UI2wc2XUBiRqRKdwOgCijNjz3cJQi7PVr m8IJKWbENsxz+mkLngVrtnMSQ+7qjtToIYxLBXygg52Pv6qtgx4OHVgEnbf3kFpYopT/7n 0UJUhdxy5Ok/Eri9jTV2O/QNj9xl3bRMKjOyKdTi/m2m9GO1SbKA4TWIM4QEBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754179194; a=rsa-sha256; cv=none; b=SlijR4cJd3vPlpaywEWiE2FM1VdvM8G14gRw/EV/LdFsEXIXBx+81enrREnAnaBkUGTG32 cR3udYeFzWa7mp1TVY08E5bQleRhhUhT+Il4iH9qpkzjJx0iO5njCvyKwRBgzF/IfDPdkO dKip4L5ekUhSZ4IpOizmmhGsmAGnmfLW+ySEDN36C2oLbudQgrmnM1dv2DIHWGNrg3K/uw EXfcfQax7+ZJowSgGQVWbCL3VY5Rme/UUkql7PdidYq3/dHnUY3ZOV99GJwvzXHoWP7K3m xwZtMr+7Y1YRctqo3TmjlLBaRQrAxSE3+4OXn+nbl3pOi1jHoeyGY3FLPFwlfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvfvG20f9zgGr; Sat, 02 Aug 2025 23:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 572Nxsjt044598; Sat, 2 Aug 2025 23:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 572NxsEj044595; Sat, 2 Aug 2025 23:59:54 GMT (envelope-from git) Date: Sat, 2 Aug 2025 23:59:54 GMT Message-Id: <202508022359.572NxsEj044595@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: 25fca243f2b7 - main - service: Add an option to enable debugging List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 25fca243f2b7ca0c523aa1cf26aaea25035e68d2 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=25fca243f2b7ca0c523aa1cf26aaea25035e68d2 commit 25fca243f2b7ca0c523aa1cf26aaea25035e68d2 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-02 23:59:26 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-02 23:59:26 +0000 service: Add an option to enable debugging * Add and document a -d option which enables rc script debugging. * Sort and document existing options correctly. MFC after: 1 week Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D51700 --- usr.sbin/service/service.8 | 13 ++++++++----- usr.sbin/service/service.sh | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 index 06f8cd989bfc..3858e608b785 100644 --- a/usr.sbin/service/service.8 +++ b/usr.sbin/service/service.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 9, 2025 +.Dd August 2, 2025 .Dt SERVICE 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Fl e .Nm .Op Fl j Ar jail +.Op Fl q .Fl R .Nm .Op Fl j Ar jail @@ -45,8 +46,7 @@ .Fl r .Nm .Op Fl j Ar jail -.Op Fl q -.Op Fl v +.Op Fl dqv .Op Fl E Ar var=value .Ar script .Op Ar command @@ -74,6 +74,8 @@ scripts, see .Pp The options are as follows: .Bl -tag -width F1 +.It Fl d +Enable debugging. .It Fl E Ar var=value Set the environment variable .Ar var @@ -106,6 +108,9 @@ this is usually .Pa /usr/local/etc/rc.d . All files will be listed whether they are an actual rc.d script or not. +.It Fl q +Be quiet, redirecting output to +.Pa /dev/null . .It Fl R Restart all enabled local services. .It Fl r @@ -116,8 +121,6 @@ as in above, but list all of the files, not just what is enabled. .It Fl v Be slightly more verbose. -.It Fl q -Be quiet, redirecting output to /dev/null. .El .Sh ENVIRONMENT When used to run rc.d scripts the diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 5f456418da49..9387a49051d6 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -27,17 +27,19 @@ # SUCH DAMAGE. . /etc/rc.subr -load_rc_config 'XXX' +load_rc_config usage () { echo '' echo 'Usage:' echo "${0##*/} [-j ] -e" - echo "${0##*/} [-j ] -R" - echo "${0##*/} [-j ] [-v] -l | -r" - echo "${0##*/} [-j ] [-v] [-E var=value] start|stop|etc." + echo "${0##*/} [-j ] [-q] -R" + echo "${0##*/} [-j ] [-v] -l" + echo "${0##*/} [-j ] [-v] -r" + echo "${0##*/} [-j ] [-dqv] [-E var=value] start|stop|etc." echo "${0##*/} -h" echo '' + echo "-d Enable debugging of rc.d scripts" echo "-j Perform actions within the named jail" echo "-E n=val Set variable n to val before executing the rc.d script" echo '-e Show services that are enabled' @@ -49,12 +51,13 @@ usage () { echo '' } -while getopts 'j:E:ehlqrRv' COMMAND_LINE_ARGUMENT ; do +while getopts 'dE:ehj:lqrRv' COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in - j) JAIL="${OPTARG}" ;; + d) DEBUG=dopt ;; E) VARS="${VARS} ${OPTARG}" ;; e) ENABLED=eopt ;; h) usage ; exit 0 ;; + j) JAIL="${OPTARG}" ;; l) LIST=lopt ;; q) QUIET=qopt ;; r) RCORDER=ropt ;; @@ -85,6 +88,10 @@ if [ -n "${JAIL}" ]; then exit $? fi +if [ -n "$DEBUG" ]; then + VARS="${VARS} rc_debug=yes" +fi + if [ -n "$RESTART" ]; then skip="-s nostart" if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then From nobody Sun Aug 3 00:15:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvgDx4jGfz63lTT; Sun, 03 Aug 2025 00:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvgDx42XLz43xv; Sun, 03 Aug 2025 00:15:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754180113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ae/WzfN3e9vJ2GbBBzeJoM98tQsf0Omr3Ujs9SUStCE=; b=yrF40iPJdZiQqDxxFjnGqfkIH62Ym+nPSL2cXn9nKTywF6lNgCQ+3NU4x3/U00r7pqVge/ Leat7I2oLM48fldZqnD1IDPKuSOmP8r+7eV4CZMgEy7TgNNYPcDFGKLdLAg1YdXOIGpg/C CUFQbnjY+Le9eof0+J19FxLi9WRQrli6VJhOrLL99HrfCjFiZZk6ja+FoPcRZ6mfikF2LX qXTtF+yxrRHwATUXW721TX3vc0jsDKvaq+43tXyiFwBGHgzUdm0rc8cclgnrTAtqFe09xP yX9wDtTT3x1BOKg2V84RgkkgxKEglMRtqCcrGrNYqaEazgryVXDRrHG1A2ymYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754180113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ae/WzfN3e9vJ2GbBBzeJoM98tQsf0Omr3Ujs9SUStCE=; b=F1+TiiFXLFIEHkuoQlr0J68Q+0GDt9lAh1E4PR3ZtQyqhGcDO5a+lC/SsVuGZ1XxeXgHil OyXRDQQDc0YvmpX1jnSyLipQVkavW0Cny0AhG+gt4wZaJ7TV2sz9M04w7Mpaawjacsfww3 UINvOYhtbdfhATAzSITVVXQcF3y0CADmIKPUb4mu/u+BTHWK4EYMzGQw/PHekb8FkSs0dE 2um5K3NEBCnuw9rspJkQjb8hOXxevTEjgcGqoEIaYiGBKuruHj4YEGARRjmX4r74g1Alnp 562vz8+WoTmhRclRASA4iuLYwJYipjj3jMkqwxV1mygx5W9f+xEcxcYljzJOfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754180113; a=rsa-sha256; cv=none; b=ALUhStAI1cJuoEyyH9RTe49QrRxMr6+CO2CmZoKoTPFQ1cKZ8nzoitOqsxUa4ooTg4JxEx T+R0XmqmGlhtG/oE45XtoBj+iKFymPrQUEJfR+kcENbZilfUN3I/aVxhXK3BXukE4NeXJt Yo9F60V27+Pin6D5Hm7hoE7ogZLNP7sfweNknWxi6EkEmWdC8RQQoLGx14Hu49E0ZIci/T dqQ3fOu3Y0u6FGzious1PB2D+wRsFt5ZprUxkzlZwYRQRJ7PE+CFSudvQ9IdzLK6Qw3l7N kd8sQHiBET1KFNsmxF9hjR5bVXaL7n4AD2ocz57caSot0C6QLCkKY7FOVf2Lhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvgDx3Y3rzgJn; Sun, 03 Aug 2025 00:15:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5730FDCY081420; Sun, 3 Aug 2025 00:15:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5730FDLZ081417; Sun, 3 Aug 2025 00:15:13 GMT (envelope-from git) Date: Sun, 3 Aug 2025 00:15:13 GMT Message-Id: <202508030015.5730FDLZ081417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Jeremy Subject: git: dbc22fdad8ea - main - eqos: Whitespace cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: peterj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbc22fdad8ea6a17f304b1a4942d187f0b950208 Auto-Submitted: auto-generated The branch main has been updated by peterj: URL: https://cgit.FreeBSD.org/src/commit/?id=dbc22fdad8ea6a17f304b1a4942d187f0b950208 commit dbc22fdad8ea6a17f304b1a4942d187f0b950208 Author: Peter Jeremy AuthorDate: 2025-08-03 00:11:05 +0000 Commit: Peter Jeremy CommitDate: 2025-08-03 00:11:05 +0000 eqos: Whitespace cleanup Reformat if_eqos.c to make it easier to follow and closer to style(9). No functional changes. Reviewed by: fuz@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51693 --- sys/dev/eqos/if_eqos.c | 131 ++++++++++++++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 50 deletions(-) diff --git a/sys/dev/eqos/if_eqos.c b/sys/dev/eqos/if_eqos.c index de3d8da7c3bf..e07d6b48f723 100644 --- a/sys/dev/eqos/if_eqos.c +++ b/sys/dev/eqos/if_eqos.c @@ -117,7 +117,8 @@ eqos_miibus_readreg(device_t dev, int phy, int reg) addr = sc->csr_clock_range | (phy << GMAC_MAC_MDIO_ADDRESS_PA_SHIFT) | (reg << GMAC_MAC_MDIO_ADDRESS_RDA_SHIFT) | - GMAC_MAC_MDIO_ADDRESS_GOC_READ | GMAC_MAC_MDIO_ADDRESS_GB; + GMAC_MAC_MDIO_ADDRESS_GOC_READ | + GMAC_MAC_MDIO_ADDRESS_GB; WR4(sc, GMAC_MAC_MDIO_ADDRESS, addr); DELAY(100); @@ -150,7 +151,8 @@ eqos_miibus_writereg(device_t dev, int phy, int reg, int val) addr = sc->csr_clock_range | (phy << GMAC_MAC_MDIO_ADDRESS_PA_SHIFT) | (reg << GMAC_MAC_MDIO_ADDRESS_RDA_SHIFT) | - GMAC_MAC_MDIO_ADDRESS_GOC_WRITE | GMAC_MAC_MDIO_ADDRESS_GB; + GMAC_MAC_MDIO_ADDRESS_GOC_WRITE | + GMAC_MAC_MDIO_ADDRESS_GB; WR4(sc, GMAC_MAC_MDIO_ADDRESS, addr); DELAY(100); @@ -195,7 +197,7 @@ eqos_miibus_statchg(device_t dev) reg |= GMAC_MAC_CONFIGURATION_FES; break; case IFM_1000_T: - case IFM_1000_SX: + case IFM_1000_SX: reg &= ~GMAC_MAC_CONFIGURATION_PS; reg &= ~GMAC_MAC_CONFIGURATION_FES; break; @@ -241,7 +243,7 @@ eqos_media_change(if_t ifp) int error; EQOS_LOCK(sc); - error = mii_mediachg(device_get_softc(sc->miibus)); + error = mii_mediachg(device_get_softc(sc->miibus)); EQOS_UNLOCK(sc); return (error); } @@ -329,8 +331,8 @@ eqos_setup_rxdesc(struct eqos_softc *sc, int index, bus_addr_t paddr) sc->rx.desc_ring[index].des1 = htole32((uint32_t)(paddr >> 32)); sc->rx.desc_ring[index].des2 = htole32(0); bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map, BUS_DMASYNC_PREWRITE); - sc->rx.desc_ring[index].des3 = htole32(EQOS_RDES3_OWN | EQOS_RDES3_IOC | - EQOS_RDES3_BUF1V); + sc->rx.desc_ring[index].des3 = + htole32(EQOS_RDES3_OWN | EQOS_RDES3_IOC | EQOS_RDES3_BUF1V); } static int @@ -370,8 +372,10 @@ eqos_enable_intr(struct eqos_softc *sc) { WR4(sc, GMAC_DMA_CHAN0_INTR_ENABLE, - GMAC_DMA_CHAN0_INTR_ENABLE_NIE | GMAC_DMA_CHAN0_INTR_ENABLE_AIE | - GMAC_DMA_CHAN0_INTR_ENABLE_FBE | GMAC_DMA_CHAN0_INTR_ENABLE_RIE | + GMAC_DMA_CHAN0_INTR_ENABLE_NIE | + GMAC_DMA_CHAN0_INTR_ENABLE_AIE | + GMAC_DMA_CHAN0_INTR_ENABLE_FBE | + GMAC_DMA_CHAN0_INTR_ENABLE_RIE | GMAC_DMA_CHAN0_INTR_ENABLE_TIE); } @@ -437,8 +441,7 @@ eqos_setup_rxfilter(struct eqos_softc *sc) eaddr = if_getlladdr(ifp); val = eaddr[4] | (eaddr[5] << 8); WR4(sc, GMAC_MAC_ADDRESS0_HIGH, val); - val = eaddr[0] | (eaddr[1] << 8) | (eaddr[2] << 16) | - (eaddr[3] << 24); + val = eaddr[0] | (eaddr[1] << 8) | (eaddr[2] << 16) | (eaddr[3] << 24); WR4(sc, GMAC_MAC_ADDRESS0_LOW, val); /* Multicast hash filters */ @@ -726,8 +729,7 @@ eqos_rxintr(struct eqos_softc *sc) if ((m = eqos_alloc_mbufcl(sc))) { if ((error = eqos_setup_rxbuf(sc, sc->rx.head, m))) printf("ERROR: Hole in RX ring!!\n"); - } - else + } else if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); @@ -896,12 +898,10 @@ eqos_ioctl(if_t ifp, u_long cmd, caddr_t data) eqos_setup_rxfilter(sc); EQOS_UNLOCK(sc); } - } - else { + } else { eqos_init(sc); } - } - else { + } else { if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) eqos_stop(sc); } @@ -1008,39 +1008,55 @@ eqos_setup_dma(struct eqos_softc *sc) int error, i; /* Set up TX descriptor ring, descriptors, and dma maps */ - if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), - DESC_ALIGN, DESC_BOUNDARY, - BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - TX_DESC_SIZE, 1, TX_DESC_SIZE, 0, - NULL, NULL, &sc->tx.desc_tag))) { + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* Parent tag */ + DESC_ALIGN, DESC_BOUNDARY, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filterfunc, filterarg */ + TX_DESC_SIZE, 1, /* maxsize, nsegs */ + TX_DESC_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->tx.desc_tag); + if (error != 0) { device_printf(sc->dev, "could not create TX ring DMA tag\n"); return (error); } - if ((error = bus_dmamem_alloc(sc->tx.desc_tag, + error = bus_dmamem_alloc(sc->tx.desc_tag, (void**)&sc->tx.desc_ring, BUS_DMA_COHERENT | BUS_DMA_WAITOK | BUS_DMA_ZERO, - &sc->tx.desc_map))) { + &sc->tx.desc_map); + if (error != 0) { device_printf(sc->dev, "could not allocate TX descriptor ring.\n"); return (error); } - if ((error = bus_dmamap_load(sc->tx.desc_tag, sc->tx.desc_map, - sc->tx.desc_ring, - TX_DESC_SIZE, eqos_get1paddr, &sc->tx.desc_ring_paddr, 0))) { + + error = bus_dmamap_load(sc->tx.desc_tag, sc->tx.desc_map, + sc->tx.desc_ring, TX_DESC_SIZE, + eqos_get1paddr, &sc->tx.desc_ring_paddr, + 0); + if (error != 0) { device_printf(sc->dev, "could not load TX descriptor ring map.\n"); return (error); } - if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - MCLBYTES*TX_MAX_SEGS, TX_MAX_SEGS, - MCLBYTES, 0, NULL, NULL, - &sc->tx.buf_tag))) { + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* Parent tag */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filterfunc, filterarg */ + MCLBYTES*TX_MAX_SEGS, TX_MAX_SEGS, /* maxsize, nsegs */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->tx.buf_tag); + if (error != 0) { device_printf(sc->dev, "could not create TX buffer DMA tag.\n"); return (error); } @@ -1055,39 +1071,54 @@ eqos_setup_dma(struct eqos_softc *sc) } /* Set up RX descriptor ring, descriptors, dma maps, and mbufs */ - if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), - DESC_ALIGN, DESC_BOUNDARY, - BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - RX_DESC_SIZE, 1, RX_DESC_SIZE, 0, - NULL, NULL, &sc->rx.desc_tag))) { + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* Parent tag */ + DESC_ALIGN, DESC_BOUNDARY, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filterfunc, filterarg */ + RX_DESC_SIZE, 1, /* maxsize, nsegs */ + RX_DESC_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rx.desc_tag); + if (error != 0) { device_printf(sc->dev, "could not create RX ring DMA tag.\n"); return (error); } - if ((error = bus_dmamem_alloc(sc->rx.desc_tag, + error = bus_dmamem_alloc(sc->rx.desc_tag, (void **)&sc->rx.desc_ring, BUS_DMA_COHERENT | BUS_DMA_WAITOK | BUS_DMA_ZERO, - &sc->rx.desc_map))) { + &sc->rx.desc_map); + if (error != 0) { device_printf(sc->dev, "could not allocate RX descriptor ring.\n"); return (error); } - if ((error = bus_dmamap_load(sc->rx.desc_tag, sc->rx.desc_map, - sc->rx.desc_ring, RX_DESC_SIZE, eqos_get1paddr, - &sc->rx.desc_ring_paddr, 0))) { + error = bus_dmamap_load(sc->rx.desc_tag, sc->rx.desc_map, + sc->rx.desc_ring, RX_DESC_SIZE, + eqos_get1paddr, &sc->rx.desc_ring_paddr, + 0); + if (error != 0) { device_printf(sc->dev, "could not load RX descriptor ring map.\n"); return (error); } - if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, - BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - MCLBYTES, 1, - MCLBYTES, 0, NULL, NULL, - &sc->rx.buf_tag))) { + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* Parent tag */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filterfunc, filterarg */ + MCLBYTES, 1, /* maxsize, nsegs */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rx.buf_tag); + if (error != 0) { device_printf(sc->dev, "could not create RX buf DMA tag.\n"); return (error); } From nobody Sun Aug 3 00:58:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvhBL2c3Bz63nBZ; Sun, 03 Aug 2025 00:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvhBL1N5Kz46jG; Sun, 03 Aug 2025 00:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754182682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MOKueup9rnWOJeLReGwdayWrVe/1BEPo575cHaVgMxk=; b=J9susMmX17cXD6ueqIIvW2+aMW0L/fgAu143Rtp3wCnSypxDAI8g9WEYC/n6mZshwB7+im J3ebUjkBaiPpqGKu2X3oMPCJHOKNhFsOras0TAz4iH7dNiF/pvfsMsKWctLrL54+au2H+0 AN+rrOy/XQqQ8C3L5ycxwn1wdgimGWImFUEfO0Y3stzMxuWYfHLw/S6+EfHwDSOTnAP+x7 eGFX0y3pkkyDjgSsubC9pTjFUh9vtUWkEqpZrC5sUAeFOwDrV2YrCjwsPC6YFaptfiT/tv /zFUq0Eg1z3xmihBaMjHsRL75GhgIlL5zmKlpRwxVPukzhLFN1NtpXhNjIeKHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754182682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MOKueup9rnWOJeLReGwdayWrVe/1BEPo575cHaVgMxk=; b=Te47B5krVEXK1R6o2tVkzUTax/HY+zlkIGwcWdtcT10uLsbQVwjqMzuNgIwN/o8tmSim/3 yZJgVAaW7gfmwcbSeIK0VRidDD8IFFZN6idrz7d0ZSz2ycSmNokurNM4iBX62soFwdmPSX TLE+czO0fKQDJFn1aPBqOOE9dxy42DVR3xayvumBx9aYNsqQ+iPYGC2K4qN0OGe73YaiCi wJ6/o9PA3ZMlm1HBRv2WBAayRqQDADG4l3NRVz5QBoniWZB/AbopUjsfRiZVrSogChjjva y/3/rO3bWVnMgFLgRAVApjyye0nvAAJ2KeCm//IHELy3JrteWtxYfPpH8kJ9eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754182682; a=rsa-sha256; cv=none; b=yg0dPnziVA72NOF+3K1CY2gXu+UF/yM6AN5z/xrvkYnTO66Wg7X2dMACJid2sk7djxQgms 7BNcy03HzkWS5ZbDHT1fgFv1NMtKn6W7DeymzEGasvM8vGyq32r5vRiB6O4apc4ag9smmT m3BU0b5bvX4m3ggcEumWmi1wQYC+CjvCGp5kcCmVSq1T/3ItR4xTqNW6rudfYfZ9oDx4VB rvtyMNm8zdaRHlKdg1s27OXYAl/0fd4FO+DJap3WaCydPvXwu8SF3vXNQkivR+epbn4Yo7 XZGLhbQyF7CbhANncB+vof4vAl7UQU2zxuIwBLnP3IeS/DwFh8CKMzAhahWUpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvhBL0RFFzhgC; Sun, 03 Aug 2025 00:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5730w1er056823; Sun, 3 Aug 2025 00:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5730w16t056820; Sun, 3 Aug 2025 00:58:01 GMT (envelope-from git) Date: Sun, 3 Aug 2025 00:58:01 GMT Message-Id: <202508030058.5730w16t056820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 7f41c76b84d0 - stable/14 - MFC: MFV: less v679. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7f41c76b84d0f24feb7d60bc566630735dbc78e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=7f41c76b84d0f24feb7d60bc566630735dbc78e3 commit 7f41c76b84d0f24feb7d60bc566630735dbc78e3 Author: Xin LI AuthorDate: 2025-07-20 17:33:52 +0000 Commit: Xin LI CommitDate: 2025-08-03 00:55:19 +0000 MFC: MFV: less v679. (cherry picked from commit 76bafc90692608c1db8df3276e966212201c270c) --- contrib/less/NEWS | 10 ++++++++++ contrib/less/decode.c | 2 +- contrib/less/help.c | 2 +- contrib/less/less.h | 9 +++++---- contrib/less/less.nro | 2 +- contrib/less/lessecho.nro | 2 +- contrib/less/lesskey.nro | 2 +- contrib/less/os.c | 6 +++--- contrib/less/version.c | 4 +++- 9 files changed, 26 insertions(+), 13 deletions(-) diff --git a/contrib/less/NEWS b/contrib/less/NEWS index 5767ded21a00..cdc8196a5f16 100644 --- a/contrib/less/NEWS +++ b/contrib/less/NEWS @@ -9,6 +9,16 @@ Report bugs, suggestions or comments at https://github.com/gwsw/less/issues. +====================================================================== + + Major changes between "less" versions 678 and 679 + +* Fix bad parsing of lesskey file an env var is a prefix of another + env var (github #626). + +* Fix unexpected exit using -K if a key press is received while reading + the input file (github #628). + ====================================================================== Major changes between "less" versions 668 and 678 diff --git a/contrib/less/decode.c b/contrib/less/decode.c index 2942a30863cb..8e451d1810c9 100644 --- a/contrib/less/decode.c +++ b/contrib/less/decode.c @@ -750,7 +750,7 @@ static int cmd_search(constant char *cmd, constant unsigned char *table, constan { action = taction; *extra = textra; - } else if (match > 0) /* cmd is a prefix of this table entry */ + } else if (match > 0 && action == A_INVALID) /* cmd is a prefix of this table entry */ { action = A_PREFIX; } diff --git a/contrib/less/help.c b/contrib/less/help.c index 81e0943fe4e2..5d8ba9a1b0fe 100644 --- a/contrib/less/help.c +++ b/contrib/less/help.c @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 20:41 on 2025/5/1 */ +/* This file was generated by mkhelp.pl from less.hlp at 19:46 on 2025/5/28 */ #include "less.h" constant char helpdata[] = { '\n', diff --git a/contrib/less/less.h b/contrib/less/less.h index 94a3e2235906..7b2d2c25bfc6 100644 --- a/contrib/less/less.h +++ b/contrib/less/less.h @@ -575,10 +575,11 @@ typedef enum { #endif #endif -#define S_INTERRUPT 01 -#define S_STOP 02 -#define S_WINCH 04 -#define ABORT_SIGS() (sigs & (S_INTERRUPT|S_STOP)) +#define S_INTERRUPT (1<<0) +#define S_SWINTERRUPT (1<<1) +#define S_STOP (1<<2) +#define S_WINCH (1<<3) +#define ABORT_SIGS() (sigs & (S_INTERRUPT|S_SWINTERRUPT|S_STOP)) #ifdef EXIT_SUCCESS #define QUIT_OK EXIT_SUCCESS diff --git a/contrib/less/less.nro b/contrib/less/less.nro index 6b74ec5f161b..25a9869a9c59 100644 --- a/contrib/less/less.nro +++ b/contrib/less/less.nro @@ -1,5 +1,5 @@ '\" t -.TH LESS 1 "Version 678: 01 May 2025" +.TH LESS 1 "Version 679: 28 May 2025" .SH NAME less \- display the contents of a file in a terminal .SH SYNOPSIS diff --git a/contrib/less/lessecho.nro b/contrib/less/lessecho.nro index 696fcb13b214..f0cccc4de6da 100644 --- a/contrib/less/lessecho.nro +++ b/contrib/less/lessecho.nro @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 678: 01 May 2025" +.TH LESSECHO 1 "Version 679: 28 May 2025" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS diff --git a/contrib/less/lesskey.nro b/contrib/less/lesskey.nro index 61ba056b04c6..0a17c9deff71 100644 --- a/contrib/less/lesskey.nro +++ b/contrib/less/lesskey.nro @@ -1,5 +1,5 @@ '\" t -.TH LESSKEY 1 "Version 678: 01 May 2025" +.TH LESSKEY 1 "Version 679: 28 May 2025" .SH NAME lesskey \- customize key bindings for less .SH "SYNOPSIS (deprecated)" diff --git a/contrib/less/os.c b/contrib/less/os.c index 98a7ecf70c3c..357cbb356a16 100644 --- a/contrib/less/os.c +++ b/contrib/less/os.c @@ -275,7 +275,7 @@ start: if (ret != 0) { if (ret == READ_INTR) - sigs |= S_INTERRUPT; + sigs |= S_SWINTERRUPT; reading = FALSE; return (ret); } @@ -287,7 +287,7 @@ start: int c; c = WIN32getch(); - sigs |= S_INTERRUPT; + sigs |= S_SWINTERRUPT; reading = FALSE; if (c != CONTROL('C') && c != intr_char) WIN32ungetch((char) c); @@ -348,7 +348,7 @@ public int iopen(constant char *filename, int flags) while (!opening && SET_JUMP(open_label)) { opening = FALSE; - if (sigs & S_INTERRUPT) + if (sigs & (S_INTERRUPT|S_SWINTERRUPT)) { sigs = 0; #if HAVE_SETTABLE_ERRNO diff --git a/contrib/less/version.c b/contrib/less/version.c index 9a97f1658940..68a42a6272fa 100644 --- a/contrib/less/version.c +++ b/contrib/less/version.c @@ -1047,6 +1047,8 @@ v675 4/3/25 Add ESC-b. v676 4/16/25 Fix two OSC 8 display bugs. v677 4/27/25 Fix & filtering bug. v678 5/1/25 Don't change stty tab setting. +v679 5/28/25 Fix lesskey parsing bug when env var is prefix of another; + fix unexpected exit when using -K. */ -char version[] = "678"; +char version[] = "679"; From nobody Sun Aug 3 01:01:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvhGF3S5Pz63nB3; Sun, 03 Aug 2025 01:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvhGF1s3hz46wS; Sun, 03 Aug 2025 01:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754182885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mB8beivFbDi9GVwOh3hWvz/j+7dKFuz6gY3mET7aP14=; b=fZ6P5MRdaf4zjZIB/AWah9pS2VLbBri0m1rhe+xQX8A97y/8YR4UKXUx7sDWnirs8QhF0d Ua6Yty6iUAknCSV6Zzm0cgqf3G2DEVPOLYdR4/UORr/YEvm+ciwLy9waiZymthLZZ4ZsUI 3JC7XO/jskfJzri39adnd9Lwk0jXPIGRejKQbHvJ/SweN8tSjjnfI94rflBYRm7LEytc07 ai+p4CrRNVUBQ7Wg8vfoW5zKiLAEcsp/PbPEwOURV6oSWHP7n5yi/VgEHqHHKMdMt4cV5u 1OdqjiFCGPAnscc2nhkBF/VB7+e46ElSJldDoszySAQjnlAeFRnd/qy++B3i+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754182885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mB8beivFbDi9GVwOh3hWvz/j+7dKFuz6gY3mET7aP14=; b=Fo6osNFBcSA2D4VOad0osV4dLe59htGK63BFHIBd/hpZqYkAFHOLTreefdEtHjOukh+04d BxUI2NHVe+COUJ/b3TwLu2tDyNAHsIF78xXm/Kl8EmkjuYQBGEuJGczdz8xi8J7m3zgE0o vorDtC4uWyZgzzIsLKkwxkPA9AiktsN7sO4jOH9KWyWOytv6GEo9z77G54g6WsTNNqqOYR bBUNP8XGQKzOqjLTsAluLvnjXvgDdzlmqslE9Fu2J8h7KaT7xgzvmvJKO2gx/ycbZZm+p6 AHA5rIin3Y1ixaVC7AsrTmiQYfh8PWcmR7Sd1xHaTykInhzQKd5v9bNxbt/MHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754182885; a=rsa-sha256; cv=none; b=oTwbFMEjQ60rAI7BEO1CWxS3HlF0bf+8qFZo46nrDD8Nd9lCHKZcT2MO4iZklgGIYCwqbb JJkpoELhCpgURtkn41xoySvxyJEoPOcxcM25o13tTKG1zvBfWbfma97SAhQHy/F3OXwOtF Up5VdHoIMS05zZi4LKULcYfkHlW4YWj43sl3iJT879/eFmbD+EufRZDF2ZKeRBsrYgPPcc 9XVGekPbx6GCS+dCwgU2jpZ40QNQoa/DVAnRxIAU9AWgHHRX21Bc5yQEg7XVx+mB3E1lXy v0m1n1JKGNi9vgTVvHeY7aH0fdNh7tWMlSMZJo1MxFHg+bz8v4Dd4fTzoZ/RQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvhGF1QPszhTs; Sun, 03 Aug 2025 01:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57311Ppm072021; Sun, 3 Aug 2025 01:01:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57311PvZ072018; Sun, 3 Aug 2025 01:01:25 GMT (envelope-from git) Date: Sun, 3 Aug 2025 01:01:25 GMT Message-Id: <202508030101.57311PvZ072018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 4266bc4fcf9b - stable/13 - MFC: MFV: less v679. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4266bc4fcf9b46565f20e46f12ccd2afec9c0734 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=4266bc4fcf9b46565f20e46f12ccd2afec9c0734 commit 4266bc4fcf9b46565f20e46f12ccd2afec9c0734 Author: Xin LI AuthorDate: 2025-07-20 17:33:52 +0000 Commit: Xin LI CommitDate: 2025-08-03 01:00:44 +0000 MFC: MFV: less v679. (cherry picked from commit 76bafc90692608c1db8df3276e966212201c270c) --- contrib/less/NEWS | 10 ++++++++++ contrib/less/decode.c | 2 +- contrib/less/help.c | 2 +- contrib/less/less.h | 9 +++++---- contrib/less/less.nro | 2 +- contrib/less/lessecho.nro | 2 +- contrib/less/lesskey.nro | 2 +- contrib/less/os.c | 6 +++--- contrib/less/version.c | 4 +++- 9 files changed, 26 insertions(+), 13 deletions(-) diff --git a/contrib/less/NEWS b/contrib/less/NEWS index 5767ded21a00..cdc8196a5f16 100644 --- a/contrib/less/NEWS +++ b/contrib/less/NEWS @@ -9,6 +9,16 @@ Report bugs, suggestions or comments at https://github.com/gwsw/less/issues. +====================================================================== + + Major changes between "less" versions 678 and 679 + +* Fix bad parsing of lesskey file an env var is a prefix of another + env var (github #626). + +* Fix unexpected exit using -K if a key press is received while reading + the input file (github #628). + ====================================================================== Major changes between "less" versions 668 and 678 diff --git a/contrib/less/decode.c b/contrib/less/decode.c index 2942a30863cb..8e451d1810c9 100644 --- a/contrib/less/decode.c +++ b/contrib/less/decode.c @@ -750,7 +750,7 @@ static int cmd_search(constant char *cmd, constant unsigned char *table, constan { action = taction; *extra = textra; - } else if (match > 0) /* cmd is a prefix of this table entry */ + } else if (match > 0 && action == A_INVALID) /* cmd is a prefix of this table entry */ { action = A_PREFIX; } diff --git a/contrib/less/help.c b/contrib/less/help.c index 81e0943fe4e2..5d8ba9a1b0fe 100644 --- a/contrib/less/help.c +++ b/contrib/less/help.c @@ -1,4 +1,4 @@ -/* This file was generated by mkhelp.pl from less.hlp at 20:41 on 2025/5/1 */ +/* This file was generated by mkhelp.pl from less.hlp at 19:46 on 2025/5/28 */ #include "less.h" constant char helpdata[] = { '\n', diff --git a/contrib/less/less.h b/contrib/less/less.h index 94a3e2235906..7b2d2c25bfc6 100644 --- a/contrib/less/less.h +++ b/contrib/less/less.h @@ -575,10 +575,11 @@ typedef enum { #endif #endif -#define S_INTERRUPT 01 -#define S_STOP 02 -#define S_WINCH 04 -#define ABORT_SIGS() (sigs & (S_INTERRUPT|S_STOP)) +#define S_INTERRUPT (1<<0) +#define S_SWINTERRUPT (1<<1) +#define S_STOP (1<<2) +#define S_WINCH (1<<3) +#define ABORT_SIGS() (sigs & (S_INTERRUPT|S_SWINTERRUPT|S_STOP)) #ifdef EXIT_SUCCESS #define QUIT_OK EXIT_SUCCESS diff --git a/contrib/less/less.nro b/contrib/less/less.nro index 6b74ec5f161b..25a9869a9c59 100644 --- a/contrib/less/less.nro +++ b/contrib/less/less.nro @@ -1,5 +1,5 @@ '\" t -.TH LESS 1 "Version 678: 01 May 2025" +.TH LESS 1 "Version 679: 28 May 2025" .SH NAME less \- display the contents of a file in a terminal .SH SYNOPSIS diff --git a/contrib/less/lessecho.nro b/contrib/less/lessecho.nro index 696fcb13b214..f0cccc4de6da 100644 --- a/contrib/less/lessecho.nro +++ b/contrib/less/lessecho.nro @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 678: 01 May 2025" +.TH LESSECHO 1 "Version 679: 28 May 2025" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS diff --git a/contrib/less/lesskey.nro b/contrib/less/lesskey.nro index 61ba056b04c6..0a17c9deff71 100644 --- a/contrib/less/lesskey.nro +++ b/contrib/less/lesskey.nro @@ -1,5 +1,5 @@ '\" t -.TH LESSKEY 1 "Version 678: 01 May 2025" +.TH LESSKEY 1 "Version 679: 28 May 2025" .SH NAME lesskey \- customize key bindings for less .SH "SYNOPSIS (deprecated)" diff --git a/contrib/less/os.c b/contrib/less/os.c index 98a7ecf70c3c..357cbb356a16 100644 --- a/contrib/less/os.c +++ b/contrib/less/os.c @@ -275,7 +275,7 @@ start: if (ret != 0) { if (ret == READ_INTR) - sigs |= S_INTERRUPT; + sigs |= S_SWINTERRUPT; reading = FALSE; return (ret); } @@ -287,7 +287,7 @@ start: int c; c = WIN32getch(); - sigs |= S_INTERRUPT; + sigs |= S_SWINTERRUPT; reading = FALSE; if (c != CONTROL('C') && c != intr_char) WIN32ungetch((char) c); @@ -348,7 +348,7 @@ public int iopen(constant char *filename, int flags) while (!opening && SET_JUMP(open_label)) { opening = FALSE; - if (sigs & S_INTERRUPT) + if (sigs & (S_INTERRUPT|S_SWINTERRUPT)) { sigs = 0; #if HAVE_SETTABLE_ERRNO diff --git a/contrib/less/version.c b/contrib/less/version.c index 9a97f1658940..68a42a6272fa 100644 --- a/contrib/less/version.c +++ b/contrib/less/version.c @@ -1047,6 +1047,8 @@ v675 4/3/25 Add ESC-b. v676 4/16/25 Fix two OSC 8 display bugs. v677 4/27/25 Fix & filtering bug. v678 5/1/25 Don't change stty tab setting. +v679 5/28/25 Fix lesskey parsing bug when env var is prefix of another; + fix unexpected exit when using -K. */ -char version[] = "678"; +char version[] = "679"; From nobody Sun Aug 3 03:41:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvlpd0tWVz63x5l; Sun, 03 Aug 2025 03:41: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvlpc71J7z3MqW; Sun, 03 Aug 2025 03:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754192473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=daObOa+sXUtEjvVQ0YA1B77cTD+hGToDPEivJ/jjGgM=; b=sXRrcPAK0JNcfhCtcjV7xCca6VwG2ztOkV/+GDO0iUPn05LSSijGf7pem7+vboL0t2Wh+u O5dXVR69uZeErf7XDb9e9fHmWy+WPDWM4GFIbQOA9JEEpJoLEGnzdw7UCI3CFKrZG9Ufks 0ZCFsltw2twrb/MPIyDXAWhdqmmHfcN3FAkv+abobOTO6HIdBRgdixxv5kOg6Xmtpphg2r TCSd9tbpsyUNuKRS8Age51NPKZbsCmt9HMFxFUZYeiink6NKN/yIPvdtU7h+DCqA3zncwT NkgK4n/kabikFPjJfoQ+lapAYonPfsRW6+YsXfDcikx5XyLeJrhSK5NTMaOaMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754192473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=daObOa+sXUtEjvVQ0YA1B77cTD+hGToDPEivJ/jjGgM=; b=vENhD/450YfxWcTTmLmOsYKaTyl9fu6O9dQ+T9Hw2vUWF9U4QatnvteQdzMFV08in/AcTw xbMnXkc+OUT3pZ2kFte/Ha8Xk2u5jKzQwz+SFKo9i+n0USbGxSs2yc9jkrgMcb5ohpTp7s w5IjFgncTf8Qoo2ACC/amdK/EVEOR3z58RdCx23Co8rIa40wM8CpSz5AAcu2dxDQNvlR64 r8l8Kf81pM6axj0JhG5uKwq2wZpKHk0P/SrwpsQjbIOyuvQ8cxIKu+89ZMLNN18EwNJMOm TexQ1E+Yn3VFGv99d9FChHH407hdBQ2q9jKuyHz09XJp9USeeIS4xL6dqYUlYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754192473; a=rsa-sha256; cv=none; b=I7/hD8ZZBmET+TeQgNhKt7x2RWG3AEWGqk9KVfJU67X7FF/0ERwYqyGnZnnh6xO1jSF1vQ Ll5b+latjApQj4KarMaGp43J08595VgqYTjcIrpoym1UgaSrHehnwjwKaijXQuRf/yRLva bkWYl3tbij44iB1ueiDpxUr2ZkQBlixgBIsi26zlNtd4CGyZi3/x6UKuIW91f9BXWjGFR+ V7nLbeX9oMqIWa8loiWYoJBqB5gRpxkr5ovMNCZzuym+3P0wGtYZknegk2v8NmWESWybhL cytTvANGDlWxDxCmm8hLAL+jwK7D0pptcmLxQSy9b/pJGnrCVQhRnM0F5AXJfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvlpc6ZM8zmYj; Sun, 03 Aug 2025 03:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5733fCad072071; Sun, 3 Aug 2025 03:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5733fCFd072068; Sun, 3 Aug 2025 03:41:12 GMT (envelope-from git) Date: Sun, 3 Aug 2025 03:41:12 GMT Message-Id: <202508030341.5733fCFd072068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: ecf65a4ae5cb - main - amd64/pmap: include opt_kstack_pages.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecf65a4ae5cb9f18ebdc5fd9a40332f443e04959 Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=ecf65a4ae5cb9f18ebdc5fd9a40332f443e04959 commit ecf65a4ae5cb9f18ebdc5fd9a40332f443e04959 Author: Ka Ho Ng AuthorDate: 2025-08-03 03:40:57 +0000 Commit: Ka Ho Ng CommitDate: 2025-08-03 03:40:57 +0000 amd64/pmap: include opt_kstack_pages.h This fixes an early KASAN initialization panic in pmap_san_enter_early_alloc_4k, when a non-default value is specified for KSTACK_PAGES in the build config file. Sponsored by: Juniper Networks, Inc. MFC after: 7 days Reviewed by: des, markj Differential Revision: https://reviews.freebsd.org/D51709 --- sys/amd64/amd64/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 4cf77ee75871..243a6625bece 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -104,6 +104,7 @@ */ #include "opt_ddb.h" +#include "opt_kstack_pages.h" #include "opt_pmap.h" #include "opt_vm.h" From nobody Sun Aug 3 04:15:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvmZD6Krwz63yJZ; Sun, 03 Aug 2025 04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvmZD58bZz3QbD; Sun, 03 Aug 2025 04:15:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754194532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cPfQpZ9Mb5X1wud18OW80nRZGaaToMjQddMBEXhy8wM=; b=Xd88PhhS/fBpJpou1JGwOc/W85CuxnjjYsqTG8LXswwfLYLPk6lCxi0gbnEvwPdypqJ/Vx qHLxuNXPf0eS211DfCVO58i4TJ0FIM8+dxb0dhwPgU4Rcq35spOJMG3VnBLlXo7i85lbSG paFeSLt1RP55mk/h3Y+wWPlg9GtfV4QxGxiBtlp/EMiRtq3cgXGS92QKD6UF2IMOh0CpiW FDEY/PUbNZKdHKiBSrKDJg2q0KxgaQEifTVzvcKi7DUVrXkrzTF/Z9Tsobcu02Oz1p2MGY uxy0YIN4qJzbAvPz/1Wi/od7n3nWkg/t3wlkYOAtnqEsbiXoq/1hVKVAewQ8+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754194532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cPfQpZ9Mb5X1wud18OW80nRZGaaToMjQddMBEXhy8wM=; b=GtW0RCLCQrf+8zBIL0+RNZ19TyV5C7gsCKchcXYdYn80Gi8dYGLqqPHGjZfXTYgLT48fZt Riq7HEzX4GPYX6kj80tWPy0Grxq3TS3hupHYkxqDRdFUu7PzWo8jNViWsfiGhpWhTxlZdo G5/i/X+e8GDPNwoxEWHMMSqr0BgIIzuTH7H4rNq7WrKpqyPzbEHfIokzdqeuBBdWU/tDty 1vFxppD0qY/y2V8dWzEAKFwsyXg+titeFUj2ic00OiKaFCQ2pCAE1nYtOXupQwwe12+bq2 YlwcicctDGYJRkCUiCCLGmVonpk0LjCW9Oh/EKJJXW/biAr+pS2t4Mlfh9BgRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754194532; a=rsa-sha256; cv=none; b=yNatePCAl5+589BHCClSRDCQqS3rGbzUqMfIfTBB3WK3lryceunzcxhFmhCt2ppkY2MGrV aHx3xmmsdHfCfW40rU0FW6RLNwrp8nCGnmgQaRf4wWiY6/z87lR9Bw78YEkzQQfn7g98ul ZDmeyJk7ugSUWcT4ddG3vvKmSPKTok6Ok2wQfM0GZQ8nZTbi9LR1t3CT9Q5HXxmMsuVGqy tY8U9RE1AaI7HR1uuL0eke35+KtkDepYFbcFKK1pYNa8sMse1TAvWtje8oxCXjgPaBrPb3 n0f4m5sLmPFFSZHtOsgz+mXgMqwcRhZ5OWsDGo/APi8qsxuiiImRQR/L6DMZHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvmZD4X6SznVy; Sun, 03 Aug 2025 04:15:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5734FWCP034761; Sun, 3 Aug 2025 04:15:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5734FWY7034758; Sun, 3 Aug 2025 04:15:32 GMT (envelope-from git) Date: Sun, 3 Aug 2025 04:15:32 GMT Message-Id: <202508030415.5734FWY7034758@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: 702423e864a5 - main - libc: gen: refactor execvPe() for readability List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 702423e864a5a297713566ea74a62723a9c68a72 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=702423e864a5a297713566ea74a62723a9c68a72 commit 702423e864a5a297713566ea74a62723a9c68a72 Author: Kyle Evans AuthorDate: 2025-08-03 04:15:03 +0000 Commit: Kyle Evans CommitDate: 2025-08-03 04:15:03 +0000 libc: gen: refactor execvPe() for readability The current incarnation of execvPe() is a bit messy, and it can be rather difficult to reason about whether we're actually doing the right thing with our errors. We have two cases in which we may enter the loop: 1.) We have a name that has no slashes in it, and we enter the loop normally through our strsep() logic to process $PATH 2.) We have a name with at least one slash, in which case we jump into the middle of the loop then bail after precisely the one iteration if we failed Both paths will exit the loop if we failed, either via jumping to the `done` label to preserve an errno or into the path that clobbers errno. Clobbering errno for case #2 above would seem to be wrong, as we did not actually search -- this would seem to be what POSIX expects, as well, based on expectations of the conformance test suite. Simplify reasoning about the two paths by splitting out an execvPe_prog that does the execve(2) call specifically, and returns based on whether the error would be fatal in a PATH search or not. For the relative/absolute case, we can just ignore the return value and keep errno intact. The search case gets simplified to return early if we hit a fatal error, or continue until the end and clobber errno if we did not find a suitable candidate. Another posix_spawnp() test is added to confirm that we didn't break our EACCES behavior in the process. Reviewed by: des, markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51629 --- lib/libc/gen/exec.c | 227 ++++++++++++++++++++++------------ lib/libc/tests/gen/posix_spawn_test.c | 50 ++++++++ 2 files changed, 197 insertions(+), 80 deletions(-) diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 926c50d64852..12020a79f6b4 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -32,8 +32,10 @@ #include "namespace.h" #include #include +#include #include #include +#include #include #include #include @@ -139,26 +141,129 @@ execvp(const char *name, char * const *argv) return (__libc_execvpe(name, argv, environ)); } +/* + * Returns 0 if we don't consider this a terminal condition, -1 if we do. + */ +static int +execvPe_prog(const char *path, char * const *argv, char * const *envp) +{ + struct stat sb; + const char **memp; + size_t cnt; + int save_errno; + + (void)_execve(path, argv, envp); + /* Grouped roughly by never terminal vs. usually terminal conditions */ + switch (errno) { + case ELOOP: + case ENAMETOOLONG: + case ENOENT: + case ENOTDIR: + /* Non-terminal: property of the path we're trying */ + break; + case ENOEXEC: + /* + * Failures here are considered terminal because we must handle + * this via the ENOEXEC fallback path; doing any further + * searching would be categorically incorrect. + */ + + for (cnt = 0; argv[cnt] != NULL; ++cnt) + ; + + /* + * cnt may be 0 above; always allocate at least + * 3 entries so that we can at least fit "sh", path, and + * the NULL terminator. We can rely on cnt to take into + * account the NULL terminator in all other scenarios, + * as we drop argv[0]. + */ + memp = alloca(MAX(3, cnt + 2) * sizeof(char *)); + assert(memp != NULL); + if (cnt > 0) { + memp[0] = argv[0]; + memp[1] = path; + memcpy(&memp[2], &argv[1], cnt * sizeof(char *)); + } else { + memp[0] = "sh"; + memp[1] = path; + memp[2] = NULL; + } + + (void)_execve(_PATH_BSHELL, __DECONST(char **, memp), envp); + return (-1); + case ENOMEM: + case E2BIG: + /* Terminal: persistent condition */ + return (-1); + case ETXTBSY: + /* + * Terminal: we used to retry here, but sh(1) doesn't. + */ + return (-1); + default: + /* + * EACCES may be for an inaccessible directory or + * a non-executable file. Call stat() to decide + * which. This also handles ambiguities for EFAULT + * and EIO, and undocumented errors like ESTALE. + * We hope that the race for a stat() is unimportant. + */ + save_errno = errno; + if (stat(path, &sb) == -1) { + /* + * We force errno to ENOENT here to disambiguate the + * EACCESS case; the results of execve(2) are somewhat + * inconclusive because either the file did not exist or + * we just don't have search permissions, but the caller + * only really wants to see EACCES if the file did exist + * but was not accessible. + */ + if (save_errno == EACCES) + errno = ENOENT; + break; + } + + errno = save_errno; + + /* + * Non-terminal: the file did exist and we just didn't have + * access to it, so we surface the EACCES and let the search + * continue for a candidate that we do have access to. + */ + if (errno == EACCES) + break; + + /* + * All other errors here are terminal, as prescribed by exec(3). + */ + return (-1); + } + + return (0); +} + static int execvPe(const char *name, const char *path, char * const *argv, char * const *envp) { - const char **memp; - size_t cnt, lp, ln; - int eacces, save_errno; char buf[MAXPATHLEN]; - const char *bp, *np, *op, *p; - struct stat sb; + size_t ln, lp; + const char *np, *op, *p; + bool eacces; - eacces = 0; + eacces = false; /* If it's an absolute or relative path name, it's easy. */ - if (strchr(name, '/')) { - bp = name; - op = NULL; - goto retry; + if (strchr(name, '/') != NULL) { + /* + * We ignore non-terminal conditions because we don't have any + * further paths to try -- we can just bubble up the errno from + * execve(2) here. + */ + (void)execvPe_prog(name, argv, envp); + return (-1); } - bp = buf; /* If it's an empty path name, fail in the usual POSIX way. */ if (*name == '\0') { @@ -192,9 +297,13 @@ execvPe(const char *name, const char *path, char * const *argv, op = np + 1; /* - * If the path is too long complain. This is a possible - * security issue; given a way to make the path too long - * the user may execute the wrong program. + * If the path is too long, then complain. This is a possible + * security issue: given a way to make the path too long, the + * user may execute the wrong program. + * + * Remember to exercise caution here with assembling our final + * buf and any output, as we may be running in a vfork() context + * via posix_spawnp(). */ if (lp + ln + 2 > sizeof(buf)) { (void)_write(STDERR_FILENO, execvPe_err_preamble, @@ -202,82 +311,40 @@ execvPe(const char *name, const char *path, char * const *argv, (void)_write(STDERR_FILENO, p, lp); (void)_write(STDERR_FILENO, execvPe_err_trailer, sizeof(execvPe_err_trailer) - 1); + continue; } - bcopy(p, buf, lp); + + memcpy(&buf[0], p, lp); buf[lp] = '/'; - bcopy(name, buf + lp + 1, ln); + memcpy(&buf[lp + 1], name, ln); buf[lp + ln + 1] = '\0'; -retry: (void)_execve(bp, argv, envp); - switch (errno) { - case E2BIG: - goto done; - case ELOOP: - case ENAMETOOLONG: - case ENOENT: - break; - case ENOEXEC: - for (cnt = 0; argv[cnt]; ++cnt) - ; - - /* - * cnt may be 0 above; always allocate at least - * 3 entries so that we can at least fit "sh", bp, and - * the NULL terminator. We can rely on cnt to take into - * account the NULL terminator in all other scenarios, - * as we drop argv[0]. - */ - memp = alloca(MAX(3, cnt + 2) * sizeof(char *)); - if (memp == NULL) { - /* errno = ENOMEM; XXX override ENOEXEC? */ - goto done; - } - if (cnt > 0) { - memp[0] = argv[0]; - memp[1] = bp; - bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); - } else { - memp[0] = "sh"; - memp[1] = bp; - memp[2] = NULL; - } - (void)_execve(_PATH_BSHELL, - __DECONST(char **, memp), envp); - goto done; - case ENOMEM: - goto done; - case ENOTDIR: - break; - case ETXTBSY: - /* - * We used to retry here, but sh(1) doesn't. - */ - goto done; - default: - /* - * EACCES may be for an inaccessible directory or - * a non-executable file. Call stat() to decide - * which. This also handles ambiguities for EFAULT - * and EIO, and undocumented errors like ESTALE. - * We hope that the race for a stat() is unimportant. - */ - save_errno = errno; - if (stat(bp, &sb) != 0) - break; - if (save_errno == EACCES) { - eacces = 1; - continue; - } - errno = save_errno; - goto done; - } + /* + * For terminal conditions we can just return immediately. If + * it was non-terminal, we just need to note if we had an + * EACCES -- execvPe_prog would do a stat(2) and leave us with + * an errno of EACCES only if the file did exist; otherwise it + * would coerce it to an ENOENT because we may not know if a + * file actually existed there or not. + */ + if (execvPe_prog(buf, argv, envp) == -1) + return (-1); + if (errno == EACCES) + eacces = true; } + + /* + * We don't often preserve errors encountering during the PATH search, + * so we override it here. ENOENT would be misleading if we found a + * candidate but couldn't access it, but most of the other conditions + * are either terminal or indicate that nothing was there. + */ if (eacces) errno = EACCES; else errno = ENOENT; -done: + return (-1); } diff --git a/lib/libc/tests/gen/posix_spawn_test.c b/lib/libc/tests/gen/posix_spawn_test.c index 77c3b5a569d9..22133cf1d59a 100644 --- a/lib/libc/tests/gen/posix_spawn_test.c +++ b/lib/libc/tests/gen/posix_spawn_test.c @@ -29,8 +29,11 @@ * IEEE Std. 1003.1-2008. */ +#include +#include #include #include +#include #include #include #include @@ -38,6 +41,10 @@ #include +static const char true_script[] = + "#!/usr/bin/env\n" + "/usr/bin/true\n"; + char *myenv[2] = { "answer=42", NULL }; ATF_TC_WITHOUT_HEAD(posix_spawn_simple_test); @@ -124,6 +131,48 @@ ATF_TC_BODY(posix_spawnp_enoexec_fallback_null_argv0, tc) ATF_REQUIRE(error == EINVAL); } +ATF_TC(posix_spawnp_eacces); +ATF_TC_HEAD(posix_spawnp_eacces, tc) +{ + atf_tc_set_md_var(tc, "descr", "Verify EACCES behavior in posix_spawnp"); + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(posix_spawnp_eacces, tc) +{ + const struct spawnp_eacces_tc { + const char *pathvar; + int error_expected; + } spawnp_eacces_tests[] = { + { ".", EACCES }, /* File exists, but not +x */ + { "unsearchable", ENOENT }, /* File exists, dir not +x */ + }; + char *myargs[2] = { "eacces", NULL }; + int error; + + error = mkdir("unsearchable", 0755); + ATF_REQUIRE(error == 0); + error = symlink("/usr/bin/true", "unsearchable/eacces"); + ATF_REQUIRE(error == 0); + + (void)chmod("unsearchable", 0444); + + /* this will create a non-executable file */ + atf_utils_create_file("eacces", true_script); + + for (size_t i = 0; i < nitems(spawnp_eacces_tests); i++) { + const struct spawnp_eacces_tc *tc = &spawnp_eacces_tests[i]; + pid_t pid; + + error = setenv("PATH", tc->pathvar, 1); + ATF_REQUIRE_EQ(0, error); + + error = posix_spawnp(&pid, myargs[0], NULL, NULL, myargs, + myenv); + ATF_CHECK_INTEQ_MSG(tc->error_expected, error, + "path '%s'", tc->pathvar); + } +} + ATF_TP_ADD_TCS(tp) { @@ -131,6 +180,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, posix_spawn_no_such_command_negative_test); ATF_TP_ADD_TC(tp, posix_spawnp_enoexec_fallback); ATF_TP_ADD_TC(tp, posix_spawnp_enoexec_fallback_null_argv0); + ATF_TP_ADD_TC(tp, posix_spawnp_eacces); return (atf_no_error()); } From nobody Sun Aug 3 04:15:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvmZF6x4Tz63y0H; Sun, 03 Aug 2025 04:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvmZF5mQGz3QmB; Sun, 03 Aug 2025 04:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754194533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+3MiQiZodbutQxV3F+gQfqjyIfbYJ/aujhbUsCJyu2c=; b=h+ISbO3sLXXOinfXxbLnFhZDbFtSk5k0STqPDxE85JHr2VxLjbzfTotSRi+nA0UTt2h57f 1UmqqEq9mQnlDJBdR8Iz0IFSnct5e1Lno83or+yvdkjtI8lqigCjpHB4n6z1SM0EtZDumH PCzCp/IkhDV62xtUFX13urjMVmtDCnjhrkcTs28vzsk/C2fpvepixc5VlzfxvlanVef63P mE5wke0fsftaqSyVEs+qkFChbViL6TKiinOtlQyZyhsKlFReuvIM4pJ6JiD3OHTIEH8TX0 86hseLHAfZPgAkcuLPQUSVeQvkGnwEwMHqZVb7eXQ9nMVm+ZhsoCkwag20SzpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754194533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+3MiQiZodbutQxV3F+gQfqjyIfbYJ/aujhbUsCJyu2c=; b=c4FkZ+nmJGplA5Diji0+brO3Uwpd8WlvuqQqA4zYhBnBol2G67iywA2WvXmUe4mrFbj8DF 8DhdeA9wyLC7ugD2m2bPynbsjD3Rbqqz0qho9gSKa7iXMHJ/odny484SSvUsI/GDniBnuP W8ap/kYCq6PetlsQ2qfoS7AO4e86TlPNWUCBvRMAdfTd8IO20A2fSLXJo63OaTpfpQu9wp PQfM3aAI5wGpfsdjD+zu3iObHFyBiTj8KwpTTz40Syuom8yE/U3bb1yCY8ks/j6RoRSDp8 Z1/HeGJE0kmriJXnVDywYZ9GOuabyb2/KHQjiNu6LfYK3vXsya5TlO8gWx9tqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754194533; a=rsa-sha256; cv=none; b=WPwqvr9YNQTnMRH+gG2okaPzQ3qmevjIvjTHp+XeXVdDdwrVjDJc6IgLOXsc1s0NTDVwIN mp2k7N4Nc6cg5n1rN+uz90qG7q/bY9QWrxG84psBUgf/O1yb2OXZ3YlGl2nMXuH/pGpHq5 q1Qe6nfSrHEhueSu5/O6tqgyIbKXP3Q+AQVku4Nn0ebDSDaXjTmWSA9I+j+C7GC7mB3Pi9 qnvn/3mYuz9c7JxH8n2pzReDmkhFwb/kEm/GOoaGKHbbO6pz7AQG7NQFbhEPj0NlMDEoBP exM3Bvh+474jR07TZJhy61mMYYz5AY3IU8FvOAWIiEEUpw0mwLiOv8lBKlU2xA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvmZF58Z6znrx; Sun, 03 Aug 2025 04:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5734FXW6034795; Sun, 3 Aug 2025 04:15:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5734FXAG034792; Sun, 3 Aug 2025 04:15:33 GMT (envelope-from git) Date: Sun, 3 Aug 2025 04:15:33 GMT Message-Id: <202508030415.5734FXAG034792@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: 91eb4d2ba4de - main - chroot: slightly cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 91eb4d2ba4def0fe0f56f0a61ad7c503fcab891b Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=91eb4d2ba4def0fe0f56f0a61ad7c503fcab891b commit 91eb4d2ba4def0fe0f56f0a61ad7c503fcab891b Author: Kyle Evans AuthorDate: 2025-08-03 04:15:03 +0000 Commit: Kyle Evans CommitDate: 2025-08-03 04:15:03 +0000 chroot: slightly cleanup Highlights: - Pull resolve_user() and resolve_group() out to make the main flow a bit easier to read - Fix some edge-cases in user/group resolution: you can have fully numeric usernames, and they may or may not live within the valid ID range. Switch to just trying to resolve every specified group/user as a name, first, with a fallback to converting it to a numeric type and trying to resolve it as an ID. - Constify locals in main() that don't need to be mutable, re-sort Reviewed by: emaste, olce Differential Revision: https://reviews.freebsd.org/D51509 --- usr.sbin/chroot/chroot.c | 94 ++++++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/usr.sbin/chroot/chroot.c b/usr.sbin/chroot/chroot.c index c978fc019c95..8a99a9bbf7cb 100644 --- a/usr.sbin/chroot/chroot.c +++ b/usr.sbin/chroot/chroot.c @@ -47,17 +47,58 @@ static void usage(void) __dead2; +static gid_t +resolve_group(const char *group) +{ + char *endp; + struct group *gp; + unsigned long gid; + + gp = getgrnam(group); + if (gp != NULL) + return (gp->gr_gid); + + /* + * Numeric IDs don't need a trip through the database to check them, + * POSIX seems to think we should generally accept a numeric ID as long + * as it's within the valid range. + */ + errno = 0; + gid = strtoul(group, &endp, 0); + if (errno == 0 && *endp == '\0' && (gid_t)gid >= 0 && gid <= GID_MAX) + return (gid); + + errx(1, "no such group '%s'", group); +} + +static uid_t +resolve_user(const char *user) +{ + char *endp; + struct passwd *pw; + unsigned long uid; + + pw = getpwnam(user); + if (pw != NULL) + return (pw->pw_uid); + + errno = 0; + uid = strtoul(user, &endp, 0); + if (errno == 0 && *endp == '\0' && (uid_t)uid >= 0 && uid <= UID_MAX) + return (uid); + + errx(1, "no such user '%s'", user); +} + int main(int argc, char *argv[]) { - struct group *gp; - struct passwd *pw; - char *endp, *p, *user, *group, *grouplist; - const char *shell; + const char *group, *p, *shell, *user; + char *grouplist; + long ngroups_max; gid_t gid, *gidlist; uid_t uid; int arg, ch, error, gids; - long ngroups_max; bool nonprivileged; gid = 0; @@ -95,19 +136,8 @@ main(int argc, char *argv[]) if (argc < 1) usage(); - if (group != NULL) { - if (isdigit((unsigned char)*group)) { - gid = (gid_t)strtoul(group, &endp, 0); - if (*endp != '\0') - goto getgroup; - } else { - getgroup: - if ((gp = getgrnam(group)) != NULL) - gid = gp->gr_gid; - else - errx(1, "no such group `%s'", group); - } - } + if (group != NULL) + gid = resolve_group(group); ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; if ((gidlist = malloc(sizeof(gid_t) * ngroups_max)) == NULL) @@ -122,35 +152,13 @@ main(int argc, char *argv[]) if (*p == '\0') continue; - if (isdigit((unsigned char)*p)) { - gidlist[gids] = (gid_t)strtoul(p, &endp, 0); - if (*endp != '\0') - goto getglist; - } else { - getglist: - if ((gp = getgrnam(p)) != NULL) - gidlist[gids] = gp->gr_gid; - else - errx(1, "no such group `%s'", p); - } - gids++; + gidlist[gids++] = resolve_group(p); } if (p != NULL && gids == ngroups_max) errx(1, "too many supplementary groups provided"); - if (user != NULL) { - if (isdigit((unsigned char)*user)) { - uid = (uid_t)strtoul(user, &endp, 0); - if (*endp != '\0') - goto getuser; - } else { - getuser: - if ((pw = getpwnam(user)) != NULL) - uid = pw->pw_uid; - else - errx(1, "no such user `%s'", user); - } - } + if (user != NULL) + uid = resolve_user(user); if (nonprivileged) { arg = PROC_NO_NEW_PRIVS_ENABLE; From nobody Sun Aug 3 06:23:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvqPx5Ph6z62vW7; Sun, 03 Aug 2025 06:23:33 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvqPx3R3Wz3b5W; Sun, 03 Aug 2025 06:23:33 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754202213; 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=LjV3Aaz8JnGm90bNGmip+Zx5kVXClPp2PV8O9di5asc=; b=Gt+FpQxJbCIyyGv3vYKrirhCBYVFUQOMY/wUElZUHS7pQA5G4+WKSu4YPczCVIkRKQixnp /k16umADzp2htnkbAT/+Q6/qvZybcuRaBhIBU6+MO3Lre39AGCOiPX5ofaN1AK+gbXDrJ9 VuE4WuhEJLXhz3YhSE1M3HeKlXJ6T2QeghZzmN54ENdHz3taicTP7s7CeZj6DoJKaLLCm8 ejwQ/J+IHTtSF3j+6exa4Z0tW3KPWiKdPnXevuYAm/eotrLOIiNBZq2nsGvUXMKkFiLtTK ih3NrmNVArADMxIUVD5S8An1DZQEzSEDLRdbEvYZ7s14Fkomi6wRkVosub8Vsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754202213; 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=LjV3Aaz8JnGm90bNGmip+Zx5kVXClPp2PV8O9di5asc=; b=tnmRaT6GAxE9CK+lPUZcj/mBiNcvKQdBbuLDS47gfpRnC+FLZV0Lw0swR44Urpl7MhRPFy 6j4/2LSRhYlQtuxp1b1MnscX9yZKz/ybv/rQcea1jmX2j4VhcYmhprgxl89VjB3nBkJG4W 8JhsPy0zfFP1Xi6IUOhYn5TAonmBQdqyvo5LLTghpTKshxZNaY4onWzk4WWU7guLqD29NE YpIndNr2nYJOTTBDsTXtUP9P7diU3zLL5C6y0Ed3pWveQH/Hy7RuabJscwrYYma6siFHXS 7EuJQm/Vp+i+QG5fsHZn+3UZvH3LzIycLDOYtG+ljLMtr81cY3OnaWVkJRc86w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754202213; a=rsa-sha256; cv=none; b=CpyilC9HI8NuXqhWsa7lKL0SVlA1k5ZXu+N3DzGObgk+x45HHdnT3Folcq/z1vPJOrm9om QCxS6JmImJXXZrYj1gyHdqVHmeigbP2+kYZmJCS58Vlw2jADnR9/gisshmhTEJoz0YSd5A GeWQHpeSH6D6whHSffjLTuLbSP0idi2MMy7UtUPmB0ufVfwnIcuF9FYVW9zVGvXj2j7SH/ xGjJ3HTfB4VYnQYaWovbjcL6I/y8Qo8PR4wVWT78ma8MnraQZBWjRgueRlPrdD52iPjmVy FNORWabJe58BGU10G/9qbebv+piJLCoaBjAWelcRE+lVSxld6EaVywRnV+vj6A== Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bvqPx2kYLzxcF; Sun, 03 Aug 2025 06:23:33 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-4aa826d4b8eso7179141cf.0; Sat, 02 Aug 2025 23:23:33 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVOR3GoGWCWIoWUQkGjn8Tamv+65hQ3AZvDBoprc1RFig38yHnI0rAsNFICIJUCWPECooWL7GEET6LF3tINT1DE+iFM@freebsd.org, AJvYcCXvl0pK+rLhalpOwpc9wVp3tSWbppj4dBV07mD2rTxZa4sQ8cgTW4zCq2WHIOc33yvz9z0+vNJps4NdMQ/scsbfxj+be28=@freebsd.org X-Gm-Message-State: AOJu0YwmHHVNZ3njSLfjTRHKt9ioO0h+5ubfjDSIBv86vSL4mxzYzcsE MqUY8kQrUm516xIdZ9zFUbOsf6QwY1Fv09unSK2Ds6en4exHGjqqwzWlICRPBK+cwQmZ7QBisMd 1JpwMZg3/nGcXQ2qbDXfTrmj1Aam3ZtU= X-Google-Smtp-Source: AGHT+IFtN/k4QknTszYasGcCj+T7s+YPPbYPpf/00L5FNFHS5aY9jBRsIET7aTg2q70SYIr8tBKuhOU41K0vHHZB7BI= X-Received: by 2002:a05:620a:2a03:b0:7e7:fd10:526 with SMTP id af79cd13be357-7e7fd100b19mr3353185a.8.1754202212747; Sat, 02 Aug 2025 23:23:32 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202508021757.572Hv2Ox066248@gitrepo.freebsd.org> In-Reply-To: <202508021757.572Hv2Ox066248@gitrepo.freebsd.org> From: Nuno Teixeira Date: Sun, 3 Aug 2025 07:23:21 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXwVXZNW7ZOp0C-cX6sFIxoDW8daRTS70cdOFiufEcrpNZ3FXgu3ARICTzA Message-ID: Subject: Re: git: 8d8a745c456c - main - libutil: Drop auth_getval() To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000c14e23063b700719" --000000000000c14e23063b700719 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello! Not sure if it is related but I've spoted that lang/ghc is failing on configure on main-n279255-95f8c3e1ed0c: Sat Aug 2: chmod 644 '/wrkdirs/usr/ports/lang/ghc/work/ghc-boot-install/lib/ghc-9.6.7/lib/packag= e.conf.d/template-haskell-2.20.0.0.conf' '/wrkdirs/usr/ports/lang/ghc/work/ghc-boot-install/lib/ghc-9.6.7/bin/ghc-pk= g' --global-package-db "/wrkdirs/usr/ports/lang/ghc/work/ghc-boot-install/lib/ghc-9.6.7/lib/packag= e.conf.d" recache ld-elf.so.1: Shared object "libutil.so.9" not found, required by "ghc-pkg" gmake: *** [Makefile:235: update_package_db] Error 1 Thanks, Dag-Erling Sm=C3=B8rgrav escreveu (s=C3=A1bado, 2/08/2025= =C3=A0(s) 18:57): > The branch main has been updated by des: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D8d8a745c456cacf706689febee9639f= 5e8292fc8 > > commit 8d8a745c456cacf706689febee9639f5e8292fc8 > Author: Dag-Erling Sm=C3=B8rgrav > AuthorDate: 2025-08-02 17:56:16 +0000 > Commit: Dag-Erling Sm=C3=B8rgrav > CommitDate: 2025-08-02 17:56:35 +0000 > > libutil: Drop auth_getval() > > This function has been an empty stub for years; now that we're bumpin= g > the library version, we can finally get rid of it. > > Fixes: 0c381b7f0570 > Reviewed by: kib, emaste > Differential Revision: https://reviews.freebsd.org/D51704 > --- > lib/libutil/Makefile | 2 +- > lib/libutil/Symbol.map | 1 - > lib/libutil/auth.c | 44 -------------------------------------------- > lib/libutil/libutil.h | 1 - > 4 files changed, 1 insertion(+), 47 deletions(-) > > diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile > index d445bc5dec3b..12ac623aec6b 100644 > --- a/lib/libutil/Makefile > +++ b/lib/libutil/Makefile > @@ -9,7 +9,7 @@ PACKAGE=3D runtime > LIB=3D util > SHLIB_MAJOR=3D 10 > > -SRCS=3D _secure_path.c auth.c cpuset.c expand_number.c flopen.c fparsel= n.c > \ > +SRCS=3D _secure_path.c cpuset.c expand_number.c flopen.c fparseln.c \ > ftime.c getlocalbase.c gr_util.c \ > hexdump.c humanize_number.c kinfo_getfile.c \ > kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \ > diff --git a/lib/libutil/Symbol.map b/lib/libutil/Symbol.map > index d4bac5b5f53e..8c8fff451cd1 100644 > --- a/lib/libutil/Symbol.map > +++ b/lib/libutil/Symbol.map > @@ -2,7 +2,6 @@ FBSD_1.8 { > _secure_path; > auth_cat; > auth_checknologin; > - auth_getval; > auth_hostok; > auth_timeok; > auth_ttyok; > diff --git a/lib/libutil/auth.c b/lib/libutil/auth.c > deleted file mode 100644 > index 3414fc8e26e7..000000000000 > --- a/lib/libutil/auth.c > +++ /dev/null > @@ -1,44 +0,0 @@ > -/*- > - * SPDX-License-Identifier: BSD-2-Clause > - * > - * Simple authentication database handling code. > - * > - * Copyright (c) 1998 > - * Jordan Hubbard. All rights reserved. > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions > - * are met: > - * 1. Redistributions of source code must retain the above copyright > - * notice, this list of conditions and the following disclaimer, > - * verbatim and that no modifications are made prior to this > - * point in the file. > - * 2. Redistributions in binary form must reproduce the above copyright > - * notice, this list of conditions and the following disclaimer in th= e > - * documentation and/or other materials provided with the distributio= n. > - * > - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR HIS PETS BE LIABLE > - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS > - * OR SERVICES; LOSS OF USE, DATA, LIFE 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 O= F > - * SUCH DAMAGE. > - */ > - > -#include > -#include > - > -#include > - > -char * > -auth_getval(const char *name) > -{ > - > - (void)name; > - return (NULL); > -} > diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h > index 6d36a0c291c6..d27262e44daf 100644 > --- a/lib/libutil/libutil.h > +++ b/lib/libutil/libutil.h > @@ -86,7 +86,6 @@ struct termios; > struct winsize; > > __BEGIN_DECLS > -char *auth_getval(const char *_name); > void clean_environment(const char * const *_white, > const char * const *_more_white); > int expand_number(const char *_buf, int64_t *_num); > > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --000000000000c14e23063b700719 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

Not sure if it is related bu= t I've spoted that lang/ghc is failing on configure on main-n279255-95f= 8c3e1ed0c: Sat Aug =C2=A02:

chmod 644 '/wrkdirs/usr/ports/lang/g= hc/work/ghc-boot-install/lib/ghc-9.6.7/lib/package.conf.d/template-haskell-= 2.20.0.0.conf'
'/wrkdirs/usr/ports/lang/ghc/work/ghc-boot-instal= l/lib/ghc-9.6.7/bin/ghc-pkg' --global-package-db "/wrkdirs/usr/por= ts/lang/ghc/work/ghc-boot-install/lib/ghc-9.6.7/lib/package.conf.d" re= cache
ld-elf.so.1: Shared object "libutil.so.9" not found, req= uired by "ghc-pkg"
gmake: *** [Makefile:235: update_package_db= ] Error 1

Thanks,

Dag-Erling Sm=C3=B8rgra= v <des@freebsd.org> escreveu (= s=C3=A1bado, 2/08/2025 =C3=A0(s) 18:57):
The branch main has been updated by des:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D8d8a745c456cacf706689febee9639f5e8292fc8
commit 8d8a745c456cacf706689febee9639f5e8292fc8
Author:=C2=A0 =C2=A0 =C2=A0Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>=
AuthorDate: 2025-08-02 17:56:16 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>=
CommitDate: 2025-08-02 17:56:35 +0000

=C2=A0 =C2=A0 libutil: Drop auth_getval()

=C2=A0 =C2=A0 This function has been an empty stub for years; now that we&#= 39;re bumping
=C2=A0 =C2=A0 the library version, we can finally get rid of it.

=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0c381b7f0570
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kib, emaste
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D51704
---
=C2=A0lib/libutil/Makefile=C2=A0 =C2=A0|=C2=A0 2 +-
=C2=A0lib/libutil/Symbol.map |=C2=A0 1 -
=C2=A0lib/libutil/auth.c=C2=A0 =C2=A0 =C2=A0| 44 --------------------------= ------------------
=C2=A0lib/libutil/libutil.h=C2=A0 |=C2=A0 1 -
=C2=A04 files changed, 1 insertion(+), 47 deletions(-)

diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile
index d445bc5dec3b..12ac623aec6b 100644
--- a/lib/libutil/Makefile
+++ b/lib/libutil/Makefile
@@ -9,7 +9,7 @@ PACKAGE=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 runtime
=C2=A0LIB=3D=C2=A0 =C2=A0util
=C2=A0SHLIB_MAJOR=3D 10

-SRCS=3D=C2=A0 _secure_path.c auth.c cpuset.c expand_number.c flopen.c fpar= seln.c \
+SRCS=3D=C2=A0 _secure_path.c cpuset.c expand_number.c flopen.c fparseln.c = \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ftime.c getlocalbase.c gr_util.c \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 hexdump.c humanize_number.c kinfo_getfile.c \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 kinfo_getallproc.c kinfo_getproc.c kinfo_getvmm= ap.c \
diff --git a/lib/libutil/Symbol.map b/lib/libutil/Symbol.map
index d4bac5b5f53e..8c8fff451cd1 100644
--- a/lib/libutil/Symbol.map
+++ b/lib/libutil/Symbol.map
@@ -2,7 +2,6 @@ FBSD_1.8 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 _secure_path;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 auth_cat;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 auth_checknologin;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0auth_getval;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 auth_hostok;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 auth_timeok;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 auth_ttyok;
diff --git a/lib/libutil/auth.c b/lib/libutil/auth.c
deleted file mode 100644
index 3414fc8e26e7..000000000000
--- a/lib/libutil/auth.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Simple authentication database handling code.
- *
- * Copyright (c) 1998
- *=C2=A0 =C2=A0 =C2=A0Jordan Hubbard.=C2=A0 All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er,
- *=C2=A0 =C2=A0 verbatim and that no modifications are made prior to this<= br> - *=C2=A0 =C2=A0 point in the file.
- * 2. Redistributions in binary form must reproduce the above copyright - *=C2=A0 =C2=A0 notice, this list of conditions and the following disclaim= er in the
- *=C2=A0 =C2=A0 documentation and/or other materials provided with the dis= tribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRE= SS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP= OSE
- * ARE DISCLAIMED.=C2=A0 IN NO EVENT SHALL THE AUTHOR OR HIS PETS BE LIABL= E
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENT= IAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS=
- * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTI= ON)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STR= ICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY W= AY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<= br> - * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#include <stdlib.h>
-
-#include <libutil.h>
-
-char *
-auth_getval(const char *name)
-{
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0(void)name;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return (NULL);
-}
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h
index 6d36a0c291c6..d27262e44daf 100644
--- a/lib/libutil/libutil.h
+++ b/lib/libutil/libutil.h
@@ -86,7 +86,6 @@ struct termios;
=C2=A0struct winsize;

=C2=A0__BEGIN_DECLS
-char=C2=A0 =C2=A0*auth_getval(const char *_name);
=C2=A0void=C2=A0 =C2=A0clean_environment(const char * const *_white,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const char * const *_more_white);=
=C2=A0int=C2=A0 =C2=A0 expand_number(const char *_buf, int64_t *_num);



--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--000000000000c14e23063b700719-- From nobody Sun Aug 3 09:44:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvvt83Hwlz637vl; Sun, 03 Aug 2025 09:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvvt82SHwz3rZB; Sun, 03 Aug 2025 09:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754214288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbEF8nKjMdQYwZ34N8Mq3KblgeypYl91J/MqWGEDYsQ=; b=TdQmnqtd51rmfnUiD2SHxfSs36+RbNS4Usc+8HGWnEXWpCSlIdP595V2ITRdJiseIckYRK bAFwCGQkT1E98IfsMokEOF+9IA1ABG3Ue7x2y2JK3wyEYUSZwanjTcTBkbBtKKPT50MTpl wc7L/1YihGOSFTMojW4v9j6G8kvNyU61rtFy16XcWJSXu4YPJt0P3djRhOebEAaQNu0Qsi e+oVs73TAW/a8pxFcylHbjppnwoPgHgVEnVhFtcK90QUY9qqTBFCBakePYe1B2cX/26FPi 69F11jcxPZrgtC642pXB2ZF2aNfL453UBenhr9BggSgYdW+MqQpe3pK/xqLX4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754214288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbEF8nKjMdQYwZ34N8Mq3KblgeypYl91J/MqWGEDYsQ=; b=BHoXKQmxzo1eJxcu6xa/ixzgTaP15n7cphwyjpA/2mlU/59fxX6iq4JedDpcNvvT1PKRZj INAQDdRNOGHSWSmJb/Sp8FMUyFamY4PaTBkLhOHaGxsryvRpwofLZaIcLrRvl53yeO9f6o r+5Qb5L0fR0FxOMrZMEaxP8YFXeDC5Fm/ATlPsXLJN6WBiPiuLUB3JDUr5MYeRjIIOpYqY bUF+th+/HjDnQPWajzj90adx7pv9pKCwuWPMMkXFykMPri4/9dLfDgkURACS+sPKNIgDsx qvjaZSk1m+Ci5YC4A0KlIFvKKT3fM1/sQhgkIwGd8pwaEcWPtFwpB/6XokBS6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754214288; a=rsa-sha256; cv=none; b=T2e7Npli18fb1W7nkMkkcY4uEBYfwkdabQZHB0m0j0XsF68YmzpZXabjNa78cmo7usuKg1 9Fe2Ixax3TL+OXkeHDRFDQaNJQ2HD3VfqPrwHI3+riK7RXeXPtw1c7w7OLYwxGdsmbJCcv P4fnQbffDy30UJM7Pbu1dEDs3mX+X3p+IhP1D6JUfVWgwPCnQss/+GgpQDBZZSUJefrfqt FOoEFzknKIvLNVR+eLrxzrcmg7/oD3MOapLrHEG67/tWnU2F/gmAgkIJUNO6lwJZaSSsLn c8fAE2XaqHr3eijaC6AEq+r7S77UhbhJ0SYG9sSXAKjrp7AhZ1s3GChUJW83rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvvt822KMzy45; Sun, 03 Aug 2025 09:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5739impO057163; Sun, 3 Aug 2025 09:44:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5739imFE057160; Sun, 3 Aug 2025 09:44:48 GMT (envelope-from git) Date: Sun, 3 Aug 2025 09:44:48 GMT Message-Id: <202508030944.5739imFE057160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 12e61c31dbd5 - main - ipfw: add numeric initializers to enum ipfw_opcodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12e61c31dbd5eca6dba09b23873c0bdc682f9719 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=12e61c31dbd5eca6dba09b23873c0bdc682f9719 commit 12e61c31dbd5eca6dba09b23873c0bdc682f9719 Author: Andrey V. Elsukov AuthorDate: 2025-07-22 07:40:33 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-08-03 09:39:27 +0000 ipfw: add numeric initializers to enum ipfw_opcodes This is mostly for better readability when we need to resolve what opcode corresponds to specific number. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D51457 --- sys/netinet/ip_fw.h | 220 ++++++++++++++++++++++++++-------------------------- 1 file changed, 110 insertions(+), 110 deletions(-) diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h index c440223b81f8..51e68c310915 100644 --- a/sys/netinet/ip_fw.h +++ b/sys/netinet/ip_fw.h @@ -167,149 +167,149 @@ typedef struct _ip_fw3_opheader { */ enum ipfw_opcodes { /* arguments (4 byte each) */ - O_NOP, - - O_IP_SRC, /* u32 = IP */ - O_IP_SRC_MASK, /* ip = IP/mask */ - O_IP_SRC_ME, /* none */ - O_IP_SRC_SET, /* u32=base, arg1=len, bitmap */ - - O_IP_DST, /* u32 = IP */ - O_IP_DST_MASK, /* ip = IP/mask */ - O_IP_DST_ME, /* none */ - O_IP_DST_SET, /* u32=base, arg1=len, bitmap */ - - O_IP_SRCPORT, /* (n)port list:mask 4 byte ea */ - O_IP_DSTPORT, /* (n)port list:mask 4 byte ea */ - O_PROTO, /* arg1=protocol */ - - O_MACADDR2, /* 2 mac addr:mask */ - O_MAC_TYPE, /* same as srcport */ - - O_LAYER2, /* none */ - O_IN, /* none */ - O_FRAG, /* none */ - - O_RECV, /* none */ - O_XMIT, /* none */ - O_VIA, /* none */ - - O_IPOPT, /* arg1 = 2*u8 bitmap */ - O_IPLEN, /* arg1 = len */ - O_IPID, /* arg1 = id */ - - O_IPTOS, /* arg1 = id */ - O_IPPRECEDENCE, /* arg1 = precedence << 5 */ - O_IPTTL, /* arg1 = TTL */ - - O_IPVER, /* arg1 = version */ - O_UID, /* u32 = id */ - O_GID, /* u32 = id */ - O_ESTAB, /* none (tcp established) */ - O_TCPFLAGS, /* arg1 = 2*u8 bitmap */ - O_TCPWIN, /* arg1 = desired win */ - O_TCPSEQ, /* u32 = desired seq. */ - O_TCPACK, /* u32 = desired seq. */ - O_ICMPTYPE, /* u32 = icmp bitmap */ - O_TCPOPTS, /* arg1 = 2*u8 bitmap */ - - O_VERREVPATH, /* none */ - O_VERSRCREACH, /* none */ - - O_PROBE_STATE, /* v0:arg1=kidx, v1:kidx=kidx */ - O_KEEP_STATE, /* v0:arg1=kidx, v1:kidx=kidx */ - O_LIMIT, /* ipfw_insn_limit */ - O_LIMIT_PARENT, /* dyn_type, not an opcode. */ + O_NOP = 0, + + O_IP_SRC = 1, /* u32 = IP */ + O_IP_SRC_MASK = 2, /* ip = IP/mask */ + O_IP_SRC_ME = 3, /* none */ + O_IP_SRC_SET = 4, /* u32=base, arg1=len, bitmap */ + + O_IP_DST = 5, /* u32 = IP */ + O_IP_DST_MASK = 6, /* ip = IP/mask */ + O_IP_DST_ME = 7, /* none */ + O_IP_DST_SET = 8, /* u32=base, arg1=len, bitmap */ + + O_IP_SRCPORT = 9, /* (n)port list:mask 4 byte ea */ + O_IP_DSTPORT = 10, /* (n)port list:mask 4 byte ea */ + O_PROTO = 11, /* arg1=protocol */ + + O_MACADDR2 = 12, /* 2 mac addr:mask */ + O_MAC_TYPE = 13, /* same as srcport */ + + O_LAYER2 = 14, /* none */ + O_IN = 15, /* none */ + O_FRAG = 16, /* none */ + + O_RECV = 17, /* none */ + O_XMIT = 18, /* none */ + O_VIA = 19, /* none */ + + O_IPOPT = 20, /* arg1 = 2*u8 bitmap */ + O_IPLEN = 21, /* arg1 = len */ + O_IPID = 22, /* arg1 = id */ + + O_IPTOS = 23, /* arg1 = id */ + O_IPPRECEDENCE = 24, /* arg1 = precedence << 5 */ + O_IPTTL = 25, /* arg1 = TTL */ + + O_IPVER = 26, /* arg1 = version */ + O_UID = 27, /* u32 = id */ + O_GID = 28, /* u32 = id */ + O_ESTAB = 29, /* none (tcp established) */ + O_TCPFLAGS = 30, /* arg1 = 2*u8 bitmap */ + O_TCPWIN = 31, /* arg1 = desired win */ + O_TCPSEQ = 32, /* u32 = desired seq. */ + O_TCPACK = 33, /* u32 = desired seq. */ + O_ICMPTYPE = 34, /* u32 = icmp bitmap */ + O_TCPOPTS = 35, /* arg1 = 2*u8 bitmap */ + + O_VERREVPATH = 36, /* none */ + O_VERSRCREACH = 37, /* none */ + + O_PROBE_STATE = 38, /* v0:arg1=kidx, v1:kidx=kidx */ + O_KEEP_STATE = 39, /* v0:arg1=kidx, v1:kidx=kidx */ + O_LIMIT = 40, /* ipfw_insn_limit */ + O_LIMIT_PARENT = 41, /* dyn_type, not an opcode. */ /* * These are really 'actions'. */ - O_LOG, /* ipfw_insn_log */ - O_PROB, /* u32 = match probability */ + O_LOG = 42, /* ipfw_insn_log */ + O_PROB = 43, /* u32 = match probability */ - O_CHECK_STATE, /* v0:arg1=kidx, v1:kidx=kidx */ - O_ACCEPT, /* none */ - O_DENY, /* none */ - O_REJECT, /* arg1=icmp arg (same as deny) */ - O_COUNT, /* none */ - O_SKIPTO, /* v0:arg1=next rule number */ + O_CHECK_STATE = 44, /* v0:arg1=kidx, v1:kidx=kidx */ + O_ACCEPT = 45, /* none */ + O_DENY = 46, /* none */ + O_REJECT = 47, /* arg1=icmp arg (same as deny) */ + O_COUNT = 48, /* none */ + O_SKIPTO = 49, /* v0:arg1=next rule number */ /* v1:kidx= next rule number */ - O_PIPE, /* arg1=pipe number */ - O_QUEUE, /* arg1=queue number */ - O_DIVERT, /* arg1=port number */ - O_TEE, /* arg1=port number */ - O_FORWARD_IP, /* fwd sockaddr */ - O_FORWARD_MAC, /* fwd mac */ - O_NAT, /* nope */ - O_REASS, /* none */ + O_PIPE = 50, /* arg1=pipe number */ + O_QUEUE = 51, /* arg1=queue number */ + O_DIVERT = 52, /* arg1=port number */ + O_TEE = 53, /* arg1=port number */ + O_FORWARD_IP = 54, /* fwd sockaddr */ + O_FORWARD_MAC = 55, /* fwd mac */ + O_NAT = 56, /* nope */ + O_REASS = 57, /* none */ /* * More opcodes. */ - O_IPSEC, /* has ipsec history */ - O_IP_SRC_LOOKUP, /* v0:arg1=table number, u32=value */ + O_IPSEC = 58, /* has ipsec history */ + O_IP_SRC_LOOKUP = 59, /* v0:arg1=table number, u32=value */ /* v1:kidx=name, u32=value, arg1=key */ - O_IP_DST_LOOKUP, /* arg1=table number, u32=value */ + O_IP_DST_LOOKUP = 60, /* arg1=table number, u32=value */ /* v1:kidx=name, u32=value, arg1=key */ - O_ANTISPOOF, /* none */ - O_JAIL, /* u32 = id */ - O_ALTQ, /* u32 = altq classif. qid */ - O_DIVERTED, /* arg1=bitmap (1:loop, 2:out) */ - O_TCPDATALEN, /* arg1 = tcp data len */ - O_IP6_SRC, /* address without mask */ - O_IP6_SRC_ME, /* my addresses */ - O_IP6_SRC_MASK, /* address with the mask */ - O_IP6_DST, - O_IP6_DST_ME, - O_IP6_DST_MASK, - O_FLOW6ID, /* for flow id tag in the ipv6 pkt */ - O_ICMP6TYPE, /* icmp6 packet type filtering */ - O_EXT_HDR, /* filtering for ipv6 extension header */ - O_IP6, + O_ANTISPOOF = 61, /* none */ + O_JAIL = 62, /* u32 = id */ + O_ALTQ = 63, /* u32 = altq classif. qid */ + O_DIVERTED = 64, /* arg1=bitmap (1:loop, 2:out) */ + O_TCPDATALEN = 65, /* arg1 = tcp data len */ + O_IP6_SRC = 66, /* address without mask */ + O_IP6_SRC_ME = 67, /* my addresses */ + O_IP6_SRC_MASK = 68, /* address with the mask */ + O_IP6_DST = 69, + O_IP6_DST_ME = 70, + O_IP6_DST_MASK = 71, + O_FLOW6ID = 72, /* for flow id tag in the ipv6 pkt */ + O_ICMP6TYPE = 73, /* icmp6 packet type filtering */ + O_EXT_HDR = 74, /* filtering for ipv6 extension header */ + O_IP6 = 75, /* * actions for ng_ipfw */ - O_NETGRAPH, /* send to ng_ipfw */ - O_NGTEE, /* copy to ng_ipfw */ + O_NETGRAPH = 76, /* send to ng_ipfw */ + O_NGTEE = 77, /* copy to ng_ipfw */ - O_IP4, + O_IP4 = 78, - O_UNREACH6, /* arg1=icmpv6 code arg (deny) */ + O_UNREACH6 = 79, /* arg1=icmpv6 code arg (deny) */ - O_TAG, /* arg1=tag number */ - O_TAGGED, /* arg1=tag number */ + O_TAG = 80, /* arg1=tag number */ + O_TAGGED = 81, /* arg1=tag number */ - O_SETFIB, /* arg1=FIB number */ - O_FIB, /* arg1=FIB desired fib number */ + O_SETFIB = 82, /* arg1=FIB number */ + O_FIB = 83, /* arg1=FIB desired fib number */ - O_SOCKARG, /* socket argument */ + O_SOCKARG = 84, /* socket argument */ - O_CALLRETURN, /* v0:arg1=called rule number */ + O_CALLRETURN = 85, /* v0:arg1=called rule number */ /* v1:kidx=called rule number */ - O_FORWARD_IP6, /* fwd sockaddr_in6 */ + O_FORWARD_IP6 = 86, /* fwd sockaddr_in6 */ - O_DSCP, /* 2 u32 = DSCP mask */ - O_SETDSCP, /* arg1=DSCP value */ - O_IP_FLOW_LOOKUP, /* v0:arg1=table number, u32=value */ + O_DSCP = 87, /* 2 u32 = DSCP mask */ + O_SETDSCP = 88, /* arg1=DSCP value */ + O_IP_FLOW_LOOKUP = 89, /* v0:arg1=table number, u32=value */ /* v1:kidx=name, u32=value */ - O_EXTERNAL_ACTION, /* v0:arg1=id of external action handler */ + O_EXTERNAL_ACTION = 90, /* v0:arg1=id of external action handler */ /* v1:kidx=id of external action handler */ - O_EXTERNAL_INSTANCE, /* v0:arg1=id of eaction handler instance */ + O_EXTERNAL_INSTANCE = 91, /* v0:arg1=id of eaction handler instance */ /* v1:kidx=id of eaction handler instance */ - O_EXTERNAL_DATA, /* variable length data */ + O_EXTERNAL_DATA = 92, /* variable length data */ - O_SKIP_ACTION, /* none */ - O_TCPMSS, /* arg1=MSS value */ + O_SKIP_ACTION = 93, /* none */ + O_TCPMSS = 94, /* arg1=MSS value */ - O_MAC_SRC_LOOKUP, /* kidx=name, u32=value, arg1=key */ - O_MAC_DST_LOOKUP, /* kidx=name, u32=value, arg1=key */ + O_MAC_SRC_LOOKUP = 95, /* kidx=name, u32=value, arg1=key */ + O_MAC_DST_LOOKUP = 96, /* kidx=name, u32=value, arg1=key */ - O_SETMARK, /* u32 = value */ - O_MARK, /* 2 u32 = value, bitmask */ + O_SETMARK = 97, /* u32 = value */ + O_MARK = 98, /* 2 u32 = value, bitmask */ O_LAST_OPCODE /* not an opcode! */ }; From nobody Sun Aug 3 09:53:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvw3h6NGVz637xr; Sun, 03 Aug 2025 09:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvw3h43Tzz3s0g; Sun, 03 Aug 2025 09:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754214784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UttMw9tNvzWe8NFQJe+FMMH9bpMr4XuAOT6O2bqF+hA=; b=D8Pp0LcI8v7K75SvvHH7hYvESoil5Wkvzd0GMDS0A8VbsjQEDwtHbRi+iFbmbippNytAXD rUZQrjy8WTMzoLMRCiT3ECLEC4uu0JxsJ+NkCawfm9Ru7ryIRUtPaNDhXxJqPEDAYB1erz 9FKEWzE6kGeBRYe5gcBZGUp36I8h+iDimuHlkJYIyrBurnY8UQ+SECxQQng9ZLKeFurs8M c5Hh5S5wpIN+mqsne6+qxkuXMW7YWpbjoVpyjvMGBdDM6YZsNQ1XmLq5c147U/n3HEI7PM eqRMvaBgOF2ntpX2QyF8xot82vMt5s7Tzp+bOdgEa0b6oSOKs0dGBMGajpFzvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754214784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UttMw9tNvzWe8NFQJe+FMMH9bpMr4XuAOT6O2bqF+hA=; b=Jknt3Q5wimpYTg1Z+nOtwXAWNXRniGP3QWrzQ0x645Z/ccSEQoeoXS+qNAH2+ZPyCzmUkx DzdpIzLJqM1oxZebEfy9+vPcSI3NoI7aL7AgfdNQZ/RtxNd5MzqbX85Qdi8DVcIpNi/DSX hIkV4U+8vruiEyf3t66+NevY0gMtUr1gvv87IyQhFaBGUfg6x3YPoH5OIG0gx6CZNS0BtP QcbFYCfJtPoPrA+cQjKJpnwodOXtJ2q6Fm+a+qTJir5njr4fAopEaBedouNavKU0BiIn4N 2e2YwMsS3E2hQ6yN2CE6EaQqlLCAu10vLrA9rp3hSqsDwP7kIr3ev+u9nXI0+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754214784; a=rsa-sha256; cv=none; b=ro3v5ZTXVLxbo9FC/+RYYR76cFDBoH7qXkFTjml6sqOC7RywgIf4opr/ZBH5omuYYnh60q AhYlgWcEYNSixl2quYY8PtGbBlR9t2QKEx9u8x2IhxAre0EwaiSCxpIyngelRMHNgJA9Fk zi9ZsdYoMz9oZbf/gGZs7Rg/tJoZRsXfT8gU2AGF19EByk9Of3KfKMjQb4SzKTU6dbv4gb 84Ud9DtifgZnppZReq7IX4yCw5hN1ziPxHjgW2Fv2UzwvXKKewFL7u6nBm2vO63g3sG2J8 dB8Q3Hgpldr4sxT99GcFzjCl35ueNiE27+nkVUMDvGHImouo4i0vXNup0KXweg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvw3h3cq5zyWr; Sun, 03 Aug 2025 09:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5739r4TP074970; Sun, 3 Aug 2025 09:53:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5739r4Z0074967; Sun, 3 Aug 2025 09:53:04 GMT (envelope-from git) Date: Sun, 3 Aug 2025 09:53:04 GMT Message-Id: <202508030953.5739r4Z0074967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 91ed876385d4 - main - ipfw: forbid adding keep-state rules that depend on tablearg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91ed876385d4531b6ab2f9176be969318e1aefc1 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=91ed876385d4531b6ab2f9176be969318e1aefc1 commit 91ed876385d4531b6ab2f9176be969318e1aefc1 Author: Andrey V. Elsukov AuthorDate: 2025-07-22 08:02:17 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-08-03 09:46:51 +0000 ipfw: forbid adding keep-state rules that depend on tablearg tablearg value is determined after making table lookup. When we applying rule action that uses dynamic state, such lookup was not done and thus rule action can not determine what table and what value should be used as tablearg. To prevent this add check for such rules and return error when they are added. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D51458 --- sys/netpfil/ipfw/ip_fw_private.h | 1 + sys/netpfil/ipfw/ip_fw_sockopt.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/sys/netpfil/ipfw/ip_fw_private.h b/sys/netpfil/ipfw/ip_fw_private.h index 79b3ed43f63b..c490d2849a7d 100644 --- a/sys/netpfil/ipfw/ip_fw_private.h +++ b/sys/netpfil/ipfw/ip_fw_private.h @@ -489,6 +489,7 @@ struct obj_idx { struct rule_check_info { uint16_t flags; /* rule-specific check flags */ +#define IPFW_RCIFLAG_HAS_STATE 0x0001 uint16_t object_opcodes; /* num of opcodes referencing objects */ uint16_t urule_numoff; /* offset of rulenum in bytes */ uint8_t version; /* rule version */ diff --git a/sys/netpfil/ipfw/ip_fw_sockopt.c b/sys/netpfil/ipfw/ip_fw_sockopt.c index 19f5fff2749a..5d57759ffb00 100644 --- a/sys/netpfil/ipfw/ip_fw_sockopt.c +++ b/sys/netpfil/ipfw/ip_fw_sockopt.c @@ -1311,6 +1311,9 @@ ipfw_check_rule(struct ip_fw_rule *rule, size_t size, return (check_ipfw_rule_body(rule->cmd, rule->cmd_len, ci)); } +#define CHECK_TARG(a, c) \ + ((a) == IP_FW_TARG && ((c)->flags & IPFW_RCIFLAG_HAS_STATE)) + enum ipfw_opcheck_result ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) { @@ -1326,6 +1329,7 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) if (cmdlen != F_INSN_SIZE(ipfw_insn_kidx)) return (BAD_SIZE); ci->object_opcodes++; + ci->flags |= IPFW_RCIFLAG_HAS_STATE; break; case O_PROTO: case O_IP_SRC_ME: @@ -1410,6 +1414,8 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) cmd->arg1 & 0x7FFF); return (FAILED); } + if (CHECK_TARG(cmd->arg1, ci)) + goto bad_targ; return (CHECK_ACTION); case O_UID: @@ -1518,11 +1524,16 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) case O_QUEUE: if (cmdlen != F_INSN_SIZE(ipfw_insn)) return (BAD_SIZE); + if (CHECK_TARG(cmd->arg1, ci)) + goto bad_targ; return (CHECK_ACTION); case O_FORWARD_IP: if (cmdlen != F_INSN_SIZE(ipfw_insn_sa)) return (BAD_SIZE); + if (insntoc(cmd, sa)->sa.sin_addr.s_addr == INADDR_ANY && + (ci->flags & IPFW_RCIFLAG_HAS_STATE)) + goto bad_targ; return (CHECK_ACTION); #ifdef INET6 case O_FORWARD_IP6: @@ -1537,6 +1548,8 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) return (FAILED); if (cmdlen != F_INSN_SIZE(ipfw_insn)) return (BAD_SIZE); + if (CHECK_TARG(cmd->arg1, ci)) + goto bad_targ; return (CHECK_ACTION); case O_NETGRAPH: case O_NGTEE: @@ -1544,12 +1557,16 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) return (FAILED); if (cmdlen != F_INSN_SIZE(ipfw_insn)) return (BAD_SIZE); + if (CHECK_TARG(cmd->arg1, ci)) + goto bad_targ; return (CHECK_ACTION); case O_NAT: if (!IPFW_NAT_LOADED) return (FAILED); if (cmdlen != F_INSN_SIZE(ipfw_insn_nat)) return (BAD_SIZE); + if (CHECK_TARG(cmd->arg1, ci)) + goto bad_targ; return (CHECK_ACTION); case O_SKIPTO: @@ -1557,6 +1574,11 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) case O_SETMARK: if (cmdlen != F_INSN_SIZE(ipfw_insn_u32)) return (BAD_SIZE); + /* O_CALLRETURN + F_NOT means 'return' opcode. */ + if (cmd->opcode != O_CALLRETURN || (cmd->len & F_NOT) == 0) { + if (CHECK_TARG(insntoc(cmd, u32)->d[0], ci)) + goto bad_targ; + } return (CHECK_ACTION); case O_CHECK_STATE: @@ -1577,6 +1599,8 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) case O_REASS: if (cmdlen != F_INSN_SIZE(ipfw_insn)) return (BAD_SIZE); + if (cmd->opcode == O_SETDSCP && CHECK_TARG(cmd->arg1, ci)) + goto bad_targ; return (CHECK_ACTION); #ifdef INET6 case O_IP6_SRC: @@ -1627,6 +1651,13 @@ ipfw_check_opcode(ipfw_insn **pcmd, int *plen, struct rule_check_info *ci) } } return (SUCCESS); +bad_targ: + /* + * For dynamic states we can not correctly initialize tablearg value, + * because we don't go through rule's opcodes except rule action. + */ + printf("ipfw: tablearg is not allowed with dynamic states\n"); + return (FAILED); } static __noinline int From nobody Sun Aug 3 09:59:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvwC62f7qz638X9; Sun, 03 Aug 2025 09:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvwC61l99z3sP0; Sun, 03 Aug 2025 09:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754215170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dCf7Qv52Co+Anor7Kxi/sEKbKKdZ/Qe/GB13JpWB8c=; b=ltKHdeeG1VlWc0EGXyjRmFwN700OEUHe3Fec8LTjslKoCvpttJLbAsW8559MP1Ozx5Zjkl yIEQ8xjrlXzXTOA+BLF/w3flldDP1hmGPU3lNJA6hlJPScRA8n/3XWEP5fIi1RLhFJOAw1 lzOZsPsyAjgPCkseljbOkCkXLVXrFehq5ouYSwcoOGr2pqCHvWYyyWWqmTGT4Guzdz42GG dK6Ef0bzzVzj72khiu8cJ4wPUF8UGZ2sfhKe8JJvjBYMAv5WX2ccd1cXwLvOrWVz/iAVWi XoZHqiWH+PrM8vnOZgY2wKz72I+toh02bgXfzZgB191GVb2e8R1ixjMyGahREg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754215170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9dCf7Qv52Co+Anor7Kxi/sEKbKKdZ/Qe/GB13JpWB8c=; b=LAC+J3NEf9xkp9B5L59+B3deS0wAX3uYIrkMO0nERX4SuIiZcdM84tFWAXnQk4ANso0aSU cIqqoyet0EVFQrj/BE3XnTWDEL6qneP3MvmxrADqq2imRVHaaa0TVfd3cdz97OfVEKHpIa wl+ZUKXSJ2DGQB2jGMLjxw5Eqcwd06jntabluWg+iPyzpm3LAP6NjEoCcyRNqgTQcILynH zlvYMKMBuwK67WhssOb1wUUFbgCI3VbDWrl9GeOeetxzCGO8oQYxXs7+DWkCOg8QF4fw86 BeZjz56SSt851PwD5Cuz347Mi8qYwre5SSu9kjQfELUkFshriWZUarY7d3rn7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754215170; a=rsa-sha256; cv=none; b=h9/BM+FWB8QFmRspVJ4fTy7hZp+GS0JmkxFCFqpIKDkrahlNT7EYixJUB2YvZ6b7bnxfgO HGHrasXIBQsnJzl+VFdu6C2LxkFWJKPvKMJPEhAvgCB8kZ2Vx3Fcj5Yf5S+8AMqCeLAN7n KJbNfq9CTxtS6UNWnmWEsXna4Uy/RUzTi8Ky1p7CJk1oVikTKE7Yjcr0kPz9cVBjXMJZPV Xm6VSHivsNbMV/ZjdLD/D8WGMrMTJmYasXp6AN3ueeT+SQfAAQ8XPJ1egw5rXBqDAZcqce 478Wqy0wLlhlaQ22Or1WTS4cEyDDMaUUQFhK0BK8hGc3Vfcj6YF4tIm9K7A99w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvwC61Gn0zyWs; Sun, 03 Aug 2025 09:59:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5739xU9h077029; Sun, 3 Aug 2025 09:59:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5739xUjn077026; Sun, 3 Aug 2025 09:59:30 GMT (envelope-from git) Date: Sun, 3 Aug 2025 09:59:30 GMT Message-Id: <202508030959.5739xUjn077026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 3b67473b9757 - main - ipfw: add additional handling for orphaned states List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b67473b97574d13eef8302c61c7245b3b3c52c1 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=3b67473b97574d13eef8302c61c7245b3b3c52c1 commit 3b67473b97574d13eef8302c61c7245b3b3c52c1 Author: Andrey V. Elsukov AuthorDate: 2025-07-22 08:12:36 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-08-03 09:54:39 +0000 ipfw: add additional handling for orphaned states When parent rule of dynamic state is deleted and net.inet.ip.fw.dyn_keep_states is enabled, dynamic states are kept working and such states are called ORPHANED. Orphaned states still keep pointer to original parent rule. And in case when rule action is skipto this can lead to unpredictable consequences. To avoid this problem add special handling for skipto action when we have found ORPHANED state. Check that new rule has the same opcode and skipto number for O_SKIPTO rule action. Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D51459 --- sys/netpfil/ipfw/ip_fw_dynamic.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 40598cef8076..9694c145e112 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -1323,6 +1323,33 @@ dyn_lookup_ipv6_parent_locked(const struct ipfw_flow_id *pkt, uint32_t zoneid, #endif /* INET6 */ +static int +dyn_handle_orphaned(struct ip_fw *old_rule, struct dyn_data *data) +{ + struct ip_fw *rule; + const ipfw_insn *cmd, *old_cmd; + + old_cmd = ACTION_PTR(old_rule); + switch (old_cmd->opcode) { + case O_SETMARK: + case O_SKIPTO: + /* + * Rule pointer was changed. For O_SKIPTO action it can be + * dangerous to keep use old rule. If new rule has the same + * action and the same destination number, then use this dynamic + * state. Otherwise it is better to create new one. + */ + rule = V_layer3_chain.map[data->f_pos]; + cmd = ACTION_PTR(rule); + if (cmd->opcode != old_cmd->opcode || + cmd->len != old_cmd->len || cmd->arg1 != old_cmd->arg1 || + insntoc(cmd, u32)->d[0] != insntoc(old_cmd, u32)->d[0]) + return (-1); + break; + } + return (0); +} + /* * Lookup dynamic state. * pkt - filled by ipfw_chk() ipfw_flow_id; @@ -1426,8 +1453,13 @@ ipfw_dyn_lookup_state(const struct ip_fw_args *args, const void *ulp, * changed to point to the penultimate rule. */ MPASS(V_layer3_chain.n_rules > 1); - data->chain_id = V_layer3_chain.id; - data->f_pos = V_layer3_chain.n_rules - 2; + if (dyn_handle_orphaned(rule, data) == 0) { + data->chain_id = V_layer3_chain.id; + data->f_pos = V_layer3_chain.n_rules - 2; + } else { + rule = NULL; + info->direction = MATCH_NONE; + } } else { rule = NULL; info->direction = MATCH_NONE; From nobody Sun Aug 3 10:03:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvwHf01JSz639FR; Sun, 03 Aug 2025 10:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvwHd6GG1z3tfD; Sun, 03 Aug 2025 10:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754215405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+XukJCvKb8oWmzWXsyyTbDWViZcSsu0HFjdhknVe9Rw=; b=oLX1nONVXA6OJqClpbuPVNvZe4ZYMcBod1jLFJ7ZM4xWHMrC9kgrqtlBK3+UcmrxD3Iv+q S+Ac6CbM3q1+WKhNWIIRU201c7+P30dY1lrdErID7hUNrGQ4lXlBUwq6hZrRutBynWx98l 6A9Q2CNhIe3RQ7+2bYsitRpAwJlPIVNT3B87vpcnPtZnpB+yO79480x9aKTyQdNpQp6PAz qyoNaEZtN5GLt/0i4Ta2K56sQ/Da4mYhMKokujvKYE/Rn/zKNhMN0hphDb7A/yzea9NOrv vBK7DA/WfbAQ3s3mixPeTlfgA8hBeRQrnQOPf/C0/7miwN+fNNBim8+6tLRgOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754215405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+XukJCvKb8oWmzWXsyyTbDWViZcSsu0HFjdhknVe9Rw=; b=gjvUV+zXakwoTCmcv8nMUkwxUujxZNXJeWgdK10tkzSFXSZW2SCQPTKpI3YZW+dQ91aeyg K0oKjDH+stdcbB4a+EgAiy/dx0bHxfGwXox+sm4CpO/TzEOpzBFiCzJYj1i7l92/VDCI+c X8T4VbIMjcnfK62KZnWJYE3Qa9mVYlkiB9g37OcF3PQEj4gpv31E0mD4BQ1BRffgcyNqYn kZ1mbsgwz6HFQshHL0YOJZqiMj/xNQtZgWxLTL3yFDml4lfdKn8luAoj8/2j4G5dH1asmK y8h8YJyBUbEPz3KGuE1YUrCpI6a6J+K8Z9FUhOdZGiSZdb7dVw6bn/2Ak3QpPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754215405; a=rsa-sha256; cv=none; b=xbbM50y19kFFo+nb0GuhcKIu6VqoMs+VnC52zbcVqzjfZBZSr++LFy8r/HD9J9qTbnH3W8 vZptYPLOeFayt05VuuWIpOxclotAhpW9NVyypBVmaK/SqFo2znU7nmZWxKNvVtYKmRFrp/ X4RkUFWKrjFONjru1lIv1I1W7Mwi7oEyMWg9mrBZ34GP/SaFWoMMdDmhRwfm2YblKVu0um 7Xy35YTupW/aSRfURjOKVAxwCc+/gmedNuWhBmfQCQEgucqeX1E4kWyKv99tz8fsY3Z9lV D+VDeQOMY4orae7GKu5+vBu83wajNV6fHG0mdteTuLPowg+JZETOw1CzWV0I5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvwHd5YGRzymK; Sun, 03 Aug 2025 10:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573A3Pdk095219; Sun, 3 Aug 2025 10:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573A3PgQ095216; Sun, 3 Aug 2025 10:03:25 GMT (envelope-from git) Date: Sun, 3 Aug 2025 10:03:25 GMT Message-Id: <202508031003.573A3PgQ095216@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: 630efff12879 - main - fix cross build after expand_number type change List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 630efff12879f64da5338abb08b04710f8c0f2cb Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=630efff12879f64da5338abb08b04710f8c0f2cb commit 630efff12879f64da5338abb08b04710f8c0f2cb Author: Brooks Davis AuthorDate: 2025-08-03 09:48:08 +0000 Commit: Brooks Davis CommitDate: 2025-08-03 10:03:14 +0000 fix cross build after expand_number type change Fixes: 2e0caa7c7e14 ("libutil: Really fix expand_number(3)") --- tools/build/cross-build/include/common/libutil.h | 2 +- tools/build/cross-build/include/linux/libutil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/cross-build/include/common/libutil.h b/tools/build/cross-build/include/common/libutil.h index 15afd2fbca15..3cda32379965 100644 --- a/tools/build/cross-build/include/common/libutil.h +++ b/tools/build/cross-build/include/common/libutil.h @@ -39,4 +39,4 @@ #include_next #endif -int expand_number(const char *_buf, uint64_t *_num); +int expand_number(const char *_buf, int64_t *_num); diff --git a/tools/build/cross-build/include/linux/libutil.h b/tools/build/cross-build/include/linux/libutil.h index 8f9ca406edc1..a1d6508be82d 100644 --- a/tools/build/cross-build/include/linux/libutil.h +++ b/tools/build/cross-build/include/linux/libutil.h @@ -46,7 +46,7 @@ struct pidfh; __BEGIN_DECLS int humanize_number(char *buf, size_t len, int64_t bytes, const char *suffix, int scale, int flags); -int expand_number(const char *_buf, uint64_t *_num); +int expand_number(const char *_buf, int64_t *_num); int flopen(const char *_path, int _flags, ...); int flopenat(int dirfd, const char *path, int flags, ...); From nobody Sun Aug 3 10:07:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvwNp4mJ8z6397j; Sun, 03 Aug 2025 10:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvwNp4Bh3z3tsf; Sun, 03 Aug 2025 10:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754215674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QiH5aEmUtrFBZDA5tOUwEqNg2DSI5yKGgcS01omq5D8=; b=HD5J7JlBdMu0ZqHhOH9Yj0F42vmVyvMtM1oXmnBv46l+5quarBnhFBYGpuxW7TkdlpekDO u4IWftaEmO+oPBgp6R0QCy9y3yH5udg9cgOfM7fS7GYSkkHx7jkx3RhsDdLvbQFE8JB2P2 kNoCsYMRogsp97t2MxsVbHeaEo6omcBUtnu/qEEfgrgGjfjv30Rrn68Uq4WhKiDNrfxWls E0lcEeqS0NrUuQCuy1Rc8QN84nHvynRIyXxeOGBV0dzJEGUkWY+RG8AOkzkDhA3BY7PqDz 0USdWhL674FUpEdTuudt18BMOLbB/qzRSmzVV+PgHafv0oFEwLtOnJ+XvaL8cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754215674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QiH5aEmUtrFBZDA5tOUwEqNg2DSI5yKGgcS01omq5D8=; b=jVborpznIaQVrquK/L0LCoy1963Ah7d4TuoncL3q2E19mMSoL60Ih6MASlR0YT6JhROTFP 8J7CaNOMohWpVUoFvfBTl7duZRO6F0hc+4vz0pTLh8Er7zdZlYA1CW1LGUd6DJNglqX2mk mklQzsUh6Ggn0X48Fn8VXBeJzPdWq8RStVqqkvvhv3PcsnsvYcvKjjoPyvBaWQwRE58cJ4 BD3lYCzfyctqiq3pIZ20RKlO2zj3z1YvFKxBVKrFm01pRewiS/sINya/FYj6pdKMQxymCX dv8pS70Gm0GB8GHDgkU/gv9pOu1g6LU9ufHBgmBqYUX71qhpbsEksSOxKhD7Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754215674; a=rsa-sha256; cv=none; b=NedGEfpjAPMSuQfIAmXdFedp7p2xLlvwWIGaRwCq9efpW7gMFhc59Lamn9mRPfx90Gf5uT TeWtQ2m8a3vGyAttI6gl9gSkuCInDe4VCmTtqSgJFXWEF+hsxWE8LXkqnAX5gPEr9fXR2l xyIsoghhoY/18J/Q7g0y4TFtrjXjo0W4iJKjoJHJ2Gq6Swj+vVbPF998uXyAfA0Y7pyUrp 8Y/fM+6Jq5Y6Y2uMXYw+o3ej79Ga427GCxAmz7Y3Z4wE6xOEyclNifE4fQiAR1IZ5YXoo1 /XXxpbQwJtvcCCD/TJi0kTqcv7S5J/EMWg4ZiNVvhu5L4Jd7Q7h/YeyqrVfJTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bvwNp3HDmzyb8; Sun, 03 Aug 2025 10:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573A7sD0096670; Sun, 3 Aug 2025 10:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573A7s1L096667; Sun, 3 Aug 2025 10:07:54 GMT (envelope-from git) Date: Sun, 3 Aug 2025 10:07:54 GMT Message-Id: <202508031007.573A7s1L096667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 877e70e6087f - main - ipfw: add protected rule for orphaned dynamic states List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 877e70e6087f9937e41da82f53bcbb4e04432428 Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=877e70e6087f9937e41da82f53bcbb4e04432428 commit 877e70e6087f9937e41da82f53bcbb4e04432428 Author: Andrey V. Elsukov AuthorDate: 2025-07-22 08:20:13 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-08-03 10:07:33 +0000 ipfw: add protected rule for orphaned dynamic states When we have enabled V_dyn_keep_states, states that become ORPHANED will keep pointer to original rule. Then this rule pointer is used to apply rule action after ipfw_dyn_lookup_state(). Some rule actions use IPFW_INC_RULE_COUNTER() directly to this rule pointer to increment rule counters, but other rule actions use chain->map[f_pos] instead. The last case leads to incrementing counters on the wrong rule, because ORPHANED states have not parent rule in chain->map[]. To solve this we add protected rule, that will be matched only by packets that are handled by ORPHANED states. This is `count' rule that is prior to the default rule: 65535 count ip from any to any not // orphaned dynamic states counter Obtained from: Yandex LLC Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D51460 --- sys/netpfil/ipfw/ip_fw2.c | 2 +- sys/netpfil/ipfw/ip_fw_dynamic.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index c129c8c49921..3f810533b7fc 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -3680,6 +3680,7 @@ vnet_ipfw_init(const void *unused) IPFW_LOCK_INIT(chain); + ipfw_dyn_init(chain); /* fill and insert the default rule */ rule = ipfw_alloc_rule(chain, sizeof(struct ip_fw)); rule->flags |= IPFW_RULE_NOOPT; @@ -3689,7 +3690,6 @@ vnet_ipfw_init(const void *unused) chain->default_rule = rule; ipfw_add_protected_rule(chain, rule, 0); - ipfw_dyn_init(chain); ipfw_eaction_init(chain, first); ipfw_init_skipto_cache(chain); ipfw_bpf_init(first); diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 9694c145e112..cfb686594c7c 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -3141,6 +3141,43 @@ ipfw_dump_states(struct ip_fw_chain *chain, struct sockopt_data *sd) #undef DYN_EXPORT_STATES } +/* + * When we have enabled V_dyn_keep_states, states that become ORPHANED + * will keep pointer to original rule. Then this rule pointer is used + * to apply rule action after ipfw_dyn_lookup_state(). + * Some rule actions use IPFW_INC_RULE_COUNTER() directly to this rule + * pointer, but other actions use chain->map[f_pos] instead. The last + * case leads to incrementing counters on the wrong rule, because + * ORPHANED states have not parent rule in chain->map[]. + * To solve this we add protected rule: + * count ip from any to any not // comment + * It will be matched only by packets that are handled by ORPHANED states. + */ +static void +dyn_add_protected_rule(struct ip_fw_chain *chain) +{ + static const char *comment = + "orphaned dynamic states counter"; + struct ip_fw *rule; + ipfw_insn *cmd; + size_t l; + + l = roundup(strlen(comment) + 1, sizeof(uint32_t)); + rule = ipfw_alloc_rule(chain, sizeof(*rule) + sizeof(ipfw_insn) + l); + cmd = rule->cmd; + cmd->opcode = O_NOP; + cmd->len = 1 + l/sizeof(uint32_t); + cmd->len |= F_NOT; /* make rule to be not matched */ + strcpy((char *)(cmd + 1), comment); + cmd += F_LEN(cmd); + + cmd->len = 1; + cmd->opcode = O_COUNT; + rule->act_ofs = cmd - rule->cmd; + rule->cmd_len = rule->act_ofs + 1; + ipfw_add_protected_rule(chain, rule, 0); +} + void ipfw_dyn_init(struct ip_fw_chain *chain) { @@ -3203,6 +3240,8 @@ ipfw_dyn_init(struct ip_fw_chain *chain) callout_init(&V_dyn_timeout, 1); callout_reset(&V_dyn_timeout, hz, dyn_tick, curvnet); IPFW_ADD_OBJ_REWRITER(IS_DEFAULT_VNET(curvnet), dyn_opcodes); + + dyn_add_protected_rule(chain); } void From nobody Sun Aug 3 10:50:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvxLY4MJkz63C1H; Sun, 03 Aug 2025 10:51:01 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp6.goneo.de (smtp6.goneo.de [IPv6:2001:1640:5::8:31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvxLY15Pgz3xtR; Sun, 03 Aug 2025 10:51:01 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub1.goneo.de (hub1.goneo.de [85.220.129.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp6.goneo.de (Postfix) with ESMTPS id A30D7240AB6; Sun, 3 Aug 2025 12:50:48 +0200 (CEST) Received: from hub1.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPS id C9511240165; Sun, 3 Aug 2025 12:50:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1754218246; 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=8u6Z+UZ3AV52Xsx3EBCUfLGJk5WjqELB6E5OJ4BxhcI=; b=i7ItGC6cv5roBo3JPHCecdTC02TofmvPJAu8vmR0cCHOfljXM82QSnQakHjo9gwzp3pmNv D2pb9cEgx3wcHsvW64DSpSVB0ACdAJKdJH8Xsy76P+6y0C72eKa+Rc9GumYbGIMtxBelUA 7yk/PnQvCmQg4iNR34ZGjekZbU3++DGgkrHyLRUjF1lmVlD1dg1429z50hA6cL5TKdJSKd 4QpX/2FBf2g6NlZ3xB0amlJ9eqt6gDzxAF8yCUuf73o35gaWw8mSpp0yYpNArmIWU0EObn 8gwXL0cX8on6S7IsIlqzXFxpY6h8pnBzKSJUFpvh8hiHxEF9xf7q0WZ9CFTSrw== Received: from thor.sb211.local (dynamic-2a02-3100-1867-d902-0bef-22e9-45a0-eb8a.310.pool.telefonica.de [IPv6:2a02:3100:1867:d902:bef:22e9:45a0:eb8a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPSA id 5B971240036; Sun, 3 Aug 2025 12:50:46 +0200 (CEST) Date: Sun, 3 Aug 2025 12:50:12 +0200 From: A FreeBSD User To: Dag-Erling =?UTF-8?B?U23DuHJncmF2?= Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 8d8a745c456c - main - libutil: Drop auth_getval() Message-ID: <20250803125039.5a69441a@thor.sb211.local> In-Reply-To: <202508021757.572Hv2Ox066248@gitrepo.freebsd.org> References: <202508021757.572Hv2Ox066248@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/.LB0UYE.0213/7DSnNh=G7M"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: 6e4fcf X-Rspamd-UID: d6c502 X-Rspamd-Queue-Id: 4bvxLY15Pgz3xtR X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25394, ipnet:2001:1640::/32, country:DE] --Sig_/.LB0UYE.0213/7DSnNh=G7M Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Tage des Herren Sat, 2 Aug 2025 17:57:02 GMT Dag-Erling Sm=C3=B8rgrav schrieb: > The branch main has been updated by des: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8d8a745c456cacf706689febee= 9639f5e8292fc8 >=20 > commit 8d8a745c456cacf706689febee9639f5e8292fc8 > Author: Dag-Erling Sm=C3=B8rgrav > AuthorDate: 2025-08-02 17:56:16 +0000 > Commit: Dag-Erling Sm=C3=B8rgrav > CommitDate: 2025-08-02 17:56:35 +0000 >=20 > libutil: Drop auth_getval() > =20 > This function has been an empty stub for years; now that we're bumping > the library version, we can finally get rid of it. > =20 > Fixes: 0c381b7f0570 > Reviewed by: kib, emaste > Differential Revision: https://reviews.freebsd.org/D51704 > --- > lib/libutil/Makefile | 2 +- > lib/libutil/Symbol.map | 1 - > lib/libutil/auth.c | 44 -------------------------------------------- > lib/libutil/libutil.h | 1 - > 4 files changed, 1 insertion(+), 47 deletions(-) >=20 > diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile > index d445bc5dec3b..12ac623aec6b 100644 > --- a/lib/libutil/Makefile > +++ b/lib/libutil/Makefile > @@ -9,7 +9,7 @@ PACKAGE=3D runtime > LIB=3D util > SHLIB_MAJOR=3D 10 > =20 > -SRCS=3D _secure_path.c auth.c cpuset.c expand_number.c flopen.c fparseln= .c \ > +SRCS=3D _secure_path.c cpuset.c expand_number.c flopen.c fparseln.c \ > ftime.c getlocalbase.c gr_util.c \ > hexdump.c humanize_number.c kinfo_getfile.c \ > kinfo_getallproc.c kinfo_getproc.c kinfo_getvmmap.c \ > diff --git a/lib/libutil/Symbol.map b/lib/libutil/Symbol.map > index d4bac5b5f53e..8c8fff451cd1 100644 > --- a/lib/libutil/Symbol.map > +++ b/lib/libutil/Symbol.map > @@ -2,7 +2,6 @@ FBSD_1.8 { > _secure_path; > auth_cat; > auth_checknologin; > - auth_getval; > auth_hostok; > auth_timeok; > auth_ttyok; > diff --git a/lib/libutil/auth.c b/lib/libutil/auth.c > deleted file mode 100644 > index 3414fc8e26e7..000000000000 > --- a/lib/libutil/auth.c > +++ /dev/null > @@ -1,44 +0,0 @@ > -/*- > - * SPDX-License-Identifier: BSD-2-Clause > - * > - * Simple authentication database handling code. > - * > - * Copyright (c) 1998 > - * Jordan Hubbard. All rights reserved. > - * > - * Redistribution and use in source and binary forms, with or without > - * modification, are permitted provided that the following conditions > - * are met: > - * 1. Redistributions of source code must retain the above copyright > - * notice, this list of conditions and the following disclaimer, > - * verbatim and that no modifications are made prior to this > - * point in the file. > - * 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 distributio= n. > - * > - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE > - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR HIS PETS BE LIABLE > - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL > - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS > - * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUP= TION) > - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT > - * 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 > - > -char * > -auth_getval(const char *name) > -{ > - > - (void)name; > - return (NULL); > -} > diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h > index 6d36a0c291c6..d27262e44daf 100644 > --- a/lib/libutil/libutil.h > +++ b/lib/libutil/libutil.h > @@ -86,7 +86,6 @@ struct termios; > struct winsize; > =20 > __BEGIN_DECLS > -char *auth_getval(const char *_name); > void clean_environment(const char * const *_white, > const char * const *_more_white); > int expand_number(const char *_buf, int64_t *_num); >=20 A warning should be issued about transition of libutil.so.9 -> libutil.so.1= 0! make delete-old-libs has a great impact (as usual) on a running/working sys= tem regarding python, perl, X11, claws-mail and other software. A quick and dirty (but wo= rking) workaround was using the libmap.conf mechanism. Kind regards, oh --=20 A FreeBSD user --Sig_/.LB0UYE.0213/7DSnNh=G7M Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRQheDybVktG5eW/1Kxzvs8OqokrwUCaI8+/wAKCRCxzvs8Oqok r8SAAP9lnH8oodj8s14g0HWbvBSQILZJT3AoLLAatNYOXBwSnAEA+oWXZl5a4pBd F/9PtZYbsob6l5MudIX83C/1kqzyDQU= =zQ19 -----END PGP SIGNATURE----- --Sig_/.LB0UYE.0213/7DSnNh=G7M-- From nobody Sun Aug 3 12:04:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvyzf2vZ4z63J0J; Sun, 03 Aug 2025 12:04:46 +0000 (UTC) (envelope-from herbert@fastmail.jp) Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvyzd2wZtz4407; Sun, 03 Aug 2025 12:04:45 +0000 (UTC) (envelope-from herbert@fastmail.jp) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fastmail.jp header.s=fm3 header.b=gLuOcZ1r; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=nohCLp8t; spf=pass (mx1.freebsd.org: domain of herbert@fastmail.jp designates 103.168.172.148 as permitted sender) smtp.mailfrom=herbert@fastmail.jp; dmarc=pass (policy=none) header.from=fastmail.jp Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id DAE7AEC008E; Sun, 3 Aug 2025 08:04:41 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-01.internal (MEProxy); Sun, 03 Aug 2025 08:04:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.jp; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1754222681; x=1754309081; bh=NZCMQNa50papw0ZOu3fo/Cr6Fz/rUAS/DoY8YK9FbpA=; b= gLuOcZ1r0Y01f1O9YKj52mqbz9sIeYfkOC6uDKTSJhCvbt/CKv4Tc+FvBW/msCKA iVB2w2mXgCIlerQKvQwOe3LU6/xQ/IvJyYHM3G8K66lyLquHNJ3KVohFXlNcEJbM 0yTGBhfPBoMq3NM0Y9pH0OLq8hqqcrqEkwqWVdig5x6MuiIERWsA5MyDhCtLo6yu s+SW4lDwz1K4anQJ1Q+hstgjQn2NKKnKGcgrtQvaiD0WbzP/9DX2qoDtKK7gByiU JuTatNTW4zlW5/en6FXncAIO+fYlO02hbg4Y6bDrfZzMhd1Zuxm8Ez+nH2tIc7r0 lOy/0a3Rovo63rrFLmXcgw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1754222681; x=1754309081; bh=N ZCMQNa50papw0ZOu3fo/Cr6Fz/rUAS/DoY8YK9FbpA=; b=nohCLp8tjHCkLcYwc jCKfOvi4Oh9jNFZQcMFwemhNGNhJha5L4voXf9yRH79H27UUX9lckwtCjk37JzhL Ok/m7C/36fypUyehwoRz1xN8vSDAe8M2B5wFvG2ZXVu62LRuvOkckijMfE2DpqaF EokhgSEhFVJtq+Da0pxyZ6WQOC61vMeoK6Riy0qooTp3IdBrKn4hpXLSgr8VL9uZ 9R8vSzybTyS2MfVPysUkFAgCFHkwifDeqG1MOX7uj6Zhm4HPW/TKVz34mv1yW4+y bEKoXaByIU/5IylRlSNM8BLcSdGhnL27aOL8JBvWNdm+mDno0fNW/o+qXhfldw7y vVezA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddutdelgeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefoggffhffvkfgjfhfutgfgsehtjeertd ertddtnecuhfhrohhmpefjvghrsggvrhhtuceohhgvrhgsvghrthesfhgrshhtmhgrihhl rdhjpheqnecuggftrfgrthhtvghrnheptdegkeelteffgfdtheejfffgieffudffkeevue eiffefledtvefgudekfeeghefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhephhgvrhgsvghrthesfhgrshhtmhgrihhlrdhjphdpnhgspghrtg hpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggvvhdqtghomhhm ihhtshdqshhrtgdqrghllhesfhhrvggvsghsugdrohhrghdprhgtphhtthhopeguvghvqd gtohhmmhhithhsqdhsrhgtqdhmrghinhesfhhrvggvsghsugdrohhrghdprhgtphhtthho pehsrhgtqdgtohhmmhhithhtvghrshesfhhrvggvsghsugdrohhrgh X-ME-Proxy: Feedback-ID: i8e7149f9:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 9D02D700068; Sun, 3 Aug 2025 08:04:41 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 X-ThreadId: A3fiRQsbygpZ Date: Sun, 03 Aug 2025 14:04:13 +0200 From: Herbert To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: In-Reply-To: <20250803125039.5a69441a@thor.sb211.local> References: <202508021757.572Hv2Ox066248@gitrepo.freebsd.org> <20250803125039.5a69441a@thor.sb211.local> Subject: Re: git: 8d8a745c456c - main - libutil: Drop auth_getval() Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.09 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[fastmail.jp,none]; R_DKIM_ALLOW(-0.20)[fastmail.jp:s=fm3,messagingengine.com:s=fm3]; R_SPF_ALLOW(-0.20)[+ip4:103.168.172.128/27]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[103.168.172.148:from]; XM_UA_NO_VERSION(0.01)[]; ASN(0.00)[asn:151847, ipnet:103.168.172.0/24, country:AU]; FREEMAIL_ENVFROM(0.00)[fastmail.jp]; DWL_DNSWL_NONE(0.00)[messagingengine.com:dkim]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[fastmail.jp]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[fastmail.jp:+,messagingengine.com:+] X-Rspamd-Queue-Id: 4bvyzd2wZtz4407 X-Spamd-Bar: ---- On Sun, 3 Aug 2025, at 12:50, A FreeBSD User wrote: > A warning should be issued about transition of libutil.so.9 -> > libutil.so.10! There is a warning when you run 'make delete-old-libs'. Have you checked 'pkg shlib -qR libutil.so.9' before removing it? Maybe libutil.so.9 will be added to misc/compat14x and ghc needs updated ghc-xxx-boot for main. From nobody Sun Aug 3 17:28:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bw68x1GTJz63c74; Sun, 03 Aug 2025 17:28:17 +0000 (UTC) (envelope-from phil@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bw68v5lRdz3HY3; Sun, 03 Aug 2025 17:28:15 +0000 (UTC) (envelope-from phil@juniper.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=juniper.net header.s=PPS1017 header.b=DouGjJiT; dkim=none ("invalid DKIM record") header.d=juniper.net header.s=selector1 header.b=FQlfemvj; spf=pass (mx1.freebsd.org: domain of phil@juniper.net designates 67.231.152.164 as permitted sender) smtp.mailfrom=phil@juniper.net; dmarc=pass (policy=reject) header.from=juniper.net; arc=pass ("microsoft.com:s=arcselector10001:i=1") Received: from pps.filterd (m0108163.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 573GgrWL027836; Sun, 3 Aug 2025 10:28:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=PPS1017; bh=2P phQw7+uhZpneWdKHSE0moAQUVuzsJdnp5rMqAVZFA=; b=DouGjJiT9S42Ef5XOQ o3Oc5guQl00p8HNEu/bS9QHWy70Ng42cbIzNSTGIEcDP40byfWf+3cTmlKCXgyxe QbUxNdVhPalsD25UDR3RaEFvjVWPQFpZEBoz61hNXy9IY5pVLhS1oa3Vxzr2WuCT 8cvJ3KkgDWmjs0DIr2hEd58K0EXHA8Xkqq7BmVs1IbbJ4b6fSvwo9usBLrrKUBDw 1XlTS+4bOkmdVajdv9Hyc7C9jFnsNqd4485QkENavYGtQrb9H+4MoRwmOJ+X6sVS awS5GCm1j+l70vtCJ0SWJpcS32F650mrYYPF+ltqGZP/QXTGCYKw+bRGoGepN4Jo hzig== Received: from ph8pr06cu001.outbound.protection.outlook.com (mail-westus3azon11022074.outbound.protection.outlook.com [40.107.209.74]) by mx0b-00273201.pphosted.com (PPS) with ESMTPS id 48abhf01g6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 03 Aug 2025 10:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iVcCb5jvSyp1HIrcYBUCchPyOdQejh7kKabf0O9u5vgi19HUmhaVS4cLJMcVqKpf9uMxfzW6s1X4g+tCavHE/enOgeJeuF+ugvZQ+BIZwC8jegy0Z2dVkHnNpMxO6F/YNWIZKOFOOx1ZA09Xf8e0lDP11Bhm2e9XHZkhBFVTer5D4IV0xcph2XvGLgeI8ZiZP9JlFyFz/3zEs2enuD7upYS9Vnu/brf7zKpK5sNJM3Bg7gpmQJgkQmAN9XYTXGlN4fswFebKODKp7zGqvL92w2r5sSYIqZlxgPiUja6RtRlsDijb2QANt5kgNKAVVzCHXgXZXqdAmZhhGJuOPDl9dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2PphQw7+uhZpneWdKHSE0moAQUVuzsJdnp5rMqAVZFA=; b=cY45LYm449UQkVvlwhybUCgV3r6/Z7BXc2dbOdjIiDf4NJs03GcBJtF0EFyYSRSg5GvzQ5u3wr8tZ7uF06+Wkf5osINTwcZuW1lW1HNaSBYSzKkILm8Cs+uAFLXhPncLxfy3fN5TKeLKR6BRfmAI3QfRxUz0zbYiD3LvhrH7Uw6pQkcQ3bqlm6ZOWXtDI7XYUk+6QghYXqtl7eawukNeT4NX/y5wtTdZBpCjkLMZm7HTMlcyS7nvky+HUaX7bUS+EnK7RHz2dVWnmOQjm6AYLnS8m+6gf65xGzPQrnvEJ6yQF6B5nn4mswlz/lFZdxEZo3JYMbv585eQMGyH6t+Riw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.15) smtp.rcpttodomain=gmail.com smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2PphQw7+uhZpneWdKHSE0moAQUVuzsJdnp5rMqAVZFA=; b=FQlfemvjR3OryVxYfquvefgbaphbUsRw5E2vMKgcRvdtlshmv8xqyKHgthSRjfNrpq9Sh3ktJ9gZhJetFaS+x/eek9So3Uyl5ze4Mmg2Va07UnWf3FLZSHLZ7hMVSczaMu8h9spqBDqjvO9RLfTfCDID6vzE6L3p154XsuB/PnI= Received: from CH5PR05CA0001.namprd05.prod.outlook.com (2603:10b6:610:1f0::19) by SA1PR05MB8408.namprd05.prod.outlook.com (2603:10b6:806:1d7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.18; Sun, 3 Aug 2025 17:28:11 +0000 Received: from DS3PEPF0000C37F.namprd04.prod.outlook.com (2603:10b6:610:1f0:cafe::ac) by CH5PR05CA0001.outlook.office365.com (2603:10b6:610:1f0::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9009.12 via Frontend Transport; Sun, 3 Aug 2025 17:28:10 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 66.129.239.15) smtp.mailfrom=juniper.net; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from p-exchfe-eqx-02.jnpr.net (66.129.239.15) by DS3PEPF0000C37F.mail.protection.outlook.com (10.167.23.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.8 via Frontend Transport; Sun, 3 Aug 2025 17:28:10 +0000 Received: from p-exchbe-eqx-02.jnpr.net (10.104.9.15) by p-exchfe-eqx-02.jnpr.net (10.104.9.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 3 Aug 2025 12:28:10 -0500 Received: from p-exchbe-eqx-02.jnpr.net (10.104.9.15) by p-exchbe-eqx-02.jnpr.net (10.104.9.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 3 Aug 2025 12:28:09 -0500 Received: from p-mailhub01.juniper.net (10.104.20.6) by p-exchbe-eqx-02.jnpr.net (10.104.9.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Sun, 3 Aug 2025 12:28:09 -0500 Received: from idleski.juniper.net (idleski.juniper.net [172.25.4.10]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id 573HS8DZ012954; Sun, 3 Aug 2025 10:28:09 -0700 (envelope-from phil@juniper.net) Received: from [10.0.8.206] (localhost [127.0.0.1]) by idleski.juniper.net (8.18.1/8.18.1) with ESMTP id 573HSOss009285; Sun, 3 Aug 2025 13:28:25 -0400 (EDT) (envelope-from phil@juniper.net) From: Phil Shafer To: Damin Rido CC: Alan Somers , , , , "Damin Rido" Subject: Re: git: 7b35b4d19630 - main - sockstat: add libxo support Date: Sun, 3 Aug 2025 13:28:06 -0400 X-Mailer: MailMate (1.14r5937) Message-ID: In-Reply-To: References: <202507302027.56UKRhb5011315@gitrepo.freebsd.org> <8F928557-328D-46E9-BB53-BDE216693BFC@juniper.net> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37F:EE_|SA1PR05MB8408:EE_ X-MS-Office365-Filtering-Correlation-Id: ca94c060-ca80-4f8b-a0ec-08ddd2b31e68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ajJUeXVpVHh4bnQzNDZsVEx6MGcxOG1UMHhjTVRWYlBQRllrNS9vbDFlSVRv?= =?utf-8?B?cXpBbnkzc213VE5zcys3dnl0bmNzRWJWOWdtS1RFOEtHN2xESW5mRHF6UUw1?= =?utf-8?B?Z2tVUi9PMnllWUNPV0MzQ0dSRUZCN2hJbUpIcHFVRFNxekZmUzNTajhST1lS?= =?utf-8?B?eVBtbHpqbHJvLzN5WE9wM04wNWp2SHZuNTFNb3F0TGk1QTZjRjRxS2lpL0tU?= =?utf-8?B?a0liRkIzdnd6SUdSa1I4KzhpZVQwZklKQjdDc3E0QjNJblFpSXhMSjZvUVhl?= =?utf-8?B?N0dBcmN3QlpmZ3hBUDJscU8xRDJ1Wk9qUndOTEdYWkVqZUhsSDNlQzBZeHpD?= =?utf-8?B?SG00UXRHdnhTRncyMFk5eFhXNHhMVzllVGs2OEFIemZGRXlqSzJtQ3hMd2lk?= =?utf-8?B?M1VkSnl1UVlsSS9DekVhd3Axa1A3MnRqTnRNaHVPNkhDWG1OTi9tOE5YWHpL?= =?utf-8?B?TEJLYTd5UlBkcHJ2R1laOFgvSTR6aHI2Ujh2b042N3llZzBmVk9SNTNNbGlV?= =?utf-8?B?ajRJZ1dMWk05LzhMQ09BSXNLTEZnUVZKcHJYYnV0M0RLMU0xbXFzSVV4cGRG?= =?utf-8?B?OXBMdFBvYjd5eCthVExPYWFzcC9qZkROa01jdzkzRmxDUWJTcjRYOUpTVzRV?= =?utf-8?B?UHlUZS9jeTFzc1JETnRXZXhGYUg3TGJjeVhqY2ZCMXhhdkVZVlBEeFJYdk9h?= =?utf-8?B?cmx0MW9vcVl5WnhrODJzWjdpTmJEWVE4MXRSVWJ1SXhna2xqOGwwL29HcHRQ?= =?utf-8?B?dVQ0emRpV0NDOVQ4MncvVUpBMlVZU1dGTERzU3p2SWhHK3FYQVBvaHViR0lZ?= =?utf-8?B?OFI2SjMxRjVNRXVDV1p2ckxWdzBvb2ttR0tXTVUrTEpxYjZQMGIrUWpGRy9V?= =?utf-8?B?SkMxWkJvVTFVQ3B0MnNscGZvUkZIc05FQ2lHcFdwcVZHOUZtWE92S3loUWUw?= =?utf-8?B?Y1FLa01sS01lbkZTc2EyeE55SEVOZTdTeFNMVVpNUTdUVmFLZDVxanJNUUkr?= =?utf-8?B?SmFjc3NpOTltdTZIRnVUczZJMzlxelorV0FEejZqOW01akVLR282NjRJbkR3?= =?utf-8?B?aEY1ZlRwVzRnR29QSU4xdHBkbHhEL2c0M0hVRllKZmtRdW94dmhuaDdxSWxG?= =?utf-8?B?WnNGc3dpbzhBRWF6Tkd1N0hSSnFKc0RUaENJSXltc3pXZmpISVY2ZzBxS3Qr?= =?utf-8?B?cmcvcCs5TDYxSEFRMXBOaTNrZ1JEREI5cnZKZ2NqUEpwZzhhbW1LcUtmdzY4?= =?utf-8?B?aW96Z1I5WHFxa0VxYm1VNTl1Q0hlbWkvYjRaSVRwS0loVEJnSDR4RnFjZ1Ba?= =?utf-8?B?Zi9nOUVCVUhmaHozd1ZrNVRhdXlxekdraUc1Z0dHdEs0WXBYL0h1VFR6VmVN?= =?utf-8?B?QU5LbENLRTVTSWRCMlBWZ0dCWDNFWTh3eDhYMkszbk9mcHhZdmlwTGFZWURK?= =?utf-8?B?VGZuR2hPbGJ2eit5Z2JuTmJuSzdrSUdWR0l1eUtzdjlLMDUrWXdNQWNrbkZi?= =?utf-8?B?akwrb1BXZ0lUSzROUlEzbnVQMVBsRWN0M280NUJuOHhRelRYV3VJZExOUFNr?= =?utf-8?B?YTNPYmwvMFVlTW5SSndJa2lIRnJ2cTVxUy9neGI1K2UvTDJTZzR3WTFFelFW?= =?utf-8?B?aWRVZExDams2YXYzcnQzYWlIQW5BWDMvUkV2ZUI2UzdnR2k3OXllSDhrMjBU?= =?utf-8?B?eDNOUVIwbEVhUnNwSzg4TWlzZGhkcHh5Ym92bUdUM0p3RDVxbk5raUtjWGFv?= =?utf-8?B?RDREb2FiK0FZNlJCdmk0WEVPY0EzU0ZBVUVwb09WSVR4aWJDWWFiNEFMbnJY?= =?utf-8?B?Rk5OUnJVakdJc01OcElMQWQ4RHFFdytleVgwOWl6bTVTYk1kSUJLU2lNTXNz?= =?utf-8?B?Wm1KcktEaXQ0em5nNkxVS01heW9zV1RmMVFBTnFtRlQrcXpkVjA4cXZDdERU?= =?utf-8?B?YWtGc1hDT3g1WlVPZkp2VTJOWDNoQzlhZFU3NW1iZVZLTjFkZzN5aDcxWThl?= =?utf-8?B?TWtaNXoybjN3N2cwVU1aamNqRVNFNEd1bTJMODgyUlB2bkkrbG5mR3gwQ3RT?= =?utf-8?Q?qTi9qP?= X-Forefront-Antispam-Report: CIP:66.129.239.15;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:p-exchfe-eqx-02.jnpr.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1102; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2025 17:28:10.6753 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca94c060-ca80-4f8b-a0ec-08ddd2b31e68 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4;Ip=[66.129.239.15];Helo=[p-exchfe-eqx-02.jnpr.net] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF0000C37F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR05MB8408 X-Proofpoint-ORIG-GUID: olAmLLWmYO7vIZkxwDUEciYUSqVtYZUT X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODAzMDExOSBTYWx0ZWRfX3UlskVGi2RuW 0AdmKgvTkCbcrg9SBfFEOu1i73LY/eS55NMjLylrY11+14yIk6+XsNqjKM9aFi6ZM1TtTQamJmB pkFtM9nc/cQ5lpFR/0V/mgi0mTRNHnrwMsQE66BDM9hniko7sRWqjA/pCHk4c8u+FXMVRTr3WsA a68Yqkb4VHE4CCcLxyc0Yi10hZXzq0cxcLfuzs4tWme0iufrnzOPRgbbnlYVxeL/Uq7BHZoepiD M0p/QhJCZVmXDEq9XtBvr42HnPApoEAXphz7m6+ByHgStPzZD2X9wXI90ykTRZ+9XQ7BtFn/R3K Sw4VmvjFBuCVMWshNRh/8E525ter/39WW/9kzTSbktl81dbJMFqkgIWX69Vp9xDmtWpyZty+xVT +GQtTLNVwdKNL7xQ2MyVsdp4GbjxvR44jJChKvaXJJHC+CvWerPod01ZLQ7stGxuCCl3S5RE X-Authority-Analysis: v=2.4 cv=D6dHKuRj c=1 sm=1 tr=0 ts=688f9c2e cx=c_pps a=3Q1LJU4cGtvhj/bJjmVHbQ==:117 a=YQU41r7WENJiSYrYYNJVsQ==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=h8e1o3o8w34MuCiiGQrqVE4VwXA=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=IkcTkHD0fZMA:10 a=2OwXVqhp2XgA:10 a=s63m1ICgrNkA:10 a=rhJc5-LppCAA:10 a=t8X7EqYlRj7fXVrgXWMA:9 a=-fxwlg8_MQYTmFTB:21 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: olAmLLWmYO7vIZkxwDUEciYUSqVtYZUT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-03_04,2025-08-01_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 clxscore=1011 malwarescore=0 adultscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2508030119 X-Spamd-Result: default: False [-4.77 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector10001:i=1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.968]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; MIME_HTML_ONLY(0.20)[]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017]; R_SPF_ALLOW(-0.20)[+ip4:67.231.152.164]; RCVD_IN_DNSWL_LOW(-0.10)[67.231.152.164:from]; ASN(0.00)[asn:22843, ipnet:67.231.152.0/24, country:US]; TO_DN_SOME(0.00)[]; FREEFALL_USER(0.00)[phil]; R_DKIM_PERMFAIL(0.00)[juniper.net:s=selector1]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:~]; RCVD_COUNT_SEVEN(0.00)[10]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_MIXED(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; FREEMAIL_TO(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[juniper.net:+,juniper.net:~] X-Rspamd-Queue-Id: 4bw68v5lRdz3HY3 X-Spamd-Bar: ---- On 2 Aug 2025, at 1:59, Damin Rido wrote: > I deliberately omitted field names in some xo_emit calls when the outpu= t style was XO_STYLE_TEXT, since I assumed field names wouldn't matter fo= r human-readable formats. I also couldn=E2=80=99t trigger any warnings wi= th --libxo:W. However, to stay consistent with xolint expectations and en= sure correctness across all styles, I=E2=80=99ll add proper field names i= n my next commit. Even with text, this is an error, since the library can't know you've mad= e this test, and it doesn't work with HTML. You should use a name consis= tent with other places the field is emitted. > I initially assumed that only TEXT is intended for human-readable outpu= t, and that XML, JSON, and HTML are all machine-readable formats. That=E2= =80=99s why I treated TEXT separately in my formatting logic. Also, I use= space-padding specifically for XO_STYLE_TEXT to produce a neat, structur= ed, table-like output, which I assumed wouldn=E2=80=99t be necessary for = HTML or other formats. Could you please clarify why HTML should be handle= d similarly to TEXT in this case? Using HTML means you get text output, but it is "wrapped" in HTML tags th= at express the purpose (and more) of the fields, allowing CSS to render d= ata in browsers that's consistent with TTY output, but HTML-friendly (e.g= =2E hover, sort, etc). Take a look at xohtml(1) for an example/demonstra= tion. The underlaying HTML looks like: % df --libxo:H /
Filesystem
1K-blocks
Used
Avail
Capacity
Mo= unted on
zroot/ROOT/default
1581781064
<= div class=3D"data" data-tag=3D"used-blocks">7599348
1574181716
0
%
/
Or (pretty-fied); % df --libxo:HP /
Filesystem
1K-blocks
Used
Avail
Capacity
Mounted on
zroot/ROOT/default
1581781064
7599348
1574181716
0
%
/
Adding "data" and "path" data-* attributes to the HTML suitable for hover= and link creation:
zroot/ROOT/default
= 1581780992
75= 99348
1574181644
= 0
%
/
So, yes, please handle HTML while you're doing this work. It will maximi= ze the utility of your xo changes. Thanks, Phil From nobody Sun Aug 3 17:32:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bw6Fp5HGZz63cK0; Sun, 03 Aug 2025 17:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bw6Fp2whWz3Hrk; Sun, 03 Aug 2025 17:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754242350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oQiGU/RU37N1ratdvArnhfXQBP++8FUwr2vGor9xdvU=; b=eAA/69yBvMKAZC3nyEnAIwILdCSDj0rFBxglR9nCX4ZJrB/IxDiyRPIPBvOP0rICZVBqNA +W874ewh3Joekt99RlWmsBzjKYLa/fN3VAKWFakrJPsrHl2iJWtnBB/yJD1jozVpypGsH1 TTJhQCf2/gyrZiWWPQXsT5mMRP4RYddohrsbESPC9Ypqa+Zxic1nvaJaRA32fIlLGhpP6F ucp2YD4/ybdOz+/ya4RuNOo2wLlw3p+h9x/IFy6SjD8NL1vFZN567UZrrJCcejly6OAVxS cCYvCIl75Y4a5MazuOyYVX4+BENAJ755e0FBMeVScGm6jhokM/ZgV+yzpfDTcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754242350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oQiGU/RU37N1ratdvArnhfXQBP++8FUwr2vGor9xdvU=; b=PkJiZBbsCePadKLLnglI8+HhU6ipCR8PYGeO7Uf2Xs0XKKT9pYBPSMx7fahfV7bD5Qwshj 7doHoJl7GigdUtfDKG2lzahE6lt3OZxlbBSSqeWg9TzrbROrdeBTa2OBsovQ6Obj5hjIeC hOM+nqbyhJXwg0gsRf3r4mQD4Uxnu9sYR1MNocJ/UrVA6XTF9KL37OiSKNN2rMyrbhbELu 2mHXC7UWT+5i52BYSI4Ysutp1/edp1fDrAzpktpEfuHxwmov12OaUQHCpGpjLp4ZgPI/2p pt0nKJ9pMeI82KImjhJlaO6BSxM5Qov3o0qDxCW+vFCq2ku494EmVxH3Z2LYNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754242350; a=rsa-sha256; cv=none; b=EkZ6JHLouWh+RTvZ8kV6sBllLozVgUjKKV1u/9hq1uZAXrhn8KOUnyFBhGUl18Pmj2USSL DYqNhwmSYIUwOSfzgQ1Rc0ZpAWq2YOdin2VvIVa6m3LFLfGaP2YY2WTJWRHBiJgRHAplnz fBp2SdIKPRyRv6dDM/5YB/somncGhIA12EIvt6JbIS2OxzVlSyGLOLA9orncT4k+EAwkot 7qZpGNkyuV2aNisKt91nWdvLEgy5T6AQW1w+5uyJo5lMhxBHXGsFL7kXddsaQ0yjcBpbTZ Y96leVJHMd8rI0+S3sIdRyW+YTYVafMP9blCq8fQQWGUF6sv8k2kqUDUeZqJ1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bw6Fp2Vmyz1CBW; Sun, 03 Aug 2025 17:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573HWUCG039459; Sun, 3 Aug 2025 17:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573HWUPf039456; Sun, 3 Aug 2025 17:32:30 GMT (envelope-from git) Date: Sun, 3 Aug 2025 17:32:30 GMT Message-Id: <202508031732.573HWUPf039456@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: 4e6a3e7e3240 - main - libutil: Document pidfile_signal() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4e6a3e7e3240a95cda1d490831aa16ed3b9bd59b Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4e6a3e7e3240a95cda1d490831aa16ed3b9bd59b commit 4e6a3e7e3240a95cda1d490831aa16ed3b9bd59b Author: Dag-Erling Smørgrav AuthorDate: 2025-08-03 17:31:20 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-03 17:31:20 +0000 libutil: Document pidfile_signal() Fixes: 287451fd0192 MFC after: 1 week Reviewed by: pauamma_gundo.com, emaste Differential Revision: https://reviews.freebsd.org/D51705 --- lib/libutil/pidfile.3 | 68 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/lib/libutil/pidfile.3 b/lib/libutil/pidfile.3 index c4786736d28f..d28d5ed8eccb 100644 --- a/lib/libutil/pidfile.3 +++ b/lib/libutil/pidfile.3 @@ -22,14 +22,16 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 10, 2020 +.Dd August 2, 2025 .Dt PIDFILE 3 .Os .Sh NAME .Nm pidfile_open , .Nm pidfile_write , .Nm pidfile_close , -.Nm pidfile_remove +.Nm pidfile_remove , +.Nm pidfile_fileno , +.Nm pidfile_signal .Nd "library for PID files handling" .Sh LIBRARY .Lb libutil @@ -45,6 +47,8 @@ .Fn pidfile_remove "struct pidfh *pfh" .Ft int .Fn pidfile_fileno "struct pidfh *pfh" +.Ft int +.Fn pidfile_signal "const char *path" "int sig" "pid_t *pidptr" .Sh DESCRIPTION The .Nm pidfile @@ -101,6 +105,26 @@ function closes and removes a pidfile. The .Fn pidfile_fileno function returns the file descriptor for the open pidfile. +.Pp +The +.Fn pidfile_signal +function looks for the pidfile specified by +.Va path , +and if it exists and is locked, sends the signal specified by +.Va sig +to the PID it contains. +If +.Va pidptr +is not +.Dv NULL , +the PID that was found in the pidfile is stored in the location it +points to. +Note that calling +.Fn pidfile_signal +with +.Va sig +set to zero is an effective way to verify the existence of a pidfile +and of the process that owns it. .Sh RETURN VALUES The .Fn pidfile_open @@ -125,6 +149,13 @@ and sets if a NULL .Vt pidfh is specified, or if the pidfile is no longer open. +.Pp +The +.Fn pidfile_signal +function returns 0 if it successfully signaled a process, and an +appropriate +.Va errno +value otherwise. .Sh EXAMPLES The following example shows in which order these functions should be used. Note that it is safe to pass @@ -132,7 +163,7 @@ Note that it is safe to pass to .Fn pidfile_write , .Fn pidfile_remove , -.Fn pidfile_close +.Fn pidfile_close , and .Fn pidfile_fileno functions. @@ -280,7 +311,28 @@ Improper function use. Probably called not from the process which used .Fn pidfile_open . .El +.Pp +The +.Fn pidfile_signal +function will fail if: +.Bl -tag -width Er +.It Bq Er ENOENT +The pidfile does not exist, or exists but is not locked. +.It Bq Er EDOM +The pidfile contains a negative number. +.El +.Pp +The +.Fn pidfile_signal +function may also fail and return any of the +.Va errno +values specified for the +.Fn pidfile_read +function and the +.Xr kill 2 +system call. .Sh SEE ALSO +.Xr kill 2 , .Xr open 2 , .Xr daemon 3 , .Xr flopen 3 @@ -288,11 +340,19 @@ Probably called not from the process which used The functions .Fn pidfile_open , .Fn pidfile_write , -.Fn pidfile_close +.Fn pidfile_close , and .Fn pidfile_remove first appeared in .Fx 5.5 . +The +.Fn pidfile_fileno +function was added in +.Fx 9.1 . +The +.Fn pidfile_signal +function was added in +.Fx 14.0 . .Sh AUTHORS .An -nosplit The From nobody Sun Aug 3 17:32:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bw6Fq5T1Kz63cK2; Sun, 03 Aug 2025 17:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bw6Fq3tvBz3J3R; Sun, 03 Aug 2025 17:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754242351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mnf1e5xwZabxjcNdYUl6BTTtmocIbdSVg1r6d9UQgj0=; b=wcwobhos9E0TKlFS3OOtqL6gWJddZ6x0ACnMCRRKz4J1xCJSAYozFS5tiSrIyGBKIa77af Ho0rznQtoB2SMqjfbExn1X17M8uiK+J/3TkPWcOFyr/RCRd4ey4cmqGOGBfdtDRwjfzvYM Xu9Vv5IfJRvB+xfK7Tbs7Fjy7syAjWeWimXlaOUIbrMmFoWZEBlyB5e41/isUGxHK2Wf4r BqvPMy5e5Jn92SpxyuMoXR3QCedI/JF0LxmZfWNRPwEia+QtxipLs8mIk0eUvvnHz27fxS CBY7xItX+omdLOvVq9Br82YJanfDV++iKS0Ftygf7lQ9VBA/gfa5xK3dP6bUmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754242351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mnf1e5xwZabxjcNdYUl6BTTtmocIbdSVg1r6d9UQgj0=; b=uvPy4qqg/ODd7tbDDJdn2FCVmyNB60Jxg489gpSFTmmnuiyse3Pf1jW2hwM4NuUMQoSmGG MDUUNGPnjRmFmCVKmeKtPd4OW86TIIrOUu1J7Roy7hYF/M7ReyGiM6szl0l5vslFJjJElZ ovxkcTDyrK3y+ELM5/1lzpYT10AEqvp1M8GW8KqwvdbvEm7SccnxavEatx4Yf1krjiQ3r6 s5hWhwrEuMVtRwBNMoXQYSwqiDZl3lL7Al/INMQ6Qq+92GXkJPFauoz5pONNJBTusJrUTF 2mF+k/y3wkE9n+TImpfhWM26QcN3rD2MzCfIViefNDxHazs/MBjLCVLm+rR3aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754242351; a=rsa-sha256; cv=none; b=g0IUee61ydgJFUZRPqXWjGHNxGmPTVao3RfTxgXFLoKOWChyvcg1u2L5oCBmDs7YxENlds zL62fV0tJXJfAuXoiei+nGTMcPwHbBUBwY9mCCOHYPqgPGQnxECXKsaaBihk7uMM22Hhj2 epVD+QfJhP74Rl71ykhJyW84VFZkQYk9Xt3ob//GDErv1lu/1evQk8uas45mfKRVQvhKHr CnS4AGZnO9w9yRJjmecRa+j3ktwL4tNbJa3G1bGAWesIYnFPynvXtwb+b/N4WwIPJ5Vudt G5wnXEktHBjv26xz38+WsSwQK6L7PqtYeYq2kqe71JnHLxkAciaoLGzG/41BYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bw6Fq3TgBz1BV9; Sun, 03 Aug 2025 17:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573HWVYG039495; Sun, 3 Aug 2025 17:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573HWVDf039492; Sun, 3 Aug 2025 17:32:31 GMT (envelope-from git) Date: Sun, 3 Aug 2025 17:32:31 GMT Message-Id: <202508031732.573HWVDf039492@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: 22afc767869a - main - libutil: Add missing MLINKs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 22afc767869a23f4e0ec5436ce843728fded950c Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=22afc767869a23f4e0ec5436ce843728fded950c commit 22afc767869a23f4e0ec5436ce843728fded950c Author: Dag-Erling Smørgrav AuthorDate: 2025-08-03 17:31:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-08-03 17:31:28 +0000 libutil: Add missing MLINKs MFC after: 1 week Reviewed by: olce, imp, emaste Differential Revision: https://reviews.freebsd.org/D51706 --- lib/libutil/Makefile | 179 ++++++++++++++++++++++++++++++++------------------ lib/libutil/pw_util.3 | 1 + 2 files changed, 115 insertions(+), 65 deletions(-) diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 12ac623aec6b..f8c566ca731a 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -32,74 +32,123 @@ CFLAGS+= -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/ VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map -MAN+= cpuset.3 expand_number.3 flopen.3 fparseln.3 ftime.3 getlocalbase.3 \ - hexdump.3 humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ - kinfo_getproc.3 kinfo_getvmmap.3 kinfo_getvmobject.3 kld.3 \ - login_auth.3 login_cap.3 \ - login_class.3 login_ok.3 login_times.3 login_tty.3 mntopts.3 \ - pidfile.3 \ - property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \ - _secure_path.3 trimdomain.3 uucplock.3 pw_util.3 -MAN+= login.conf.5 +MAN+= cpuset.3 +MLINKS+=cpuset.3 cpuset_parselist.3 MLINKS+=cpuset.3 domainset_parselist.3 +MAN+= expand_number.3 +MAN+= flopen.3 MLINKS+=flopen.3 flopenat.3 -MLINKS+=kld.3 kld_isloaded.3 kld.3 kld_load.3 -MLINKS+=login_auth.3 auth_cat.3 login_auth.3 auth_checknologin.3 -MLINKS+=login_cap.3 login_close.3 login_cap.3 login_getcapbool.3 \ - login_cap.3 login_getcaplist.3 login_cap.3 login_getcapnum.3 \ - login_cap.3 login_getcapsize.3 login_cap.3 login_getcapstr.3 \ - login_cap.3 login_getcaptime.3 login_cap.3 login_getclass.3 \ - login_cap.3 login_getclassbyname.3 login_cap.3 login_getpath.3 \ - login_cap.3 login_getpwclass.3 login_cap.3 login_getstyle.3 \ - login_cap.3 login_getuserclass.3 login_cap.3 login_setcryptfmt.3 -MLINKS+=login_class.3 setclasscontext.3 login_class.3 setclassenvironment.3 \ - login_class.3 setclassresources.3 login_class.3 setusercontext.3 -MLINKS+=login_ok.3 auth_hostok.3 login_ok.3 auth_timeok.3 \ - login_ok.3 auth_ttyok.3 -MLINKS+=login_times.3 in_lt.3 login_times.3 in_ltm.3 \ - login_times.3 in_ltms.3 \ - login_times.3 in_lts.3 \ - login_times.3 parse_lt.3 -MLINKS+=mntopts.3 getmntopts.3 \ - mntopts.3 getmntpoint.3 \ - mntopts.3 chkdoreload.3 \ - mntopts.3 build_iovec.3 \ - mntopts.3 build_iovec_argf.3 \ - mntopts.3 free_iovec.3 \ - mntopts.3 checkpath.3 \ - mntopts.3 rmslashes.3 -MLINKS+=pidfile.3 pidfile_close.3 \ - pidfile.3 pidfile_fileno.3 \ - pidfile.3 pidfile_open.3 \ - pidfile.3 pidfile_remove.3 \ - pidfile.3 pidfile_write.3 -MLINKS+=property.3 property_find.3 property.3 properties_free.3 +MAN+= fparseln.3 +MAN+= ftime.3 +MAN+= getlocalbase.3 +MAN+= hexdump.3 +MAN+= humanize_number.3 +MAN+= kinfo_getallproc.3 +MAN+= kinfo_getfile.3 +MAN+= kinfo_getproc.3 +MAN+= kinfo_getvmmap.3 +MAN+= kinfo_getvmobject.3 +MAN+= kld.3 +MLINKS+=kld.3 kld_isloaded.3 +MLINKS+=kld.3 kld_load.3 +MAN+= login_auth.3 +MLINKS+=login_auth.3 auth_cat.3 +MLINKS+=login_auth.3 auth_checknologin.3 +MAN+= login_cap.3 +MLINKS+=login_cap.3 login_close.3 +MLINKS+=login_cap.3 login_getcapbool.3 +MLINKS+=login_cap.3 login_getcapenum.3 +MLINKS+=login_cap.3 login_getcaplist.3 +MLINKS+=login_cap.3 login_getcapnum.3 +MLINKS+=login_cap.3 login_getcapsize.3 +MLINKS+=login_cap.3 login_getcapstr.3 +MLINKS+=login_cap.3 login_getcaptime.3 +MLINKS+=login_cap.3 login_getclass.3 +MLINKS+=login_cap.3 login_getclassbyname.3 +MLINKS+=login_cap.3 login_getpath.3 +MLINKS+=login_cap.3 login_getpwclass.3 +MLINKS+=login_cap.3 login_getstyle.3 +MLINKS+=login_cap.3 login_getuserclass.3 +MLINKS+=login_cap.3 login_setcryptfmt.3 +MAN+= login_class.3 +MLINKS+=login_class.3 setclasscontext.3 +MLINKS+=login_class.3 setclasscpumask.3 +MLINKS+=login_class.3 setclassenvironment.3 +MLINKS+=login_class.3 setclassresources.3 +MLINKS+=login_class.3 setusercontext.3 +MAN+= login_ok.3 +MLINKS+=login_ok.3 auth_hostok.3 +MLINKS+=login_ok.3 auth_timeok.3 +MLINKS+=login_ok.3 auth_ttyok.3 +MAN+= login_times.3 +MLINKS+=login_times.3 in_lt.3 +MLINKS+=login_times.3 in_ltm.3 +MLINKS+=login_times.3 in_ltms.3 +MLINKS+=login_times.3 in_lts.3 +MLINKS+=login_times.3 parse_lt.3 +MAN+= login_tty.3 +MAN+= mntopts.3 +MLINKS+=mntopts.3 build_iovec.3 +MLINKS+=mntopts.3 build_iovec_argf.3 +MLINKS+=mntopts.3 checkpath.3 +MLINKS+=mntopts.3 chkdoreload.3 +MLINKS+=mntopts.3 free_iovec.3 +MLINKS+=mntopts.3 getmntopts.3 +MLINKS+=mntopts.3 getmntpoint.3 +MLINKS+=mntopts.3 rmslashes.3 +MAN+= pidfile.3 +MLINKS+=pidfile.3 pidfile_close.3 +MLINKS+=pidfile.3 pidfile_fileno.3 +MLINKS+=pidfile.3 pidfile_open.3 +MLINKS+=pidfile.3 pidfile_remove.3 +MLINKS+=pidfile.3 pidfile_signal.3 +MLINKS+=pidfile.3 pidfile_write.3 +MAN+= property.3 +MLINKS+=property.3 property_find.3 +MLINKS+=property.3 properties_free.3 MLINKS+=property.3 properties_read.3 -MLINKS+=pty.3 forkpty.3 pty.3 openpty.3 -MLINKS+=quotafile.3 quota_close.3 \ - quotafile.3 quota_fsname.3 \ - quotafile.3 quota_open.3 \ - quotafile.3 quota_qfname.3 \ - quotafile.3 quota_read.3 \ - quotafile.3 quota_statfs.3 \ - quotafile.3 quota_write_limits.3 \ - quotafile.3 quota_write_usage.3 -MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \ - uucplock.3 uu_lockerr.3 uucplock.3 uu_unlock.3 -MLINKS+=pw_util.3 pw_copy.3 \ - pw_util.3 pw_dup.3 \ - pw_util.3 pw_edit.3 \ - pw_util.3 pw_equal.3 \ - pw_util.3 pw_fini.3 \ - pw_util.3 pw_init.3 \ - pw_util.3 pw_make.3 \ - pw_util.3 pw_make_v7.3 \ - pw_util.3 pw_mkdb.3 \ - pw_util.3 pw_lock.3 \ - pw_util.3 pw_scan.3 \ - pw_util.3 pw_tempname.3 \ - pw_util.3 pw_tmp.3 -MLINKS+=cpuset.3 cpuset_parselist.3 +MAN+= pty.3 +MLINKS+=pty.3 forkpty.3 +MLINKS+=pty.3 openpty.3 +MAN+= pw_util.3 +MLINKS+=pw_util.3 pw_copy.3 +MLINKS+=pw_util.3 pw_dup.3 +MLINKS+=pw_util.3 pw_edit.3 +MLINKS+=pw_util.3 pw_equal.3 +MLINKS+=pw_util.3 pw_fini.3 +MLINKS+=pw_util.3 pw_init.3 +MLINKS+=pw_util.3 pw_initpwd.3 +MLINKS+=pw_util.3 pw_make.3 +MLINKS+=pw_util.3 pw_make_v7.3 +MLINKS+=pw_util.3 pw_mkdb.3 +MLINKS+=pw_util.3 pw_lock.3 +MLINKS+=pw_util.3 pw_scan.3 +MLINKS+=pw_util.3 pw_tempname.3 +MLINKS+=pw_util.3 pw_tmp.3 +MAN+= quotafile.3 +MLINKS+=quotafile.3 quota_check_path.3 +MLINKS+=quotafile.3 quota_close.3 +MLINKS+=quotafile.3 quota_convert.3 +MLINKS+=quotafile.3 quota_fsname.3 +MLINKS+=quotafile.3 quota_maxid.3 +MLINKS+=quotafile.3 quota_off.3 +MLINKS+=quotafile.3 quota_on.3 +MLINKS+=quotafile.3 quota_open.3 +MLINKS+=quotafile.3 quota_qfname.3 +MLINKS+=quotafile.3 quota_read.3 +MLINKS+=quotafile.3 quota_statfs.3 +MLINKS+=quotafile.3 quota_write_limits.3 +MLINKS+=quotafile.3 quota_write_usage.3 +MAN+= realhostname.3 +MAN+= realhostname_sa.3 +MAN+= _secure_path.3 +MAN+= trimdomain.3 +MAN+= uucplock.3 +MLINKS+=uucplock.3 uu_lock.3 +MLINKS+=uucplock.3 uu_lock_txfr.3 +MLINKS+=uucplock.3 uu_lockerr.3 +MLINKS+=uucplock.3 uu_unlock.3 +MAN+= login.conf.5 HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/lib/libutil/pw_util.3 b/lib/libutil/pw_util.3 index ed05818cd16a..a6bb71600441 100644 --- a/lib/libutil/pw_util.3 +++ b/lib/libutil/pw_util.3 @@ -31,6 +31,7 @@ .Nm pw_edit , .Nm pw_equal , .Nm pw_fini , +.Nm pw_initpwd , .Nm pw_init , .Nm pw_make , .Nm pw_make_v7 , From nobody Sun Aug 3 22:11:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwDS624Spz63tqs; Sun, 03 Aug 2025 22:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwDS61KGqz3sVQ; Sun, 03 Aug 2025 22:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KE4g8tjQcuNHaGFwNBZ/UCJ+eYfm4ZX/3MpYlWx6PzE=; b=DrAq0PSfhp36Oinj1BfTWSwqtFu4gr0DRdl4ojIqzQBvzcq8SWEr3IgTpdonF+5FgaOP37 kVsh8WzY3ky/HmbnjPDKDrUDGWpFSsSiOux4irtp9qVOAccqcJHMBsr0IjSgGQBeF66vw8 n+HWJ6ZZeEShx2QYk6gX9yDFq+IT8Q15UmPbquKlFdJ2ah9XyWMQGXlyb+vYHR7JkiJrlD 5piEOqxt2J+t8P9NZgLRjffsb/lt6c6ghAfarIzOaJM8B2S8MQanhtSdh/eYCgMS3NwLGX 3v+Vo+wC/hyRmLh8tJNCX4k27x9wivcdt9V4R8evAVokrgcj8SgvXRG8SezuEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KE4g8tjQcuNHaGFwNBZ/UCJ+eYfm4ZX/3MpYlWx6PzE=; b=atrheNSR63nKNwdJ+PMo1Y46LVCfjnQvaVYFju3jDfTisSrRGyOs3RYjQVGQ2y51JOn9HJ 6BeHzHT1XkUJkj3eTOaTZ0pXMOuSrYk9XlKN5V52paKx4qcm9cf91I1J873Bk8/ZGSUc9G ygP1awCIjJdVMZNdO3qHdcQgzjSSmBkxyTOhnhjXyKjKjMy27bgwMC92vaFreH7i5GHntD lYXQHIsByZOzue+VZ5ul6yngBz5Y3EzxYt3uodfMfRA5GF5hBYW9GbN1hpl6yYQlT5hmk8 2BSqJpNrxTNqsC+WWfMva6ZZToQpG4vdwIXLLFfVdYIFosy7Ms4KRzK1GqXeKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754259110; a=rsa-sha256; cv=none; b=qg+3TmDANPV7nE2Ej3TrDgWid/tMfRycu+1n1I+5YveGeZj8S0h9wZVfp/9bOFXXZBe6cd 4VNFowhLwiD2fxuCP6xpKylYjqC+LmbTECkP14rsRhHZQXxaTcgso4mn1OSjsP6hE13/P+ nkGL/qQAJRLuY/vMnIzsl/i0q6T7CKTd9axlSbAZ08oLcui7B1LTxAUHS/jQFQhGxXjDtF PR/boM7xGp4wIAcAoqwqvdqG+QfEiemDUYfccalpfAybDooqthejwCoUrKnj5R0Phkuu84 PXBmr2UDsUBjH3BnOH9ByiFNa9XqJUQ9b3uJQY1emU4iP/KIQSf82OhUjxB75A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwDS60jXVz6Cb; Sun, 03 Aug 2025 22:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573MBotp065808; Sun, 3 Aug 2025 22:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573MBnoC065805; Sun, 3 Aug 2025 22:11:49 GMT (envelope-from git) Date: Sun, 3 Aug 2025 22:11:49 GMT Message-Id: <202508032211.573MBnoC065805@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: 3bd8fab2415b - main - vfs: Move DEBUG_VFS_LOCKS checks to 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 3bd8fab2415bf517d169fed2aa345ef08a977a98 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3bd8fab2415bf517d169fed2aa345ef08a977a98 commit 3bd8fab2415bf517d169fed2aa345ef08a977a98 Author: Mark Johnston AuthorDate: 2025-07-17 21:54:32 +0000 Commit: Mark Johnston CommitDate: 2025-08-03 21:27:28 +0000 vfs: Move DEBUG_VFS_LOCKS checks to INVARIANTS It is easy to forget to configure DEBUG_VFS_LOCKS, and when one does, no vnode lock assertions are checked when INVARIANTS is configured, so bugs can arise. This has happened to me more than once, and the overhead over DEBUG_VFS_LOCKS does not appear to be high enough to prohibit folding it into INVARIANTS, so let's do that. The change makes vnode lock assertions useful in plain INVARIANTS kernels, and guards VOP debug routines on INVARIANTS rather than DEBUG_VFS_LOCKS. Further, invariants are now checked by plain assertions rather than having various sysctls to finely control what happens the checks fail. The extra complexity didn't seem particularly useful and is at odds with how we handle debugging most everywhere else. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51402 --- sys/kern/vfs_subr.c | 103 ++++++++++++++----------------------------------- sys/sys/vnode.h | 8 ++-- sys/tools/vnode_if.awk | 6 +-- 3 files changed, 37 insertions(+), 80 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 29774cf87393..4eac8bb0c8bb 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -97,10 +97,6 @@ #include #include -#if defined(DEBUG_VFS_LOCKS) && (!defined(INVARIANTS) || !defined(WITNESS)) -#error DEBUG_VFS_LOCKS requires INVARIANTS and WITNESS -#endif - #ifdef DDB #include #endif @@ -5736,102 +5732,69 @@ extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, } } -#ifdef DEBUG_VFS_LOCKS -int vfs_badlock_ddb = 1; /* Drop into debugger on violation. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_ddb, CTLFLAG_RW, &vfs_badlock_ddb, 0, - "Drop into debugger on lock violation"); - -int vfs_badlock_mutex = 1; /* Check for interlock across VOPs. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_mutex, CTLFLAG_RW, &vfs_badlock_mutex, - 0, "Check for interlock across VOPs"); - -int vfs_badlock_print = 1; /* Print lock violations. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_print, CTLFLAG_RW, &vfs_badlock_print, - 0, "Print lock violations"); - -int vfs_badlock_vnode = 1; /* Print vnode details on lock violations. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_vnode, CTLFLAG_RW, &vfs_badlock_vnode, - 0, "Print vnode details on lock violations"); - -#ifdef KDB -int vfs_badlock_backtrace = 1; /* Print backtrace at lock violations. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_backtrace, CTLFLAG_RW, - &vfs_badlock_backtrace, 0, "Print backtrace at lock violations"); -#endif - -static void -vfs_badlock(const char *msg, const char *str, struct vnode *vp) -{ - -#ifdef KDB - if (vfs_badlock_backtrace) - kdb_backtrace(); -#endif - if (vfs_badlock_vnode) - vn_printf(vp, "vnode "); - if (vfs_badlock_print) - printf("%s: %p %s\n", str, (void *)vp, msg); - if (vfs_badlock_ddb) - kdb_enter(KDB_WHY_VFSLOCK, "lock violation"); -} - +#ifdef INVARIANTS void assert_vi_locked(struct vnode *vp, const char *str) { - - if (vfs_badlock_mutex && !mtx_owned(VI_MTX(vp))) - vfs_badlock("interlock is not locked but should be", str, vp); + VNASSERT(mtx_owned(VI_MTX(vp)), vp, + ("%s: vnode interlock is not locked but should be", str)); } void assert_vi_unlocked(struct vnode *vp, const char *str) { - - if (vfs_badlock_mutex && mtx_owned(VI_MTX(vp))) - vfs_badlock("interlock is locked but should not be", str, vp); + VNASSERT(!mtx_owned(VI_MTX(vp)), vp, + ("%s: vnode interlock is locked but should not be", str)); } void assert_vop_locked(struct vnode *vp, const char *str) { + bool locked; + if (KERNEL_PANICKED() || vp == NULL) return; #ifdef WITNESS - if ((vp->v_irflag & VIRF_CROSSMP) == 0 && - witness_is_owned(&vp->v_vnlock->lock_object) == -1) + locked = !((vp->v_irflag & VIRF_CROSSMP) == 0 && + witness_is_owned(&vp->v_vnlock->lock_object) == -1); #else - int locked = VOP_ISLOCKED(vp); - if (locked == 0 || locked == LK_EXCLOTHER) + int state = VOP_ISLOCKED(vp); + locked = state != 0 && state != LK_EXCLOTHER; #endif - vfs_badlock("is not locked but should be", str, vp); + VNASSERT(locked, vp, ("%s: vnode is not locked but should be", str)); } void assert_vop_unlocked(struct vnode *vp, const char *str) { + bool locked; + if (KERNEL_PANICKED() || vp == NULL) return; #ifdef WITNESS - if ((vp->v_irflag & VIRF_CROSSMP) == 0 && - witness_is_owned(&vp->v_vnlock->lock_object) == 1) + locked = (vp->v_irflag & VIRF_CROSSMP) == 0 && + witness_is_owned(&vp->v_vnlock->lock_object) == 1; #else - if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) + locked = VOP_ISLOCKED(vp) == LK_EXCLUSIVE; #endif - vfs_badlock("is locked but should not be", str, vp); + VNASSERT(!locked, vp, ("%s: vnode is locked but should not be", str)); } void assert_vop_elocked(struct vnode *vp, const char *str) { + bool locked; + if (KERNEL_PANICKED() || vp == NULL) return; - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) - vfs_badlock("is not exclusive locked but should be", str, vp); + locked = VOP_ISLOCKED(vp) == LK_EXCLUSIVE; + VNASSERT(locked, vp, + ("%s: vnode is not exclusive locked but should be", str)); } -#endif /* DEBUG_VFS_LOCKS */ +#endif /* INVARIANTS */ void vop_rename_fail(struct vop_rename_args *ap) @@ -5852,7 +5815,7 @@ vop_rename_pre(void *ap) { struct vop_rename_args *a = ap; -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS struct mount *tmp; if (a->a_tvp) @@ -5895,7 +5858,7 @@ vop_rename_pre(void *ap) vhold(a->a_tvp); } -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS void vop_fplookup_vexec_debugpre(void *ap __unused) { @@ -6008,13 +5971,7 @@ vop_strategy_debugpre(void *ap) if ((bp->b_flags & B_CLUSTER) != 0) return; - if (!KERNEL_PANICKED() && !BUF_ISLOCKED(bp)) { - if (vfs_badlock_print) - printf( - "VOP_STRATEGY: bp is not locked but should be\n"); - if (vfs_badlock_ddb) - kdb_enter(KDB_WHY_VFSLOCK, "lock violation"); - } + BUF_ASSERT_LOCKED(bp); } void @@ -6063,7 +6020,7 @@ vop_need_inactive_debugpost(void *ap, int rc) ASSERT_VI_LOCKED(a->a_vp, "VOP_NEED_INACTIVE"); } -#endif +#endif /* INVARIANTS */ void vop_allocate_post(void *ap, int rc) @@ -6229,7 +6186,7 @@ vop_mkdir_post(void *ap, int rc) } } -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS void vop_mkdir_debugpost(void *ap, int rc) { @@ -6677,7 +6634,7 @@ vfs_knlunlock(void *arg) static void vfs_knl_assert_lock(void *arg, int what) { -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS struct vnode *vp = arg; if (what == LA_LOCKED) diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index a416fddcddc3..074769d55c2d 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -538,7 +538,7 @@ extern struct vnodeop_desc *vnodeop_descs[]; #define VOPARG_OFFSETTO(s_type, s_offset, struct_p) \ ((s_type)(((char*)(struct_p)) + (s_offset))) -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS /* * Support code to aid in debugging VFS locking problems. Not totally * reliable since if the thread sleeps between changing the lock @@ -572,7 +572,7 @@ void assert_vop_unlocked(struct vnode *vp, const char *str); VNPASS(!seqc_in_modify(_vp->v_seqc), _vp); \ } while (0) -#else /* !DEBUG_VFS_LOCKS */ +#else /* !INVARIANTS */ #define ASSERT_VI_LOCKED(vp, str) ((void)0) #define ASSERT_VI_UNLOCKED(vp, str) ((void)0) @@ -583,7 +583,7 @@ void assert_vop_unlocked(struct vnode *vp, const char *str); #define ASSERT_VOP_IN_SEQC(vp) ((void)0) #define ASSERT_VOP_NOT_IN_SEQC(vp) ((void)0) -#endif /* DEBUG_VFS_LOCKS */ +#endif /* INVARIANTS */ /* * This call works for vnodes in the kernel. @@ -956,7 +956,7 @@ void vop_symlink_pre(void *a); void vop_symlink_post(void *a, int rc); int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS void vop_fdatasync_debugpre(void *a); void vop_fdatasync_debugpost(void *a, int rc); void vop_fplookup_vexec_debugpre(void *a); diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index e829105197cc..74b11e6cb27d 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -86,7 +86,7 @@ function add_debug_code(name, arg, pos, ind) function add_debugpre(name) { if (lockdata[name, "debugpre"]) { - printc("#ifdef DEBUG_VFS_LOCKS"); + printc("#ifdef INVARIANTS"); printc("\t"lockdata[name, "debugpre"]"(a);"); printc("#endif"); } @@ -95,7 +95,7 @@ function add_debugpre(name) function add_debugpost(name) { if (lockdata[name, "debugpost"]) { - printc("#ifdef DEBUG_VFS_LOCKS"); + printc("#ifdef INVARIANTS"); printc("\t"lockdata[name, "debugpost"]"(a, rc);"); printc("#endif"); } @@ -340,7 +340,7 @@ while ((getline < srcfile) > 0) { for (i = 0; i < numargs; ++i) printh("\ta.a_" args[i] " = " args[i] ";"); if (can_inline(name)) { - printh("\n#if !defined(DEBUG_VFS_LOCKS) && !defined(INVARIANTS) && !defined(KTR)"); + printh("\n#if !defined(INVARIANTS) && !defined(KTR)"); printh("\tif (!SDT_PROBES_ENABLED())"); printh("\t\treturn (" args[0]"->v_op->"name"(&a));"); printh("\telse"); From nobody Sun Aug 3 22:11:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwDS73z5Zz63tl8; Sun, 03 Aug 2025 22:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwDS72Bkhz3sZX; Sun, 03 Aug 2025 22:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4A0LIk7NOAnoYTA9Iqv0GhWq0U9tTvEykKY0IwNlm94=; b=fJy1+4EPfK9JPHMO9YtFbMXajycCY4gSzRh0EopCyok+ZBvA7vXWXxKMg2OKvQs5ohwlB+ vZg1+Wv/oPIlCo/IvddLgBbneMKeWuoC3CFbJpbyaeIxyu3HvQVm4Zl4TBCDd4RwnuJ2x3 qGB3kxBVawIyATGSBh30sZt0EY5KUIxQ2z66b2FzY9xjKAxBR0c07uQEsvVukD+XtFYcjb TsFtC0tJw9lm3YutF3+iYhBJdWHzimE1rXrqxgH2jwjXzfrzjOHBlU8i+BbemNn1C6xB7K p28xZ3Vro4zNhSr0TJWRaV/fumm6U2PzIPZ9Z+G8gNyT0td6vmEzyjZToiLROA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4A0LIk7NOAnoYTA9Iqv0GhWq0U9tTvEykKY0IwNlm94=; b=BPUvXjoSMVJkQDAh1pA7zfdj00Q7qxysq13bmNvMwXfp+W8wksYNOsIat1Yul0ggUR0Dzq bqtcEDIS55V6XRSMOHtYmwNhQdyPyp3uhKIC9Uxpx95wiXc+198KY/MqEXwaYiB8G8r1Hu 4Ut4PKw2Aw+SlL+kizO8GlfMHQKyxSff/lrFrnT5q891252sA7U15hYJN5N3Qm9K9LfxC9 y9lCnP8WcYdyxFOERUNNp8BABkYDVM2BvPNODV9QD/DQ8XsYxO5ZPMwwD6ZXjQ1U7etLM4 RGSHoWTCz+pkOsDUgJ1uygKROpquGIajXqX/sqp8gOA36+sOiIBo8T3+t7RlFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754259111; a=rsa-sha256; cv=none; b=PNmf4s3UsQBGcVZxMujrefoZstSc1UJG3F9gmNrGK8evC5Sff7cGZJP48ARyiL8f38HtAA Wre5Hr+g4YEfXlx2EHzUY98/MK8ssFSDj8HrjGDWoNCZsTlkAl17wpBYuDVSS0d8cSQsDc JRP2XBj1fa9v0EO5C19oPcFPgiHmV9V14e1XVyvaKgiP5waFb7OTqNFScT4ovGLgqpaEpV tm/iOzd3IPsNvzIdoS/zQwB0Ss+0NSrw0+NjrV96WJN/Om+PFaDigECp5gMibLo4JOnvy8 fgUz/b+Ayd2vL8pr2u5CbdjEcuFsv0ORv0e4u19u8lAGLhlQ069gn+UGBmKIrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwDS71l03z6Yq; Sun, 03 Aug 2025 22:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573MBp77065844; Sun, 3 Aug 2025 22:11:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573MBpVN065841; Sun, 3 Aug 2025 22:11:51 GMT (envelope-from git) Date: Sun, 3 Aug 2025 22:11:51 GMT Message-Id: <202508032211.573MBpVN065841@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: 4798f1e8f28d - main - ufs: Remove uses of DEBUG_VFS_LOCKS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4798f1e8f28d1bd440987696b3474eb6ca764fde Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4798f1e8f28d1bd440987696b3474eb6ca764fde commit 4798f1e8f28d1bd440987696b3474eb6ca764fde Author: Mark Johnston AuthorDate: 2025-07-24 15:27:56 +0000 Commit: Mark Johnston CommitDate: 2025-08-03 21:51:58 +0000 ufs: Remove uses of DEBUG_VFS_LOCKS All of these assertions can reasonably be checked when plain INVARIANTS is configured, there's no need to configure a separate option. Reviewed by: olce, imp, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51696 --- sys/ufs/ffs/ffs_softdep.c | 2 -- sys/ufs/ffs/ffs_vnops.c | 2 -- sys/ufs/ufs/ufs_lookup.c | 2 -- sys/ufs/ufs/ufs_quota.c | 4 ---- 4 files changed, 10 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 67cd6fb4b738..b5212ce5875f 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -14522,10 +14522,8 @@ getdirtybuf(struct buf *bp, BUF_UNLOCK(bp); if (waitfor != MNT_WAIT) return (NULL); -#ifdef DEBUG_VFS_LOCKS if (bp->b_vp->v_type != VCHR) ASSERT_BO_WLOCKED(bp->b_bufobj); -#endif bp->b_vflags |= BV_BKGRDWAIT; rw_sleep(&bp->b_xflags, lock, PRIBIO, "getbuf", 0); return (NULL); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 33e1bc3ed88b..897a21032907 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -508,9 +508,7 @@ ffs_lock( case LK_EXCLUSIVE: flags = ap->a_flags; for (;;) { -#ifdef DEBUG_VFS_LOCKS VNPASS(vp->v_holdcnt != 0, vp); -#endif /* DEBUG_VFS_LOCKS */ lkp = vp->v_vnlock; result = lockmgr_lock_flags(lkp, flags, &VI_MTX(vp)->lock_object, ap->a_file, ap->a_line); diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index fd0539c40c0d..9221aa63184d 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -230,7 +230,6 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, bmask = VFSTOUFS(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; -#ifdef DEBUG_VFS_LOCKS /* * Assert that the directory vnode is locked, and locked * exclusively for the last component lookup for modifying @@ -248,7 +247,6 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, if ((nameiop == CREATE || nameiop == DELETE || nameiop == RENAME) && (flags & (LOCKPARENT | ISLASTCN)) == (LOCKPARENT | ISLASTCN)) ASSERT_VOP_ELOCKED(vdp, "ufs_lookup2"); -#endif restart: bp = NULL; diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index b132eea658d0..ac125902b74b 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -1278,10 +1278,8 @@ dqget(struct vnode *vp, uint64_t id, struct ufsmount *ump, int type, struct uio auio; int dqvplocked, error; -#ifdef DEBUG_VFS_LOCKS if (vp != NULLVP) ASSERT_VOP_ELOCKED(vp, "dqget"); -#endif if (vp != NULLVP && *dqp != NODQUOT) { return (0); @@ -1553,10 +1551,8 @@ dqsync(struct vnode *vp, struct dquot *dq) struct mount *mp; struct ufsmount *ump; -#ifdef DEBUG_VFS_LOCKS if (vp != NULL) ASSERT_VOP_ELOCKED(vp, "dqsync"); -#endif mp = NULL; error = 0; From nobody Sun Aug 3 22:11:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwDS8680Lz63tqt; Sun, 03 Aug 2025 22:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwDS833gpz3sg5; Sun, 03 Aug 2025 22:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QtrBHguNKsqBfoQjRHl264UdyNhSA5IgIDYLVPP9ViY=; b=QX48FyjjWhItDkLFTC0yW2x0BgE6xAEzbRNq+8QPKy181xfLsXgwG0Lx6nVf3L/+m6rXxm ZQzQ1kbPy+bFgatNdfhTfIYZcYQMoBbBVkwR0AQPZk2hGOYJFeY5JlwC3DgTMESYJV+qNq C2YifSLUzcsYXbmNUuj7cV0gwOZn7JFy/YvQlkrwWbm/9icDYmW1estur5FbZZXedtWsAn 9Il3fCgegof3Y5Nz6Z1N313R0x9NwyJSDS3CQWTPc3+LwEUTsqhw+NBjuTaZoh039ixzFi jcxcGQmMZvto2KCiGx2B60dueFsqt+4f3XGQz6g6S5FbbZCwIRBiMhAWFoaVDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QtrBHguNKsqBfoQjRHl264UdyNhSA5IgIDYLVPP9ViY=; b=Wtb0VmiT2LjLN8PSDPpQ+Rom5/ahOoaoH8bwfR6xBou2NO9pVoc/GIp4HSC+kY8GOD1p+a iV7vgbPOs9Gd3Hf6HDcKEfztlUtJwwx8FbayM8VJAyyH4vxQlwqn0yWCfRL61NYYWTZI1V zOGLlNQZQwKiBeyCGgrbsObTE/UWAgGFKwozkfnVJEnHGZcDry5S8IqSn1xmtugM3hWUjF 9uO9VxpeGWS6ThSVRPFtPGeg238gNKAeBg4Fbh040uSQnjcR+7s4DXDS5zDNM1kIrB0lGe 5fwetO9QI6Q4SvUrAFBD/87mZCzyPkwCVErwFOovGl0YMy+TAjv/P+PyOEzgaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754259112; a=rsa-sha256; cv=none; b=tiNAxr8mC6sF5Cnlqqspjse0EJr5QfnRtX59u04WvFdy+TozS2nCiyAHoy3U6Rz9DxNWKT EI9rOz1AsNo+zicz5z8u2acrNOoTeRk/n9R5EGHCKpNR2mfeM70WsaXZQ/v0p2Zg01fl1x rGJ7ugqxI1Yhj9AC3wePR/jQ4C1ndxtzzaaiqxuVyjddamewE03YbshoGON0MF1aLWzcbi PnXryBF2X0jRdhV2dPCG2QRs8MTMp635oVAHfwCQhbMEmWkPcBzBWUASZ1lXUnfmD7Qd2j LeqKUAbZs08OO8xAitw8hqQLQc+aHBtcJxyAudPVUKlVxmp/hLBH0ta98/DCBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwDS82gJJz6Yr; Sun, 03 Aug 2025 22:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573MBqm6065884; Sun, 3 Aug 2025 22:11:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573MBq5F065881; Sun, 3 Aug 2025 22:11:52 GMT (envelope-from git) Date: Sun, 3 Aug 2025 22:11:52 GMT Message-Id: <202508032211.573MBq5F065881@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: 4b56c7ff6c5b - main - tmpfs: Remove uses of DEBUG_VFS_LOCKS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 4b56c7ff6c5b4e4f9dfd2eb09a5a901f4ff9b8b3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4b56c7ff6c5b4e4f9dfd2eb09a5a901f4ff9b8b3 commit 4b56c7ff6c5b4e4f9dfd2eb09a5a901f4ff9b8b3 Author: Mark Johnston AuthorDate: 2025-07-24 15:29:24 +0000 Commit: Mark Johnston CommitDate: 2025-08-03 21:52:14 +0000 tmpfs: Remove uses of DEBUG_VFS_LOCKS This assertion can reasonably be checked when plain INVARIANTS is configured, there's no need to configure a separate option. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51697 --- sys/fs/tmpfs/tmpfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 9d2a587b177a..79b6c8b2e6a1 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -384,7 +384,7 @@ static int tmpfs_access_locked(struct vnode *vp, struct tmpfs_node *node, accmode_t accmode, struct ucred *cred) { -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS if (!mtx_owned(TMPFS_NODE_MTX(node))) { ASSERT_VOP_LOCKED(vp, "tmpfs_access_locked needs locked vnode or node"); From nobody Sun Aug 3 22:11:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwDS96NdJz63tjW; Sun, 03 Aug 2025 22:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwDS94PgDz3sjh; Sun, 03 Aug 2025 22:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOEOEEyV36O3aAN2ZA/rVr9PHrEkpkDUod1iyI6nxvQ=; b=QrV3Q7uB1j94y7FTgiMJfLflRHsBWWRfPNEoMqCDMGX4y6lY0kSrY4/6iL867LMOe2OTVd YPL52wX3QDdz2sijBOSk4GwX7sUwvMZFiN3J53LN4tiJItBZFz8shTX3Z4x1GR9j+Wm7SM Wi2xcH6QlKbfjtD4R+sfyLSctKCvjIQL3JtEEPVBPhA0SC4W9Vq/a0jsvSq+1aRpbG1Jv0 +5n08WR67ptGnqynJgVEdwHDbqDv/0J1s491du0F7Ow16ITrr37mtdbH4R60IpWT/U+YuH c3d+W4Tyde+K+QL610h3LZweDWLUfl7qN7rosIk27MclSOPJx6eN4VgDi5mrCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOEOEEyV36O3aAN2ZA/rVr9PHrEkpkDUod1iyI6nxvQ=; b=qsx2G4ShECwlr7jrCbhB/IYCI6eu1gDCS/DIGEUFoQ3AXbNvj3dgZV4bsrXhcQTN3e18nJ f1LZ0fStKVmhNWUa85nR3V53pL9gGai5sutGIlaMcTbq9Epwuk3Cj7JL7x1Lf2Kn2rSOkS 975Ij9ze4xiefhs8hdNlXxGb77/K9gezkNuEPGH3am5W06BpKqPLY37og4kimOLHliJPJf lymvCWP3MU99MgEEYk1Msl25o4l+kyivkW43Sc9ZpHyt6QJ6uc2/mIzHZJNbzBM8B7eq84 76fUGeUzxL74Gfy2IOVWYJ0JHrdTdlekfsOZE00BW2h//v8My0iOX32gcXgUFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754259113; a=rsa-sha256; cv=none; b=JFEDeGVMhrlYH+GC5hjaNeFxctEYArHqSJn7J8t7b4dXjlGcipYJ5UsW9cZHfuLmOKKPtL iNPYL1cMsbh/w1TDWlE40IgAZoKekxP7B0FCAsrVKAiaaP5EzBgtAHAYVRy3nZQgaITZuO cmn57cWO11LsUXOAt6z9bHdnFXdMe5lhobLhxFFQ9IDzGDJo776RkmiSjmEWPx0ikOs7d/ pXv6SaTJGwuRGnEhica3JyxXHtFF7TsYrx3LHIR+CpUkkSdw5TPjp7VLqkjXnD7qasgQOu Cc7mtu1rnigNCPRfJxf8P9rPIpSnw40aQANDlBGqf6XZozf/krSXIN/BYcvu6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwDS93Z1Nz6Zc; Sun, 03 Aug 2025 22:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573MBria067047; Sun, 3 Aug 2025 22:11:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573MBrmQ067036; Sun, 3 Aug 2025 22:11:53 GMT (envelope-from git) Date: Sun, 3 Aug 2025 22:11:53 GMT Message-Id: <202508032211.573MBrmQ067036@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: 2daaf63d538b - main - mac: Remove uses of DEBUG_VFS_LOCKS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2daaf63d538b76b6c135c273cc17c56fac5a7535 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2daaf63d538b76b6c135c273cc17c56fac5a7535 commit 2daaf63d538b76b6c135c273cc17c56fac5a7535 Author: Mark Johnston AuthorDate: 2025-07-24 15:30:15 +0000 Commit: Mark Johnston CommitDate: 2025-08-03 21:52:23 +0000 mac: Remove uses of DEBUG_VFS_LOCKS We can assert that a vnode lock is held whenever INVARIANTS is configured. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51698 --- sys/security/mac/mac_framework.h | 2 +- sys/security/mac/mac_vfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h index 8e43f267f368..af827c33ee58 100644 --- a/sys/security/mac/mac_framework.h +++ b/sys/security/mac/mac_framework.h @@ -488,7 +488,7 @@ void mac_sysvshm_init(struct shmid_kernel *); void mac_thread_userret(struct thread *td); -#if defined(MAC) && defined(DEBUG_VFS_LOCKS) +#if defined(MAC) && defined(INVARIANTS) void mac_vnode_assert_locked(struct vnode *vp, const char *func); #else #define mac_vnode_assert_locked(vp, func) do { } while (0) diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c index a50c6f0c8f26..dc2bfa7c643b 100644 --- a/sys/security/mac/mac_vfs.c +++ b/sys/security/mac/mac_vfs.c @@ -1078,7 +1078,7 @@ vn_setlabel(struct vnode *vp, struct label *intlabel, struct ucred *cred) return (0); } -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS void mac_vnode_assert_locked(struct vnode *vp, const char *func) { From nobody Sun Aug 3 22:11:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwDSC1w6sz63tjZ; Sun, 03 Aug 2025 22:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwDSB5840z3sgQ; Sun, 03 Aug 2025 22:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mypNa5KPGR7deth1mzBpQSY6UqGMLQvn32HF/cexif8=; b=cJIw0fVjxV1u2OmpQcKVLyXs4+qD9jkoraUc8U/uyUZ8TVrdB1iFFiy+66WyvbYVl9OH29 z2At3qpyyJk7wdoMVFmFst6KSI8aerI8QnMPsa2H6MHONqXsHjH+HHYZeerytW9XUwydeD hlUx7g6xIVbYxZ48BHlsstP4zTwzzGFTMoBVmKea1kmXfE4zBlTuY2Jx1FPmybo/OJEVWH uCvZ5MrVfShl1HLbV3zPXX7HxJS3eblg78Y12O8+fw+H1JD5/ajkrl6awL5VsrzsWKmSf4 lRC3t33n/sf5VZLiwKIXbscRCScSEoay2KST8BscCZkvm5BhlHa1M6UilAAwcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754259114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mypNa5KPGR7deth1mzBpQSY6UqGMLQvn32HF/cexif8=; b=LsFi9/YeOGfifbaGKLHpBa60nJthxq+rOgXSJcYamMTH0JhDVRiZ1yYAc9IyosAVMB/dX1 RKwXOtNPNrToa5ip3yQl4Fiy8pZwcBmr3aVdm+soztbJRiRok0cZlvkTtmXldQry0p/mCG unT65BLiJscpzhFo/0NWV/2gNLFyjnv2KWibkJ5m2sqna0ll5F4+opp2pPUfUPBcZNOQXx TmnnaMl3BHRDLeXM+Akmo2FsOHgWAGc/eeetny45xoeCMsqGaZ+v1dRCSE5edd/XZZBS8g eo9/C2FL1QsZ0Tk1/BhbK+3pUXB+jXARxSTp5spPNXs0nWBEZHS8myNVCgYXuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754259114; a=rsa-sha256; cv=none; b=yhp4W9ofsqazUc6RR0b5pbf62qLcAuSKflO8s94wIkl6JYP/qiHkZLgk6pnVP969eQxlkS oTBB/Lt2aZ2/qwGllLXTPG06krfawrBLE5vR8YwlmNwzmcQIQ55iqmDVkHMVLXeypY/ldN 56VGgAD9QohbPuyJIft99qX04uHiIJY59pphkgDGZXpT3O6h13oZmxnFQnSOEuXsP3KPH0 kFZqKqUNBGznM1pBkphcXwGieeWdnABND3IHHd8TmOXGEaRIb9o2cAEZjQkYLObMkFt8Ux O8UBEf8GBuSgepxdhFElgw1s+UMqHkU/yp/FvxS+P97c8T+2EWPt5cZy6/4jhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwDSB4YZwz6jN; Sun, 03 Aug 2025 22:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573MBskw067254; Sun, 3 Aug 2025 22:11:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573MBsTK067251; Sun, 3 Aug 2025 22:11:54 GMT (envelope-from git) Date: Sun, 3 Aug 2025 22:11:54 GMT Message-Id: <202508032211.573MBsTK067251@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: d733bca67055 - main - vnode_pager: Remove uses of DEBUG_VFS_LOCKS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: d733bca67055b6a49b4f7abe78c39188900a7720 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d733bca67055b6a49b4f7abe78c39188900a7720 commit d733bca67055b6a49b4f7abe78c39188900a7720 Author: Mark Johnston AuthorDate: 2025-07-24 16:51:10 +0000 Commit: Mark Johnston CommitDate: 2025-08-03 21:52:34 +0000 vnode_pager: Remove uses of DEBUG_VFS_LOCKS This assertion can reasonably be checked when plain INVARIANTS is configured, there's no need to configure a separate option. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51699 --- sys/vm/vnode_pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 24e3bef07f7c..de8a6c52c08f 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -502,7 +502,7 @@ vnode_pager_setsize(struct vnode *vp, vm_ooffset_t nsize) if ((object = vp->v_object) == NULL) return; -#ifdef DEBUG_VFS_LOCKS +#ifdef INVARIANTS { struct mount *mp; From nobody Sun Aug 3 23:13:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwFq20BrPz63xjS; Sun, 03 Aug 2025 23:13:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwFq16r7Wz426f; Sun, 03 Aug 2025 23:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754262797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YlLOJfK9pFwtBfboSWcuWDUCFYfKiO+9mTUibSeKnMI=; b=gdvlEu/pWpiT62JghG6d7dU2oe98+HUuvVBpxxBsieKU15Z7s4CvVIHMu8ERmw/6C6F5mt mIbgx2o6RVVJL9HLor8jUMadQGC2v13I4KfiF5OhpMg09TOuZBYYlJo5Ih9o03+ne81AWe NgENWimDywZt6odU+r5AnxB1FBPZNSI7CJvzQPw8NsG1/CxPW18GZTBxE/jj3q+GVduMJJ QVPrTKuLCCnWFCmzJOqGIco/ciehZkOt+U97sSlwovv1aCAQbfQN6wJ5hz4JLG1TAyJW6S Vm6csBLU7OFCGgyvNFHfW2exqEahR2+dguj4M8Yo3LWPVNiZPz7LFABXfSMQvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754262797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YlLOJfK9pFwtBfboSWcuWDUCFYfKiO+9mTUibSeKnMI=; b=sZKWtaUrJUe8E64zsrzJ97HrI27Q5/V7FOfehIMbnUXZy1c6oPtCKmZcc9dNCp1GCmBW3t cYOzdImNnzYy2c4+pEOXTKeSf/EJAcaAYulPwvWUjPLCziwRsIXQ4BzNkqOPKSvWTMI5Iy zgEKWuCxdD8XruM8HprK5zU2bIpOQgyAEc7klY3oJHPBzkgdT5BRlmJMpp5cV4nNwxkBu8 tFTAlrEuWU0VDSAv3K3bdv2cE/tePP14sqMWPCedaL1EmovmUvSxIzBJ7aGIwRy9/uvX2A VZSA8D0T5UWA6MLXBlFIBvVpbzUH9wbs+5Krdnh6fe3twDV8q5p+aw5iNoig/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754262797; a=rsa-sha256; cv=none; b=gqABGHsErB2sBpqgmTGbluZPp+azDSRWlGAWsTVZgCjMZTEU+EBf38L4hiG9oCYHVrPs8R WOL6jEqwokcV2Wo54Erh1y6AuPuuCfECnmdKCdRVSVSsQ29ecKJyA/Aq5VWlkRlEZx7I5T pWlNkZrqwDvuTX/MrlGGcjS/uIsfST/8vnlqQbMmzl2hN2FmKvEXzL9Q7NDWo0yY5iJdxM x6AMPii2wwVt87Y5+7VYTngtmE4SvUeY1SY3U74UKcDR8G3uUZX9wtN18YgDkZOGhE9gX0 yBPK9/HR8u8XLFDSLzj73/5waOUIVGiyua674FYc0Y35q114y4ZFxR1seZSZAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwFq16J53z7fT; Sun, 03 Aug 2025 23:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573NDHQm080384; Sun, 3 Aug 2025 23:13:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573NDH1t080381; Sun, 3 Aug 2025 23:13:17 GMT (envelope-from git) Date: Sun, 3 Aug 2025 23:13:17 GMT Message-Id: <202508032313.573NDH1t080381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: ce06c1921e0c - main - bridge: Add a vlanfilter bridge option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce06c1921e0c8f1e7999acdf371c756e80a3c709 Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=ce06c1921e0c8f1e7999acdf371c756e80a3c709 commit ce06c1921e0c8f1e7999acdf371c756e80a3c709 Author: Lexi Winter AuthorDate: 2025-08-03 22:54:59 +0000 Commit: Lexi Winter CommitDate: 2025-08-03 22:55:10 +0000 bridge: Add a vlanfilter bridge option vlanfilter was originally a per-interface flag to allow more flexible configurations where some interfaces had VLAN filtering enabled and some didn't. In practice, this just makes the configuration more confusing without any real benefit, so remove it, and make vlanfilter a bridge flag instead. Add a new bridge option "defuntagged", which sets the automatically assigned PVID for new members. If set to 0 (the default) then no PVID is assigned, which matches the current behaviour. While here, add some more atf_checks to the bridge VLAN tests to make debugging easier. Differential Revision: https://reviews.freebsd.org/D51600 --- lib/libifconfig/libifconfig.h | 2 + lib/libifconfig/libifconfig_bridge.c | 12 +++ sbin/ifconfig/ifbridge.c | 80 +++++++++++++---- sbin/ifconfig/ifconfig.8 | 33 +++---- share/man/man4/bridge.4 | 4 +- sys/net/if_bridge.c | 84 +++++++++++++++--- sys/net/if_bridgevar.h | 21 ++++- tests/sys/net/if_bridge_test.sh | 161 +++++++++++++++++++++++++---------- 8 files changed, 299 insertions(+), 98 deletions(-) diff --git a/lib/libifconfig/libifconfig.h b/lib/libifconfig/libifconfig.h index fc835485a51e..b2f0cf9744ea 100644 --- a/lib/libifconfig/libifconfig.h +++ b/lib/libifconfig/libifconfig.h @@ -69,6 +69,8 @@ struct ifconfig_bridge_status { size_t members_count; /**< how many member interfaces */ uint32_t cache_size; /**< size of address cache */ uint32_t cache_lifetime; /**< address cache entry lifetime */ + ifbr_flags_t flags; /**< bridge flags */ + ether_vlanid_t defpvid; /**< default pvid */ }; struct ifconfig_capabilities { diff --git a/lib/libifconfig/libifconfig_bridge.c b/lib/libifconfig/libifconfig_bridge.c index b4a920f488c5..675bf5dd2ff5 100644 --- a/lib/libifconfig/libifconfig_bridge.c +++ b/lib/libifconfig/libifconfig_bridge.c @@ -92,6 +92,18 @@ ifconfig_bridge_get_bridge_status(ifconfig_handle_t *h, } bridge->inner.cache_lifetime = cache_param.ifbrp_ctime; + if (ifconfig_bridge_ioctlwrap(h, name, BRDGGFLAGS, + &cache_param, sizeof(cache_param), false) != 0) { + goto err; + } + bridge->inner.flags = cache_param.ifbrp_flags; + + if (ifconfig_bridge_ioctlwrap(h, name, BRDGGDEFPVID, + &cache_param, sizeof(cache_param), false) != 0) { + goto err; + } + bridge->inner.defpvid = cache_param.ifbrp_defpvid; + if (ifconfig_bridge_ioctlwrap(h, name, BRDGPARAM, &bridge->params, sizeof(bridge->params), false) != 0) { goto err; diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 1a8c4c6e9c3e..335ed9bf513f 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -223,6 +223,11 @@ bridge_status(if_ctx *ctx) params->ifbop_root_path_cost, params->ifbop_root_port & 0xfff); + printb("\tbridge flags", bridge->flags, IFBRFBITS); + if (bridge->defpvid) + printf(" defuntagged=%u", (unsigned) bridge->defpvid); + printf("\n"); + prefix = "\tmember: "; pad = "\t "; for (size_t i = 0; i < bridge->members_count; ++i) { @@ -514,7 +519,6 @@ setbridge_deladdr(if_ctx *ctx, int argc, const char *const *argv) static void setbridge_addr(if_ctx *ctx, const char *val __unused, int dummy __unused) { - bridge_addresses(ctx, ""); } @@ -735,18 +739,6 @@ unsetbridge_private(if_ctx *ctx, const char *val, int dummy __unused) do_bridgeflag(ctx, val, IFBIF_PRIVATE, 0); } -static void -setbridge_vlanfilter(if_ctx *ctx, const char *val, int dummy __unused) -{ - do_bridgeflag(ctx, val, IFBIF_VLANFILTER, 1); -} - -static void -unsetbridge_vlanfilter(if_ctx *ctx, const char *val, int dummy __unused) -{ - do_bridgeflag(ctx, val, IFBIF_VLANFILTER, 0); -} - static int parse_vlans(ifbvlan_set_t *set, const char *str) { @@ -838,6 +830,59 @@ delbridge_tagged(if_ctx *ctx, const char *ifn, const char *vlans) set_bridge_vlanset(ctx, ifn, vlans, BRDG_VLAN_OP_DEL); } +static void +setbridge_flags(if_ctx *ctx, const char *val __unused, int newflags) +{ + struct ifbrparam req; + + if (do_cmd(ctx, BRDGGFLAGS, &req, sizeof(req), 0) < 0) + err(1, "BRDGGFLAGS"); + + req.ifbrp_flags |= (uint32_t)newflags; + + if (do_cmd(ctx, BRDGSFLAGS, &req, sizeof(req), 1) < 0) + err(1, "BRDGSFLAGS"); +} + +static void +unsetbridge_flags(if_ctx *ctx, const char *val __unused, int newflags) +{ + struct ifbrparam req; + + if (do_cmd(ctx, BRDGGFLAGS, &req, sizeof(req), 0) < 0) + err(1, "BRDGGFLAGS"); + + req.ifbrp_flags &= ~(uint32_t)newflags; + + if (do_cmd(ctx, BRDGSFLAGS, &req, sizeof(req), 1) < 0) + err(1, "BRDGSFLAGS"); +} + +static void +setbridge_defuntagged(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct ifbrparam req; + + memset(&req, 0, sizeof(req)); + if (get_vlan_id(arg, &req.ifbrp_defpvid) < 0) + errx(1, "invalid vlan id: %s", arg); + + if (do_cmd(ctx, BRDGSDEFPVID, &req, sizeof(req), 1) < 0) + err(1, "BRDGSDEFPVID"); +} + +static void +unsetbridge_defuntagged(if_ctx *ctx, const char *val __unused, int dummy __unused) +{ + struct ifbrparam req; + + memset(&req, 0, sizeof(req)); + req.ifbrp_defpvid = 0; + + if (do_cmd(ctx, BRDGSDEFPVID, &req, sizeof(req), 1) < 0) + err(1, "BRDGSDEFPVID"); +} + static struct cmd bridge_cmds[] = { DEF_CMD_ARG("addm", setbridge_add), DEF_CMD_ARG("deletem", setbridge_delete), @@ -874,8 +919,6 @@ static struct cmd bridge_cmds[] = { DEF_CMD_ARG2("ifpriority", setbridge_ifpriority), DEF_CMD_ARG2("ifpathcost", setbridge_ifpathcost), DEF_CMD_ARG2("ifmaxaddr", setbridge_ifmaxaddr), - DEF_CMD_ARG("vlanfilter", setbridge_vlanfilter), - DEF_CMD_ARG("-vlanfilter", unsetbridge_vlanfilter), DEF_CMD_ARG2("untagged", setbridge_untagged), DEF_CMD_ARG("-untagged", unsetbridge_untagged), DEF_CMD_ARG2("tagged", setbridge_tagged), @@ -884,7 +927,14 @@ static struct cmd bridge_cmds[] = { DEF_CMD_ARG("timeout", setbridge_timeout), DEF_CMD_ARG("private", setbridge_private), DEF_CMD_ARG("-private", unsetbridge_private), + DEF_CMD("vlanfilter", (int32_t)IFBRF_VLANFILTER, + setbridge_flags), + DEF_CMD("-vlanfilter", (int32_t)IFBRF_VLANFILTER, + unsetbridge_flags), + DEF_CMD_ARG("defuntagged", setbridge_defuntagged), + DEF_CMD("-defuntagged", 0, unsetbridge_defuntagged), }; + static struct afswtch af_bridge = { .af_name = "af_bridge", .af_af = AF_UNSPEC, diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 6a50a91880ef..06ec62197fba 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -2710,18 +2710,23 @@ The behaviour of these options is described in the section of .Xr bridge 4 . .Bl -tag -width indent -.It Cm vlanfilter Ar interface -Enable VLAN filtering on an interface. -.It Cm -vlanfilter Ar interface -Disable VLAN filtering on an interface. +.It Cm vlanfilter +Enable VLAN filtering on the bridge. +.It Cm -vlanfilter +Disable VLAN filtering on the bridge. +This is the default. .It Cm untagged Ar interface Ar vlan-id Set the untagged VLAN identifier for an interface. -.Pp -Setting -.Cm untagged -will automatically enable VLAN filtering on the interface. .It Cm -untagged Ar interface Ar vlan-id Clear the untagged VLAN identifier for an interface. +.It Cm defuntagged Ar vlan-id +Enable the +.Cm untagged +option by default on newly added members. +.It Cm -defuntagged +Do not enable the +.Cm untagged +option by default on newly added members. .It Cm tagged Ar interface Ar vlan-list Set the interface's VLAN access list to the provided list of VLANs. The list should be a comma-separated list of one or more VLAN IDs @@ -2733,27 +2738,15 @@ meaning the empty set, or the value .Dq all meaning all VLANs (1-4094). -.Pp -Setting -.Cm tagged -will automatically enable VLAN filtering on the interface. .It Cm +tagged Ar interface Ar vlan-list Add the provided list of VLAN IDs to the interface's VLAN access list. The list should be formatted as described for .Cm tagged . -.Pp -Setting -.Cm +tagged -will automatically enable VLAN filtering on the interface. .It Cm -tagged Ar interface Ar vlan-list Remove the provided list of VLAN IDs from the interface's VLAN access list. The list should be formatted as described for .Cm tagged . -.Pp -Setting -.Cm -tagged -will automatically enable VLAN filtering on the interface. .El .Ss Link Aggregation and Link Failover Parameters The following parameters are specific to lagg interfaces: diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 2dff393ebc29..7048df4593bf 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -36,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 5, 2025 +.Dd July 28, 2025 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -289,7 +289,7 @@ interface on the bridge and (if necessary) assign IP addresses there. By default no access control is enabled, so any interface may participate in any VLAN. .Pp -VLAN filtering may be enabled on an interface using the +VLAN filtering may be enabled on a bridge using the .Xr ifconfig 8 .Cm vlanfilter option. diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 0a35fb4095fb..46e54339a171 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -300,6 +300,8 @@ struct bridge_softc { struct ether_addr sc_defaddr; /* Default MAC address */ if_input_fn_t sc_if_input; /* Saved copy of if_input */ struct epoch_context sc_epoch_ctx; + ifbr_flags_t sc_flags; /* bridge flags */ + ether_vlanid_t sc_defpvid; /* default PVID */ }; VNET_DEFINE_STATIC(struct sx, bridge_list_sx); @@ -417,6 +419,10 @@ static int bridge_ioctl_grte(struct bridge_softc *, void *); static int bridge_ioctl_gifsstp(struct bridge_softc *, void *); static int bridge_ioctl_sproto(struct bridge_softc *, void *); static int bridge_ioctl_stxhc(struct bridge_softc *, void *); +static int bridge_ioctl_gflags(struct bridge_softc *, void *); +static int bridge_ioctl_sflags(struct bridge_softc *, void *); +static int bridge_ioctl_gdefpvid(struct bridge_softc *, void *); +static int bridge_ioctl_sdefpvid(struct bridge_softc *, void *); static int bridge_pfil(struct mbuf **, struct ifnet *, struct ifnet *, int); #ifdef INET @@ -636,6 +642,18 @@ static const struct bridge_control bridge_control_table[] = { { bridge_ioctl_gifvlanset, sizeof(struct ifbif_vlan_req), BC_F_COPYIN|BC_F_COPYOUT }, + + { bridge_ioctl_gflags, sizeof(struct ifbrparam), + BC_F_COPYOUT }, + + { bridge_ioctl_sflags, sizeof(struct ifbrparam), + BC_F_COPYIN|BC_F_SUSER }, + + { bridge_ioctl_gdefpvid, sizeof(struct ifbrparam), + BC_F_COPYOUT }, + + { bridge_ioctl_sdefpvid, sizeof(struct ifbrparam), + BC_F_COPYIN|BC_F_SUSER }, }; static const int bridge_control_table_size = nitems(bridge_control_table); @@ -1476,6 +1494,8 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) bif->bif_ifp = ifs; bif->bif_flags = IFBIF_LEARNING | IFBIF_DISCOVER; bif->bif_savedcaps = ifs->if_capenable; + if (sc->sc_flags & IFBRF_VLANFILTER) + bif->bif_pvid = sc->sc_defpvid; /* * Assign the interface's MAC address to the bridge if it's the first @@ -1941,6 +1961,9 @@ bridge_ioctl_sifpvid(struct bridge_softc *sc, void *arg) struct ifbreq *req = arg; struct bridge_iflist *bif; + if ((sc->sc_flags & IFBRF_VLANFILTER) == 0) + return (EXTERROR(EINVAL, "VLAN filtering not enabled")); + bif = bridge_lookup_member(sc, req->ifbr_ifsname); if (bif == NULL) return (EXTERROR(ENOENT, "Interface is not a bridge member")); @@ -1948,8 +1971,6 @@ bridge_ioctl_sifpvid(struct bridge_softc *sc, void *arg) if (req->ifbr_pvid > DOT1Q_VID_MAX) return (EXTERROR(EINVAL, "Invalid VLAN ID")); - if (req->ifbr_pvid != DOT1Q_VID_NULL) - bif->bif_flags |= IFBIF_VLANFILTER; bif->bif_pvid = req->ifbr_pvid; return (0); } @@ -1960,6 +1981,9 @@ bridge_ioctl_sifvlanset(struct bridge_softc *sc, void *arg) struct ifbif_vlan_req *req = arg; struct bridge_iflist *bif; + if ((sc->sc_flags & IFBRF_VLANFILTER) == 0) + return (EXTERROR(EINVAL, "VLAN filtering not enabled")); + bif = bridge_lookup_member(sc, req->bv_ifname); if (bif == NULL) return (EXTERROR(ENOENT, "Interface is not a bridge member")); @@ -1991,12 +2015,6 @@ bridge_ioctl_sifvlanset(struct bridge_softc *sc, void *arg) "Unsupported BRDGSIFVLANSET operation")); } - /* - * The only reason to modify the VLAN access list is to use VLAN - * filtering on this interface, so enable it automatically. - */ - bif->bif_flags |= IFBIF_VLANFILTER; - return (0); } @@ -2190,6 +2208,50 @@ bridge_ioctl_stxhc(struct bridge_softc *sc, void *arg) return (bstp_set_holdcount(&sc->sc_stp, param->ifbrp_txhc)); } +static int +bridge_ioctl_gflags(struct bridge_softc *sc, void *arg) +{ + struct ifbrparam *param = arg; + + param->ifbrp_flags = sc->sc_flags; + + return (0); +} + +static int +bridge_ioctl_sflags(struct bridge_softc *sc, void *arg) +{ + struct ifbrparam *param = arg; + + sc->sc_flags = param->ifbrp_flags; + + return (0); +} + +static int +bridge_ioctl_gdefpvid(struct bridge_softc *sc, void *arg) +{ + struct ifbrparam *param = arg; + + param->ifbrp_defpvid = sc->sc_defpvid; + + return (0); +} + +static int +bridge_ioctl_sdefpvid(struct bridge_softc *sc, void *arg) +{ + struct ifbrparam *param = arg; + + /* Reject invalid VIDs, but allow 0 to mean 'none'. */ + if (param->ifbrp_defpvid > DOT1Q_VID_MAX) + return (EINVAL); + + sc->sc_defpvid = param->ifbrp_defpvid; + + return (0); +} + /* * bridge_ifdetach: * @@ -2325,7 +2387,7 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m, * outgoing interface matches the VLAN ID of the frame, remove * the VLAN header. */ - if ((bif->bif_flags & IFBIF_VLANFILTER) && + if ((sc->sc_flags & IFBRF_VLANFILTER) && bif->bif_pvid != DOT1Q_VID_NULL && VLANTAGOF(m) == bif->bif_pvid) { m->m_flags &= ~M_VLANTAG; @@ -3185,7 +3247,7 @@ bridge_vfilter_in(const struct bridge_iflist *sbif, struct mbuf *m) return (false); /* If VLAN filtering isn't enabled, pass everything. */ - if ((sbif->bif_flags & IFBIF_VLANFILTER) == 0) + if ((sbif->bif_sc->sc_flags & IFBRF_VLANFILTER) == 0) return (true); if (vlan == DOT1Q_VID_NULL) { @@ -3231,7 +3293,7 @@ bridge_vfilter_out(const struct bridge_iflist *dbif, const struct mbuf *m) NET_EPOCH_ASSERT(); /* If VLAN filtering isn't enabled, pass everything. */ - if ((dbif->bif_flags & IFBIF_VLANFILTER) == 0) + if ((dbif->bif_sc->sc_flags & IFBRF_VLANFILTER) == 0) return (true); vlan = VLANTAGOF(m); diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index c458dcc152a0..6718c5ebcc34 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -127,6 +127,17 @@ #define BRDGSIFPVID 31 /* set if PVID */ #define BRDGSIFVLANSET 32 /* set if vlan set */ #define BRDGGIFVLANSET 33 /* get if vlan set */ +#define BRDGGFLAGS 34 /* get bridge flags (ifbrparam) */ +#define BRDGSFLAGS 35 /* set bridge flags (ifbrparam) */ +#define BRDGGDEFPVID 36 /* get default pvid (ifbrparam) */ +#define BRDGSDEFPVID 37 /* set default pvid (ifbrparam) */ + +/* BRDGSFLAGS, Bridge flags (non-interface-specific) */ +typedef uint32_t ifbr_flags_t; + +#define IFBRF_VLANFILTER (1U<<0) /* VLAN filtering enabled */ + +#define IFBRFBITS "\020\01VLANFILTER" /* * Generic bridge control request. @@ -161,11 +172,12 @@ struct ifbreq { #define IFBIF_BSTP_ADMEDGE 0x0200 /* member stp admin edge enabled */ #define IFBIF_BSTP_ADMCOST 0x0400 /* member stp admin path cost */ #define IFBIF_PRIVATE 0x0800 /* if is a private segment */ -#define IFBIF_VLANFILTER 0x1000 /* if does vlan filtering */ +/* was IFBIF_VLANFILTER 0x1000 */ +#define IFBIF_QINQ 0x2000 /* if allows 802.1ad Q-in-Q */ #define IFBIFBITS "\020\001LEARNING\002DISCOVER\003STP\004SPAN" \ "\005STICKY\014PRIVATE\006EDGE\007AUTOEDGE\010PTP" \ - "\011AUTOPTP\015VLANFILTER" + "\011AUTOPTP" #define IFBIFMASK ~(IFBIF_BSTP_EDGE|IFBIF_BSTP_AUTOEDGE|IFBIF_BSTP_PTP| \ IFBIF_BSTP_AUTOPTP|IFBIF_BSTP_ADMEDGE| \ IFBIF_BSTP_ADMCOST) /* not saved */ @@ -237,7 +249,10 @@ struct ifbrparam { #define ifbrp_fwddelay ifbrp_ifbrpu.ifbrpu_int8 /* fwd time (sec) */ #define ifbrp_maxage ifbrp_ifbrpu.ifbrpu_int8 /* max age (sec) */ #define ifbrp_cexceeded ifbrp_ifbrpu.ifbrpu_int32 /* # of cache dropped - * adresses */ + * addresses */ +#define ifbrp_flags ifbrp_ifbrpu.ifbrpu_int32 /* bridge flags */ +#define ifbrp_defpvid ifbrp_ifbrpu.ifbrpu_int16 /* default pvid */ + /* * Bridge current operational parameters structure. */ diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 31299c562510..534144f46632 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -919,7 +919,7 @@ vlan_pvid_body() bridge=$(vnet_mkbridge) - ifconfig ${bridge} up + ifconfig ${bridge} vlanfilter up ifconfig ${epone}a up ifconfig ${eptwo}a up ifconfig ${bridge} addm ${epone}a untagged ${epone}a 20 @@ -958,16 +958,18 @@ vlan_pvid_filtered_body() vnet_mkjail one ${epone}b vnet_mkjail two ${eptwo}b - jexec one ifconfig ${epone}b 192.0.2.1/24 up - jexec two ifconfig ${eptwo}b 192.0.2.2/24 up + atf_check -s exit:0 jexec one ifconfig ${epone}b 192.0.2.1/24 up + atf_check -s exit:0 jexec two ifconfig ${eptwo}b 192.0.2.2/24 up bridge=$(vnet_mkbridge) - ifconfig ${bridge} up - ifconfig ${epone}a up - ifconfig ${eptwo}a up - ifconfig ${bridge} addm ${epone}a untagged ${epone}a 20 - ifconfig ${bridge} addm ${eptwo}a untagged ${eptwo}a 30 + atf_check -s exit:0 ifconfig ${bridge} vlanfilter up + atf_check -s exit:0 ifconfig ${epone}a up + atf_check -s exit:0 ifconfig ${eptwo}a up + atf_check -s exit:0 ifconfig ${bridge} \ + addm ${epone}a untagged ${epone}a 20 + atf_check -s exit:0 ifconfig ${bridge} \ + addm ${eptwo}a untagged ${eptwo}a 30 atf_check -s exit:2 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 atf_check -s exit:2 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 @@ -997,18 +999,22 @@ vlan_pvid_tagged_body() vnet_mkjail two ${eptwo}b # Create two tagged interfaces on the appropriate VLANs - jexec one ifconfig ${epone}b up - jexec one ifconfig ${epone}b.20 create 192.0.2.1/24 up - jexec two ifconfig ${eptwo}b up - jexec two ifconfig ${eptwo}b.20 create 192.0.2.2/24 up + atf_check -s exit:0 jexec one ifconfig ${epone}b up + atf_check -s exit:0 jexec one ifconfig ${epone}b.20 \ + create 192.0.2.1/24 up + atf_check -s exit:0 jexec two ifconfig ${eptwo}b up + atf_check -s exit:0 jexec two ifconfig ${eptwo}b.20 \ + create 192.0.2.2/24 up bridge=$(vnet_mkbridge) - ifconfig ${bridge} up - ifconfig ${epone}a up - ifconfig ${eptwo}a up - ifconfig ${bridge} addm ${epone}a untagged ${epone}a 20 - ifconfig ${bridge} addm ${eptwo}a untagged ${eptwo}a 20 + atf_check -s exit:0 ifconfig ${bridge} vlanfilter up + atf_check -s exit:0 ifconfig ${epone}a up + atf_check -s exit:0 ifconfig ${eptwo}a up + atf_check -s exit:0 ifconfig ${bridge} \ + addm ${epone}a untagged ${epone}a 20 + atf_check -s exit:0 ifconfig ${bridge} \ + addm ${eptwo}a untagged ${eptwo}a 20 # Tagged frames should not be passed. atf_check -s exit:2 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 @@ -1042,18 +1048,20 @@ vlan_pvid_1q_body() # This forces the bridge to add and remove .1q tags to bridge the # traffic. - jexec one ifconfig ${epone}b 192.0.2.1/24 up - jexec two ifconfig ${eptwo}b up - jexec two ifconfig ${eptwo}b.20 create 192.0.2.2/24 up + atf_check -s exit:0 jexec one ifconfig ${epone}b 192.0.2.1/24 up + atf_check -s exit:0 jexec two ifconfig ${eptwo}b up + atf_check -s exit:0 jexec two ifconfig ${eptwo}b.20 create 192.0.2.2/24 up bridge=$(vnet_mkbridge) - ifconfig ${bridge} addm ${epone}a untagged ${epone}a 20 - ifconfig ${bridge} addm ${eptwo}a + atf_check -s exit:0 ifconfig ${bridge} vlanfilter up + atf_check -s exit:0 ifconfig ${bridge} \ + addm ${epone}a untagged ${epone}a 20 + atf_check -s exit:0 ifconfig ${bridge} addm ${eptwo}a \ + tagged ${eptwo}a 20 - ifconfig ${bridge} up - ifconfig ${epone}a up - ifconfig ${eptwo}a up + atf_check -s exit:0 ifconfig ${epone}a up + atf_check -s exit:0 ifconfig ${eptwo}a up atf_check -s exit:0 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 atf_check -s exit:0 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 @@ -1085,18 +1093,20 @@ vlan_filtering_body() vnet_mkjail one ${epone}b vnet_mkjail two ${eptwo}b - jexec one ifconfig ${epone}b up - jexec one ifconfig ${epone}b.20 create 192.0.2.1/24 up - jexec two ifconfig ${eptwo}b up - jexec two ifconfig ${eptwo}b.20 create 192.0.2.2/24 up + atf_check -s exit:0 jexec one ifconfig ${epone}b up + atf_check -s exit:0 jexec one ifconfig ${epone}b.20 \ + create 192.0.2.1/24 up + atf_check -s exit:0 jexec two ifconfig ${eptwo}b up + atf_check -s exit:0 jexec two ifconfig ${eptwo}b.20 \ + create 192.0.2.2/24 up bridge=$(vnet_mkbridge) - ifconfig ${bridge} up - ifconfig ${epone}a up - ifconfig ${eptwo}a up - ifconfig ${bridge} addm ${epone}a vlanfilter ${epone}a - ifconfig ${bridge} addm ${eptwo}a vlanfilter ${eptwo}a + atf_check -s exit:0 ifconfig ${bridge} vlanfilter up + atf_check -s exit:0 ifconfig ${epone}a up + atf_check -s exit:0 ifconfig ${eptwo}a up + atf_check -s exit:0 ifconfig ${bridge} addm ${epone}a + atf_check -s exit:0 ifconfig ${bridge} addm ${eptwo}a # Right now there are no VLANs on the access list, so everything # should be blocked. @@ -1116,15 +1126,15 @@ vlan_filtering_body() atf_check -s exit:0 ifconfig ${bridge} -untagged ${eptwo}a # Add VLANs 10-30 to the access list; now access should be allowed. - ifconfig ${bridge} +tagged ${epone}a 10-30 - ifconfig ${bridge} +tagged ${eptwo}a 10-30 + atf_check -s exit:0 ifconfig ${bridge} +tagged ${epone}a 10-30 + atf_check -s exit:0 ifconfig ${bridge} +tagged ${eptwo}a 10-30 atf_check -s exit:0 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 atf_check -s exit:0 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 # Remove vlan 20 from the access list, now access should be blocked # again. - ifconfig ${bridge} -tagged ${epone}a 20 - ifconfig ${bridge} -tagged ${eptwo}a 20 + atf_check -s exit:0 ifconfig ${bridge} -tagged ${epone}a 20 + atf_check -s exit:0 ifconfig ${bridge} -tagged ${eptwo}a 20 atf_check -s exit:2 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 atf_check -s exit:2 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 } @@ -1151,9 +1161,10 @@ vlan_ifconfig_tagged_body() ep=$(vnet_mkepair) bridge=$(vnet_mkbridge) + atf_check -s exit:0 ifconfig ${bridge} vlanfilter up - ifconfig ${bridge} addm ${ep}a vlanfilter ${ep}a up - ifconfig ${ep}a up + atf_check -s exit:0 ifconfig ${bridge} addm ${ep}a + atf_check -s exit:0 ifconfig ${ep}a up # To start with, no vlans should be configured. atf_check -s exit:0 -o not-match:"tagged" ifconfig ${bridge} @@ -1210,18 +1221,20 @@ vlan_svi_body() vnet_mkjail one ${epone}b - jexec one ifconfig ${epone}b up - jexec one ifconfig ${epone}b.20 create 192.0.2.1/24 up + atf_check -s exit:0 jexec one ifconfig ${epone}b up + atf_check -s exit:0 jexec one ifconfig ${epone}b.20 \ + create 192.0.2.1/24 up bridge=$(vnet_mkbridge) - ifconfig ${bridge} up - ifconfig ${epone}a up - ifconfig ${bridge} addm ${epone}a tagged ${epone}a 20 + atf_check -s exit:0 ifconfig ${bridge} vlanfilter up + atf_check -s exit:0 ifconfig ${epone}a up + atf_check -s exit:0 ifconfig ${bridge} addm ${epone}a \ + tagged ${epone}a 20 svi=$(vnet_mkvlan) - ifconfig ${svi} vlan 20 vlandev ${bridge} - ifconfig ${svi} inet 192.0.2.2/24 up + atf_check -s exit:0 ifconfig ${svi} vlan 20 vlandev ${bridge} + atf_check -s exit:0 ifconfig ${svi} inet 192.0.2.2/24 up atf_check -s exit:0 -o ignore ping -c 3 -t 1 192.0.2.1 } @@ -1311,6 +1324,59 @@ bridge_svi_in_bridge_cleanup() vnet_cleanup } +atf_test_case "vlan_defuntagged" "cleanup" +vlan_defuntagged_head() +{ + atf_set descr 'defuntagged (defpvid) bridge option' + atf_set require.user root +} + +vlan_defuntagged_body() +{ + vnet_init + vnet_init_bridge + + bridge=$(vnet_mkbridge) + atf_check -s exit:0 ifconfig ${bridge} vlanfilter + + # Invalid VLAN IDs + atf_check -s exit:1 -ematch:"invalid vlan id: 0" \ + ifconfig ${bridge} defuntagged 0 + atf_check -s exit:1 -ematch:"invalid vlan id: 4095" \ + ifconfig ${bridge} defuntagged 4095 + atf_check -s exit:1 -ematch:"invalid vlan id: 5000" \ + ifconfig ${bridge} defuntagged 5000 + + # Check the bridge option is set and cleared correctly + atf_check -s exit:0 -onot-match:"defuntagged=" \ + ifconfig ${bridge} + + atf_check -s exit:0 ifconfig ${bridge} defuntagged 10 + atf_check -s exit:0 -omatch:"defuntagged=10$" \ + ifconfig ${bridge} + + atf_check -s exit:0 ifconfig ${bridge} -defuntagged + atf_check -s exit:0 -onot-match:"defuntagged=" \ + ifconfig ${bridge} + + # Check the untagged option is correctly set on a member + atf_check -s exit:0 ifconfig ${bridge} defuntagged 10 + + epair=$(vnet_mkepair) + atf_check -s exit:0 ifconfig ${bridge} addm ${epair}a + + tag=$(ifconfig ${bridge} | sed -Ene \ + "/member: ${epair}a/ { N;s/.*untagged ([0-9]+).*/\\1/p;q; }") + if [ "$tag" != "10" ]; then + atf_fail "wrong untagged vlan: ${tag}" + fi +} + +vlan_defuntagged_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -1338,5 +1404,6 @@ atf_init_test_cases() atf_add_test_case "vlan_ifconfig_tagged" atf_add_test_case "vlan_svi" atf_add_test_case "vlan_qinq" + atf_add_test_case "vlan_defuntagged" atf_add_test_case "bridge_svi_in_bridge" } From nobody Sun Aug 3 23:13:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwFq32klLz63y7Y; Sun, 03 Aug 2025 23:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwFq30WG0z42Gc; Sun, 03 Aug 2025 23:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754262799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X1Tg4kOD/yykr1mh2b5F7T91OYiDqJmlDBtDFC5q4Sc=; b=edN9RaGk1M2dbuNhpq9puF+67RaB9ZXjDokbM80HeKltqgQmQFZGmn+0nW0SByxCl1oFS7 7F5Oj7Fyec+eXINnhjO8wp7qW97lgFo8qNEpE+zr7/cuJmwGsJMxGULEH3Edu8fahg/CWA bva9whfp5+XfYznVvEwvuFPv4Z6EBk5K5RZkNqV7L4dwtoumsnDNiPizLbTUAiSSyXUh8+ MvZ7emcgygpstubIrl0ozIKWtnUsBrHleVpqfCz7caGv7rcQrrtLarQZm84/YIBn58kbaK E3McOUCB2jiZxpIXtwwAvpNqaFgNZaLzox65vTv3+uran/jjdaJq3e/scFTYAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754262799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X1Tg4kOD/yykr1mh2b5F7T91OYiDqJmlDBtDFC5q4Sc=; b=GTylm+/WvN3aiTU8LuFVSg7h5SYAJX/oMKiEUDJc8x4K3P2jrE9ePZa46OnzSANnuczzTt Ka6NTPlamPixZ5ENuwDe2O1WqMJoAxCyfZkMtbYJpThLboOq+pND8NWvnvZa0WBg1j93iQ srhz1S0zGqEnnZ49/LVTY42Vpvto2uOnXqwJ+SKg8d1UzkV4HFa7lxQNj4lW5xUCGVSaF8 JyB6MhdjMLQ+pttNj/DA4DKna8Vsn+8JU1kEm2xNINiMROrD21eSN1EcBKc3WTXneGlUvA FTnHSDxEtQireMFYPhxuDkmTievjdJowPuvoee9G27jf79ZWygeAI2sH2VCz+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754262799; a=rsa-sha256; cv=none; b=yExX3/oqRZs4/ggcDuEPcvOIA+UiiZunBR2Yq4NdaMuF90DTSzcDII0c0ebihUdvW3Bu+a 2tYFv4+ykPbz8A/mysxX9wQojaDWq9lCxj482shRAmxO1c3VqPeN1qqzyl8y2wP5NME7kw Us4BsogSbYG+KMX2nJTupnJlg1TX5BLMiDYoo3Rcb6gyNvvb8is8QAxHyweYKQnkc95F9G cO0JIumzcvsAK1bQjAGNuE8NEqxnjOdYhV2SC9avmoZ1RCF2IQnR6L1cwCut8zRdmN+US7 T5+P7ySh8WApNRRugrt3SjjmfopI+y6YUGdMzytQUrgr1XNodQlvo7fz48lOdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwFq3069rz8F1; Sun, 03 Aug 2025 23:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573NDIDw080418; Sun, 3 Aug 2025 23:13:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573NDIPD080415; Sun, 3 Aug 2025 23:13:18 GMT (envelope-from git) Date: Sun, 3 Aug 2025 23:13:18 GMT Message-Id: <202508032313.573NDIPD080415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 624b7beed5ac - main - kadm5: add -Wno-alloc-size-larger-than List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 624b7beed5ac03da09effa8370909a30e43a8dad Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=624b7beed5ac03da09effa8370909a30e43a8dad commit 624b7beed5ac03da09effa8370909a30e43a8dad Author: Lexi Winter AuthorDate: 2025-08-03 22:56:37 +0000 Commit: Lexi Winter CommitDate: 2025-08-03 22:56:37 +0000 kadm5: add -Wno-alloc-size-larger-than This trips the gcc build in kadm5/srv/svr_principal.c: /home/ivy/src/bsd/gcc/crypto/krb5/src/lib/kadm5/srv/svr_principal.c: In function 'apply_keysalt_policy': /home/ivy/src/bsd/gcc/crypto/krb5/src/lib/kadm5/srv/svr_principal.c:208:14: error: argument 1 range [2147483648, 4294967295] exceeds maximum object size 2147483647 [-Werror=alloc-size-larger-than=] 208 | subset = calloc(n_ks_tuple, sizeof(*subset)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Differential Revision: https://reviews.freebsd.org/D51577 --- krb5/lib/kadm5srv/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/krb5/lib/kadm5srv/Makefile b/krb5/lib/kadm5srv/Makefile index e0ec557a3f5b..6e66fd433f52 100644 --- a/krb5/lib/kadm5srv/Makefile +++ b/krb5/lib/kadm5srv/Makefile @@ -46,6 +46,7 @@ CFLAGS+=-I${KRB5_DIR}/lib \ -I${KRB5_OBJTOP}/lib/gssapi \ -I${KRB5_DIR}/lib/gssapi/krb5 \ -I${KRB5_DIR}/lib/gssapi/generic +CWARNFLAGS+=-Wno-alloc-size-larger-than HDRDIR= ${KRB5_OBJHDR}/kadm5 HDRS= ${HDRDIR}/admin.h \ From nobody Sun Aug 3 23:13:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwFq45cpXz63xpq; Sun, 03 Aug 2025 23:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwFq41LTVz4228; Sun, 03 Aug 2025 23:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754262800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mcTDdweHdZOerm6zbpj4yGy7F+MdeOIQpND+Ifr7w6s=; b=CffoGLryWjU66epkLQytrWjcVnot5w639IzdGGcH5WDbYtQg2tjANkOxZj9dwdRDS1Qaom FIMl8E2O+Wypy8a4SiNZZXcJrnUo7bnm9LCpnaBRIENPSqCaTpQJ2/4mbenAbhZRLD1kae z3mql9GimV7wEvtRJ/iS51O7tAFjraL1cxGy+g8+pucxdrOo6ZXfx7ZyXvZZ6nv/BR0i3Y OO5xwgvVviZIjeSUAkQIe6W7/lhZAX8CBqbSwcWJvo1m/YqQLu4VQvuGrMcXnrdpuSdtnA 3A2VbsaeUBkk0bfZR2iOg+D3MkYuqSJ/UqoUeS1IjEs3gpoyp5v2Rj+0kf1RMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754262800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mcTDdweHdZOerm6zbpj4yGy7F+MdeOIQpND+Ifr7w6s=; b=IkRQJF3pss8NfTHRJsYEdxBc9shv+CLw3zDO9L2b/tXHu/w0VpUFf0H6bwDYki7UT4sqE2 kXjZueMrPGwFvF6vIjKKD3FS+/JRYazpNYql3dvjIfcC0WwAHsPMck9NJilNixMgjzn6rz 6WTltO19HJuG/bgKmlUSocXWaENk5H+268nlqoil4Q+L4FNQ5Uo8xg7ZSFbEpXFuaIffd6 THmzIkaXzThHy2ioGd+sJbwYpMlHJ8FKbfH8xEt3iEUi8aMsrOjZNmUfCRUL3hmIGBzb7h KTGwb3tdnd5mjSm9EiAGrP1r2FNK1x56zeRKz+iVJ0yARDCjIbB4ncVCpUHSMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754262800; a=rsa-sha256; cv=none; b=IDfMUkeO/BsdFzW6iwKZGk+q1R0Ed49/HIVfO0A66fiyK1zcYkByB+jR6ZjZJ2s84zBRuP rePIdjRDCeUm1as1w+dwtuh+F2MpEQ1yxanolIs3n0C3k+c6KGzIEHsAWpS36NN+kIymm2 UU36/bThEYxc+pcJz2q1yvHrgY6vt0CgrVeH5gB1fulQVNVkb09+O3CxW3lZICm2i20uaN y18OoR7T4l7lU8um0A2udNhvTsYb2LG4Uu3RtitGlrpndBiBRhI4zQsVFssmsP5VtEZfzC qrRE7bU1tB6Wz/CVxo37ki4KUPKjPMkWrY/M+3w0IhNIIpzNOOX5IZj8OwgUVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bwFq40x5qz7fV; Sun, 03 Aug 2025 23:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 573NDKtF080451; Sun, 3 Aug 2025 23:13:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 573NDKol080448; Sun, 3 Aug 2025 23:13:20 GMT (envelope-from git) Date: Sun, 3 Aug 2025 23:13:20 GMT Message-Id: <202508032313.573NDKol080448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 37056594f0ef - main - bsdconfig: Move to -bsdconfig package List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37056594f0ef82a458ef9aab2e183224948364bb Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=37056594f0ef82a458ef9aab2e183224948364bb commit 37056594f0ef82a458ef9aab2e183224948364bb Author: Lexi Winter AuthorDate: 2025-08-03 22:57:07 +0000 Commit: Lexi Winter CommitDate: 2025-08-03 23:13:03 +0000 bsdconfig: Move to -bsdconfig package Now that rc.subr(8) no longer depends on sysrc(8), bsdconfig does not need to be part of -utilities. Move it to a -bsdconfig package. Differential Revision: https://reviews.freebsd.org/D51543 --- UPDATING | 5 +++++ release/packages/ucl/bsdconfig-all.ucl | 5 +++++ usr.sbin/bsdconfig/Makefile | 2 ++ usr.sbin/bsdconfig/Makefile.inc | 1 + usr.sbin/bsdconfig/console/Makefile.inc | 1 + usr.sbin/bsdconfig/diskmgmt/Makefile.inc | 1 + usr.sbin/bsdconfig/docsinstall/Makefile.inc | 1 + usr.sbin/bsdconfig/dot/Makefile.inc | 1 + usr.sbin/bsdconfig/includes/Makefile.inc | 1 + usr.sbin/bsdconfig/mouse/Makefile.inc | 1 + usr.sbin/bsdconfig/networking/Makefile.inc | 1 + usr.sbin/bsdconfig/packages/Makefile.inc | 1 + usr.sbin/bsdconfig/password/Makefile.inc | 1 + usr.sbin/bsdconfig/security/Makefile.inc | 1 + usr.sbin/bsdconfig/share/Makefile.inc | 1 + usr.sbin/bsdconfig/startup/Makefile.inc | 1 + usr.sbin/bsdconfig/timezone/Makefile.inc | 1 + usr.sbin/bsdconfig/ttys/Makefile.inc | 1 + usr.sbin/bsdconfig/usermgmt/Makefile.inc | 1 + usr.sbin/sysrc/Makefile | 1 + 20 files changed, 29 insertions(+) diff --git a/UPDATING b/UPDATING index 55cb4181ce30..60c974198934 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20250804: + bsdconfig (including sysrc(8)) has moved to the new bsdconfig + package. If you use pkgbase and wish to use bsdconfig, you should + install FreeBSD-bsdconfig. + 20250730: The usbhid(4) USB HID driver is now enabled by default, and will be used in preference to other USB HID drivers like ukbd(4), ums(4), and diff --git a/release/packages/ucl/bsdconfig-all.ucl b/release/packages/ucl/bsdconfig-all.ucl new file mode 100644 index 000000000000..7ffe7ccff9d8 --- /dev/null +++ b/release/packages/ucl/bsdconfig-all.ucl @@ -0,0 +1,5 @@ +comment = "System configuration utility" +desc = < +PACKAGE= bsdconfig + SUBDIR= console \ diskmgmt \ docsinstall \ diff --git a/usr.sbin/bsdconfig/Makefile.inc b/usr.sbin/bsdconfig/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/console/Makefile.inc b/usr.sbin/bsdconfig/console/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/console/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/diskmgmt/Makefile.inc b/usr.sbin/bsdconfig/diskmgmt/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/diskmgmt/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/docsinstall/Makefile.inc b/usr.sbin/bsdconfig/docsinstall/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/docsinstall/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/dot/Makefile.inc b/usr.sbin/bsdconfig/dot/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/dot/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/includes/Makefile.inc b/usr.sbin/bsdconfig/includes/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/includes/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/mouse/Makefile.inc b/usr.sbin/bsdconfig/mouse/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/mouse/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/networking/Makefile.inc b/usr.sbin/bsdconfig/networking/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/usr.sbin/bsdconfig/networking/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/usr.sbin/bsdconfig/packages/Makefile.inc b/usr.sbin/bsdconfig/packages/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/usr.sbin/bsdconfig/packages/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/usr.sbin/bsdconfig/password/Makefile.inc b/usr.sbin/bsdconfig/password/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/usr.sbin/bsdconfig/password/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/usr.sbin/bsdconfig/security/Makefile.inc b/usr.sbin/bsdconfig/security/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/security/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/share/Makefile.inc b/usr.sbin/bsdconfig/share/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/usr.sbin/bsdconfig/share/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/usr.sbin/bsdconfig/startup/Makefile.inc b/usr.sbin/bsdconfig/startup/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/usr.sbin/bsdconfig/startup/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/usr.sbin/bsdconfig/timezone/Makefile.inc b/usr.sbin/bsdconfig/timezone/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/usr.sbin/bsdconfig/timezone/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/usr.sbin/bsdconfig/ttys/Makefile.inc b/usr.sbin/bsdconfig/ttys/Makefile.inc new file mode 100644 index 000000000000..156c588eb3de --- /dev/null +++ b/usr.sbin/bsdconfig/ttys/Makefile.inc @@ -0,0 +1 @@ +PACKAGE= bsdconfig diff --git a/usr.sbin/bsdconfig/usermgmt/Makefile.inc b/usr.sbin/bsdconfig/usermgmt/Makefile.inc new file mode 100644 index 000000000000..01b5f23410c8 --- /dev/null +++ b/usr.sbin/bsdconfig/usermgmt/Makefile.inc @@ -0,0 +1 @@ +.include "../Makefile.inc" diff --git a/usr.sbin/sysrc/Makefile b/usr.sbin/sysrc/Makefile index e1f48f2af97b..bad50caf2ffc 100644 --- a/usr.sbin/sysrc/Makefile +++ b/usr.sbin/sysrc/Makefile @@ -1,5 +1,6 @@ .include +PACKAGE= bsdconfig SCRIPTS= sysrc MAN= sysrc.8 From nobody Sun Aug 3 23:54:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bwGkV6xzwz63GKW; Sun, 03 Aug 2025 23:54:26 +0000 (UTC) (envelope-from ivy@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bwGkV5bSdz47dY; Sun, 03 Aug 2025 23:54:26 +0000 (UTC) (envelope-from ivy@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754265266; 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=5p+xZamcVtiB4e+OO1ccM90OjRKnGW84IE59ASM1BZw=; b=Ipzo/Q6q2desGL0m0lsDG2FpPRnxOWN7G1S5ShjA22p/4MQ2TGqSJZDRFR4gnrjaifmy2E jJCKSH0Ga/gJV9UnEajebDXuAvyNz5gSdqfilMfWh2ASyZebzHa98E+LxaIBDUDyflMXQd SwFUBYSBvcSLDLLUHPKMrxJ1yor/mXO5HnsbWzgjyBq+Zr6nAZ8m9CQ17cEZYIen1ypTie 0lqwu1pICzcNSbsfh1dizwSAeB3EzJNnorPB5GiSk15ksXTT7qS7vSw9PHkJWem3EUvLBM ZfFyIQFg76BZmHdBCtsrrxOwpYHSZpUGlmSV/2aCkueoA58CqUnl/URbB+5E8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754265266; 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=5p+xZamcVtiB4e+OO1ccM90OjRKnGW84IE59ASM1BZw=; b=iQDaGP29tYTJL2EdrmLI/9QAmxn3jhHITDMX2JoX2xa5ds/pHc047FsvChez+VsfbVnPkg FBepboRQjmo5eijcuyQzd6o1dN6V7wG2dSI+ILPWz9izBplj/qxZYjwblcMhWNYAuPMnyH 09GNLgAaga6DZApC5vNE0poH5PijIWxBmnDkKeo2avFzc/Wwqu3PNP0mLOCjM0dLTZJByn xT+hyMHrJakBzipswhmLXGI3UM560C1mJIsRa0oFast8FUoknIVT1qRgDkL/KUC2nw9j6y HnOjE1m50iIN4QtM58VktCp6oBnlqtd4pCfz9bqBkAYSh/2Vj6f6Ow6+ZItGhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754265266; a=rsa-sha256; cv=none; b=WP1P0myQMwmxih/EKWCXWC102LPdYHg6Ce/TL7AkSuN5d5otCSNk4cIPsqX/jQDtvS2l2h szq0/QX5T/tDgDiZTk9O/PolhKXzkH/u0yt6XWj7Z8sLg8xp6leS7QODxvUh0TEocLYKFc gZlpSXL3XoBYJsm6kgQVvVqzkTs1lh+cMrrpQyPY1oIFhtHnaQr3SsAD+ucQSELkmDF7+U Yg6j21IZkpCh0xcJXAaQRGOmTlG5QoUOLL+yqSimB5WdUFzPcN4jR08sDD7xpWodTCARZy FLLjK6pZYNEwn0A8aYhVxG1oBPmrHmpc20V/y0OCKzNwDQ88D0a7SYRV451pvA== Received: by freefall.freebsd.org (Postfix, from userid 1532) id A7AC5956C; Sun, 03 Aug 2025 23:54:26 +0000 (UTC) Date: Mon, 4 Aug 2025 00:54:26 +0100 From: Lexi Winter To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Cc: current@freebsd.org Subject: Re: git: 624b7beed5ac - main - kadm5: add -Wno-alloc-size-larger-than Message-ID: Mail-Followup-To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, current@freebsd.org References: <202508032313.573NDIPD080415@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vWDCtN1Dba5tw2zF" Content-Disposition: inline In-Reply-To: <202508032313.573NDIPD080415@gitrepo.freebsd.org> --vWDCtN1Dba5tw2zF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Lexi Winter: > kadm5: add -Wno-alloc-size-larger-than this broke main on clang. i am very sorry about that, i am about to commit a fix once the test build finishes here.=20 --vWDCtN1Dba5tw2zF Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSyjTg96lp3RifySyn1nT63mIK/YAUCaI/2rgAKCRD1nT63mIK/ YNAZAP4j+qyNeZSXlne0bVmAVk2zGpPzoVj3n80rvsTg8RftuQEAptFNsHMSSSeM utV7//8hRdAi9kRsl6vs5Hx9xXzAtQI= =BnsH -----END PGP SIGNATURE----- --vWDCtN1Dba5tw2zF--