From nobody Mon Jul 28 01:13:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="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:46:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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:54:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brQrP3VSlz63K3y for ; Mon, 28 Jul 2025 17:46:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 4brQrP0NT7z3l67 for ; Mon, 28 Jul 2025 17:46:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-b34a78bb6e7so3951612a12.3 for ; Mon, 28 Jul 2025 10:46:13 -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=dVyS55t5d3ofjISHJdTr8kA/h6J9ExYAmp64+xD7XEt5BZfyVS/WNlaVYD6UdbaE1L tMPGr7JDQXcOXMhe40QPlxxtgcu51JbXj/r/JV3XMnvI3hf52KbTizC2GHhykrmVOyzZ N0dePYkb7qyDx9udECTVQWAkLPOLYoBLNbt2hK3+pZmDfmvYMVi0I4xXbkjAVownTw8S Apx5wBX+UA+2yApQf+F6bvb+B4JIjCc2X9ckG62EEeKe3EdNEDu/5QiW2dRyHY1E61Wj yYSWgg/6WGoQZOeVAez/kv/x149U8oSBGJ06gDM5wW0kRzwUSZ6M9FhjK9eDW/sglsPE uqWw== X-Forwarded-Encrypted: i=1; AJvYcCVom0/7gnHyA1IkXXxyhaAvHIdlERRmdXhrKw+2qPZ/IE7onBQTjALjJsg14ljP83hRFKj24joSCLjtoMHnyAAaLE21pQ==@freebsd.org X-Gm-Message-State: AOJu0YyUnX6bD3YE9bgsJpyKEZVgxnmfyoV6PJIvINQitYhLpG74V2/H HxUGfPuQ4Bo9gJjgPx9N9AWwD+eOhQxoaHJoid9jvLOHyugTrPnpubOPpLCA+A60iuyzUDqiOTJ zMyvnhspBJdnZBbRullGjoTGNHYOa7yASaOBWnIQVKQ== X-Gm-Gg: ASbGnctkCDbOHlOHIyg28Vc9T3BOMgmIwmA952WbaLSjwo85i++PE/Gkcdw9mUHZr0B dS+Dq54wiIn1Oa9hKrE1V3kTj77UHbHN149c1yw3bP+VJmpaIRb7Tb/MveHkLJzIlOJkh60n5Ld Q30BTGUgtp4b0UzzRtIyz64D/yinqTng7T1E3gWz0L2q6Q/3o4kDbMr2lU+7lFuclmzrRYu1V/V Sa30Q== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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: 4brQrP0NT7z3l67 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brTQQ2tMDz63QCv for ; Mon, 28 Jul 2025 19:42:22 +0000 (UTC) (envelope-from kevin.bowling@kev009.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 4brTQP6ttVz3xFk for ; Mon, 28 Jul 2025 19:42:21 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-4ab814c4f2dso89253061cf.1 for ; Mon, 28 Jul 2025 12:42:21 -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=rTgjxvU59dHZ8u/oOAk9w0T3qSE4Yw1XfrBOFoOO7HL94qGVlngkBgFbYti7kWRPJK 0NT0gpXmEV4fcebiMTXA8wwX8442HDzEDOU1bnuftXfvKOP+ElNmtl8JSIf1b2eHlY/1 66n1jW52X4IHv3Gs6wmiTq75E7eBzm9iRDAvnznx4V6SOMKd9wF/izE0pt4rP/gv02k5 NWrQQVSXYqiUa1gc29PFib/xLpAe+dCiNr+qE+7SpeJvyHM+vP3Xi0lUBdLBys1tFeaI UWR8ILbtUr2Slk1MeOP4ALOgQpKC6/Os+3BM4RQR4x3zAeDuUPTgQpZeWj6xpc1bzsJr /ZRw== X-Forwarded-Encrypted: i=1; AJvYcCU85zMKRXwTOySQ4ZXtPsrjkxfVCI3/Q68qSXDEw+CZZe0UYAzlv+Ei6g+AFGFPxJUfllbrMF8Cmgnfq+lpaBmJPHtzZQ==@freebsd.org X-Gm-Message-State: AOJu0YxRbrkPzPRLUO54/ST4jpz0i0+/4N7YmREkYq2qqB62dUQFEkLc u241Qttm54uH8KQyfM3Ff2Oas69Qnd1D9ZleJsgqOTdDGqUrdj80SF1rFG2Rx4pegclXifDrGms p0tjFqm2mynTW9EAQKlubHUtQiucESZjb11t0m0A0 X-Gm-Gg: ASbGncsRwdCjAO8JERkJnvLz1biM1ByzGsvfLXcVuCSA1+F787cu5VnvGi5az9g/921 mAh4YMlxo0GVvUXekWoIDhFxTYIVWkWOfUBRYmkoAkrB/sV58TJkw2O4dT6s61/Ttas8nbGQtDr U851uuYhHeN8rkQIPNZqxrWK3LJgjWHZZz6YGRrDo44hojEH+gBu6L3cLx7EPmcTakilVKNB+B/ m628mOTZ+3LGRc91wE= 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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: 4brTQP6ttVz3xFk 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 21:20:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brWcW4msWz63VDj for ; Mon, 28 Jul 2025 21:21:15 +0000 (UTC) (envelope-from pikolasikolatest2@gmail.com) Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) (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 4brWcV5T7vz46sc for ; Mon, 28 Jul 2025 21:21:14 +0000 (UTC) (envelope-from pikolasikolatest2@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=LOB53Y9R; spf=pass (mx1.freebsd.org: domain of pikolasikolatest2@gmail.com designates 2607:f8b0:4864:20::b42 as permitted sender) smtp.mailfrom=pikolasikolatest2@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-yb1-xb42.google.com with SMTP id 3f1490d57ef6-e8e21bbd736so747630276.3 for ; Mon, 28 Jul 2025 14:21:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753737672; x=1754342472; darn=freebsd.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=kIX5S/IYN1UD5lUVG8s/g1vqb82wrjrrTZCP1v00aeo=; b=LOB53Y9RmO/Y1kjZ1UY39dXbyHVYszNmgqLMV4bbZiK36y01LBsSz7vzPng9i9vTUu eHiE1UOwp/Ws5GgwBCloQ79HGK6nnE0ayxeZWUEwZV0vTLPHCU4uxvKGtmTwQbHwOCji tGaEj7HdhKQvnQ5jvJHbl4iqr55pPAWyOwUf0ClG0FYwUegu17JLd8mvzUZO3csv2JZh QervsY5wDcoHrCNKoUqz1hS6JsW6wDSZvWpaWs5BFRNyvinE5OTzBMPNqPOPn+jsz7pR 5e84AyPhNrI260HYOhBm3QFapBbk5L++E5/GitYSkFLsdxjo3E0FiD4Mj8myc6DtESwb 0kKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753737672; x=1754342472; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kIX5S/IYN1UD5lUVG8s/g1vqb82wrjrrTZCP1v00aeo=; b=owDxZ0ZMn1rGXdMuI0ZeI+RCDOlpdn8AYC9c0c0wfsW1+v+tVdyUezB3VNysmjTbu4 dEheWL2HFki2teXcnfBnBphVDM3zIiKY1/pwTEy42kxmmUZh4y5LGMvnll1MTmwLBJVc 6dLO3EXt3NcDKaZ6sWp9eAWDeSfhqKsHWLszqfyV6zOILoettEW+zetGPYDw4K8USgWc DHyZQU9q/HBB89u5L0m/MNsFtoq9bhWZtquFUE2rev8la/JywBXLbGT6ZGxsces0I7JC kcTSr47Ut9H7rVjFa2IzfTmCUEj6OhVOQXZU08z+xIPTFiLZBaEwcVzjzqXs5RhozMOP KSTg== X-Gm-Message-State: AOJu0Yy85OM7dWBvsMEpFoq7z8at5XiBfKTd7J+o4PpeydVxGHbdeSiG 6OCpvg/N3wqay++tf/GWhuCHnGV9MM08hhn2RQ37aHSLdeB9LEUR2i8900OJ8Cp6sStKdjmTlwO /nSQQdeYCD+xlY/EE0LUbYGMHJOpFHPMlGojw2AZw/Clx X-Gm-Gg: ASbGncvuAhZwnktByUJAh8sNXwql0u13Fb3Iv2V2242xRo22EdoDGSPnDzxiX9wCkPP Kg65hEfASNVtBLJzkUoGq71fCRe7PygYWdygM1RBjQ/K8eyqSkVTKEub1Q4KKZedIl5oqs0wBjh UmA/0vLuYyN15j5o02Whg2kXCpXw+8N1HjTvoe2J4cG5ClrF8+PI10+lb3YWK3JJBtalnyvt1st WX/QC0= X-Google-Smtp-Source: AGHT+IEsMTEnjvWBYaqDxghg59YjC8FgMTJaTp/zfR+LdCR4FL3bS/jjQt208fV69OMcTMs/cf0DyESLpxzlnseM13o= X-Received: by 2002:a05:6902:15cc:b0:e8d:f354:f936 with SMTP id 3f1490d57ef6-e8df35502d0mr14827001276.23.1753737671834; Mon, 28 Jul 2025 14:21:11 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 From: walid falcon Date: Mon, 28 Jul 2025 22:20:59 +0100 X-Gm-Features: Ac12FXxJXAm8ZSkFMXRHOex2thYa5-BLoNYcjSb43uJRplqNpEqChrPj62T4gzU Message-ID: Subject: =?UTF-8?B?2LTZh9in2K/YqSDYp9mE2KPYqNmI2Kkg2YHZiiDYp9mE2YXYutix2Kg=?= To: dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000f58132063b03dea2" X-Spamd-Result: default: False [0.39 / 15.00]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; NEURAL_SPAM_LONG(1.00)[0.998]; NEURAL_HAM_SHORT(-0.71)[-0.710]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_BASE64_TEXT(0.10)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b42:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_HAS_DN(0.00)[] X-Rspamd-Queue-Id: 4brWcV5T7vz46sc X-Spamd-Bar: / --000000000000f58132063b03dea2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 2YPZhCDZhdinINiq2K3Yqtin2Kwg2YXYudix2YHYqtmHINit2YjZhCDYtNmH2KfYr9ipINin2YTY o9io2YjYqSDYqNin2YTZhdi62LHYqA0KDQoNCg0KDQog2YrZhdmD2YbZgyDYqtit2YXZitmEINin 2YTYt9mE2Kgg2YXZhiDYrtmE2KfZhCDYp9mE2LHYp9io2Lcg2KfZhNmF2KjYp9i02LENCmh0dHBz Oi8vd3d3LnRhcmdpci5jb20vMjAyNS8wNC9ibG9nLXBvc3RfMTQuaHRtbA0KDQoNCg0K2YXYudmE 2YjZhdin2Kog2LTYp9mF2YTYqSDZhNin2LPYqtiu2LHYp9isINi02YfYp9iv2Kkg2KfZhNij2KjZ iNipINmI2KfZhNil2KzYsdin2KHYp9iqINin2YTZgtin2YbZiNmG2YrYqSDYp9mE2YXYsdiq2KjY t9ipINio2YfYpw0KDQoNCg0KDQrZhdinINmH2Yog2LTZh9in2K/YqSDYp9mE2KPYqNmI2Kkg2YHZ iiDYp9mE2YXYutix2KjYnw0KDQoNCg0KDQrYtNmH2KfYr9ipINin2YTYo9io2YjYqSDZiNir2YrZ gtipINmC2KfZhtmI2YbZitipINiq2LXYr9ixINio2YbYp9ih2Ysg2LnZhNmJINit2YPZhSDZgti2 2KfYptmK2Iwg2YjYqtmP2KvYqNiqINin2YTYudmE2KfZgtipINin2YTYqNmG2YjZitipDQrYqNmK 2YYg2KfZhNi32YHZhCDZiNmI2KfZhNiv2Ycg2KfZhNio2YrZiNmE2YjYrNmK2Iwg2YHZiiDYrdin 2YQg2LnYr9mFINmI2KzZiNivINi52YLYryDYstmI2KfYrCDYsdiz2YXZiiDYo9mIINiq2LPYrNmK 2YQg2LPYp9io2YIuDQrYqtmP2LnZjtivINmH2LDZhyDYp9mE2LTZh9in2K/YqSDYrNiy2KHZi9in INmF2YYg2KfZhNil2KzYsdin2KHYp9iqINin2YTZgti22KfYptmK2Kkg2KfZhNiq2Yog2KrYr9iu 2YQg2LbZhdmGINmC2LbYp9mK2Kcg2KfZhNit2KfZhNipDQrYp9mE2YXYr9mG2YrYqS4NCg0KDQoN Cg0K2KfZhNit2KfZhNin2Kog2KfZhNiq2Yog2KrYs9iq2YjYrNioINin2LPYqtiu2LHYp9isINi0 2YfYp9iv2Kkg2KfZhNij2KjZiNipDQoxLiDYp9mE2KPYt9mB2KfZhCDYutmK2LEg2KfZhNmF2LPY rNmE2YrZhiDZgdmKINin2YTYrdin2YTYqSDYp9mE2YXYr9mG2YrYqQ0K2LnZhtiv2YXYpyDZitmI 2YTYryDYt9mB2YQg2K7Yp9ix2Kwg2KXYt9in2LEg2KfZhNiy2YjYp9isINij2Ygg2YTZhSDZitmP 2LPYrNmR2Y7ZhCDYqNi12YHYqSDZgtin2YbZiNmG2YrYqSDZgdmKINiv2YHYqtixINin2YTYrdin 2YTYqQ0K2KfZhNmF2K/ZhtmK2KnYjCDZitit2KrYp9isINin2YTYo9ioINil2YTZiSDYsdmB2Lkg 2K/YudmI2Ykg2YTZhNit2LXZiNmEINi52YTZiSDYtNmH2KfYr9ipINin2YTYo9io2YjYqS4NCg0K DQoNCg0KMi4g2KXYq9io2KfYqiDYp9mE2YbYs9ioINmB2Yog2LrZitin2Kgg2LnZgtivINiy2YjY p9isDQrZgdmKINit2KfZhNin2Kog2LnYr9mFINiq2YjZgdixINmI2KvZitmC2Kkg2KfZhNiy2YjY p9isINio2YrZhiDYp9mE2KPYqNmI2YrZhtiMINmK2Y/ZhNis2KMg2KXZhNmJINin2YTZhdit2YPZ hdipINmE2KrZgtiv2YrZhQ0K2KfZhNiq2LXYsdmK2K0g2KjYp9mE2KPYqNmI2KkuDQoNCg0KDQoN Ctil2KzYsdin2KHYp9iqINin2YTYrdi12YjZhCDYudmE2Ykg2LTZh9in2K/YqSDYp9mE2KPYqNmI 2KkNCtij2YjZhNinOiDYsdmB2Lkg2K/YudmI2Ykg2KPZhdin2YUg2KfZhNmF2K3Zg9mF2KkNCtmK 2KrZiNis2Kgg2LnZhNmJINin2YTYo9ioINij2Ygg2YjZhNmKINij2YXYsSDYp9mE2LfZgdmEINiq 2YLYr9mK2YUg2LfZhNioINil2YTZiSDYp9mE2YXYrdmD2YXYqSDYp9mE2KfYqNiq2K/Yp9im2YrY qSDYp9mE2KrZiiDZitmC2LkNCtmB2YrZh9inINmF2YLYsSDYs9mD2YYg2KfZhNi32YHZhCDYo9mI INin2YTYo9io2Iwg2YjYsNmE2YMg2YXZhiDYo9is2YQg2KXYtdiv2KfYsSDYrdmD2YUg2YLYttin 2KbZiiDYqNil2KvYqNin2Kog2KfZhNij2KjZiNipLg0KDQoNCg0KDQrYq9in2YbZitin2Ys6INin 2YTZiNir2KfYptmCINin2YTZhdi32YTZiNio2KkNCtmG2LPYrtipINmF2YYg2KjYt9in2YLYqSDY p9mE2KrYudix2YrZgSDYp9mE2YjYt9mG2YrYqQ0K2LnZgtivINin2YTYp9iy2K/Zitin2K8g2KfZ hNiu2KfYtSDYqNin2YTYt9mB2YQgKNil2YYg2YjZj9is2K8pDQrYtNmH2KfYr9ipINi32KjZitip INmE2YTZiNmE2KfYr9ipDQrYtNmH2KfYr9ipINin2YTYs9mD2YbZiQ0K2YjYq9in2KbZgiDYo9mI INil2KvYqNin2KrYp9iqINiq2K/YudmFINi52YTYp9mC2Kkg2KfZhNij2Kgg2KjYp9mE2LfZgdmE DQrZhtmF2YjYsNisINi02YfYp9iv2Kkg2KfZhNij2KjZiNipIHBkZg0K2KrYqtmK2K0g2KjYudi2 INin2YTZhdmI2KfZgti5INin2YTYpdmE2YPYqtix2YjZhtmK2Kkg2KrYrdmF2YrZhCDZhtmF2YjY sNisINi02YfYp9iv2Kkg2KfZhNij2KjZiNipIFBERiDZgtin2KjZhCDZhNmE2LfYqNin2LnYqdiM INi62YrYsQ0K2KPZhiDYpdi12K/Yp9ix2YfYpyDYp9mE2LHYs9mF2Yog2YTYpyDZitiq2YUg2KXZ hNinINio2LnYryDYrdmD2YUg2YLYttin2KbZitiMINmI2YrYqtmFINiq2YjYrNmK2YfZh9inINmE 2YXYtdmE2K3YqSDYp9mE2K3Yp9mE2KkNCtin2YTZhdiv2YbZitipINmE2KrYs9is2YrZhCDYp9mE 2LfZgdmELg0KDQoNCg0KDQrYp9mE2KPYs9im2YTYqSDYp9mE2LTYp9im2LnYqSDYrdmI2YQg2LTZ h9in2K/YqSDYp9mE2KPYqNmI2KkNCtmH2YQg2YrZhdmD2YYg2KrZgtiv2YrZhSDYt9mE2Kgg2LTZ h9in2K/YqSDYp9mE2KPYqNmI2Kkg2KXZhNmD2KrYsdmI2YbZitin2YvYnw0K2YTYp9iMINin2YTZ hdiz2LfYsdipINiq2LjZhCDZgti22KfYptmK2Kkg2YjYqtiq2LfZhNioINin2YTYrdi22YjYsSDY o9mF2KfZhSDYp9mE2YXYrdmD2YXYqS4NCg0KDQoNCg0K2YXYpyDZh9mKINmF2K/YqSDYp9mE2K3Y tdmI2YQg2LnZhNmJINi02YfYp9iv2Kkg2KfZhNij2KjZiNip2J8NCtmC2K8g2KrYrtiq2YTZgSDY p9mE2YXYr9ipINit2LPYqCDYudiv2K8g2KfZhNis2YTYs9in2KrYjCDZiNmE2YPZhiDYudin2K/Y qSDZhdinINiq2LPYqti62LHZgiDYqNmK2YYg2LTZh9ixINil2YTZiSDYq9mE2KfYq9ipINij2LTZ h9ix2IwNCtit2LPYqCDYqti52YLZitivINin2YTZhdmE2YEuDQoNCg0KDQoNCti12YTYqSDYqNmK 2YYg2LTZh9in2K/YqSDYp9mE2KPYqNmI2Kkg2YjYqNi52LYg2KfZhNiq2LXYp9ix2YrYrSDYp9mE 2YLYp9mG2YjZhtmK2Kkg2KfZhNij2K7YsdmJDQrYqtmFINin2YTYsdio2Lcg2LbZhdmGINmH2LDY pyDYp9mE2K/ZhNmK2YQg2KjZitmGINi02YfYp9iv2Kkg2KfZhNij2KjZiNipINmI2KjYudi2INin 2YTZhdmB2KfZh9mK2YUg2KfZhNmC2KfZhtmI2YbZitipINin2YTYo9iu2LHZiQ0K2KfZhNiq2Yog 2YrYqNit2Ksg2LnZhtmH2Kcg2KfZhNmD2KvZitix2Iwg2YXYq9mEOg0KDQoNCg0KDQoxLiDYp9mE 2KrYtdix2YrYrSDYp9mE2KPZhdmG2Yog2YjYqti12LHZititINin2YTYs9mB2LENCti62KfZhNio 2KfZiyDZhdinINmK2Y/Yt9mE2Kgg2YHZiiDYqNi52LYg2KfZhNit2KfZhNin2Kog2KfZhNmC2KfZ htmI2YbZitipINiq2YjZgdmK2LEg2KrYtdix2YrYrSDYo9mF2YbZiiDYudmG2K8g2KfYs9iq2K7Y sdin2Kwg2KPZiNix2KfZgg0K2KvYqNmI2KrZitip2Iwg2YPZhdinINmH2Ygg2KfZhNit2KfZhCDZ gdmKOg0KDQoNCg0KDQrYp9mE2KPZiNix2KfZgiDYp9mE2YXYt9mE2YjYqNipINmE2KfYs9iq2K7Y sdin2Kwg2KrYtdix2YrYrSDYp9mE2LPZgdixINmF2YYg2YXZhti32YLYqSDYp9mE2KrYrNmG2YrY rw0K2KrYtdix2YrYrSDYo9mF2YbZiiDZhdiz2KrYudis2YQNCtin2YTYqti12LHZititINin2YTY o9mF2YbZiiDYp9mE2KXZhNmD2KrYsdmI2YbZig0KMi4g2KfYs9iq2KjYr9in2YQg2KfZhNiq2LXY sdmK2K0g2KjYsdiu2LXYqSDZgtmK2KfYr9ipDQrZgdmKINit2KfZhNin2Kog2YXYq9mEINi02LHZ iNi3INil2LXYr9in2LEg2LHYrti12Kkg2YLZitin2K/YqSDYqNi52K8g2KfZhNiq2LXYsdmK2K0g 2KPZiCDYqtis2K/ZitivINin2YTYqti12LHZititINil2YTZiSDYsdiu2LXYqdiMDQrZhdmGINin 2YTZhdmH2YUg2KfZhNiq2KPZg9ivINmF2YYg2KXYq9io2KfYqiDYp9mE2YfZiNmK2Kkg2KfZhNmC 2KfZhtmI2YbZitip2Iwg2YjZh9mIINmF2Kcg2YrYrNi52YQg2LTZh9in2K/YqSDYp9mE2KPYqNmI 2Kkg2LbYsdmI2LHZitipDQrZgdmKINio2LnYtiDYp9mE2K3Yp9mE2KfYqiDYp9mE2YLYp9mG2YjZ htmK2Kkg2KfZhNiu2KfYtdipLg0KDQoNCg0KDQrYtNmH2KfYr9ipINin2YTYo9io2YjYqQ0K2KfZ hNi62KfZitipINmF2YYg2YfYsNmHINin2YTZiNir2YrZgtipINmH2Yog2KXYq9io2KfYqiDYudmE 2KfZgtipINin2YTYo9io2YjYqSDYqNin2YTYp9io2YYg2LPZiNin2KEg2YPYp9mGINix2KfYtNiv 2Kcg2KPZhSDZgtin2LXYsdinDQrZiNi62KfZhNio2Kcg2YXYpyDYqti32YTYqCDZgdmKINio2LnY tiDYp9mE2YXYs9in2LfYsSDYp9mE2KXYr9in2LHZitipLg0KDQoNCg0KDQrYtdin2K3YqCDYp9mE 2LfZhNioDQrYp9mE2YXYutix2KjZiiDYp9mE2YXZgtmK2YUg2KjYp9mE2K7Yp9ix2KwNCg0KDQoN Cg0K2KfZhNmI2KvYp9im2YIg2KfZhNmF2LfZhNmI2KjYqQ0K2KjYp9mE2YbYs9io2Kkg2YTZhNix 2KfYtNivIDoNCg0KDQoNCg0KwrcgICAgICAg2KjYt9in2YLYqSDYp9mE2KrYs9is2YrZhCDYmw0K DQoNCg0KDQrCtyAgICAgICDYp9mE2K/Zgdiq2LEg2KfZhNi52KfYptmE2YoNCg0KDQoNCg0K2KjY p9mE2YbYs9io2Kkg2YTZhNmC2KfYtdixIDoNCg0KDQoNCg0KwrcgICAgICAg2KjYt9in2YLYqSDY qtiz2KzZitmEINin2YTYo9ioINibDQoNCg0KDQoNCsK3ICAgICAgINin2YTYr9mB2KrYsSDYp9mE 2LnYp9im2YTZiiAuDQoNCg0KDQoNCtin2YTZhdi12YTYrdipINin2YTZhdmD2YTZgdipINio2KfY s9iq2YTYp9mFINin2YTZiNir2KfYptmCINin2YTZhdi32YTZiNio2KkNCtin2YTZhdi12KfZhNit INin2YTZgtmG2LXZhNmK2Kkg2KfZhNiq2KfYqNi52Kkg2YTZhdit2YQg2KXZgtin2YXYqSDYtdin 2K3YqCDYp9mE2LfZhNioDQoNCg0KDQoNCtin2YTZhdi12YTYrdipINin2YTZhdmD2YTZgdipINio 2KrZgtiv2YrZhSDYp9mE2K7Yr9mF2KkNCtin2YTZhdi12KfZhNitINin2YTZgtmG2LXZhNmK2Kkg 2KfZhNiq2KfYqNi52Kkg2YTZhdit2YQg2KXZgtin2YXYqSDYtdin2K3YqCDYp9mE2LfZhNioDQoN Cg0KDQoNCtmB2Yog2K3Yp9mE2Kkg2KrYudiw2LEg2KfZhNit2LXZiNmEINi52YTZiSDYp9mE2K7Y r9mF2KkNCtmF2KTYs9iz2Kkg2KfZhNmI2LPZiti3DQoNCg0KDQoNCtmE2KPYrNmEINin2YTYp9iq 2LXYp9mEDQrZiNiy2KfYsdipINin2YTYtNik2YjZhiDYp9mE2K7Yp9ix2KzZitipINmI2KfZhNiq 2LnYp9mI2YYNCg0KDQoNCg0K2YXYtdiv2LEg2KfZhNmF2LnZhNmI2YXYp9iqICjYp9mE2KXYr9in 2LHYqSDYp9mE2YXYudmG2YrYqSkNCtmI2LLYp9ix2Kkg2KfZhNi02KTZiNmGINin2YTYrtin2LHY rNmK2Kkg2YjYp9mE2KrYudin2YjZhl/Yo9ix2LTZitmBDQoNCg0KDQoNCtmK2YXZg9mG2YMg2KrY rdmF2YrZhCDYp9mE2LfZhNioINmF2YYg2K7ZhNin2YQg2KfZhNix2KfYqNi3INin2YTZhdio2KfY tNixDQoNCg0KDQoNCtmG2YXZiNiw2Kwg2LTZh9in2K/YqSDYp9mE2KPYqNmI2Kkg2KjYp9mE2YXY utix2KgNCtmF2K3Zg9mF2Kkg2KfZhNij2LPYsdipINio2YA6IFvYp9iz2YUg2KfZhNmF2K/ZitmG 2KldDQrYsdmC2YUg2KfZhNmF2YTZgTogW9mK2Y/Yqtix2YMg2YTZhNmF2K3Zg9mF2KldDQrYsdmC 2YUg2KfZhNmC2LbZitipOiBb2YrZj9iq2LHZgyDZhNmE2YXYrdmD2YXYqV0NCg0KDQoNCg0K2KjZ itin2YYg2KrYtdix2YrYrSDYqNin2YTYo9io2YjYqQ0K2KPZhtinINin2YTZhdmI2YLYuSDYo9iz 2YHZhNmHOg0KDQoNCg0KDQrYp9mE2KfYs9mFINin2YTZg9in2YXZhDogW9in2YTYp9iz2YUg2KfZ hNmD2KfZhdmEINmE2YTYo9ioXQ0KDQoNCg0KDQrYsdmC2YUg2KjYt9in2YLYqSDYp9mE2KrYudix 2YrZgSDYp9mE2YjYt9mG2YrYqTogW9ix2YLZhSBDSU5dDQoNCg0KDQoNCtiq2KfYsdmK2K4g2YjZ hdmD2KfZhiDYp9mE2KfYstiv2YrYp9ivOiBb2KrYp9ix2YrYriDZiNmF2YPYp9mGINmI2YTYp9iv 2Kkg2KfZhNij2KhdDQoNCg0KDQoNCtin2YTYudmG2YjYp9mGINin2YTZg9in2YXZhDogW9i52YbZ iNin2YYg2KfZhNil2YLYp9mF2KldDQoNCg0KDQoNCtin2YTZhdmH2YbYqTogW9in2YTZhdmH2YbY qSDYp9mE2K3Yp9mE2YrYqV0NCg0KDQoNCg0K2KPZj9i12LHZkditINio2YXZiNis2Kgg2YfYsNin 2Iwg2YjYqNmD2KfZhdmEINmC2YjYp9mKINin2YTYudmC2YTZitipINmI2KfZhNmC2KfZhtmI2YbZ itip2Iwg2KjZhdinINmK2YTZijoNCg0KDQoNCg0K2KPZhiDYp9mE2LfZgdmEICjYqSkg2KfZhNmF 2LPZhdmJICjYqSk6IFvYp9iz2YUg2KfZhNi32YHZhC/YqV0NCtin2YTZhdmI2YTZiNivICjYqSkg 2KjYqtin2LHZitiuOiBb2KrYp9ix2YrYriDYp9mE2YjZhNin2K/YqV0NCtio2YA6IFvZhdmD2KfZ hiDYp9mE2YjZhNin2K/YqV0NCg0KDQoNCg0K2YfZiCjZh9mKKSDYp9io2YbZii/Yp9io2YbYqtmK INin2YTYqNmK2YjZhNmI2KzZiijYqSnYjCDZiNmC2K8g2YjZj9mE2K8o2KopINmG2KrZitis2Kkg 2LnZhNin2YLYqSDYo9io2YjZitipINmC2KfYptmF2Kkg2KjZitmG2YoNCtmI2KjZitmGINin2YTY s9mK2K/YqToNClvYp9iz2YUg2KfZhNij2YVd2Iwg2KfZhNmF2YjZhNmI2K/YqSDYqNiq2KfYsdmK 2K46IFvYqtin2LHZitiuINmF2YrZhNin2K8g2KfZhNij2YVd2Iwg2YjYp9mE2K3Yp9mF2YTYqSDZ hNix2YLZhSDYqNi32KfZgtipDQrYp9mE2KrYudix2YrZgSDYp9mE2YjYt9mG2YrYqTogW9ix2YLZ hSBDSU4g2KfZhNij2YVdLg0KDQoNCg0KDQrZiNij2KrYrdmF2YQg2YPYp9mF2YQg2KfZhNmF2LPY pNmI2YTZitipINin2YTZgtin2YbZiNmG2YrYqSDZiNin2YTYo9io2YjZitipINiq2KzYp9mHINmH 2LDYpyDYp9mE2LfZgdmEL9ip2Iwg2YjYo9i32YTYqCDZhdmGINin2YTZhdit2YPZhdipDQrYp9mE 2YXZiNmC2LHYqSDYpdi12K/Yp9ixINit2YPZhSDZgti22KfYptmKINmK2KvYqNiqINmG2LPYqCDY p9mE2LfZgdmEINmE2YrYjCDZiNiq2YXZg9mK2YbZhyDZhdmGINin2YTYqtiz2KzZitmEINmB2Yog 2KfZhNit2KfZhNipDQrYp9mE2YXYr9mG2YrYqS4NCg0KDQrYp9mE2KXZhdi22KfYoQ0K2KfZhNil 2LPZhSDYp9mE2YPYp9mF2YQ6IF9fX19fX19fX19fX19fX19fX19fXw0K2KfZhNiq2YjZgtmK2Lk6 IF9fX19fX19fX19fX19fX19fX19fX19fX19fXw0K2KfZhNiq2KfYsdmK2K46IF9fX18gLyBfX19f IC8gX19fX19fX18NCg0K2YXZhNin2K3YuNin2KogOg0K2YrZj9ix2YHZgiDZh9iw2Kcg2KfZhNmG 2YXZiNiw2Kwg2KjYp9mE2YjYq9in2KbZgiDYp9mE2K/Yp9i52YXYqSDZg9mAOiDZhtiz2K7YqSDY p9mE2KjYt9in2YLYqSDYp9mE2YjYt9mG2YrYqdiMINi02YfYp9iv2Kkg2KfZhNiz2YPZhtmJ2IwN Cti02YfYp9iv2Kkg2KfZhNmI2YTYp9iv2KnYjCDZiNi62YrYsdmH2KcuDQrZitmP2YjYr9mO2Lkg 2YTYr9mJINmD2KrYp9io2Kkg2LbYqNi3INin2YTZhdit2YPZhdipINin2YTYp9io2KrYr9in2KbZ itipICjZgtiz2YUg2YLYttin2KEg2KfZhNij2LPYsdipKSDYp9mE2KrZiiDZitmC2Lkg2LbZhdmG DQrYp9iu2KrYtdin2LXZh9inINmF2K3ZhCDZiNmE2KfYr9ipINin2YTYt9mB2YQg2KPZiCDZhdit 2YQg2LPZg9mGINin2YTYo9ioLg0K --000000000000f58132063b03dea2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+2YPZhCDZhdinINiq2K3Yqtin2Kwg2YXYudix2YHYqtmHINit2YjZhMKg 2LTZh9in2K/YqSDYp9mE2KPYqNmI2Kkg2KjYp9mE2YXYutix2Kg8YnI+PGJyPjxicj48YnI+PGJy PsKg2YrZhdmD2YbZgyDYqtit2YXZitmEINin2YTYt9mE2Kgg2YXZhiDYrtmE2KfZhCDYp9mE2LHY p9io2Lcg2KfZhNmF2KjYp9i02LE8YnI+PGEgaHJlZj0iaHR0cHM6Ly93d3cudGFyZ2lyLmNvbS8y MDI1LzA0L2Jsb2ctcG9zdF8xNC5odG1sIj5odHRwczovL3d3dy50YXJnaXIuY29tLzIwMjUvMDQv YmxvZy1wb3N0XzE0Lmh0bWw8L2E+PGJyPjxicj48YnI+PGJyPtmF2LnZhNmI2YXYp9iqINi02KfZ hdmE2Kkg2YTYp9iz2KrYrtix2KfYrCDYtNmH2KfYr9ipINin2YTYo9io2YjYqSDZiNin2YTYpdis 2LHYp9ih2KfYqiDYp9mE2YLYp9mG2YjZhtmK2Kkg2KfZhNmF2LHYqtio2LfYqSDYqNmH2Kc8YnI+ PGJyPjxicj48YnI+PGJyPtmF2Kcg2YfZisKg2LTZh9in2K/YqSDYp9mE2KPYqNmI2KnCoNmB2Yog 2KfZhNmF2LrYsdio2J88YnI+PGJyPjxicj48YnI+PGJyPti02YfYp9iv2Kkg2KfZhNij2KjZiNip INmI2KvZitmC2Kkg2YLYp9mG2YjZhtmK2Kkg2KrYtdiv2LEg2KjZhtin2KHZiyDYudmE2Ykg2K3Z g9mFINmC2LbYp9im2YrYjCDZiNiq2Y/Yq9io2Kog2KfZhNi52YTYp9mC2Kkg2KfZhNio2YbZiNmK 2Kkg2KjZitmGINin2YTYt9mB2YQg2YjZiNin2YTYr9mHINin2YTYqNmK2YjZhNmI2KzZitiMINmB 2Yog2K3Yp9mEINi52K/ZhSDZiNis2YjYryDYudmC2K8g2LLZiNin2Kwg2LHYs9mF2Yog2KPZiCDY qtiz2KzZitmEINiz2KfYqNmCLiDYqtmP2LnZjtivINmH2LDZhyDYp9mE2LTZh9in2K/YqSDYrNiy 2KHZi9inINmF2YYg2KfZhNil2KzYsdin2KHYp9iqINin2YTZgti22KfYptmK2Kkg2KfZhNiq2Yog 2KrYr9iu2YQg2LbZhdmGINmC2LbYp9mK2Kcg2KfZhNit2KfZhNipINin2YTZhdiv2YbZitipLjxi cj48YnI+PGJyPjxicj48YnI+2KfZhNit2KfZhNin2Kog2KfZhNiq2Yog2KrYs9iq2YjYrNioINin 2LPYqtiu2LHYp9isINi02YfYp9iv2Kkg2KfZhNij2KjZiNipPGJyPjEuINin2YTYo9i32YHYp9mE INi62YrYsSDYp9mE2YXYs9is2YTZitmGINmB2Yog2KfZhNit2KfZhNipINin2YTZhdiv2YbZitip PGJyPti52YbYr9mF2Kcg2YrZiNmE2K8g2LfZgdmEINiu2KfYsdisINil2LfYp9ixINin2YTYstmI 2KfYrCDYo9mIINmE2YUg2YrZj9iz2KzZkdmO2YQg2KjYtdmB2Kkg2YLYp9mG2YjZhtmK2Kkg2YHZ iiDYr9mB2KrYsSDYp9mE2K3Yp9mE2Kkg2KfZhNmF2K/ZhtmK2KnYjCDZitit2KrYp9isINin2YTY o9ioINil2YTZiSDYsdmB2Lkg2K/YudmI2Ykg2YTZhNit2LXZiNmEINi52YTZiSDYtNmH2KfYr9ip INin2YTYo9io2YjYqS48YnI+PGJyPjxicj48YnI+PGJyPjIuINil2KvYqNin2Kog2KfZhNmG2LPY qCDZgdmKINi62YrYp9ioINi52YLYryDYstmI2KfYrDxicj7ZgdmKINit2KfZhNin2Kog2LnYr9mF INiq2YjZgdixINmI2KvZitmC2Kkg2KfZhNiy2YjYp9isINio2YrZhiDYp9mE2KPYqNmI2YrZhtiM INmK2Y/ZhNis2KMg2KXZhNmJINin2YTZhdit2YPZhdipINmE2KrZgtiv2YrZhSDYp9mE2KrYtdix 2YrYrSDYqNin2YTYo9io2YjYqS48YnI+PGJyPjxicj48YnI+PGJyPtil2KzYsdin2KHYp9iqINin 2YTYrdi12YjZhCDYudmE2Ykg2LTZh9in2K/YqSDYp9mE2KPYqNmI2Kk8YnI+2KPZiNmE2Kc6INix 2YHYuSDYr9i52YjZiSDYo9mF2KfZhSDYp9mE2YXYrdmD2YXYqTxicj7Zitiq2YjYrNioINi52YTZ iSDYp9mE2KPYqCDYo9mIINmI2YTZiiDYo9mF2LEg2KfZhNi32YHZhCDYqtmC2K/ZitmFINi32YTY qCDYpdmE2Ykg2KfZhNmF2K3Zg9mF2Kkg2KfZhNin2KjYqtiv2KfYptmK2Kkg2KfZhNiq2Yog2YrZ gti5INmB2YrZh9inINmF2YLYsSDYs9mD2YYg2KfZhNi32YHZhCDYo9mIINin2YTYo9io2Iwg2YjY sNmE2YMg2YXZhiDYo9is2YQg2KXYtdiv2KfYsSDYrdmD2YUg2YLYttin2KbZiiDYqNil2KvYqNin 2Kog2KfZhNij2KjZiNipLjxicj48YnI+PGJyPjxicj48YnI+2KvYp9mG2YrYp9mLOiDYp9mE2YjY q9in2KbZgiDYp9mE2YXYt9mE2YjYqNipPGJyPtmG2LPYrtipINmF2YYg2KjYt9in2YLYqSDYp9mE 2KrYudix2YrZgSDYp9mE2YjYt9mG2YrYqTxicj7YudmC2K8g2KfZhNin2LLYr9mK2KfYryDYp9mE 2K7Yp9i1INio2KfZhNi32YHZhCAo2KXZhiDZiNmP2KzYryk8YnI+2LTZh9in2K/YqSDYt9io2YrY qSDZhNmE2YjZhNin2K/YqTxicj7YtNmH2KfYr9ipINin2YTYs9mD2YbZiTxicj7ZiNir2KfYptmC INij2Ygg2KXYq9io2KfYqtin2Kog2KrYr9i52YUg2LnZhNin2YLYqSDYp9mE2KPYqCDYqNin2YTY t9mB2YQ8YnI+2YbZhdmI2LDYrCDYtNmH2KfYr9ipINin2YTYo9io2YjYqSBwZGY8YnI+2KrYqtmK 2K0g2KjYudi2INin2YTZhdmI2KfZgti5INin2YTYpdmE2YPYqtix2YjZhtmK2Kkg2KrYrdmF2YrZ hCDZhtmF2YjYsNisINi02YfYp9iv2Kkg2KfZhNij2KjZiNipIFBERiDZgtin2KjZhCDZhNmE2LfY qNin2LnYqdiMINi62YrYsSDYo9mGINil2LXYr9in2LHZh9inINin2YTYsdiz2YXZiiDZhNinINmK 2KrZhSDYpdmE2Kcg2KjYudivINit2YPZhSDZgti22KfYptmK2Iwg2YjZitiq2YUg2KrZiNis2YrZ h9mH2Kcg2YTZhdi12YTYrdipINin2YTYrdin2YTYqSDYp9mE2YXYr9mG2YrYqSDZhNiq2LPYrNmK 2YQg2KfZhNi32YHZhC48YnI+PGJyPjxicj48YnI+PGJyPtin2YTYo9iz2KbZhNipINin2YTYtNin 2KbYudipINit2YjZhCDYtNmH2KfYr9ipINin2YTYo9io2YjYqTxicj7Zh9mEINmK2YXZg9mGINiq 2YLYr9mK2YUg2LfZhNioINi02YfYp9iv2Kkg2KfZhNij2KjZiNipINil2YTZg9iq2LHZiNmG2YrY p9mL2J88YnI+2YTYp9iMINin2YTZhdiz2LfYsdipINiq2LjZhCDZgti22KfYptmK2Kkg2YjYqtiq 2LfZhNioINin2YTYrdi22YjYsSDYo9mF2KfZhSDYp9mE2YXYrdmD2YXYqS48YnI+PGJyPjxicj48 YnI+PGJyPtmF2Kcg2YfZiiDZhdiv2Kkg2KfZhNit2LXZiNmEINi52YTZiSDYtNmH2KfYr9ipINin 2YTYo9io2YjYqdifPGJyPtmC2K8g2KrYrtiq2YTZgSDYp9mE2YXYr9ipINit2LPYqCDYudiv2K8g 2KfZhNis2YTYs9in2KrYjCDZiNmE2YPZhiDYudin2K/YqSDZhdinINiq2LPYqti62LHZgiDYqNmK 2YYg2LTZh9ixINil2YTZiSDYq9mE2KfYq9ipINij2LTZh9ix2Iwg2K3Ys9ioINiq2LnZgtmK2K8g 2KfZhNmF2YTZgS48YnI+PGJyPjxicj48YnI+PGJyPti12YTYqSDYqNmK2YYg2LTZh9in2K/YqSDY p9mE2KPYqNmI2Kkg2YjYqNi52LYg2KfZhNiq2LXYp9ix2YrYrSDYp9mE2YLYp9mG2YjZhtmK2Kkg 2KfZhNij2K7YsdmJPGJyPtiq2YUg2KfZhNix2KjYtyDYttmF2YYg2YfYsNinINin2YTYr9mE2YrZ hCDYqNmK2YYg2LTZh9in2K/YqSDYp9mE2KPYqNmI2Kkg2YjYqNi52LYg2KfZhNmF2YHYp9mH2YrZ hSDYp9mE2YLYp9mG2YjZhtmK2Kkg2KfZhNij2K7YsdmJINin2YTYqtmKINmK2KjYrdirINi52YbZ h9inINin2YTZg9ir2YrYsdiMINmF2KvZhDo8YnI+PGJyPjxicj48YnI+PGJyPjEuINin2YTYqti1 2LHZititINin2YTYo9mF2YbZiiDZiNiq2LXYsdmK2K0g2KfZhNiz2YHYsTxicj7Yutin2YTYqNin 2Ysg2YXYpyDZitmP2LfZhNioINmB2Yog2KjYudi2INin2YTYrdin2YTYp9iqINin2YTZgtin2YbZ iNmG2YrYqSDYqtmI2YHZitixINiq2LXYsdmK2K0g2KPZhdmG2Yog2LnZhtivINin2LPYqtiu2LHY p9isINij2YjYsdin2YIg2KvYqNmI2KrZitip2Iwg2YPZhdinINmH2Ygg2KfZhNit2KfZhCDZgdmK Ojxicj48YnI+PGJyPjxicj48YnI+2KfZhNij2YjYsdin2YIg2KfZhNmF2LfZhNmI2KjYqSDZhNin 2LPYqtiu2LHYp9isINiq2LXYsdmK2K0g2KfZhNiz2YHYsSDZhdmGINmF2YbYt9mC2Kkg2KfZhNiq 2KzZhtmK2K88YnI+2KrYtdix2YrYrSDYo9mF2YbZiiDZhdiz2KrYudis2YQ8YnI+2KfZhNiq2LXY sdmK2K0g2KfZhNij2YXZhtmKINin2YTYpdmE2YPYqtix2YjZhtmKPGJyPjIuINin2LPYqtio2K/Y p9mEINin2YTYqti12LHZititINio2LHYrti12Kkg2YLZitin2K/YqTxicj7ZgdmKINit2KfZhNin 2Kog2YXYq9mEINi02LHZiNi3INil2LXYr9in2LEg2LHYrti12Kkg2YLZitin2K/YqSDYqNi52K8g 2KfZhNiq2LXYsdmK2K0g2KPZiCDYqtis2K/ZitivINin2YTYqti12LHZititINil2YTZiSDYsdiu 2LXYqdiMINmF2YYg2KfZhNmF2YfZhSDYp9mE2KrYo9mD2K8g2YXZhiDYpdir2KjYp9iqINin2YTZ h9mI2YrYqSDYp9mE2YLYp9mG2YjZhtmK2KnYjCDZiNmH2Ygg2YXYpyDZitis2LnZhCDYtNmH2KfY r9ipINin2YTYo9io2YjYqSDYttix2YjYsdmK2Kkg2YHZiiDYqNi52LYg2KfZhNit2KfZhNin2Kog 2KfZhNmC2KfZhtmI2YbZitipINin2YTYrtin2LXYqS48YnI+PGJyPjxicj48YnI+PGJyPti02YfY p9iv2Kkg2KfZhNij2KjZiNipPGJyPtin2YTYutin2YrYqSDZhdmGINmH2LDZhyDYp9mE2YjYq9mK 2YLYqSDZh9mKINil2KvYqNin2Kog2LnZhNin2YLYqSDYp9mE2KPYqNmI2Kkg2KjYp9mE2KfYqNmG INiz2YjYp9ihINmD2KfZhiDYsdin2LTYr9inINij2YUg2YLYp9i12LHYpyDZiNi62KfZhNio2Kcg 2YXYpyDYqti32YTYqCDZgdmKINio2LnYtiDYp9mE2YXYs9in2LfYsSDYp9mE2KXYr9in2LHZitip Ljxicj48YnI+PGJyPjxicj48YnI+2LXYp9it2Kgg2KfZhNi32YTYqDxicj7Yp9mE2YXYutix2KjZ iiDYp9mE2YXZgtmK2YUg2KjYp9mE2K7Yp9ix2Kw8YnI+PGJyPjxicj48YnI+PGJyPtin2YTZiNir 2KfYptmCINin2YTZhdi32YTZiNio2Kk8YnI+2KjYp9mE2YbYs9io2Kkg2YTZhNix2KfYtNivIDo8 YnI+PGJyPjxicj48YnI+PGJyPsK3wqDCoMKgwqDCoMKgINio2LfYp9mC2Kkg2KfZhNiq2LPYrNmK 2YQg2Js8YnI+PGJyPjxicj48YnI+PGJyPsK3wqDCoMKgwqDCoMKgINin2YTYr9mB2KrYsSDYp9mE 2LnYp9im2YTZijxicj48YnI+PGJyPjxicj48YnI+2KjYp9mE2YbYs9io2Kkg2YTZhNmC2KfYtdix IDo8YnI+PGJyPjxicj48YnI+PGJyPsK3wqDCoMKgwqDCoMKgINio2LfYp9mC2Kkg2KrYs9is2YrZ hCDYp9mE2KPYqCDYmzxicj48YnI+PGJyPjxicj48YnI+wrfCoMKgwqDCoMKgwqAg2KfZhNiv2YHY qtixINin2YTYudin2KbZhNmKIC48YnI+PGJyPjxicj48YnI+PGJyPtin2YTZhdi12YTYrdipINin 2YTZhdmD2YTZgdipINio2KfYs9iq2YTYp9mFINin2YTZiNir2KfYptmCINin2YTZhdi32YTZiNio 2Kk8YnI+2KfZhNmF2LXYp9mE2K0g2KfZhNmC2YbYtdmE2YrYqSDYp9mE2KrYp9io2LnYqSDZhNmF 2K3ZhCDYpdmC2KfZhdipINi12KfYrdioINin2YTYt9mE2Kg8YnI+PGJyPjxicj48YnI+PGJyPtin 2YTZhdi12YTYrdipINin2YTZhdmD2YTZgdipINio2KrZgtiv2YrZhSDYp9mE2K7Yr9mF2Kk8YnI+ 2KfZhNmF2LXYp9mE2K0g2KfZhNmC2YbYtdmE2YrYqSDYp9mE2KrYp9io2LnYqSDZhNmF2K3ZhCDY pdmC2KfZhdipINi12KfYrdioINin2YTYt9mE2Kg8YnI+PGJyPjxicj48YnI+PGJyPtmB2Yog2K3Y p9mE2Kkg2KrYudiw2LEg2KfZhNit2LXZiNmEINi52YTZiSDYp9mE2K7Yr9mF2Kk8YnI+2YXYpNiz 2LPYqSDYp9mE2YjYs9mK2Lc8YnI+PGJyPjxicj48YnI+PGJyPtmE2KPYrNmEINin2YTYp9iq2LXY p9mEPGJyPtmI2LLYp9ix2Kkg2KfZhNi02KTZiNmGINin2YTYrtin2LHYrNmK2Kkg2YjYp9mE2KrY udin2YjZhjxicj48YnI+PGJyPjxicj48YnI+2YXYtdiv2LEg2KfZhNmF2LnZhNmI2YXYp9iqICjY p9mE2KXYr9in2LHYqSDYp9mE2YXYudmG2YrYqSk8YnI+2YjYstin2LHYqSDYp9mE2LTYpNmI2YYg 2KfZhNiu2KfYsdis2YrYqSDZiNin2YTYqti52KfZiNmGX9ij2LHYtNmK2YE8YnI+PGJyPjxicj48 YnI+PGJyPtmK2YXZg9mG2YMg2KrYrdmF2YrZhCDYp9mE2LfZhNioINmF2YYg2K7ZhNin2YQg2KfZ hNix2KfYqNi3INin2YTZhdio2KfYtNixPGJyPjxicj48YnI+PGJyPjxicj7ZhtmF2YjYsNisINi0 2YfYp9iv2Kkg2KfZhNij2KjZiNipINio2KfZhNmF2LrYsdioPGJyPtmF2K3Zg9mF2Kkg2KfZhNij 2LPYsdipINio2YA6IFvYp9iz2YUg2KfZhNmF2K/ZitmG2KldPGJyPtix2YLZhSDYp9mE2YXZhNmB OiBb2YrZj9iq2LHZgyDZhNmE2YXYrdmD2YXYqV08YnI+2LHZgtmFINin2YTZgti22YrYqTogW9mK 2Y/Yqtix2YMg2YTZhNmF2K3Zg9mF2KldPGJyPjxicj48YnI+PGJyPjxicj7YqNmK2KfZhiDYqti1 2LHZititINio2KfZhNij2KjZiNipPGJyPtij2YbYpyDYp9mE2YXZiNmC2Lkg2KPYs9mB2YTZhzo8 YnI+PGJyPjxicj48YnI+PGJyPtin2YTYp9iz2YUg2KfZhNmD2KfZhdmEOiBb2KfZhNin2LPZhSDY p9mE2YPYp9mF2YQg2YTZhNij2KhdPGJyPjxicj48YnI+PGJyPjxicj7YsdmC2YUg2KjYt9in2YLY qSDYp9mE2KrYudix2YrZgSDYp9mE2YjYt9mG2YrYqTogW9ix2YLZhSBDSU5dPGJyPjxicj48YnI+ PGJyPjxicj7Yqtin2LHZitiuINmI2YXZg9in2YYg2KfZhNin2LLYr9mK2KfYrzogW9iq2KfYsdmK 2K4g2YjZhdmD2KfZhiDZiNmE2KfYr9ipINin2YTYo9ioXTxicj48YnI+PGJyPjxicj48YnI+2KfZ hNi52YbZiNin2YYg2KfZhNmD2KfZhdmEOiBb2LnZhtmI2KfZhiDYp9mE2KXZgtin2YXYqV08YnI+ PGJyPjxicj48YnI+PGJyPtin2YTZhdmH2YbYqTogW9in2YTZhdmH2YbYqSDYp9mE2K3Yp9mE2YrY qV08YnI+PGJyPjxicj48YnI+PGJyPtij2Y/Ytdix2ZHYrSDYqNmF2YjYrNioINmH2LDYp9iMINmI 2KjZg9in2YXZhCDZgtmI2KfZiiDYp9mE2LnZgtmE2YrYqSDZiNin2YTZgtin2YbZiNmG2YrYqdiM INio2YXYpyDZitmE2Yo6PGJyPjxicj48YnI+PGJyPjxicj7Yo9mGINin2YTYt9mB2YQgKNipKSDY p9mE2YXYs9mF2YkgKNipKTogW9in2LPZhSDYp9mE2LfZgdmEL9ipXTxicj7Yp9mE2YXZiNmE2YjY ryAo2KkpINio2KrYp9ix2YrYrjogW9iq2KfYsdmK2K4g2KfZhNmI2YTYp9iv2KldPGJyPtio2YA6 IFvZhdmD2KfZhiDYp9mE2YjZhNin2K/YqV08YnI+PGJyPjxicj48YnI+PGJyPtmH2Ygo2YfZiikg 2KfYqNmG2Yov2KfYqNmG2KrZiiDYp9mE2KjZitmI2YTZiNis2Yoo2Kkp2Iwg2YjZgtivINmI2Y/Z hNivKNiqKSDZhtiq2YrYrNipINi52YTYp9mC2Kkg2KPYqNmI2YrYqSDZgtin2KbZhdipINio2YrZ htmKINmI2KjZitmGINin2YTYs9mK2K/YqTo8YnI+W9in2LPZhSDYp9mE2KPZhV3YjCDYp9mE2YXZ iNmE2YjYr9ipINio2KrYp9ix2YrYrjogW9iq2KfYsdmK2K4g2YXZitmE2KfYryDYp9mE2KPZhV3Y jCDZiNin2YTYrdin2YXZhNipINmE2LHZgtmFINio2LfYp9mC2Kkg2KfZhNiq2LnYsdmK2YEg2KfZ hNmI2LfZhtmK2Kk6IFvYsdmC2YUgQ0lOINin2YTYo9mFXS48YnI+PGJyPjxicj48YnI+PGJyPtmI 2KPYqtit2YXZhCDZg9in2YXZhCDYp9mE2YXYs9ik2YjZhNmK2Kkg2KfZhNmC2KfZhtmI2YbZitip INmI2KfZhNij2KjZiNmK2Kkg2KrYrNin2Ycg2YfYsNinINin2YTYt9mB2YQv2KnYjCDZiNij2LfZ hNioINmF2YYg2KfZhNmF2K3Zg9mF2Kkg2KfZhNmF2YjZgtix2Kkg2KXYtdiv2KfYsSDYrdmD2YUg 2YLYttin2KbZiiDZitir2KjYqiDZhtiz2Kgg2KfZhNi32YHZhCDZhNmK2Iwg2YjYqtmF2YPZitmG 2Ycg2YXZhiDYp9mE2KrYs9is2YrZhCDZgdmKINin2YTYrdin2YTYqSDYp9mE2YXYr9mG2YrYqS48 YnI+PGJyPjxicj7Yp9mE2KXZhdi22KfYoTxicj7Yp9mE2KXYs9mFINin2YTZg9in2YXZhDogX19f X19fX19fX19fX19fX19fX19fPGJyPtin2YTYqtmI2YLZiti5OiBfX19fX19fX19fX19fX19fX19f X19fX19fX188YnI+2KfZhNiq2KfYsdmK2K46IF9fX18gLyBfX19fIC8gX19fX19fX188YnI+PGJy PtmF2YTYp9it2LjYp9iqIDo8YnI+2YrZj9ix2YHZgiDZh9iw2Kcg2KfZhNmG2YXZiNiw2Kwg2KjY p9mE2YjYq9in2KbZgiDYp9mE2K/Yp9i52YXYqSDZg9mAOiDZhtiz2K7YqSDYp9mE2KjYt9in2YLY qSDYp9mE2YjYt9mG2YrYqdiMINi02YfYp9iv2Kkg2KfZhNiz2YPZhtmJ2Iwg2LTZh9in2K/YqSDY p9mE2YjZhNin2K/YqdiMINmI2LrZitix2YfYpy48YnI+2YrZj9mI2K/Zjti5INmE2K/ZiSDZg9iq 2KfYqNipINi22KjYtyDYp9mE2YXYrdmD2YXYqSDYp9mE2KfYqNiq2K/Yp9im2YrYqSAo2YLYs9mF INmC2LbYp9ihINin2YTYo9iz2LHYqSkg2KfZhNiq2Yog2YrZgti5INi22YXZhiDYp9iu2KrYtdin 2LXZh9inINmF2K3ZhCDZiNmE2KfYr9ipINin2YTYt9mB2YQg2KPZiCDZhdit2YQg2LPZg9mGINin 2YTYo9ioLjxicj48YnI+PC9kaXY+DQo= --000000000000f58132063b03dea2-- From nobody Mon Jul 28 22:04:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4brXnk4jM6z63XQb for ; Mon, 28 Jul 2025 22:14:18 +0000 (UTC) (envelope-from wlosh@bsdimp.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 4brXnk3tqYz4Cf8 for ; Mon, 28 Jul 2025 22:14:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-b39011e5f8eso4450886a12.0 for ; Mon, 28 Jul 2025 15:14:18 -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=spchkAhPJoALKf5Bhz8hn0pFhjapqYJ/tGMG7+Jb5BDUcE91S5uqxrw/Vrt4FnDfKk qNwpITGsmSHwB8W9UU6OhYcHwNi7ILtPOewxh/fDICgmikLjSg/V/iMZu2wo/dKEk3jl fotvVmnhmGNV7YUrGdZECgOu4PwL44K9H4dXNsWO3AA57WMnj79kaqDwnhKo/nMMx8WI 0X/h3+3nt1K7tWkoYrh2HKiFdHn7ggOXYTdRPJoiRGq587rkd3TRzvP1qigr3FX+1He7 VA5fxbaWkPGqg6gI6DvJarVohtEbKdk8U1fqR0yMcXRVxqjmBxyCyOza1Y6U8HLJL+Gp aQLA== X-Forwarded-Encrypted: i=1; AJvYcCVKaxWllxHiwMjLhTTyCbAcpBfGieuI2z7YfoiRmtWkUFeuvfsIZ34b/vkvjxOqpJDiobfPMgFK4DJckSsCEWSCV3LTJw==@freebsd.org X-Gm-Message-State: AOJu0YztR5BgK3N8HMhhlLLCKXWaEUnJAOZCc1h6S2+7Dge5DmStl/98 RnY7ERFwsts01GBg8boh3kLCKso4iEfnKXflxh5676VtjrCV0UfnntF9S9oTIjriuulzyz0tOVR xZ8sMskoWQlM8O+SSEdDfpeW9Z0ASH/FpMnZjGwYNGA== X-Gm-Gg: ASbGncv/2Pc+gbbBdzZu3eDPfXL1OEhlSfB8XNrDNwT9FCUqbWY+Su7CsjDwIzaO2wz aWew7xF9vvv0h056LezNAh1LdbAsWMQDXmO9lJzLid/FMYL0tQh9yiYBO+6QzklA7it0tou9vz4 SFOTIbgw0bAf6lMYFZljPhK2Kacewl4EFsawUIyp8T6zNLJufHIqETSZ4anE62FZQ3Gc5K6Fdmn 3JnwAFMk+bLfDvxoBjYY4U8afvffks6F4xF82F7xg== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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: 4brXnk3tqYz4Cf8 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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 06:22:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:51:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 13:01:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 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:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 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:27:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 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 17:31:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 23:35:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 12:29:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 15:31:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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:32:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 20:27:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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:24:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 10:07:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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:13:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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:50:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-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:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 12:09:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4btrWg16tfz62nmN for ; Fri, 01 Aug 2025 16:10:07 +0000 (UTC) (envelope-from 199841@rhotelcentral.emktlw-02.com) Received: from mail1536.delibird-emkt0001.lwdlv.com.br (mail1536.delibird-emkt0001.lwdlv.com.br [191.252.15.36]) by mx1.freebsd.org (Postfix) with ESMTP id 4btrWZ2LhQz41B3 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=eAQNXNAh; spf=pass (mx1.freebsd.org: domain of 199841@rhotelcentral.emktlw-02.com designates 191.252.15.36 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=2uJyZLsjuYdD6WHJTKpu/+beIRPqxyumdjlEdHHsWS4=; b=eAQNXNAh3Pbs6pGM+GaZKc6sZL9ZfYzs9mvRobYPS5xtbFYLQwFaLESBBDPJ8qmiGnHIxkw3i9nD CsCfqz+ZbW+eU0qcvvltMl3eVhYedRQAPXHJIqfZBAJ+83T6xkIopK0CtabO6CuStFD7hW9KoyHy i2NytmzGpkrt09MUmxM= Received: from localhost (191.252.190.4) by mail1536.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-main@freebsd.org Subject: brtConsolidadora List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_688ce6bf267f1_1d8db3ff60d41880c28142fc"; charset=UTF-8 List-Unsubscribe: , Precedence: bulk x-account-id: 199841 x-contact-id: 3607 x-envelope-id: 2 x-message-id: 2 x-locaweb-id: 7JeUCgYehpPWjLrMV5PPTVFGrjCIgH8bLwkkBZe33e3yGLd-ZpSfSuCBKDmHSeaRrpSxyI17IWKezVIYM_rWlAZlRBTJYasl8Xm2xm1EvdyXrQinkDUCjA74Sz0JZ03XSlB_Y6yTdQx6wWtgDPVMEtmHvASNfUuB941VaXzNAn68DLVWqonrDcxycf74z3Md x-locaweb-id2: NDI1MjU0MjAzYzcyNjU3MzY1NzI3NjYxNzM0MDcyNjg2Zjc0NjU2YzYzNjU2ZTc0NzI2MTZjMmU2NTZkNmI3NDZjNzcyZDMwMzIyZTYzNmY2ZDNl Feedback-ID: 199841:2:c:emktlw Message-ID: <0.9.0.59.1DC02FEA3BB51B6.2A223@mail1536.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]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[rhotelcentral.emktlw-02.com,quarantine]; FORGED_SENDER(0.30)[reservas@rhotelcentral.emktlw-02.com,199841@rhotelcentral.emktlw-02.com]; R_SPF_ALLOW(-0.20)[+ip4:191.252.15.0/26]; R_DKIM_ALLOW(-0.20)[emktlw-02.com:s=emktlw]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; HAS_LIST_UNSUB(-0.01)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RECEIVED_HELO_LOCALHOST(0.00)[]; REPLYTO_DOM_NEQ_TO_DOM(0.00)[]; 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)[]; DKIM_TRACE(0.00)[emktlw-02.com:+]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:27715, ipnet:191.252.0.0/19, country:BR]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; ARC_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; HAS_REPLYTO(0.00)[reservas@hotelcentral-ro.com.br] X-Rspamd-Queue-Id: 4btrWZ2LhQz41B3 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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:32:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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 06:39:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bvCpt0Kp0z63fwP for ; Sat, 02 Aug 2025 06:39:34 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic.asd.mail.yahoo.com (sonic310-20.consmr.mail.gq1.yahoo.com [98.137.69.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bvCpm2qXxz3JDd for ; Sat, 02 Aug 2025 06:39:28 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=B5vtaZeH; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.146 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1754116761; bh=bqXIZQ7GDypeCDtAAjR6qEVlikn5zORCzShMjA0KC4U=; h=From:Subject:Date:Cc:To:References:From:Subject:Reply-To; b=B5vtaZeH8lYwJW7NBYELKX18A909/oE3ejUhIggtRh4ICvgRBHaXikarqunbQVMwDjrDHbp80j4DH7pGLjsDze1IUtDzHltchluRImySKtDxzy3ld3qaZXmaWYfcZ5SvoXUBhLg7uzIk+3r7e5X6Lr7XMatKSbS114ZBGU0+XPYIWg8dcj4IoaPLWjR0wKybRwgKLtCv4xvw6zUPeTnbgrTcMSQSAhN7OIFg8SXWEFe5/YJ0ZlcktdRUycn3UVCZS5hbL0lJuABli8gkizUss39m9PJtJxvczReks9J7lmYvi7P/LE824PITC8Tpu+LqyeSFIgk2Gh37U8ExIvxF5w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1754116761; bh=f6/wwgnbPNgprt4T9ZJqi6xQwAVzb75GMPWYmNKkJyr=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=a3MvTkibBUrtXWe5D7MhNVFk+SvR+37IFEAZxB8Vn0qUEczztMUmR47ROM8G86+YGrrhmBsHn82DkGRIO5VQpXfvg37K8LSzuTni2zcwEFPcYXeaWYdbM5SSYHjIae9lW/D0cwt0ZgEqLy6JejnL3wZ39s+IfaE6AAfqlhWSMJJr0TgR5FQZuFbqRVfvw2b6/O9Q3ED/RqLbQeSnXYQwlY2IjAptZJzPzln4qAbDxaCu7lmcO+uEmzPnPdhwILsyGXFrO1An/XSQhDseWzqSBkWC07yCIpSyNoDUz2lMCap93JoSF959tcj+ctjPRfAgED3VO3RDmU9KlFVSolrd5g== X-YMail-OSG: zxmkMa8VM1nfDaOsyEpEZdJo1B..0wEf5oAN9POuVQl9eYpQhcn5Jy0.x8.gKp6 zyHbuNJnf6nOduratVAWtBcriP0Id5oXs63b6oXowdcjAbBl53xAx7oS0JdrAvZMORfIqV4sG9H. AHspDbcX34pXINTvxaKZX2GTgnL41e.IFwgKuvDkrVfx.cnno3D6pSOGSme_K8lxAser5TsPZqCW 2GaiZFcJUtSguA0YqOmOVOCdUpPGsJqVKQ9OhyI6kqcGJlXj.upFfrJCKlHgrirtmTJ7YqNYRfkd 9MSHLZjkfO8QioVll6ttLaGv5U8z2MwtWlvCvVd_a7ZxbtIEl1vOA.8PE2Ga1We2ROatOm25WTO6 hbZzOQr5ILTPLKlxmNVTfOWK.7iXNK7Fs1IxeoFU4Rwflz_YELAST62AeiUa2zdhh4g7mobWioZo BJWKRFpZ957EfceBXNkn0pSrLGXd4vF4ODaJLXMUtDMY78Rom_CmZrTRegbW4QQOthLcUwyCYcuZ d0LAWcuunD6dYAspA02rxV1YWgvpTBDIyVtS_4JyWVVfoF8SWUM1vHPWh2u6C5Laj._WN7i5X2hU T0fj5tZbxigH6w2ChJFC1aD_86j4C1S2pAgKCv_BXCALXq1_FJC_VWlZ7CUhdSFtjv2wFdtUlNtt RzBkZovCJYSlI9ztjR3pxf6AgN1pZdhLDR.J27ZW9qmGe4Z4CFDYBlhHW80mhRUkoQJe_bJIRueq TWoxG_Z0jzQev1ockB8BkfzkYKBPCbiORKB7QJiHEcD4jSGDys1qAwjyvC30KPlKzU1VmUMpEiMB f4qh9K0f7z6sHPcbIcGrRl8LjJbA6qd4EwxRqgr6gNfLaer18sG16vOFU2WkYs3j5hwEtPYYSuZf LBo9vo5VLzqD4RgSGybkc26hEC1COXjmhpJr51IzFshto7Au_jDtybSlR2gvSAiEHeEq6TQ1H2Rt bgcp29ZB.gTIf2IDFBjJn4PZbon8fySRPCBPLD8frjLyrfUpAibFVchbYZe2hSEBfScbxYdUlP6n 7MVLwopreUo3cBM_jRTE3MdkTao77dlWrTozyeoJ3qcGZKCRWKp5IFbS1_1U1AwXwIS99.mHkGP7 A8N4Qg.SuUTUiaZIHBbAgjzTIhV1cRobtUwskUX2IZnDcvuEZa5pnDQ3Jeh9wOdoqmZB2XdM9asj .qLIUaXuEtSTCciWsNUGnp5e7GIdtCCsxYVij_Ru2PaEmj0M.uTp2rhEpQrXv_fVzmFWqa8Hs1em cytCqIDx3jodQAGVjg0Yuy0jaD_fGIfV9PrVrHgBWSxHIeMPJoiY1Cp3InXv33sQFECdTD1xj0q7 uHjM2XOM.Z8MbdukhYljutbrZD5l6Jzs5YYTuDxrTzWasZsHKiYRS_QhfeO_9pnOsOLejRmYSJIG rlmDLUcAUX6Nz35cWKbFKfmVFHSpkq.biwukJEieMWbcltYW3VvTkaPE9hLVGRE5To0.H1F0Xj3b L34_R5wnkPLWv4t3u4G4GBB1eNGplK7O.hL6FGsSIEpaDrTNq0uuHg0XcFMdo2VQLFJPGCulijUF BPVbGkWR59kAta.B0.y3Uw09sHgBz6q_8zkVMpjbMWYEHFpp7XR0YZUzcuwG2umn6mjSzSwsThcP SrSfw6V9t6kPClDuXz98C8kVUZnp2CizAqfIG9lJUQXdANGoTRg9xbMJR8V1m6YviVz4xTKsriIO Un.ixKwqw_NTOxmbzNbfeGQ8LvwpcBoVXvLizOuw2lWTSyf59xZqF8PB5ODZgvt8Lf817D9l0k64 1SlbLcnVcP4ZeizoWRo1Z.dznzaGlgk4vZvUl6xGQIcRv7bL5xIm2VBAqXIo2Ydn4n4S8Rki4k13 UU0uhNkU2btGEn6jnFPZOdP2iVrtvPdU8GwuE1QCZhhY3kGiEvD6Q_LBVmFocvCtd1FwNIjQLbH2 HLdDuIS6mHtTdPeOtenecQ919WKIGUv1olIOQCdgcqR5hZAv0FVp7i8K4ljs2gfKwSj28NAG9ZN3 XXTpldvZt0M5AkIXFGBXW48orNvhe1bpAbL1XfccZ1DpOY11XivbwXtujXNzizxUfJtfJVEth2vc EEjsjE8U91P.47aXHNqhO6IJeQn1OYTXiwmZ1iP.9HX5cu3yPb8WDob4Yd_nGWouqP9v._BlvSjp oDLQhHqmOqjuv8swmfehLv4RR1STBQO87cY_zSBEu8TCIj9MM4KhQL2I.gKOsq909DJQi8WqSJE9 dcEA.c0XXoPIPMX4XNwDRcYdbHqdiP7b7NDe1tH7sth9BVP_INaohQca6U1zBAZwdcwzMduPddT9 3kO13HV9pKUcEcOrBjhN5S.3CwXODn2ha1zg4mDBLyFEI3uE- X-Sonic-MF: X-Sonic-ID: d4921dd5-5939-483d-a190-971f2945b0eb Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Sat, 2 Aug 2025 06:39:21 +0000 Received: by hermes--production-gq1-74d64bb7d7-r4nbl (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 48eb9184372d616902793749eae74ec1; Sat, 02 Aug 2025 06:39:20 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: RE: git: 8d4464377219 - stable/14 - vm_page: Fix loading bad memory addresses from file Message-Id: Date: Fri, 1 Aug 2025 23:39:09 -0700 Cc: Konstantin Belousov , Mark Johnston To: "romain@freebsd.org" , dev-commits-src-branches@freebsd.org, dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3826.600.51.1.1) References: X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.146:from]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.146:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim] X-Rspamd-Queue-Id: 4bvCpm2qXxz3JDd X-Spamd-Bar: --- Romain Tarti=C3=A8re wrote on Date: Sat, 02 Aug 2025 05:31:12 UTC : > Romain Tarti=C3=A8re > Date: Sat, 02 Aug 2025 05:31:12 UTC > The branch stable/14 has been updated by romain: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D8d4464377219dcf45e87510b73767c9e= c3515bc2 >=20 > commit 8d4464377219dcf45e87510b73767c9ec3515bc2 > Author: Romain Tarti=C3=A8re > AuthorDate: 2025-07-25 18:31:57 +0000 > Commit: Romain Tarti=C3=A8re > CommitDate: 2025-08-02 05:30:18 +0000 >=20 > vm_page: Fix loading bad memory addresses from file > =20 > 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. > =20 > Approved by: kib, markj > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D51433 > =20 > (cherry picked from commit = 202f8bde836dc86627be2b5b98174d9a0fb2eaba) > --- > sys/vm/vm_page.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 =3D ptr; > if (ptr !=3D NULL) > - *end =3D ptr + len; > + *end =3D ptr + len - 1; This looks wrong to me if/when len=3D=3D0 is possible. It looks possible, see below. > else > *end =3D NULL; > return; > return; More context, original code(from main): . . . mod =3D preload_search_by_type("ram_blacklist"); if (mod !=3D NULL) { ptr =3D preload_fetch_addr(mod); len =3D preload_fetch_size(mod); } *list =3D ptr; if (ptr !=3D NULL) *end =3D ptr + len; else *end =3D NULL; return; . . . But in /usr/src/sys/kern/subr_module.c : size_t preload_fetch_size(caddr_t mod) { size_t *mdp; mdp =3D (size_t *)preload_search_info(mod, MODINFO_SIZE); if (mdp =3D=3D NULL) return (0); return (*mdp); } Note the "return (0);" (possibly *mdp=3D=3D0 as well when mdp!=3D0 ?). Then, for that return, showing the substitution: + *end =3D ptr + 0 - 1; Simplifying for the specific case: + *end =3D ptr - 1; That looks likely to be wrong to me. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Sat Aug 2 14:06:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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 03:41:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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 18:53:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bw8414bh7z63hnV; Sun, 03 Aug 2025 18:54:09 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from agrajag.blogreen.org (agrajag.blogreen.org [135.181.146.104]) (using TLSv1.3 with cipher TLS_AES_256_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 4bw84057Mbz3R8X; Sun, 03 Aug 2025 18:54:08 +0000 (UTC) (envelope-from romain@blogreen.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=blogreen.org header.s=marvin header.b=XPddry2f; spf=pass (mx1.freebsd.org: domain of romain@blogreen.org designates 135.181.146.104 as permitted sender) smtp.mailfrom=romain@blogreen.org; dmarc=pass (policy=reject) header.from=blogreen.org Received: by agrajag.blogreen.org (Postfix, from userid 1001) id B1A1FA6805; Sun, 03 Aug 2025 21:54:00 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=blogreen.org; s=marvin; t=1754247240; bh=HlNy4zY+8ltQCvsAKg8KiYCoXOiFPmyYGNGudTWZBGA=; h=From:From; b=XPddry2fgEHDiisN++Gls8fTIf47PHzORBBTRlJk8Y15bgm/WoF9vPVx2iOXfD5e3 5hM7gX7G7XnpBlY9Cr9CmRoaZhrrd2fJcQcINdTZvYQ2EeLgozIcv2V5hXod2oULgm VB2wwMcuII2ERm+UCOMPxl3HH+usy61caU6UKyc8= Date: Sun, 3 Aug 2025 08:53:55 -1000 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: Mark Millard Cc: dev-commits-src-branches@freebsd.org, dev-commits-src-main@freebsd.org, Konstantin Belousov , Mark Johnston Subject: Re: git: 8d4464377219 - stable/14 - vm_page: Fix loading bad memory addresses from file Message-ID: References: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J9NsQzbtQ/QfLRbh" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://romain.blogreen.org/pubkey.asc X-Spamd-Result: default: False [-5.90 / 15.00]; SIGNED_PGP(-2.00)[]; 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)[blogreen.org,reject]; R_SPF_ALLOW(-0.20)[+mx]; ONCE_RECEIVED(0.20)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_DKIM_ALLOW(-0.20)[blogreen.org:s=marvin]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEFALL_USER(0.00)[romain]; RCVD_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; FROM_HAS_DN(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-branches@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:24940, ipnet:135.181.0.0/16, country:DE]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[yahoo.com]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[blogreen.org:+] X-Rspamd-Queue-Id: 4bw84057Mbz3R8X X-Spamd-Bar: ----- --J9NsQzbtQ/QfLRbh Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Sun, 3 Aug 2025 08:53:55 -1000 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: Mark Millard Cc: dev-commits-src-branches@freebsd.org, dev-commits-src-main@freebsd.org, Konstantin Belousov , Mark Johnston Subject: Re: git: 8d4464377219 - stable/14 - vm_page: Fix loading bad memory addresses from file On Fri, Aug 01, 2025 at 11:39:09PM -0700, Mark Millard wrote: > [...] > > > - *end =3D ptr + len; > > + *end =3D ptr + len - 1; >=20 > This looks wrong to me if/when len=3D=3D0 is possible. Thansk, let's track this here: https://reviews.freebsd.org/D51717 --=20 Romain Tarti=E8re http://romain.blogreen.org/ pgp: 8234 9A78 E7C0 B807 0B59 80FF BA4D 1D95 5112 336F (ID: 0x5112336F) (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated) --J9NsQzbtQ/QfLRbh Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEgjSaeOfAuAcLWYD/uk0dlVESM28FAmiPsEMACgkQuk0dlVES M2//PwwAno1sJXTN9ZFXsTb0bowBLM3iPrvmN31vqJbh2b97JAgwPQgPCbz2e5hA 7BH6CcqMCc47f48PT68JEuvz8E5XF8jV3ZNvPSAG1E5owKYgo6eqWHr8/1gmSkdS Vy4DgIKC+hNTsibnHK08GuDbgz0/2pYDKwxVDiCtCPF5NV8FrcUryARw9grsBcv0 kytTf3RpNeA+WFCUgTMXEHirlJVLSnG1gEGJ0zXmmRAH95Lz+JvMdVCi/+2ho/JS ojgodPvlSDoegFu8ZYTV8P8l2SIAR54UJ9dDrOfXdVQKS36NVZ/scLZF/oU9/yQV VQEjmOpm4yeRQLjrQ28t8FD5GyqrwS2bUikIy8s2SidAIBjte4WmCX0xHy+6y5f2 4UxOHg8Z9TbivY4qPeBs5w7CUVGgRWn8+PHe+/+B4lJVQxvvYOtQ5faDj6cYfc8E YEdm+CCXBfsr7gb0Z3ckbnmFJpThDk7j8uT7pdTpNePiwvqHlhpaK3D8+DoCXz3m puGUZvTN =vYiH -----END PGP SIGNATURE----- --J9NsQzbtQ/QfLRbh-- From nobody Sun Aug 3 22:11:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 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-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="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--