From nobody Mon Sep 29 03:22:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cZmhZ5Cp7z68lfT; Mon, 29 Sep 2025 03:22:22 +0000 (UTC) (envelope-from zlei@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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cZmhZ3KCXz3p80; Mon, 29 Sep 2025 03:22:22 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759116142; 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=+MhqIeRYv86kAgCsgJPqwAUil2CstKNPbCXkTyXkViM=; b=WpMnyf0Cu4X+lrRluicdY6n0UzTrweGfeu+yLGWmqEOq17pxZKOVhhK3uUtNy+uRkpShMm P/DMeuGoKaCS9l3kjvp/5cToitt/+GRp7TQrVSj3EgPPBRWQxk/0iSdsItCUM0M12V4XXm 3DJPx4GR1GaIAVzVd3T656pizayChj/SiF5XyxcN3mb1RxlgmM35fSk1VhzoT5HWziLC2a Ay5opa+wL+CyzxB+MoageNig8qvrDpt768U5h3VLlfVMZNqMyj5Vd+oJ/QKtWqeXYnRKwI 7tZybkcAj+weq9YL+p3kXuOE0JdHdWAbMT71ev/qQ2vbRwNonQxaQqCPROeHMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759116142; 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=+MhqIeRYv86kAgCsgJPqwAUil2CstKNPbCXkTyXkViM=; b=iIQx12kUpjE8puc6KvhKhMp3GY81sAvdYLLBoatNgYz6vxA8iL1XsENVpFmgAXD9sqeQwM HrbA2NG9kKBrhOEneT8JW64qj6KeBNTJbVzIadApZhtKeRJajvQLxJNJbAJDvDL2caZhc8 NMt93JukceqI4X8iwAVTavymVHkswRZfh0zSz5HOIhjkjAOjZAgtKEWxCe5R/YKJ0HDN7R K/VNCUd7WyTx1Un5sbCHJIHi8jxsKw8aOWv5aCP6WnSOTj4v4GzA2xPyWF/5aIhGXpyI0x fgEn84BNTspGHw7coKRUDok00yebezx80veNFS5m3kxL4Izt5Lg7VxDI0y6LmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759116142; a=rsa-sha256; cv=none; b=FLEtr3o8M7exNKtP61aQ3xsPOBa4jG/rX9fB6GoWww20MyMq+tzED91U8baCUnIKfkDKTD qXAuR8Q3ZCSZYZCGm01EyQV+K4OAL10VM29XMcSK2zI4f6iaONWnyx3H72E2FeIu9z2rIk MyBoUkkRz1aqssSkHg0sa2fe9pe3TNH9kJoq1A2mGUI9Oy0KG0bQQxh02KesY9x10Tok3O tBUfof8MYOKn9ODOxygaNCijxR35kBQNTT9SwP+QGSbWiMfnFWzkV8wj3yzzS82Pz49Gvq Mby5k+1wCYQMcO9XNYOKXX2EzSw7RzTKCfTQGUhzEgj44Qv3iLdG8TKlrjmvwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cZmhX2SVLz16HT; Mon, 29 Sep 2025 03:22:20 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_A963760F-6B49-4366-A5BC-DC8BF57C03DA" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: b4c6c3db0379 - stable/14 - ipfw: Teach ipfw that EtherIP is an upper layer protocol Date: Mon, 29 Sep 2025 11:22:15 +0800 In-Reply-To: <20250927143548.661e75f7@ralga.knownspace> Cc: Michael Tuexen , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" , Warner Losh To: Justin Hibbits References: <202509271513.58RFDst3083057@gitrepo.freebsd.org> <44DAB9B2-B037-49B0-9153-90B4CFBB6234@FreeBSD.org> <20250927143548.661e75f7@ralga.knownspace> X-Mailer: Apple Mail (2.3696.120.41.1.10) --Apple-Mail=_A963760F-6B49-4366-A5BC-DC8BF57C03DA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Sep 28, 2025, at 2:35 AM, Justin Hibbits = wrote: >=20 > On Sat, 27 Sep 2025 20:32:20 +0200 > Michael Tuexen > wrote: >=20 >>> On 27. Sep 2025, at 17:13, Zhenlei Huang wrote: >>>=20 >>> The branch stable/14 has been updated by zlei: >>>=20 >>> URL: >>> = https://cgit.FreeBSD.org/src/commit/?id=3Db4c6c3db0379a5b3d34143325805cd7e= 68cf3d9a >>>=20 >>> commit b4c6c3db0379a5b3d34143325805cd7e68cf3d9a >>> Author: Zhenlei Huang >>> AuthorDate: 2025-09-16 15:58:24 +0000 >>> Commit: Zhenlei Huang >>> CommitDate: 2025-09-27 15:11:35 +0000 >>>=20 >>> ipfw: Teach ipfw that EtherIP is an upper layer protocol >>>=20 >>> so that we do not discard EtherIP packets ( over IPv6 network ) >>> when net.inet6.ip6.fw.deny_unknown_exthdrs is set to 1 ( which is >>> the default value ). >>>=20 >>> PR: 227450 >>> Reviewed by: ae, #network >>> MFC after: 1 week >>> Differential Revision: https://reviews.freebsd.org/D52566 >>>=20 >>> (cherry picked from commit >>> 0418e6690e91aa6c38dd9af9da43c4c5a9dc1cd2) (cherry picked from >>> commit b1c96e54b906d0cdea0b5a9c74cc295803dfe50e) =20 >> Why is this cherry picked from two commits? Shouldn't this be only >> cherry picked from the commit to the main branch? >>=20 >> Best regards >> Michael >=20 > It's common to cherry-pick from stable to older-stable. This was > likely cherry-picked from stable/15, which was cherry-picked from = main. Exactly ! I have ever encountered merge conflicts when doing MFC and it is painful = to resolve the conflicts multiple times when MFCing to older branches. Also it it likely that branches will no drift too much between closer = ones and less conflicts can happen, e.g. stable/15 and stable/14, but = not main and stable/14, As Warner pointed out, if no merge conflicts happens then it is OK to = MFC from main to older branches. To make it simple ( I'm a little lazy ~ ) I'd always choose MFC from a = near branch. Best regards, Zhenlei >=20 > - Justin >=20 >>> --- >>> sys/netpfil/ipfw/ip_fw2.c | 7 +++++++ >>> 1 file changed, 7 insertions(+) >>>=20 >>> diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c >>> index 0e0ecd3c6b20..928ccefe4803 100644 >>> --- a/sys/netpfil/ipfw/ip_fw2.c >>> +++ b/sys/netpfil/ipfw/ip_fw2.c >>> @@ -67,6 +67,7 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>>=20 >>> #include >>> @@ -1717,6 +1718,12 @@ do { \ >>> PULLUP_TO(hlen, ulp, struct ip); >>> break; >>>=20 >>> + case IPPROTO_ETHERIP: /* RFC 3378 */ >>> + PULLUP_LEN(hlen, ulp, >>> + sizeof(struct etherip_header) + >>> + sizeof(struct ether_header)); >>> + break; >>> + >>> case IPPROTO_PFSYNC: >>> PULLUP_TO(hlen, ulp, struct pfsync_header); >>> break; =20 --Apple-Mail=_A963760F-6B49-4366-A5BC-DC8BF57C03DA Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Sep 28, 2025, at 2:35 AM, Justin Hibbits <chmeee@has.gonegalt.net> wrote:

On Sat, 27 Sep 2025 20:32:20 +0200
Michael = Tuexen <tuexen@FreeBSD.org> wrote:

On= 27. Sep 2025, at 17:13, Zhenlei Huang <zlei@FreeBSD.org> = wrote:

The branch stable/14 has been = updated by zlei:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3Db4c6c3db0379a5b3d3414= 3325805cd7e68cf3d9a

commit = b4c6c3db0379a5b3d34143325805cd7e68cf3d9a
Author: =     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-09-16 15:58:24 +0000
Commit: =     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-09-27 15:11:35 +0000

  ipfw: Teach ipfw that EtherIP is an upper layer = protocol

  so that we do not = discard EtherIP packets ( over IPv6 network )
when = net.inet6.ip6.fw.deny_unknown_exthdrs is set to 1 ( which is
the default value ).

  PR: =             22= 7450
  Reviewed by:    ae, = #network
  MFC after: =      1 week
  Differential Revision: =  https://reviews.freebsd.org/D52566

  (cherry picked from commit
0418e6690e91aa6c38dd9af9da43c4c5a9dc1cd2) (cherry picked = from
commit b1c96e54b906d0cdea0b5a9c74cc295803dfe50e) =  
Why is this cherry picked from two = commits? Shouldn't this be only
cherry picked from the = commit to the main branch?

Best regards
Michael

It's common to cherry-pick from stable to older-stable. =  This was
likely cherry-picked from stable/15, which was cherry-picked = from main.

Exactly !

I = have ever encountered merge conflicts when doing MFC and it is painful = to resolve the conflicts multiple times when
MFCing to older = branches.

Also it it likely that = branches will no drift too much between closer ones and less conflicts can happen, e.g. stable/15 and stable/14, = but not main and stable/14,

As = Warner pointed out, if no merge conflicts happens then it is OK to MFC = from main to older branches.

To = make it simple ( I'm a little lazy ~ ) I'd always choose MFC from a near = branch.

Best = regards,
Zhenlei


- Justin

---
sys/netpfil/ipfw/ip_fw2.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/sys/netpfil/ipfw/ip_fw2.c = b/sys/netpfil/ipfw/ip_fw2.c
index = 0e0ecd3c6b20..928ccefe4803 100644
--- = a/sys/netpfil/ipfw/ip_fw2.c
+++ = b/sys/netpfil/ipfw/ip_fw2.c
@@ -67,6 +67,7 @@
#include <net/route/nhop.h>
#include = <net/pfil.h>
#include <net/vnet.h>
+#include <net/if_gif.h>
#include = <net/if_pfsync.h>

#include = <netpfil/pf/pf_mtag.h>
@@ -1717,6 +1718,12 @@ do { = \
PULLUP_TO(hlen, ulp, struct ip);
break;

+ case IPPROTO_ETHERIP: /* RFC 3378 */
+ PULLUP_LEN(hlen, ulp,
+ =    sizeof(struct etherip_header) +
+ =    sizeof(struct ether_header));
+ = break;
+
case IPPROTO_PFSYNC:
PULLUP_TO(hlen, ulp, struct pfsync_header);
break; =  


= --Apple-Mail=_A963760F-6B49-4366-A5BC-DC8BF57C03DA-- From nobody Mon Sep 29 04:59:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cZprz2vLxz68svG; Mon, 29 Sep 2025 04:59:47 +0000 (UTC) (envelope-from avg@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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cZprz24bVz40xR; Mon, 29 Sep 2025 04:59:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759121987; 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:autocrypt:autocrypt; bh=fRaVo41nyqO2w3EocUlVjVcyFrUcyV5oJEMUAjfN98Y=; b=OguUn1O18nZ89IxZynvY5wSwzDZcGVwch/2f8LB7pTryqz92mpKJzRGYZ5AEtA19IV4QFN whULng3QxWO2k72K4Ii/gaNZVzFbJmUTqCcyFWVid9uBvWpeOGWb6JJ/iFzrtpx0beenne BEvxrEMz7Hd42la/l/N9hNInjvoLQZN0nGIFE2hzWXsAND/0hwkDEABXbLibuAZWdIayv5 H7cpBHvnFo2NqPMGtPSxtbznJdAakr1WpjwA1oc3ovT7E2r52yR0JOZKbkSoByK26m55PM gRCWTamfw0bfoLifAg1hxcfxDT8l3AhcOHQDc8M5B/DNrxvIM+TJ7eYL57nDJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759121987; 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:autocrypt:autocrypt; bh=fRaVo41nyqO2w3EocUlVjVcyFrUcyV5oJEMUAjfN98Y=; b=Iin5ManVPopzcK3A96NtzFrbOg7P2GXM4Pdrlr61mXOw86tlPWEq2jz5EFFUWJhiAqkXe2 xB8Yn6QH3eDGSOaUHZdLGBjUFMsUdy959S2m0BMwtpIiW002puAKayj6nilijbM6+ZyF+Q EouvH5VF77uviQJmbjKnXut0lzQsy1B+a6WF1xl5n3cnVO7WBMi7bettxSZBnrq7KtLNFd xG8WdhHhqwo/8w0YTaAyKBg1P0jj4TNO/b0nA0okEYoIMbdOSnZAB0UqGKqO8gjSOgebfL RIzOQEPi426PHXKqS6+9/FnJU7HeZAwnA1LaQLUdmummjNNAez4btH6tLGwZtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759121987; a=rsa-sha256; cv=none; b=MdU1Oqb0dKDJHLrgjPpm1hlYSo6OjuTyDY7+YTRW1QJF1wehRuASg/xFmG6tl663d+0Q5/ Z3pNEQeVLchleXvExNLs+61222zbBP9u/9+GO43exb46zCTDQZdCe8Vjuhhohycj76QxDZ kOnY0QU7Tp8BtUGTrGsHvtPvLbTxi8Vv1CfUTZubrueRvZ6yNuAPIc+/GINbq4DFhHrEXu MzO5jp92LyrEo6SJ80vwJycszo4qvmjUADuPwSK3eQt0XnjE9IEPp24gc2cBCwOhflYEZn dnAJkqsy2uBtl2OKW8WpEWzky/0r5OG9KS7Ouc32H6b6TpFCWilWGV/We4DoQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [192.168.0.88] (unknown [93.188.39.137]) (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: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cZpry1yfnz18h0; Mon, 29 Sep 2025 04:59:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Message-ID: <08b7ae7f-8799-4cb5-b5f7-de4cb9c828e8@FreeBSD.org> Date: Mon, 29 Sep 2025 07:59:42 +0300 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: b4c6c3db0379 - stable/14 - ipfw: Teach ipfw that EtherIP is an upper layer protocol To: Zhenlei Huang , Justin Hibbits Cc: Michael Tuexen , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" , Warner Losh References: <202509271513.58RFDst3083057@gitrepo.freebsd.org> <44DAB9B2-B037-49B0-9153-90B4CFBB6234@FreeBSD.org> <20250927143548.661e75f7@ralga.knownspace> Content-Language: en-US From: Andriy Gapon Autocrypt: addr=avg@FreeBSD.org; keydata= xsDNBGcKrHEBDADRvwQOK0b/yo4ys5cs6bOQMhEh4xtfbaZ/CU00cpPgUip3sOZCdrtMWlRC g25z97prxE9pKueZi+HXDhIPpa9xl14ghqF4oYScuJ1i18HyiOH2y5Q3Vv/TtFiSzicd3EAu QgS3jVidpgDSPDdj2Yz3UxYpZ+PuFl6nOnvCvqOFcjUlzKCyPaiN2b86l1Nscmhnc+zQ/faB erUOEFEDQbWMA5YfXi8HrbeR16hfRfGt7E0aMDlIj9FIPIq71UWMN9CimPgs4+rbNr1MAlLa z4GxSDhVYZEY5rqtCzr+PLXboRQWnaUwXl0/biw9enf17NHdYv1SNAFTX2eC4dZ3qBVI74dS PgNprm+PMfz+6Hhs/dAv+Nan5nVhg3EFIjYTiy0MnjMSq8uI0v0ykpAGAcJJ5xl6d23aLxgN 6f0z6pJRCO0hGPgU7UzvFD0MxJxmbzqdT1R51KDan1oD41b+tjl2LMBuCDCoB0U44Pu0zLdp xMfFTxCXtwIYKIUxwd28jwMAEQEAAc0eQW5kcml5IEdhcG9uIDxhdmdARnJlZUJTRC5vcmc+ wsENBBMBCAA3FiEEmXvSmjiQFHPVOpLnzDOt5NLj67sFAmcKrHEFCQeEzgACGwMECwkIBwUV CAkKCwUWAgMBAAAKCRDMM63k0uPru5tSDACFK15LLbq89RSQ6QMnjiIm1t/wYJyumb519MHu Dhzxx1lbr8oghf0RHtF6kYRLQPaW2VdToi74pRobd3CN4bhZKDLSL6WfTn17RfavDjL6Njwp KBo30CkOeYKWq1mDmo0xEoQj8cc7ybEZnus+YScZOpj8Ti4EFwhRt6SHer7YDb161IHKL8m4 MsCxpFSGEjbKj8Iul3Ri/fTOO8w14ivcuEEQIvJt4/+4YV5Az8G23wKzL/3aJ7SOT3oYGmR9 atBTmVO3DlODjM+rZLegd8SfLSPTcBTHspWE5duemIzZbEX3BP77r3Qx4Fo5Tkit3bG1XVar yPQato+sFGFEGifdE9USBQoAoOaaeZevwAWjDU0TIuCT0CUe0sKtQuNP4LRq0n9EEHOXBu9a CfdMhFUSkAZnuE7miSVwgPvoVNJ1stA37EXLN/sVsWik7wslTQ5vF81VpdGFiwoQPOe2XEKh ogcwGSnXbwv1gD4x+Gz/7Y+kFyr1NY+4/nSaeXVcS2fOwM0EZwqscgEMAMQTe6ypAmQe/TFO HqKD2hfFKdksTptKi6uEh8xIwct8G/0FBldDWXo9eu8CGr/ZrDg0/bAwJxbaLRQCMH19Gq2Y hLvZ1QK5GQJVzZKcqfxbF2LiDUTs6WkdOBIhGpdDy7p1xFrvqCGCtNFYHuGYm067EozibBSF BWAPstKu2FQuVHZNMOfs7p3OIz3Yfqu9woXDeg3/8G2qVQJINe+8EwXKlhgh4CyDbq7nAZoA kIu1SE9z9u3WI5mcNy/0dFmVUsFxBqRC3ewbvzie8tKyZ9yFOlaZPT0Y4nRBXQTI3mLZ8zQ8 mtrWK5OOmrJ02kdeO9RBXe+OMaUUWMf92ZIoBFb4HP6N+B+4N1y1OwULousfl7JRoYxA4MRL ls7E2sSoJvrEBTJB3Pc34xu8rsJ1A5V3NgN6djX8yEZYpTRkcmrBeWy/ofDqZPVqneAx0LRm eldDS9msXDW4KXODyPZ+9unvmHAcoH0xaBYaSH44CDZDQDg4LNcmbOvuu1TEXBJhjQARAQAB wsD8BBgBCAAmFiEEmXvSmjiQFHPVOpLnzDOt5NLj67sFAmcKrHMFCQeEzgACGwwACgkQzDOt 5NLj67sUCAv5AXqgWnYN9EblapMbZjkiqL8pZQ0GNqh+Pg9FwbyULxjtRTO6rD4D0IxizByb ef+neeUNyYlagt5nfKMysEr0SU/gHKCi8vyTF/63ukMrGUNGmJJxrndl5ZYKC6j6eX7twrZF L1Uvlmn6FnQ22red5kHO93fDjG4zaDIZvHfwj7kzjZ4tpC7Byinf88s14mdZeScc0PnU2hj4 UGYju/wg2FF4YxaZYhcmdTiRYY0Wx85XSMZv19pnn78sadEuRvfRd4JTmw++j1xGXeqQGWzz /CTG5/Ex9GAkQ02hZbmi236byDXoet4G8TEyOph9QFVkV9bNd0jQZaFZPGEj4PSPUYGAF7s5 xJaNGgctC3aZ7WjEv1FBoo44XCU4xcjJ1wZQUrHxRhx6TW0Jtcl0U9qfKFW30TSPo6RyiXuj X4ltWKAtjoXB8nUmEJckaz7IRu2b4pXDeazZuz5JBygUs10yJjDxh2vFQZo0KaBAPx9MZlPn gpPTjT15L8xGftEjQXF6 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 29/09/2025 06:22, Zhenlei Huang wrote: > I have ever encountered merge conflicts when doing MFC and it is painful to > resolve the conflicts multiple times when MFCing to older branches. I always enable Git rerere and (almost) never regret it. -- Andriy Gapon From nobody Mon Sep 29 08:07:18 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cZv1W0CHqz695js; Mon, 29 Sep 2025 08:07:27 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cZv1V6QxYz3FbS; Mon, 29 Sep 2025 08:07:26 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759133246; 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=44mVreuxDdwgW6jQPcQbEMxtxCg3vuZSss7qXdm3bfU=; b=GaR5ChgOhvHpHnyUcSikslOs6h0f9YHaUFXJF+t6uVNqqifI2vwMCMUrq8pxrIFwVueNrT qO0nP+lVS28fheR1lNG5QTbphl7lp/s0IvAS8YJDlX8QCaPr9faRjI2ab8BjiumxQAlvcF ASMiHxfGEi+K0gsFblt92QUVTLT9hkJtm4694syolUtFLHC5Tz2FVtnvrgbXwNQ4ljw02z JHXeSJEFzH6/sXNVJbRH9vUu+7izzn91/mIYozHol0Zp5ymUmNMFuLlSvoNfqjL0GgpZez 3CKLGC8jBUZ7iGyd3brLYVGj+7sigv8UsuGIWVrch3/44VZ7fpW0otR+jYJyew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759133246; 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=44mVreuxDdwgW6jQPcQbEMxtxCg3vuZSss7qXdm3bfU=; b=NP7BiX9+H3lwb83cqe24ksvmRtE9tDp0ffuE4/JD0DeKX1AdG6b6RqXHm+LsXG9cI9BV56 CE//8cAEL58Lk5kUaQepJZc47Wb7QPymxVdDH2ER2iK7fUAXYPnl6ibmKIlmkjRRn4M99j hAmn1vN+kEWMNapitfokCpM1pjzOT4H3zyeTmpId2hdvriqwHVaQJR3kQ7rWS0Tz0G2Cwz tTIQeOhVEh2ADwGoemItNEbLBSiJhZUr+ZTnsPT5TcGHUDNFwPh0AIUztKGe6G0adIGYRn cBWS7f9YKHKxE3HTthrqt8MNV6udXf/C/+KxFU0+wxHtXS6DgUdOKoqNJiTnbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759133246; a=rsa-sha256; cv=none; b=ZL6bfYuSIYF26u1dqbMKgsPRGUzDVkR1YkUBQOzG9igyaBupEZaT5E1XlwH9Rb+jUjF62m 5qxXX6JELcxf/To/PCWqcl5jPc7cqsd/R38GDdVAMJXIXuvJENym9yecl+KJQUIYKz6O55 AYTr7oZAiOw15vfBLMFzKsgZnyfg2XuzxwvLn+l2+CMAK8B9zHvvM/sSRvZIaaAJd12ScN c6LSCDfdp1HWyaakmxD3cEkT0PT9d5WJoNY2m7+/Lx6uLDkxDUd/vgkhehltE8JKyu6NkU /RXn/J8bqd11RE3i+os/Y0cJuNVpUagwlDhhSqzi1CliuTv/CrQAWx5oy8dqrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cZv1S4k8bzxh; Mon, 29 Sep 2025 08:07:24 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: b4c6c3db0379 - stable/14 - ipfw: Teach ipfw that EtherIP is an upper layer protocol From: Zhenlei Huang In-Reply-To: <08b7ae7f-8799-4cb5-b5f7-de4cb9c828e8@FreeBSD.org> Date: Mon, 29 Sep 2025 16:07:18 +0800 Cc: Justin Hibbits , Michael Tuexen , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" , Warner Losh Content-Transfer-Encoding: quoted-printable Message-Id: <3BE3B2DB-4A7B-4C66-8CD7-DC7FF907CD82@FreeBSD.org> References: <202509271513.58RFDst3083057@gitrepo.freebsd.org> <44DAB9B2-B037-49B0-9153-90B4CFBB6234@FreeBSD.org> <20250927143548.661e75f7@ralga.knownspace> <08b7ae7f-8799-4cb5-b5f7-de4cb9c828e8@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.3696.120.41.1.10) > On Sep 29, 2025, at 12:59 PM, Andriy Gapon wrote: >=20 > On 29/09/2025 06:22, Zhenlei Huang wrote: >> I have ever encountered merge conflicts when doing MFC and it is = painful to resolve the conflicts multiple times when MFCing to older = branches. >=20 > I always enable Git rerere and (almost) never regret it. Nice git command ! >=20 > --=20 > Andriy Gapon Best regards, Zhenlei From nobody Mon Sep 29 13:40:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb2Q93qSfz68Fkc; Mon, 29 Sep 2025 13:40: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb2Q93JLDz3l77; Mon, 29 Sep 2025 13:40:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/eaE6eZguwngVdKSyRtd13/KF+ale6zxbVw8cN0vaUY=; b=TEpm1P/FhZ8rNgSNZJj0evdt7oCFxLqSuBVQX+OgJl+WGdFTHYaGmJX9j7TL+g54qrWKTt 0/VkF7eVvJvB9rtn3R2h6/C94soB8x2Jw/+HdvBTq4Q7NxrIisgVxOPCtPWuPf3yBCA4el rET0MGg3/YVESKNNB2Ef/shMwGYXN0PEAuzMdVX/rw3+rq0vBoymMp23PrdU2fewGehpMv YGadngLustYLEXy46qlSWnrg0TyBgdOEQjFT0otSKtrJRhQz8/bGbV/t71FsnIkrjweKxp Ve+1Bi568zZyZlA6cXYQcmizpoWYQv5ACZeqXrlI9erstiy6fxuo/pbLyEamvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/eaE6eZguwngVdKSyRtd13/KF+ale6zxbVw8cN0vaUY=; b=J2WXBG7tb+GOq0D1pwAyup1ePAAXGz/lXNte6LEoyA1XjRHFJ4pLMtcTKaT5jmweWZ7lMk RkSGz7O46A6axrJv+oCoAfjv9htH+sEdLscoOAgGb498rBleFzxan0GGQnKjDocXuAZLS6 W3V85X8RUbfKWMGSEmQVJZUhDMQdOCZPuEIAjD9qPyp0g6aHzUdnGG5qrkGrWTBCMM4eyY sBUOPeq+GluaBSkMNq876vhmtogFFmUBUZZJD54aN9d919eyTlWMHr2LGdQKd2SdZb+zR9 5Kfdz1PxNdRRDRwY0SuS58sfQiar0RNj1YURFl5hkkG4ANsaZy+TsY/NAwVIcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759153249; a=rsa-sha256; cv=none; b=RqkYNKMvMdWNNt8IGVoBbq6u4Oy7H5KYh20YhfkDAvr420hptiD4fQbuUnFtUrlzp7KLC0 YtZCYqmdzu8DKK+uX3G4hb0T6C5lEghOS1na2GrCXjgQiwjfWpxOhB/hWUKcZyUdAlu2bH qwrNk214jAa25HFInZqISjefyT8UYepYWk/hbpmh05wBpTQTdlS6P67tMYxDIhL4368CsP vMdhdJ/qIjPGy5olcpGiErvxL59/CcdyS64VKIlHzLTqu9QTGVYh9qwoVHv9sc+j3pJkqm TGNrY/QKZF3zLfSxrTl8EjKR0dHoesLFPDH07MUk3mfJ3rhSvFYcrroYIf9p4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb2Q92trtz16bg; Mon, 29 Sep 2025 13:40: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 58TDenMH014554; Mon, 29 Sep 2025 13:40:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TDenkH014551; Mon, 29 Sep 2025 13:40:49 GMT (envelope-from git) Date: Mon, 29 Sep 2025 13:40:49 GMT Message-Id: <202509291340.58TDenkH014551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Krzysztof Galazka Subject: git: 0c946b6072ab - stable/14 - ixl(4): Fix queue MSI and legacy IRQ rearming List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0c946b6072ab1545af28d4bad8317b2696845adb Auto-Submitted: auto-generated The branch stable/14 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=0c946b6072ab1545af28d4bad8317b2696845adb commit 0c946b6072ab1545af28d4bad8317b2696845adb Author: Krzysztof Galazka AuthorDate: 2025-08-19 12:50:33 +0000 Commit: Krzysztof Galazka CommitDate: 2025-09-29 13:16:48 +0000 ixl(4): Fix queue MSI and legacy IRQ rearming When MSI or legacy interrupt is used driver controls wheter queues can trigger an interrupt with the Interrupt Linked List. While processing traffic first index of the list is set to EOL value to stop queues from triggering interrupts. This index was not reset to the correct value when driver attempted to re-enable interrupts from queues, what prevented driver from processing any traffic. Fix that by setting correct first index in the ixl_if_enable_intr function. While at that fix the comments style and make ixl_if_enable_intr and ixl_if_disable_intr more consistent. Signed-off-by: Krzysztof Galazka PR: 288077 Suggested by: Mike Belanger Approved by: kbowling (mentor), erj (mentor) Tested by: gowtham.kumar.ks_intel.com, Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D51331 (cherry picked from commit 6f41c1fc39d9fa9db989a7b4f325c3ab85b8fb45) --- sys/dev/ixl/if_ixl.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 60e66aeaf579..43c3af056b67 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1151,13 +1151,20 @@ ixl_if_enable_intr(if_ctx_t ctx) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; - struct ixl_rx_queue *que = vsi->rx_queues; + struct ixl_rx_queue *rx_que = vsi->rx_queues; ixl_enable_intr0(hw); /* Enable queue interrupts */ - for (int i = 0; i < vsi->num_rx_queues; i++, que++) - /* TODO: Queue index parameter is probably wrong */ - ixl_enable_queue(hw, que->rxr.me); + if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { + for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) + ixl_enable_queue(hw, rx_que->rxr.me); + } else { + /* + * Set PFINT_LNKLST0 FIRSTQ_INDX to 0x0 to enable + * triggering interrupts by queues. + */ + wr32(hw, I40E_PFINT_LNKLST0, 0x0); + } } /* @@ -1175,11 +1182,13 @@ ixl_if_disable_intr(if_ctx_t ctx) if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) - ixl_disable_queue(hw, rx_que->msix - 1); + ixl_disable_queue(hw, rx_que->rxr.me); } else { - // Set PFINT_LNKLST0 FIRSTQ_INDX to 0x7FF - // stops queues from triggering interrupts - wr32(hw, I40E_PFINT_LNKLST0, 0x7FF); + /* + * Set PFINT_LNKLST0 FIRSTQ_INDX to End of List (0x7FF) + * to stop queues from triggering interrupts. + */ + wr32(hw, I40E_PFINT_LNKLST0, IXL_QUEUE_EOL); } } From nobody Mon Sep 29 13:48:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb2Zj69lRz68G5Q; Mon, 29 Sep 2025 13:48: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb2Zj3mbMz3lsP; Mon, 29 Sep 2025 13:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DR/pK80f03mwSNZPYtl7H62HVkhi9YLIYMRghjMu+o=; b=Pbg3xc67pzR3G/iGU5kJetLVTeDBeCq4z4o/itPi08+zr9lnPF/Uld3vZe5rjguJ+/ohIC tyuhXua3M3CN/PyvgMcNHmQWS68HhVx8udTUKDXQUCXGRh9iEKvZ21JWZrWDtH+oROTsEx mpqgzLn5WOHJKu5wtR01KOq4bJHIV4xeTYofu4oOqY6myDDUEhW0n3ojupz5da65WrgouY 4+79gfWEhSfpI+SnYlY933kuXOq49/upVOKIXqGG4JS9ELGJipdqbTim3t9TRyrV0aYuvz z53/IgMnuwYBV3NQLx1iJ5fcMeGMdB7STI+mILLVb4pSqQGJ0DfUsAjq7hodeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DR/pK80f03mwSNZPYtl7H62HVkhi9YLIYMRghjMu+o=; b=eAjig1wx/MKWfmRHHHTByQXaTooFVVOQAnuVvSo02uFPrk2Rx95tGKD9M7XCKs7n751dsz EpSMcEV/ldyifCr/Dp0eV3m3A0/vlI50ceweI7CkcNMdqHFXn9rWz8Njqc+p1I2o8h+7RF zwxsMiIsW+4XDN5NwXC8e/EaVsei01s3cHbhLTWwovN36HlfPYx+PAnDJMmHU6Gl+kBOMx DSehWaqL8qxDZnQPuB5uPqqBVRrSuNuxWG4Dkw/PGZRJLKcc/wuTcCsaXeZV2UcYVMDa6C 7Be94QK67GlrcxOYThvlAqzLoBJjl7UBTML6kk1VNTTBsalrUmxCo+GsA+tzqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759153693; a=rsa-sha256; cv=none; b=N982YeD5Z4bY0vouH6AQbl+ItSrQYw+fMIUj6tV4PePCf99GodTle348pl7YtsV3RYRmA+ gfUxUi5yFfGoM3oQutf1OFOGQ+G7uX6xqDnF7UjST9HT6sNNq5DOzu6dFzLVjsWT/Utwju qN8ugeYMzioI8D5r7YB++TUpN3tHliUXQUZaRGsH58og30wXbYY2vaCsI+Vkx2eh55hPHg XKpuMQ+A1x2jFef+ZCQC+rpq+5qHrCJrboVvTb7KoBCEq9nMByiCENNlKM+VZ92LlyGXLF J4t0QWFy3kSPlmvrpaatQ2V6EG9Ouo/Kwyuh7mXlwGndAayHgPKPFjDlEIAoWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb2Zj2hXCz17PD; Mon, 29 Sep 2025 13:48: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 58TDmDBI022770; Mon, 29 Sep 2025 13:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TDmDiE022767; Mon, 29 Sep 2025 13:48:13 GMT (envelope-from git) Date: Mon, 29 Sep 2025 13:48:13 GMT Message-Id: <202509291348.58TDmDiE022767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Krzysztof Galazka Subject: git: db8b10d728da - stable/13 - ixl(4): Fix queue MSI and legacy IRQ rearming List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: db8b10d728da9a798253cf4eb70d60a1f1075cad Auto-Submitted: auto-generated The branch stable/13 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=db8b10d728da9a798253cf4eb70d60a1f1075cad commit db8b10d728da9a798253cf4eb70d60a1f1075cad Author: Krzysztof Galazka AuthorDate: 2025-08-19 12:50:33 +0000 Commit: Krzysztof Galazka CommitDate: 2025-09-29 13:45:33 +0000 ixl(4): Fix queue MSI and legacy IRQ rearming When MSI or legacy interrupt is used driver controls wheter queues can trigger an interrupt with the Interrupt Linked List. While processing traffic first index of the list is set to EOL value to stop queues from triggering interrupts. This index was not reset to the correct value when driver attempted to re-enable interrupts from queues, what prevented driver from processing any traffic. Fix that by setting correct first index in the ixl_if_enable_intr function. While at that fix the comments style and make ixl_if_enable_intr and ixl_if_disable_intr more consistent. Signed-off-by: Krzysztof Galazka PR: 288077 Suggested by: Mike Belanger Approved by: kbowling (mentor), erj (mentor) Tested by: gowtham.kumar.ks_intel.com, Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D51331 (cherry picked from commit 6f41c1fc39d9fa9db989a7b4f325c3ab85b8fb45) --- sys/dev/ixl/if_ixl.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index c52d5ad287ba..f75a352b7162 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1153,13 +1153,20 @@ ixl_if_enable_intr(if_ctx_t ctx) struct ixl_pf *pf = iflib_get_softc(ctx); struct ixl_vsi *vsi = &pf->vsi; struct i40e_hw *hw = vsi->hw; - struct ixl_rx_queue *que = vsi->rx_queues; + struct ixl_rx_queue *rx_que = vsi->rx_queues; ixl_enable_intr0(hw); /* Enable queue interrupts */ - for (int i = 0; i < vsi->num_rx_queues; i++, que++) - /* TODO: Queue index parameter is probably wrong */ - ixl_enable_queue(hw, que->rxr.me); + if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { + for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) + ixl_enable_queue(hw, rx_que->rxr.me); + } else { + /* + * Set PFINT_LNKLST0 FIRSTQ_INDX to 0x0 to enable + * triggering interrupts by queues. + */ + wr32(hw, I40E_PFINT_LNKLST0, 0x0); + } } /* @@ -1177,11 +1184,13 @@ ixl_if_disable_intr(if_ctx_t ctx) if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) - ixl_disable_queue(hw, rx_que->msix - 1); + ixl_disable_queue(hw, rx_que->rxr.me); } else { - // Set PFINT_LNKLST0 FIRSTQ_INDX to 0x7FF - // stops queues from triggering interrupts - wr32(hw, I40E_PFINT_LNKLST0, 0x7FF); + /* + * Set PFINT_LNKLST0 FIRSTQ_INDX to End of List (0x7FF) + * to stop queues from triggering interrupts. + */ + wr32(hw, I40E_PFINT_LNKLST0, IXL_QUEUE_EOL); } } From nobody Mon Sep 29 13:50:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb2cy3M0Mz68G3w; Mon, 29 Sep 2025 13:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb2cy2fpDz3mJf; Mon, 29 Sep 2025 13:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0K+sfwu10v1zksCuDdi+y9AAjR+Fhtayzz16y/s2UU=; b=E4MDRYBQfM+zxt3qaYZoED4wFjPxghQIQLYk0r7rW5NchBpSiEuzX30bRBV2BxXFHc5K/O EG4eTpJrnwIaCPcq/IOE4dTfj7CP4yZC14b1oB/2da5k3SS8Ulb2T/nnAiVDlLnhokdtgJ KltuASFCK/9+lyXoViK26S1hUI47t/jP2P0gr4YKVOF6NWBDUc75Kk0EBGkeZuKa3kchUB T24kdpp7z5rJDcaUGG7TWevU9KuAF9aVg1yYgxT7x4ThVDUBv+StXHm/08JuNpX+xcuBSZ k+x3dAbL39QtbnN1abovt9JTl7FrXTIeZfczyujYK4YNpA89p/GIRP8pJBAs0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0K+sfwu10v1zksCuDdi+y9AAjR+Fhtayzz16y/s2UU=; b=LuiPvA0/W6hn+5bBrhOE9YARjdBPxFMdh0EqZLZTh9XbGZ9K9croXIxCNFHxjj/RmIVU+A PH4xCtUKDZ7oNsWYkYzkGR61hm5M3GBGSdEksJo7KbAu8UnsTdKjyGTcrBhojuWCz9dWXr lJ1sreW3o0lB7faPyqrWC17KIV/Qs1ft7SDzNCICzSyqYVhutUOS98rCjxJyFQT4E0ocRH dq6D9rWFZTDWw8fEfHgqP0BVJt3zlQiYMpXuc8yRzNcEAQHAy/JLiHYQjYhKNrlAPj/6yg jxB61B8cLQl6HaPorUwQMV8+XZK0h0STQfpQcdJ8C+lHcdk6LUzn52cXqhv2Rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759153810; a=rsa-sha256; cv=none; b=AYe1szcRVRuK+YnxN37Y/YP0Nu1UNVEm82HlcomVn6lP/DjzfcZwnssVs4SfR/tdpB1UdR BlI05fojUt3uXRutuROZCkdXjI4qUu8l2pp99/G98dqj82QkqlDUfSxrxHa/EaiUNO7Ro6 vBLIY9SH2K0PXt9wedZarC0shQcRFnUrzn2b/kP8TzpKWG2dBFDkpAQo9yKarkJm0HLFkf 210Ki2RYp5ynOGL9kDv5sR/JyHH/93dnN8KgLVNjaj/vUVpgwXavD9tN5YaQxHoKQ+wkE5 AoD/z49I7NWmn4Mg+Ig/FuMQqsVZ7BtgbAKlEt8X4ss+zQfv5VRW/Sod4flQ1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb2cy1xqjz17PL; Mon, 29 Sep 2025 13:50: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 58TDoAtG027685; Mon, 29 Sep 2025 13:50:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TDoACf027676; Mon, 29 Sep 2025 13:50:10 GMT (envelope-from git) Date: Mon, 29 Sep 2025 13:50:10 GMT Message-Id: <202509291350.58TDoACf027676@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: f54dfda721ef - stable/15 - if_re: Add PNP info for module List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f54dfda721ef63326c666299ff5258036ca19748 Auto-Submitted: auto-generated The branch stable/15 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=f54dfda721ef63326c666299ff5258036ca19748 commit f54dfda721ef63326c666299ff5258036ca19748 Author: Mitchell Horne AuthorDate: 2025-09-16 13:19:00 +0000 Commit: Mitchell Horne CommitDate: 2025-09-29 13:23:42 +0000 if_re: Add PNP info for module Add PNP info so it the module can be by devmatch(8) and automatically loaded. On non-x86 platforms it is not included in GENERIC. Reviewed by: imp MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52557 --- sys/dev/re/if_re.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 091ab2db72ec..76d395165df7 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -353,6 +353,8 @@ static driver_t re_driver = { DRIVER_MODULE(re, pci, re_driver, 0, 0); DRIVER_MODULE(miibus, re, miibus_driver, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;U32:#;D:#", pci, re, re_devs, + nitems(re_devs) - 1); #define EE_SET(x) \ CSR_WRITE_1(sc, RL_EECMD, \ From nobody Mon Sep 29 13:50:11 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb2cz6J0yz68GFX; Mon, 29 Sep 2025 13:50: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb2cz37GVz3mD3; Mon, 29 Sep 2025 13:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CAK45o3SFT1q+XdlAFu6dulJ84D/Fig+ITwJUzBqKUo=; b=N69lthmU+jRU5qoUOfHAVQlQrdCY7cbeoKG+KEx677CjEP59qT5poRJIB4/bmHHqlrzaP3 uBqMpL1XY8v+mb+kMRqoB7P+dBIRpdeF+K/nzqKLXxS/kXoJkFr4TSzXi/YU2Zz0EyAV8E 1vIDs84RVqrqMQDoEh+K/YjIJgxr98kCFqaqdFcMwau5gcdK3F41XJFn66gLqYg24iYQVa bpgkJAC6tMHYXJnGVBV/h63nLtOKbKawfHinL3/0MM2xCuwRdqa+0YNeMp7VT+dqXJnoiv 1IGHEMlVDtvm9nM+hfLb4KLWMexGrpLRFPiDQ5pskzG3M3fZA5M5GTkxUiYfvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CAK45o3SFT1q+XdlAFu6dulJ84D/Fig+ITwJUzBqKUo=; b=HclUvnDGPLU1uk1uX+i7vK9zXFsEsfPy4n4o2BYeQLqurmuN9gBwBON8SoiFRxUqZTALcA 4KdJCLjxwYjHbvVKqicui2nrpcakdPKPxMBq8hGcF4mJOjeJNfVVbIaAAKKSC/dyUyVQ2b k2WIC/kSQ9b1T2sUCXVX6aO42fs0mqPu/zcdd73h2fvjwBOWhoEjVcqwDCm6/WvhqTilvW KbRhA9HKeq01ztU8cTMB/RXWMMBr2d+mt+8saZlEHoQCfHed3SZ9gMpFD0E5kKk77zp8Qe cNIaDPKhu7nXRZWqQLNOo7HNAdTeHBC/rsMtQBC0RQLJArBS/LohwFDVeK0HTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759153811; a=rsa-sha256; cv=none; b=Mi9YBGsL2nCV8p7vsJfqdFFPKM3FH3b+7t/lKZ+jyGCEabJ19KUDG3SnUYosDv/N1g0PLx rWcwtN6KsIUAGkwj/v1FsqlyqiyU3cPgPVbPJUgGqYF3bofpS2sKXOs7fcVPoZR9adi2oX 2/V9GOm7LZIwdAnicsV4J+tuN557y+Sbk8iIKTfi2mHsz5uQaeN5hVzI/yVv8BV6TC/Tj2 EBcnIOEC0C7yvOVqWciUY49TJi2tSibf1cd6zEGMec7+A7ZyLwi8a92+Hr06Kax09UInNP BxaMtqE9KrbU8pMPX8a17o8CxYWitNtTK/MgvaBu+9oG72Szl97E+l1hi/6x4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb2cz2SgQz17Cd; Mon, 29 Sep 2025 13:50: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 58TDoBBi028333; Mon, 29 Sep 2025 13:50:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TDoBVl028325; Mon, 29 Sep 2025 13:50:11 GMT (envelope-from git) Date: Mon, 29 Sep 2025 13:50:11 GMT Message-Id: <202509291350.58TDoBVl028325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 16de4bc01135 - stable/15 - MODULE_PNP_INFO.9: tweak list indent List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 16de4bc011356f389334c0475ecf6b8b6348aeb8 Auto-Submitted: auto-generated The branch stable/15 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=16de4bc011356f389334c0475ecf6b8b6348aeb8 commit 16de4bc011356f389334c0475ecf6b8b6348aeb8 Author: Mitchell Horne AuthorDate: 2025-09-05 16:14:07 +0000 Commit: Mitchell Horne CommitDate: 2025-09-29 13:23:49 +0000 MODULE_PNP_INFO.9: tweak list indent So that it renders as intended. MFC after: 3 days Sponsored by: The FreeBSD Foundation --- share/man/man9/MODULE_PNP_INFO.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/MODULE_PNP_INFO.9 b/share/man/man9/MODULE_PNP_INFO.9 index 529afd70096d..b1cc935b1aca 100644 --- a/share/man/man9/MODULE_PNP_INFO.9 +++ b/share/man/man9/MODULE_PNP_INFO.9 @@ -65,7 +65,7 @@ The second name is encoded by appending a forward slash and the second name after the first.) .Pp Types are one of the following: -.Bl -tag -width U16 +.Bl -tag -width indent .It Dq Vt U8 .Vt uint8_t element. From nobody Mon Sep 29 13:50:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb2dg5rM8z68G4C; Mon, 29 Sep 2025 13:50: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb2dg54ZHz3mfd; Mon, 29 Sep 2025 13:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sVp+2gkRojVdQ6VpK8t+PkZmPL/hPFuFIDMDikDkQAc=; b=vyokHni8WJlrunOT9Jmqh+5XqwgQL9rgo3HSnxps3s7+xOHQ0wTlMV51sr3Uc1hQPgeZDl K5/mW2VdsWa8aNmT5P/j0sp7GXA27MlXZ4kKOpbuKNWNromn3sZlQ1IMfi2EpnDbbFY3Pf PKLVlKVJGd/DY8RlU3t29ZWVY103BTKwMqm6fz8TVbVGBXkL9klS56aLlGJCLxITrA1hRw 2Z+RePRSq7ezYNzvvxe/3y26kdNeTuiytIJ851t78PvrB8JDiauGmiGGMMdS7+lzEVlgBl M6qq1nE/Wh1jD51rRJgW4hYF0CTkvjh++LXffgw0dkt88Z6SeuRjQJPddbnexw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sVp+2gkRojVdQ6VpK8t+PkZmPL/hPFuFIDMDikDkQAc=; b=jf1jJIzfSPnEMS7TFbEo+EzuSLrUpziCKYhXgULbbCo0Ebdpx5tx59QUQGRBHBJ0Hbp5GU CGDuKNYu8f8lsA+MorgEApM2bz7zcEANaJwTTTjdfMq1nShnlvH1Gxd+4V+wphnoMeSUG3 bWkBw6zpNV3XaRjT8a8p2K0WnSqqo1XUM6OPiNtufZGRDtRSRLqZw3WeAlVuNSxC2j+bK6 7sN26JmqqSUwZWX0QXFIuM21L1qK75lfHmmHfyjADqkqCAn3nGs0NlhjKR+UBFjRO5mbNV CkVhpjK7EB2x4DG1riKC+uSY05AuAH4U38TkX9BBHjvuanlSVLI/pUorhVzv0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759153847; a=rsa-sha256; cv=none; b=IGV3KlWhVniCUb6EdkUyJsCPQ14Wm2EcYfhc/GSogJ3Uu0hSGaavmgzu/gBg55Xh+oTTV2 IbsHeD/1t+UFuMQuRorjVUi9QNgekiZUeHb4jlIXqDrhIRxMltUQzY2iAhl+1chZf1hdkG 5eFVXRYAWGznUihh6pvAW9rYh0jpNCIalQNROGLUf9R0i3C4hNyU5eWkdjJ6qk2VrJ2i2j 29NLzpHiDr2F2k5dlCVrm7RQXnLhB9qJTk2SaXZqRYCZBV1f6Hg8VVk+3Lt3l64yVkXSVp +grITQPOnEYVPzcywzzVQLUxK9fmrGRtcINxUC2RCTGagU2AS0j3qL7ORgXndA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb2dg4f5qz177Z; Mon, 29 Sep 2025 13:50: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 58TDolB9033065; Mon, 29 Sep 2025 13:50:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TDolDi033051; Mon, 29 Sep 2025 13:50:47 GMT (envelope-from git) Date: Mon, 29 Sep 2025 13:50:47 GMT Message-Id: <202509291350.58TDolDi033051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 75f1a35ce445 - stable/14 - if_re: Add PNP info for module List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 75f1a35ce445774c546cf333c7b0cb3ee3205006 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=75f1a35ce445774c546cf333c7b0cb3ee3205006 commit 75f1a35ce445774c546cf333c7b0cb3ee3205006 Author: Mitchell Horne AuthorDate: 2025-09-16 13:19:00 +0000 Commit: Mitchell Horne CommitDate: 2025-09-29 13:50:33 +0000 if_re: Add PNP info for module Add PNP info so it the module can be by devmatch(8) and automatically loaded. On non-x86 platforms it is not included in GENERIC. Reviewed by: imp MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52557 (cherry picked from commit e13b5298ec87be03da2231bc7b44a6a4b976b850) --- sys/dev/re/if_re.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 0d4f1dddf46a..a74f4898fa4a 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -353,6 +353,8 @@ static driver_t re_driver = { DRIVER_MODULE(re, pci, re_driver, 0, 0); DRIVER_MODULE(miibus, re, miibus_driver, 0, 0); +MODULE_PNP_INFO("U16:vendor;U16:device;U32:#;D:#", pci, re, re_devs, + nitems(re_devs) - 1); #define EE_SET(x) \ CSR_WRITE_1(sc, RL_EECMD, \ From nobody Mon Sep 29 13:50:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb2dj1MpWz68G6C; Mon, 29 Sep 2025 13:50: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb2dh66qSz3mZW; Mon, 29 Sep 2025 13:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ITtC29bQVuAMPDrppODD6UY1WK0typxqXKMlp5YBFt8=; b=ZYoDk6N/TqGwpstkZs5W3d/nRXzh5Rhb27/m71BqpdKEFCiTrtsOC0krJhnnzgcgeVgcza EqYA2N7loYXUsEafFHYDPJ8sr+WJDHv3GMuRFEy9kpZ1QydkXlUnEf/GmPUzbcEzFduoYZ wOt4Pfep5CpR/ZOz3zsLYeh0Ktl5pEdDZ69LLhfC6nsPpdpPXKUaRldWoL/l0Zd/3JFu/7 sZvl3ejn9lmbJwmh85UNQsCF9U8xa4faBMe87Rb7gn2TVQjhlE31Bu1lnBIbNLGgsp9HKi kryhfg/y+GhlU4o7eq+cHlraTUJOn27gJRtkEO883aUzBvrRqYBd7Rr0G1QsaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759153848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ITtC29bQVuAMPDrppODD6UY1WK0typxqXKMlp5YBFt8=; b=U6d992UDMpwQDsEp++gykMMvlMz10h2Ummp55r90t72em9dWJh9MG25CvfoaIlByKaOu0p c2B4W0e7UJYW9AtTfDgWZU54LjtPOXv+eEifH0o2CVlatZbP0HDpOKWOCTOH4lGvsE7efi XEfqkiL/HNPMpvgolXbmdkhzrTPRDZvOdaqgi2IZbPKhgJuhXNRYJORuBT5q6hIVIhzdjS QLBABmTJKqIpM87GZNIAssJFDZQTopb1qTXTQKvJ5efVEevRiS2OdrdOnTI97f5kdKhAYH Yh4LqnXXlWQo2bO4DarngFpcCwzE6Pp1KApJQuhN/6TI3kWwcffurcMZwCB3ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759153848; a=rsa-sha256; cv=none; b=l0LQeXxUmCEfzMmp/vQbLcyBs3RVvXAoUe8ehPEkIUzgxh/xnh9M+dWaIAGwYv+D0LLtI6 l/NqjBsGu36KMF56I2zOn+TT4k8db5nsOy7QiHHQf8iXMHxIU4MPRcpNR4CyiFfHFk+Vbx YuRD7GHihd8CngZTy58ku1pmXx+qP9g/Fq2EuFRBubS4gltTWayv0ibIZAvt5EAafXC+Wn I80Ll0sKNElZOCS31yVylCYtqqO4uW/tPkC593BoJDmi72f36gwLuzb+CukkFvE3g0AGmC /N7yBB9/dct3bgsF8jFGLIPhyeQObmNEnfseJzcI3yFh/NNR7Bpyrg7zuaKmLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb2dh5Wxhz16wg; Mon, 29 Sep 2025 13:50: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 58TDomkN033619; Mon, 29 Sep 2025 13:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TDom9X033616; Mon, 29 Sep 2025 13:50:48 GMT (envelope-from git) Date: Mon, 29 Sep 2025 13:50:48 GMT Message-Id: <202509291350.58TDom9X033616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 6cd33535a5f3 - stable/14 - MODULE_PNP_INFO.9: tweak list indent List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6cd33535a5f3b5303121378e11067fb4ef88f8a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=6cd33535a5f3b5303121378e11067fb4ef88f8a0 commit 6cd33535a5f3b5303121378e11067fb4ef88f8a0 Author: Mitchell Horne AuthorDate: 2025-09-05 16:14:07 +0000 Commit: Mitchell Horne CommitDate: 2025-09-29 13:50:33 +0000 MODULE_PNP_INFO.9: tweak list indent So that it renders as intended. MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit a7340d559ee942c21ea1a037d1d60a7859dd873b) --- share/man/man9/MODULE_PNP_INFO.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/MODULE_PNP_INFO.9 b/share/man/man9/MODULE_PNP_INFO.9 index 529afd70096d..b1cc935b1aca 100644 --- a/share/man/man9/MODULE_PNP_INFO.9 +++ b/share/man/man9/MODULE_PNP_INFO.9 @@ -65,7 +65,7 @@ The second name is encoded by appending a forward slash and the second name after the first.) .Pp Types are one of the following: -.Bl -tag -width U16 +.Bl -tag -width indent .It Dq Vt U8 .Vt uint8_t element. From nobody Mon Sep 29 15:07:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb4LR1bBxz68MnQ; Mon, 29 Sep 2025 15:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb4LR0vRcz44fS; Mon, 29 Sep 2025 15:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759158463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2CVe4bd9BhGJLEtAZHUWjjTiJSD9wKsKErVpyD/HPB8=; b=sKxT7+zk2P5bm12PJ7NTyWHt5JJmskA+g50YJ/qDy9KdZ8peeeyc/OTE5rPZPKI3lMLeVL 0njzLpdE6kW2p+iwZg0af1DxOG/ExeLfnvIxCyabcISG3ae988qWE5r1Riaghqd03/xpSI EAQF5aikHUCf4tTFYwhlnuuvgkFhHTMmH49+ErT9J+CtuVdLCDRVAZQO6RaKhWwslNhXvI Ggoj1SoU+2Yj7vu8Feb0l520zB3iGzqXFRQTbgAbzD0tEPpYNhF1jUDf/Jsc8wZWIsXvRk Jd7mU1NxKKAdsasVOfW4mnxNT4W7E2zi7bOnN7Phl9dVxnJGFiVUh8Fdh2kZbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759158463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2CVe4bd9BhGJLEtAZHUWjjTiJSD9wKsKErVpyD/HPB8=; b=FMNYhF67uLCLzU0Si08HRxCbEif54nHKP1nSDXDXktguayrMZ7M9DtyKGOb0N/fkAG6BHI x+QjEsGAufHRcH1Q8Z6/NOm0ojlOCbf9sUhkTkPD/Omg963qaAPGXFPoUFU184IdM2/WOo dtiXuF9kOKvo4G/jPZNbbXMeVBve3WUUrKy7sA85Ps2wx8qGjIg0Vq+ykLrbo01XanAhzB YcIfpP40tO4S539m+So1t6HgCcF/QRH47zDDfW/A32XubePKtm3T2Jxo4p+A53OT4WYRVm fGOeAEeiuo2h9ZJqfUuL1kNDOCtZ0ZJmA7eILPX6mGyte/3YsZ9y3FtkV0auGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759158463; a=rsa-sha256; cv=none; b=XTXWg1oR2dDJMGczZs6chgZ2F0w3HeT0pOiFHxYLW69da/bbeNV+RnWrbmU+Oxl5gOczfS VXkMrb2Wl5OLmlt87fMxnWJkC2ZpB+7LxYjmKGS/bRdR+cu7ri+wxY+ed+1vAuPRirzx+b 0WxXHyRkgVLEDC6tGNv6sumOnci9S9NG+56ca7UGZY3z4zblP0DlxnNGgZ9dOZR/19JWAc h/CShK5q1JYDLNaVqoC4OgA/SeY2uoXvTadU3esZdJnoR9TvArZwb+rlBHLIElzBFfk9ZM FlKLfLgipgwjGHTWhzBRaeGlp+N66jnwkIe/uDGeWwHwYxD6jgSHAIk3HfLOzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb4LR0CjMz190Z; Mon, 29 Sep 2025 15:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58TF7g80075925; Mon, 29 Sep 2025 15:07:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TF7gMH075922; Mon, 29 Sep 2025 15:07:42 GMT (envelope-from git) Date: Mon, 29 Sep 2025 15:07:42 GMT Message-Id: <202509291507.58TF7gMH075922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jonathan T. Looney" Subject: git: 5b59ff1e1607 - stable/15 - ip6: add SO_BINTIME support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jtl X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 5b59ff1e160727c80686bbfc728dae075fcd0d4f Auto-Submitted: auto-generated The branch stable/15 has been updated by jtl: URL: https://cgit.FreeBSD.org/src/commit/?id=5b59ff1e160727c80686bbfc728dae075fcd0d4f commit 5b59ff1e160727c80686bbfc728dae075fcd0d4f Author: Jonathan T. Looney AuthorDate: 2025-09-12 17:49:17 +0000 Commit: Jonathan T. Looney CommitDate: 2025-09-29 15:03:02 +0000 ip6: add SO_BINTIME support This adds support for obtaining timestamps from IPv6 packets using the SO_BINTIME socket option, bringing it in parity with IPv4 behavior. Enable testing the SO_BINTIME option in the relevant (manual) regression test. PR: 289423 Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D52504 (cherry picked from commit cd02a8a9f8be2085d5242606a79668dc3720e7b0) --- sys/netinet6/ip6_input.c | 53 +++++++++++++++------- .../regression/sockets/udp_pingpong/udp_pingpong.c | 8 ++-- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 45fd23ea6c21..b22491a6007f 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1197,8 +1197,8 @@ ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, struct mbuf **mp, { struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); -#ifdef SO_TIMESTAMP - if ((inp->inp_socket->so_options & SO_TIMESTAMP) != 0) { +#if defined(SO_TIMESTAMP) && defined(SO_BINTIME) + if ((inp->inp_socket->so_options & (SO_TIMESTAMP | SO_BINTIME)) != 0) { union { struct timeval tv; struct bintime bt; @@ -1206,47 +1206,66 @@ ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, struct mbuf **mp, } t; struct bintime boottimebin, bt1; struct timespec ts1; + int ts_clock; bool stamped; + ts_clock = inp->inp_socket->so_ts_clock; stamped = false; - switch (inp->inp_socket->so_ts_clock) { - case SO_TS_REALTIME_MICRO: + + /* + * Handle BINTIME first. We create the same output options + * for both SO_BINTIME and the case where SO_TIMESTAMP is + * set with the timestamp clock set to SO_TS_BINTIME. + */ + if ((inp->inp_socket->so_options & SO_BINTIME) != 0 || + ts_clock == SO_TS_BINTIME) { if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | M_TSTMP)) { mbuf_tstmp2timespec(m, &ts1); - timespec2bintime(&ts1, &bt1); + timespec2bintime(&ts1, &t.bt); getboottimebin(&boottimebin); - bintime_add(&bt1, &boottimebin); - bintime2timeval(&bt1, &t.tv); + bintime_add(&t.bt, &boottimebin); } else { - microtime(&t.tv); + bintime(&t.bt); } - *mp = sbcreatecontrol(&t.tv, sizeof(t.tv), - SCM_TIMESTAMP, SOL_SOCKET, M_NOWAIT); + *mp = sbcreatecontrol(&t.bt, sizeof(t.bt), SCM_BINTIME, + SOL_SOCKET, M_NOWAIT); if (*mp != NULL) { mp = &(*mp)->m_next; stamped = true; } - break; - case SO_TS_BINTIME: + /* + * Suppress other timestamps if SO_TIMESTAMP is not + * set. + */ + if ((inp->inp_socket->so_options & SO_TIMESTAMP) == 0) + ts_clock = SO_TS_BINTIME; + } + + switch (ts_clock) { + case SO_TS_REALTIME_MICRO: if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | M_TSTMP)) { mbuf_tstmp2timespec(m, &ts1); - timespec2bintime(&ts1, &t.bt); + timespec2bintime(&ts1, &bt1); getboottimebin(&boottimebin); - bintime_add(&t.bt, &boottimebin); + bintime_add(&bt1, &boottimebin); + bintime2timeval(&bt1, &t.tv); } else { - bintime(&t.bt); + microtime(&t.tv); } - *mp = sbcreatecontrol(&t.bt, sizeof(t.bt), SCM_BINTIME, - SOL_SOCKET, M_NOWAIT); + *mp = sbcreatecontrol(&t.tv, sizeof(t.tv), + SCM_TIMESTAMP, SOL_SOCKET, M_NOWAIT); if (*mp != NULL) { mp = &(*mp)->m_next; stamped = true; } break; + case SO_TS_BINTIME: + break; + case SO_TS_REALTIME: if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | M_TSTMP)) { diff --git a/tools/regression/sockets/udp_pingpong/udp_pingpong.c b/tools/regression/sockets/udp_pingpong/udp_pingpong.c index 2fe342debdc6..e852f7a7af87 100644 --- a/tools/regression/sockets/udp_pingpong/udp_pingpong.c +++ b/tools/regression/sockets/udp_pingpong/udp_pingpong.c @@ -601,11 +601,9 @@ main(void) test_run(TT_TIMESTAMP, i, 1, "send()/recvmsg(), setsockopt(SO_TIMESTAMP, 1)"); printf("OK\n"); - if (i == 0) { - test_run(TT_BINTIME, i, 1, - "send()/recvmsg(), setsockopt(SO_BINTIME, 1)"); - printf("OK\n"); - } + test_run(TT_BINTIME, i, 1, + "send()/recvmsg(), setsockopt(SO_BINTIME, 1)"); + printf("OK\n"); test_run(TT_REALTIME_MICRO, i, 1, "send()/recvmsg(), setsockopt(SO_TS_CLOCK, SO_TS_REALTIME_MICRO)"); printf("OK\n"); From nobody Mon Sep 29 15:13:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cb4TB3dNVz68MxF; Mon, 29 Sep 2025 15:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cb4TB31Fhz458v; Mon, 29 Sep 2025 15:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759158814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4K8AWiNYVLv4oEE7aBmUedkYhHR0TDa3t1IvWo53CM=; b=umV+Lz2KOn1GG9/3LQWx4tqiIAK58mA/1DtxubArbhdziI9PZM1WJR7dwlcEyDMfc1j+g7 tMnPsYcHXgTKOEfqUHb9+Rx06WIvG0FVqYqJ2g/+hhQgi3TRhk0hAsrGoKc9JzZT8p2Cgj X05Y+A6j0davCkX3f1iwu9f0CXdlv3IwFHq2GBxbqx/b1JjxXvcwqksFnXkphex2KLCu8G 9hCyaZS1p8jq5WW2BvCknIc6lJ9+8YPrvYX2s9Jk3xE2EV5Vivyz1UaOTEec3Ka2vfGcPR dILYnU2xgweCk0M41Ev5OZsVawIfVlMjIUc0fEbjNhLBvppqVbM9aMCGwFRgdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759158814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4K8AWiNYVLv4oEE7aBmUedkYhHR0TDa3t1IvWo53CM=; b=ApQNZCWo7S+zj3Kvxy6Nz9O75oJOy0GfKSaBP4zJArPIwHXxyf39bf4zcKq2qDaIWzNyUl 7pqOLpOGHOQ86f1MHvN5i8OCDCvgQVvjcAICwESVxWvbEQDj4DMgaEG4A2S+dDrXTOhjyE /n1+ESK+tn+6XawTTUwdg8TaJO81c9piN/7tZHZpZ7dwHVdMxbtXIpOp1WAq6CnWC2jJV0 SGAfW2bUC2uwramxsNqW38evV0lYpzY/LCwZsV+G3UyAGW7S3E6N85ciVlZNIa33cRuXV6 QbUNvJKcXaWrr3QYp/Zf8YbamhpSrGAsKc6Xsbi7HmuaG+Qrf4xHINU0fcaDbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759158814; a=rsa-sha256; cv=none; b=Bgl5EoKY9oZhghSKeptUzODpVCiMQcjKdo/n4/diH7cF3BeUc7yCJl2cTwrPfgaXZVRdiY rOj0UIcPw7oxokGkpAuIewHe+0Y4YVrNbBmkTd/qt2xx1O6NWCfGuppvpU5fCTW+2yqj+F eYOMccOoJ2SfWynbj9sePGdj4haQv5jFfptYPVfIALzWt8muASctMym08FuK2S62/MyfKl jw1QpELxZA8i1hoGpFmGwwRhYXqMsR7/x198OSBCadxn0emVY/z7Cx9+LOYxD8gbHMtpnX k2Ni9EtSWBMNMDlG3dsGZRAuPaXpK/m53rZ9mCebYi+rT/YJN28BJk0Sts3QsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cb4TB2bz9z18Sp; Mon, 29 Sep 2025 15:13: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 58TFDYI6092970; Mon, 29 Sep 2025 15:13:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TFDYck092967; Mon, 29 Sep 2025 15:13:34 GMT (envelope-from git) Date: Mon, 29 Sep 2025 15:13:34 GMT Message-Id: <202509291513.58TFDYck092967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jonathan T. Looney" Subject: git: f801346706ea - stable/14 - ip6: add SO_BINTIME support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jtl X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f801346706ea75401614df2dba3f85ecea2af03e Auto-Submitted: auto-generated The branch stable/14 has been updated by jtl: URL: https://cgit.FreeBSD.org/src/commit/?id=f801346706ea75401614df2dba3f85ecea2af03e commit f801346706ea75401614df2dba3f85ecea2af03e Author: Jonathan T. Looney AuthorDate: 2025-09-12 17:49:17 +0000 Commit: Jonathan T. Looney CommitDate: 2025-09-29 15:12:49 +0000 ip6: add SO_BINTIME support This adds support for obtaining timestamps from IPv6 packets using the SO_BINTIME socket option, bringing it in parity with IPv4 behavior. Enable testing the SO_BINTIME option in the relevant (manual) regression test. PR: 289423 Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D52504 (cherry picked from commit cd02a8a9f8be2085d5242606a79668dc3720e7b0) --- sys/netinet6/ip6_input.c | 53 +++++++++++++++------- .../regression/sockets/udp_pingpong/udp_pingpong.c | 8 ++-- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index b3f10ddc5ea7..2db1b4723edc 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1193,8 +1193,8 @@ ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, struct mbuf **mp, { struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); -#ifdef SO_TIMESTAMP - if ((inp->inp_socket->so_options & SO_TIMESTAMP) != 0) { +#if defined(SO_TIMESTAMP) && defined(SO_BINTIME) + if ((inp->inp_socket->so_options & (SO_TIMESTAMP | SO_BINTIME)) != 0) { union { struct timeval tv; struct bintime bt; @@ -1202,47 +1202,66 @@ ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, struct mbuf **mp, } t; struct bintime boottimebin, bt1; struct timespec ts1; + int ts_clock; bool stamped; + ts_clock = inp->inp_socket->so_ts_clock; stamped = false; - switch (inp->inp_socket->so_ts_clock) { - case SO_TS_REALTIME_MICRO: + + /* + * Handle BINTIME first. We create the same output options + * for both SO_BINTIME and the case where SO_TIMESTAMP is + * set with the timestamp clock set to SO_TS_BINTIME. + */ + if ((inp->inp_socket->so_options & SO_BINTIME) != 0 || + ts_clock == SO_TS_BINTIME) { if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | M_TSTMP)) { mbuf_tstmp2timespec(m, &ts1); - timespec2bintime(&ts1, &bt1); + timespec2bintime(&ts1, &t.bt); getboottimebin(&boottimebin); - bintime_add(&bt1, &boottimebin); - bintime2timeval(&bt1, &t.tv); + bintime_add(&t.bt, &boottimebin); } else { - microtime(&t.tv); + bintime(&t.bt); } - *mp = sbcreatecontrol(&t.tv, sizeof(t.tv), - SCM_TIMESTAMP, SOL_SOCKET, M_NOWAIT); + *mp = sbcreatecontrol(&t.bt, sizeof(t.bt), SCM_BINTIME, + SOL_SOCKET, M_NOWAIT); if (*mp != NULL) { mp = &(*mp)->m_next; stamped = true; } - break; - case SO_TS_BINTIME: + /* + * Suppress other timestamps if SO_TIMESTAMP is not + * set. + */ + if ((inp->inp_socket->so_options & SO_TIMESTAMP) == 0) + ts_clock = SO_TS_BINTIME; + } + + switch (ts_clock) { + case SO_TS_REALTIME_MICRO: if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | M_TSTMP)) { mbuf_tstmp2timespec(m, &ts1); - timespec2bintime(&ts1, &t.bt); + timespec2bintime(&ts1, &bt1); getboottimebin(&boottimebin); - bintime_add(&t.bt, &boottimebin); + bintime_add(&bt1, &boottimebin); + bintime2timeval(&bt1, &t.tv); } else { - bintime(&t.bt); + microtime(&t.tv); } - *mp = sbcreatecontrol(&t.bt, sizeof(t.bt), SCM_BINTIME, - SOL_SOCKET, M_NOWAIT); + *mp = sbcreatecontrol(&t.tv, sizeof(t.tv), + SCM_TIMESTAMP, SOL_SOCKET, M_NOWAIT); if (*mp != NULL) { mp = &(*mp)->m_next; stamped = true; } break; + case SO_TS_BINTIME: + break; + case SO_TS_REALTIME: if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | M_TSTMP)) { diff --git a/tools/regression/sockets/udp_pingpong/udp_pingpong.c b/tools/regression/sockets/udp_pingpong/udp_pingpong.c index 9babe144adcb..23ba8403be6d 100644 --- a/tools/regression/sockets/udp_pingpong/udp_pingpong.c +++ b/tools/regression/sockets/udp_pingpong/udp_pingpong.c @@ -602,11 +602,9 @@ main(void) test_run(TT_TIMESTAMP, i, 1, "send()/recvmsg(), setsockopt(SO_TIMESTAMP, 1)"); printf("OK\n"); - if (i == 0) { - test_run(TT_BINTIME, i, 1, - "send()/recvmsg(), setsockopt(SO_BINTIME, 1)"); - printf("OK\n"); - } + test_run(TT_BINTIME, i, 1, + "send()/recvmsg(), setsockopt(SO_BINTIME, 1)"); + printf("OK\n"); test_run(TT_REALTIME_MICRO, i, 1, "send()/recvmsg(), setsockopt(SO_TS_CLOCK, SO_TS_REALTIME_MICRO)"); printf("OK\n"); From nobody Mon Sep 29 19:42:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbBRZ4cMPz68kQX; Mon, 29 Sep 2025 19:42: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbBRZ3tJzz3q4Y; Mon, 29 Sep 2025 19:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759174954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ifgwRKdMpc94RIJ/fJipiuNq8+jUg6AOMRiwcy7+W68=; b=seTFBg+2Lrj2J1LPIYUtFQhi4kkbjcYHb5DmEzOW/MuH21Ml6bzgr43Xq4Y0WcqUrR190s N77wWTnMt0b8/vcBc17kcoJTEcmjNBt6JFf/3EPT2LYBz/yX8fD9QeuajX9ZdMFBBJuXos IGJuFAfXKo5SB9YMZmQNjSFFn8GybahqIOrF4KYQqIRPnBF9IctGCl+ms4exYHTkNsKCCX W7LLADJWw9TDvUS3cRGMJqhzMt7yIltTFKAuqtPJXf52tiJKnKj8NDbGVhZbntBXwhMWjn ZupSaTgyO7ptpGnzbhDIvVjjhliWH6lTNoZrsrwzZAqcMZtuhS+a1GkN8+B+Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759174954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ifgwRKdMpc94RIJ/fJipiuNq8+jUg6AOMRiwcy7+W68=; b=Au1kxY5ZJnbxpFb5WHCv5lpi+XGbDOjUQFHqU6zDPSc2tQ/YJaCXIS7Er8fEbKXd6Ehvuf mNFak/vDJJ2wFRz7/bv3AzHad6YHgm/1FC0wqjig3fywWqZL28VdwxVQSC2OZfwLNxl9eg Y6s7OwAM3FhTxlcwAdYbTaq4NBj5J8QvYRUr4XXcYTimQQsJCxveDMqzgm+TzDUfJS/x37 //w1v/K4Uup2SQOgavKcBVj8eB0AO/jZ6MSsya3v/77w5LclRRKN6ZYKCfddBiRqM6s/sQ O22mStCnHT8OwD19C32Axb95WW8gGSp5SC/YSFMsMN44QBk6Ul/dWLglVWNCaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759174954; a=rsa-sha256; cv=none; b=KvIY0oJxwYpnZWlI1lV9FyP7uz5KQ4wXFkLu1Jjtous/gMCCJphkhpelIo6g3cK5Qwtvqb g4n31EskabmyH3zfttISNEHgPQzMTDeA4DRXaVS2g8IKkvD2yl31pRTTlclcaOOkzcWsGr vr6TIrX5CsQ2n3pGPb5XIIEyqrNtWl7XP0ijxlhUbzvtGbxSztyNxwTeecKPgFxSAWsjeF fDgi4bRQpLpH5Xn4ZP5FUBwxkGlcW+UKCuxvxqhBA8jz1kOJ1+mkdobMFKBy1/GuPl5StH UDQaGyqj5ctJwloyWJVL/orghs5LCqJEg3izjoNGekkYGN1LGjIYa9G4VLQjYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbBRZ3QGKz1JQH; Mon, 29 Sep 2025 19:42: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 58TJgYlW005789; Mon, 29 Sep 2025 19:42:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TJgYD2005786; Mon, 29 Sep 2025 19:42:34 GMT (envelope-from git) Date: Mon, 29 Sep 2025 19:42:34 GMT Message-Id: <202509291942.58TJgYD2005786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c0598ba49d2c - stable/14 - vtnet: improve interface capability handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c0598ba49d2cc785a174e34e687b48298b95f8a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c0598ba49d2cc785a174e34e687b48298b95f8a0 commit c0598ba49d2cc785a174e34e687b48298b95f8a0 Author: Michael Tuexen AuthorDate: 2025-09-26 09:45:12 +0000 Commit: Michael Tuexen CommitDate: 2025-09-29 19:42:07 +0000 vtnet: improve interface capability handling Enable the handling of the IFCAP_RXCSUM_IPV6 handling by handling IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 as a pair. Also make clear, that software and hardware LRO require receive checksum offload. Reviewed by: Timo Völker Differential Revision: https://reviews.freebsd.org/D52682 (cherry picked from commit eaf619fddcb21859311b895a0836da3171a01531) --- share/man/man4/vtnet.4 | 4 +++- sys/dev/virtio/network/if_vtnet.c | 31 +++++++++++-------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 4a58822e7095..8b96445f0f04 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 September 16, 2025 +.Dd September 26, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -54,6 +54,8 @@ TCP segmentation offload (TSO), TCP large receive offload (LRO), hardware VLAN tag stripping/insertion features, a multicast hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. +TCP/UDP receive checksum offload cannot be configured independently for IPv4 +and IPv6. Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 utility configures the adapter to receive and transmit Jumbo Frames. diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 949b3ba0e5bb..c2f55bb37054 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1151,11 +1151,9 @@ vtnet_setup_interface(struct vtnet_softc *sc) } if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_CSUM)) { - if_setcapabilitiesbit(ifp, IFCAP_RXCSUM, 0); -#ifdef notyet /* BMV: Rx checksums not distinguished between IPv4 and IPv6. */ + if_setcapabilitiesbit(ifp, IFCAP_RXCSUM, 0); if_setcapabilitiesbit(ifp, IFCAP_RXCSUM_IPV6, 0); -#endif if (vtnet_tunable_int(sc, "fixup_needs_csum", vtnet_fixup_needs_csum) != 0) @@ -1368,27 +1366,20 @@ vtnet_ioctl_ifcap(struct vtnet_softc *sc, struct ifreq *ifr) if ((mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO)) == IFCAP_LRO && vtnet_software_lro(sc)) reinit = update = 0; - - if (mask & IFCAP_RXCSUM) + /* + * VirtIO does not distinguish between receive checksum offload + * for IPv4 and IPv6 packets, so treat them as a pair. + */ + if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { if_togglecapenable(ifp, IFCAP_RXCSUM); - if (mask & IFCAP_RXCSUM_IPV6) if_togglecapenable(ifp, IFCAP_RXCSUM_IPV6); + } if (mask & IFCAP_LRO) if_togglecapenable(ifp, IFCAP_LRO); - - /* - * VirtIO does not distinguish between IPv4 and IPv6 checksums - * so treat them as a pair. Guest TSO (LRO) requires receive - * checksums. - */ - if (if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { - if_setcapenablebit(ifp, IFCAP_RXCSUM, 0); -#ifdef notyet - if_setcapenablebit(ifp, IFCAP_RXCSUM_IPV6, 0); -#endif - } else - if_setcapenablebit(ifp, 0, - (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO)); + /* Both SW and HW TCP LRO require receive checksum offload. */ + if ((if_getcapenable(ifp) & + (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) == 0) + if_setcapenablebit(ifp, 0, IFCAP_LRO); } if (mask & IFCAP_VLAN_HWFILTER) { From nobody Mon Sep 29 19:43:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbBSg5XDvz68kfc; Mon, 29 Sep 2025 19:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbBSg4zvWz3qNL; Mon, 29 Sep 2025 19:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759175011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bC99TaR5AqwpyWXnhCmqCz8bZw/qg5pPocM6iek17tU=; b=v1QLsOo0FTxuYWsiyQXPLoie8NaYIh7vTy2lOjniAuScU8fWQpr72/LNdYpOnue0nDtd9v vWnDj3q2t0sRzpnA9i7je64b8X3eRwcF1IFxgyr9iihCwlTGQrnCe8E5jlcJuKYhk0fdCH zA1Q/fC6ipNozpiNJu8HA9DdED/fTFKvQYdnT/QR72mpFBd2lzfDNmHeeuk6xnny++LT38 t8Ii48SSjLZXH9PHnEhk8WpbR94De+a+DmkdkA8wuPZwHMOMCnWhHebUqANDqCm3ERQzFq LDocGa6uWtJPP7Fi7jZdnyQmCvHz7OyS93lJ2AhIbqPn60rq1GgVgGV9SyHvJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759175011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bC99TaR5AqwpyWXnhCmqCz8bZw/qg5pPocM6iek17tU=; b=keqATIKKt16CNfoS+wR1aakli0OnE5oSiPw6hzauWr8WnoiMO2w8LSucRya5igq1voDESM N4/eV+8DiF3U+l0/N+OK5kMcKcw2aVkXTolfUY/3yNUVod04y6bPUcWmzp4GmjFuLPFUH1 jcu0wlZST6FZQsz4e94cigQjq6uemMMpUL8PN1It9ujy7jRESjZUavZYErJpLWKQkqmUKK OJdYBMv8j6a7BkpnLh/eZb+yEqdDwopuVeRwuIWwefJpYdH7pdGIdMZb2qYjtTmfKAHbsC NNQcCPUaRgCIpb1/+rQLYIJp1++Q7kRkod5etzpYPUeuCcgohqpTF7SSewpHdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759175011; a=rsa-sha256; cv=none; b=lfCV/fFm/duIXr20YIS8fxtndK+tEf/Y7ZY67mYpF+eLbrXrpvXCNiJNn0KOIDbL7blEEH k0/lMOijN4IaLCwA8XJ28UU9jcbJuG8j54fvMicGHLDWi8eYc8Nhq5ri/5aU2KUURzHwPl Rwbk+mKnDP7qcB32aj+YH+zK0kVqfxIBELWUUrrIfA0d+QUhz5m5Yjki1vh3pDSiez++yY FZXI4EaY5WxkAwiLxxO4/00IPSkAMvV94RFUBu2SmrVD0wqt0iiBOCDNegUyzg2Aou/sVg FpnzotVgRaDzsuKfuZdhqhtFbHgf/V1QpyZkki0NqJ1QhkHdeJ1gwSAF++zJ9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbBSg4RhQz1JZT; Mon, 29 Sep 2025 19:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58TJhVcS006199; Mon, 29 Sep 2025 19:43:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TJhVxi006194; Mon, 29 Sep 2025 19:43:31 GMT (envelope-from git) Date: Mon, 29 Sep 2025 19:43:31 GMT Message-Id: <202509291943.58TJhVxi006194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 503bf058cd0a - stable/14 - epair: add support for checksum offloading List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 503bf058cd0adfe3d5e66340b13d32b4516390cb Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=503bf058cd0adfe3d5e66340b13d32b4516390cb commit 503bf058cd0adfe3d5e66340b13d32b4516390cb Author: Timo Völker AuthorDate: 2025-09-01 22:03:47 +0000 Commit: Michael Tuexen CommitDate: 2025-09-29 19:42:58 +0000 epair: add support for checksum offloading Add capabilities RXCSUM and RXCSUM6 as well as TXCSUM and TXCSUM6 for for receive and transmit checksum offloading for TCP and UDP to the epair interface and enable them by default. RXCSUM and RXCSUM6 are enabled because an epair interface may receive a packet with the csum_flag CSUM_DATA_VALID set, which is expected only if these capabilities are enabled. Since it seems not helpful to remove this flag, it is not possible to disable these capabilities. TXCSUM and TXCSUM6 are synchronized between the two epair interface ends. If enabled/disabled on one end, it will be enabled/disabled on the other end. If the sending epair interface end has TXCSUM or TXCSUM6 enabled and the receiving end is in a bridge, it is assumed that all interfaces in the bridge have that capability enabled. Otherwise the bridge would have disabled that capability on the receiving epair interface end in the bridge which would have disabled that capability on the sending epair interface end as well due to the synchronization. Reviewed by: bcr, Seyed Pouria Mousavizadeh Tehrani Differential Revision: https://reviews.freebsd.org/D51639 (cherry picked from commit e4ea162509e400340a2bc3e755071a92f3465e2d) --- share/man/man4/epair.4 | 24 +++++++++++++++++++- sys/net/if_epair.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/share/man/man4/epair.4 b/share/man/man4/epair.4 index 342b15b5612a..0014836b01ea 100644 --- a/share/man/man4/epair.4 +++ b/share/man/man4/epair.4 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 12, 2025 +.Dd September 2, 2025 .Dt EPAIR 4 .Os .Sh NAME @@ -108,6 +108,28 @@ As with any other Ethernet interface, can have a .Xr vlan 4 configured on top of it. +.Pp +The +.Nm +has RXCSUM and RXCSUM6 enabled because it may receive a packet where the +checksum has already been validated by a physical interface. +The +.Nm +supports TXCSUM and TXCSUM6 for TCP and UDP, but only by forwarding the order +to compute the checksum. +Thus, when using an +.Nm +interface, a TCP or UDP sender can offload checksum computation +to a physical interface. +Note that, in case the packet does not leave the host, the checksum is +unnecessary and will be ignored if offloaded. +TXCSUM and TXCSUM6 are synchronized between the +.Nm +interface pair (i.e., enabling/disabling the capability on one end +enables/disables it on the other end). +In case one end is in a bridge and the bridge disabled TXCSUM or TXCSUM6, +this avoids a sender to send packets with checksum offloading into the +bridge by using the other end. .Sh SEE ALSO .Xr ioctl 2 , .Xr altq 4 , diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index e7327ec71a42..3cedd63a5320 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #ifdef RSS #include @@ -434,6 +435,21 @@ epair_media_status(struct ifnet *ifp __unused, struct ifmediareq *imr) imr->ifm_active = IFM_ETHER | IFM_10G_T | IFM_FDX; } +/* + * Update ifp->if_hwassist according to the current value of ifp->if_capenable. + */ +static void +epair_caps_changed(struct ifnet *ifp) +{ + uint64_t hwassist = 0; + + if (ifp->if_capenable & IFCAP_TXCSUM) + hwassist |= CSUM_IP_TCP | CSUM_IP_UDP; + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + hwassist |= CSUM_IP6_TCP | CSUM_IP6_UDP; + ifp->if_hwassist = hwassist; +} + static int epair_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -461,6 +477,44 @@ epair_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = 0; break; + case SIOCGIFCAP: + ifr->ifr_reqcap = ifp->if_capabilities; + ifr->ifr_curcap = ifp->if_capenable; + error = 0; + break; + case SIOCSIFCAP: + /* + * Enable/disable capabilities as requested, besides + * IFCAP_RXCSUM(_IPV6), which always remain enabled. + * Incoming packets may have the mbuf flag CSUM_DATA_VALID set. + * Without IFCAP_RXCSUM(_IPV6), this flag would have to be + * removed, which does not seem helpful. + */ + ifp->if_capenable = ifr->ifr_reqcap | IFCAP_RXCSUM | + IFCAP_RXCSUM_IPV6; + epair_caps_changed(ifp); + /* + * If IFCAP_TXCSUM(_IPV6) has been changed, change it on the + * other epair interface as well. + * A bridge disables IFCAP_TXCSUM(_IPV6) when adding one epair + * interface if another interface in the bridge has it disabled. + * In that case this capability needs to be disabled on the + * other epair interface to avoid sending packets in the bridge + * that rely on this capability. + */ + sc = ifp->if_softc; + if ((ifp->if_capenable ^ sc->oifp->if_capenable) & + (IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6)) { + sc->oifp->if_capenable &= + ~(IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6); + sc->oifp->if_capenable |= ifp->if_capenable & + (IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6); + epair_caps_changed(sc->oifp); + } + VLAN_CAPABILITIES(ifp); + error = 0; + break; + default: /* Let the common ethernet handler process this. */ error = ether_ioctl(ifp, cmd, data); @@ -572,8 +626,11 @@ epair_setup_ifp(struct epair_softc *sc, char *name, int unit) ifp->if_dname = epairname; ifp->if_dunit = unit; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_capabilities = IFCAP_VLAN_MTU; - ifp->if_capenable = IFCAP_VLAN_MTU; + ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_TXCSUM | + IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6; + ifp->if_capenable = IFCAP_VLAN_MTU | IFCAP_TXCSUM | + IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6; + epair_caps_changed(ifp); ifp->if_transmit = epair_transmit; ifp->if_qflush = epair_qflush; ifp->if_start = epair_start; From nobody Mon Sep 29 19:50:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbBd83n8Nz68l2c; Mon, 29 Sep 2025 19:50: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbBd83HS0z3r4K; Mon, 29 Sep 2025 19:50:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759175452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LTm56180eyIMMWE24Zycj19fyHkb51TB/RwgsxIlDRM=; b=l4hfmUSuxVClHwK4R6YGegKGlzK9xyIWzaX4+BwmhlqwBXALr7UN+xpXP28nfJ0OPr/4dp Mylxhyrb38B8bl58TRdYSWg/7+ceBVIaQ8m8JOoHdgfIw+rZT2Ce1hYxX6+me5bV7pNd4r sXugup0hrYs88FQqROCZj2LTzz2hCllmFgn0DWwyefAybIrHqI9sEyTydNgz2pzfv81P2P wQOzjnT9UUo6XFLVViG53A4cZsvSPeP6+UggFaFUt/ZBXWI1dBnHBF40Jpr4YNxRyfMICM 9QrycnNNs1eVTwatyEzPm6PTS6MBjw6sTiSVTmitkNTGb+ptnYcDWxCd1c6vaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759175452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LTm56180eyIMMWE24Zycj19fyHkb51TB/RwgsxIlDRM=; b=SaG0G4Y753rcpnTglozniDt3vun1vY9GxEjSzICjZrwm1EMOuCRQsEs9ZwWyn+bGxac7Ge u5JTHuwWvIkmMhN2W6LXpS4oOnxUZvnZ+j3luZyc82zZSE0KxK2JxkR6jWmWLtQz4jQR3z Q920fm+ec0Sx7m6GsH0cRtWi7fhmrS4FGHzRBDDSitCfJmogeiPTY21kxVDEWW/OvXW2gM mN3iEeJtQ/kIoSNyRtpgn5I5NoDKeim9NJoUkORORfo5kKPZz83KHLL185qJagFYbcwq2h Kh3/pyqiPbHpAEG956u7Kz4V6uECLpKLyib8l7HWarVPMIInOtnPOae31PDOWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759175452; a=rsa-sha256; cv=none; b=uyhpw6qA7mu4Suo/4s/+Kt+lx4ZcuIU4zR3njtvxuuc3H32+f7RFBwVtUUAnV1NLkICbxI 0nPi8h7wJIbpjSaQhcttyzpo5TRLsKO/FHPcM746eI+mv6kCYqEZNsWMpqEsfDiCQH72x9 y51cnle95BJvKYfULukLhKOnCUZ00WRb0fVqKKp2BVlmPPu4xP2gbhwTsaNAaFdaU+onOU OTPoZQt04VzP3DjPidYSvSZVMza0uVQxAmykzyVOcWwrTyz07PRLtV+fJ7qIEr/kj4HOW7 MV+34yMXQn75EQNBao4vk4FTY+16OsfV/MylQCHw1Kv/qBTQocEVT62oHbtyQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbBd82dYqz1JCK; Mon, 29 Sep 2025 19:50: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 58TJoqgj017355; Mon, 29 Sep 2025 19:50:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TJoqen017352; Mon, 29 Sep 2025 19:50:52 GMT (envelope-from git) Date: Mon, 29 Sep 2025 19:50:52 GMT Message-Id: <202509291950.58TJoqen017352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: fed8dbe794a6 - stable/15 - vtnet: improve interface capability handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: fed8dbe794a6fecf42d681a0d705f8a0ecd99073 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fed8dbe794a6fecf42d681a0d705f8a0ecd99073 commit fed8dbe794a6fecf42d681a0d705f8a0ecd99073 Author: Michael Tuexen AuthorDate: 2025-09-26 09:45:12 +0000 Commit: Michael Tuexen CommitDate: 2025-09-29 19:49:59 +0000 vtnet: improve interface capability handling Enable the handling of the IFCAP_RXCSUM_IPV6 handling by handling IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 as a pair. Also make clear, that software and hardware LRO require receive checksum offload. Reviewed by: Timo Völker Differential Revision: https://reviews.freebsd.org/D52682 (cherry picked from commit eaf619fddcb21859311b895a0836da3171a01531) --- share/man/man4/vtnet.4 | 4 +++- sys/dev/virtio/network/if_vtnet.c | 31 +++++++++++-------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 0594ca70e99a..636ce4cc9b60 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 September 16, 2025 +.Dd September 26, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -54,6 +54,8 @@ TCP segmentation offload (TSO), TCP large receive offload (LRO), hardware VLAN tag stripping/insertion features, a multicast hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. +TCP/UDP receive checksum offload cannot be configured independently for IPv4 +and IPv6. Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 utility configures the adapter to receive and transmit Jumbo Frames. diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 528ff3372097..a4bb57adc609 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1153,11 +1153,9 @@ vtnet_setup_interface(struct vtnet_softc *sc) } if (virtio_with_feature(dev, VIRTIO_NET_F_GUEST_CSUM)) { - if_setcapabilitiesbit(ifp, IFCAP_RXCSUM, 0); -#ifdef notyet /* BMV: Rx checksums not distinguished between IPv4 and IPv6. */ + if_setcapabilitiesbit(ifp, IFCAP_RXCSUM, 0); if_setcapabilitiesbit(ifp, IFCAP_RXCSUM_IPV6, 0); -#endif if (vtnet_tunable_int(sc, "fixup_needs_csum", vtnet_fixup_needs_csum) != 0) @@ -1370,27 +1368,20 @@ vtnet_ioctl_ifcap(struct vtnet_softc *sc, struct ifreq *ifr) if ((mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO)) == IFCAP_LRO && vtnet_software_lro(sc)) reinit = update = 0; - - if (mask & IFCAP_RXCSUM) + /* + * VirtIO does not distinguish between receive checksum offload + * for IPv4 and IPv6 packets, so treat them as a pair. + */ + if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { if_togglecapenable(ifp, IFCAP_RXCSUM); - if (mask & IFCAP_RXCSUM_IPV6) if_togglecapenable(ifp, IFCAP_RXCSUM_IPV6); + } if (mask & IFCAP_LRO) if_togglecapenable(ifp, IFCAP_LRO); - - /* - * VirtIO does not distinguish between IPv4 and IPv6 checksums - * so treat them as a pair. Guest TSO (LRO) requires receive - * checksums. - */ - if (if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { - if_setcapenablebit(ifp, IFCAP_RXCSUM, 0); -#ifdef notyet - if_setcapenablebit(ifp, IFCAP_RXCSUM_IPV6, 0); -#endif - } else - if_setcapenablebit(ifp, 0, - (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO)); + /* Both SW and HW TCP LRO require receive checksum offload. */ + if ((if_getcapenable(ifp) & + (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) == 0) + if_setcapenablebit(ifp, 0, IFCAP_LRO); } if (mask & IFCAP_VLAN_HWFILTER) { From nobody Mon Sep 29 21:52:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbFKf0Cb6z68vFp; Mon, 29 Sep 2025 21:52:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbFKd6Xxhz45pR; Mon, 29 Sep 2025 21:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5axy7U/hbwFF6+7i+Geyf7VobX7V2ZqHxf2bmpQCmT8=; b=UiziqBgLEITBNcvZzxWd9oVWQPr73iE4rvlLD1Aiz6usgBLEGCJyujg16JXDmutNFQNKUN b29oCtvGmYdt+xB5Tu80cSOdLg22OepsXV7iQ7s3vQhQTtR9qx8io9Ed7O8ZNu1UOcj52+ +qdZDPYneR4gAMezeERFW6QC0FCWY6aohmFQ5aHPTVtWzT2T+sqPel8tDBFOFYkw7qViNI rL6rMXYnw+9RYRxMOJtiizIbxBR5SKd5/TvzFL/bsNvsmNT97DnFv9LT1PKKYVHWoWL+P4 ixU+JGJJwHhh0QRwra/eEaigZj4EANcpTkYS4uf6VsZAYA/VbzeZrZsyl0lGTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5axy7U/hbwFF6+7i+Geyf7VobX7V2ZqHxf2bmpQCmT8=; b=eZZjP1N7SEqjFVouuukcl6577ytGvlyCeSl/u8QkqpQgklmOkDJ7rI7gjr+YDgKVZ7Bp9a +raxxenGYks40tgJHwZlW4SVweOkczeXesorpHSZoIrk2smALrU3tKqgHTgDayL0rASVEh 9piIBShKyhbgWwTdcUD7hHA82waGkwON1S6nteYhLtWninzkUE3M2Fx97DLohC6AxDt1G2 WMEjdo+QqpHPKWmIq4pL08sS4sULi6fDa+MwOw+Vl1lUxPVpnMLtT1Tj9WDmglY+5ko9Yw WzAklx6Nahg7v9v2E5clcwvVpxGbMTJ/Jjpi74pFQDduYmUVLXBPC3s3fJ0TCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759182757; a=rsa-sha256; cv=none; b=nLM/6a0u25qTbKYQty2c80Ee/US/YY4NUe44CMIEsZVjttRHIwbwCN2/dcwhbTBIsrzE1h LhJR/sb0/RrSqd9eK+0AWI8j1UI4VVzzB4ZVWSmCERXY9GIZVFh+P0ADykbB+NENazURSi BjNmgk7eGRxewAPn2OPABHq6W8Wrf6selz7pnBQceV9KiEXuzV5VW9uvZBItyMw5ebK9ct wLtf8opOocKNEMdU/63SbufH8gLB4HiCBigTnO+OU9Wc6RJ8Mpe8/vzKVQeNWFvY9ZcJRx lY/HWGVSQcxksf3avH2aqoovq/Xuny2+lfC8bthFqNaTIsyS5ejjAZQJczFKAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbFKd5y2wz1M8W; Mon, 29 Sep 2025 21:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58TLqbdI051759; Mon, 29 Sep 2025 21:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TLqbdG051756; Mon, 29 Sep 2025 21:52:37 GMT (envelope-from git) Date: Mon, 29 Sep 2025 21:52:37 GMT Message-Id: <202509292152.58TLqbdG051756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: c18032ba3172 - stable/15 - iichid(4): Always use wMaxInputLength bytes as input report length List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c18032ba3172ec139056d71952b885b35f9fe107 Auto-Submitted: auto-generated The branch stable/15 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c18032ba3172ec139056d71952b885b35f9fe107 commit c18032ba3172ec139056d71952b885b35f9fe107 Author: Vladimir Kondratyev AuthorDate: 2025-09-22 08:37:19 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-09-29 21:50:43 +0000 iichid(4): Always use wMaxInputLength bytes as input report length Lower values may result in non-acknowledged interrupts. E.g. ITE5570 device found in ASUS TUF. Greater values may result in read failures. E.g. GXTP7863 device found on MateBookPro 2023. Investigated by: huanghwh@gmail.com PR: 289353 MFC after: 1 week fixes: 36027361f9cf ("iichid: Stop using split I²C bus transactions") (cherry picked from commit 8f496952e3e6cdd531675a44b84b3f1954532afb) --- sys/dev/iicbus/iichid.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index fdb4816b8bd9..6d95d6d2d4f8 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -816,12 +816,13 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, sc = device_get_softc(dev); /* - * 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. + * Start with wMaxInputLength to follow HID-over-I2C specs. Than if + * semi-HID device like ietp(4) requested changing of input buffer + * size with report descriptor overloading, find the longest input + * report in the descriptor, and add two for the length field. */ - rdesc->rdsize = 2 + - MAX(rdesc->isize, le16toh(sc->desc.wMaxInputLength)); + rdesc->rdsize = rdesc->rdsize == 0 ? + le16toh(sc->desc.wMaxInputLength) : rdesc->isize + 2; /* Write and get/set_report sizes are limited by I2C-HID protocol. */ rdesc->grsize = rdesc->srsize = IICHID_SIZE_MAX; rdesc->wrsize = IICHID_SIZE_MAX; From nobody Mon Sep 29 21:52:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbFKg13sKz68v1T; Mon, 29 Sep 2025 21:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbFKg0414z45pT; Mon, 29 Sep 2025 21:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qPk3NtRyTo6IfJSr1mtO2OWQ2Iycrv3YPpbQbIQM1iY=; b=TTvXXyPIdD7o3ZeCXKd85NcbnhRvESjlKnr1bOpxFMXwyv8E/h74VZZYsXi318hNe3noVd KkmqSKY/Kno+Tzuq44EIPRaVtPqui4tG2XiOjFLWaoFkvJx4+nuleC3nT29BVwMoN7rwrd mKK0PgC2KTWm5T1zx6/js+KbggSu5sBJdmHDzyHEk+WpR8b3auW4HB1zTPWYuVHv1ukxB1 CtISGepdex03k+7BaQcYpJfZ2TmHG6zyXXbzCDqmPnLcMkyF0iXpWTBwl3i9mMc3KqmFRJ gnLY01+RmPp4uuFNZePpxv40aTlotWQTa26tvV6iXB8JIpo2pxmrlZm8zZ9rbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qPk3NtRyTo6IfJSr1mtO2OWQ2Iycrv3YPpbQbIQM1iY=; b=GTsHQZCgii7vMOCexbQZ3PcJ9EIqK+m6XeYRVgK11qDQwpyEcyU/vd0UqbsxnrPaEHRyfq 8h27rXyhbfWxhG3PUhzX0LMSjSY51IY9OMa1+rPOdLn0Nj9aaWI+/SfEkaQOA0t+TY8NLi WggwXpTk0uDp85kGIBXmoTIrzsX4Q8WMfiSt4uoMOcSBek3PyHvt9P/kHLmtYNOWdNOGLY Re3+C4BzaEFIWr26aDRfjb/X5BKH8bqIkGnxcxao/DzXEElhHFqNubrnlty3ewxmbEiClF P36xf4+Uc12dqpVUkqxhPDmJBTay/s3ZpvgQRJ7G306f5eXNcDjFpV5hH2cb0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759182759; a=rsa-sha256; cv=none; b=aN16YjSoeyfSuYS3l4fGzKn4QO4jZXw8tt9J0Y9NqQxyTfmvAtD2j/u8IRiFksFxtRQfAI FfJ8o8cekhpigLZ/8OaCMvctm51/0i2r0R/RaoY3dkiHyht+urjr8IIrLwIRQYkdRRsham AxzkdwemMybB195ev77SjK382r0JgzokUulOPCYovxyDXVmeCmnUJeJ3da+YpI6tsO6gED Wmj+SvchwpZ7qriy/hN+AIcK/yOVXHSbWNmdMVBZCDime0SHhU9gvy/jwoRcZQdEGet6lU IEjA3g0VkUjloYrzEMpx1I9/55uNqjgVClxEDiJxs1UbMLsuJ0db3/qhtL+9pQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbFKf6bybz1MXr; Mon, 29 Sep 2025 21:52: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 58TLqc6Q051793; Mon, 29 Sep 2025 21:52:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TLqcX8051790; Mon, 29 Sep 2025 21:52:38 GMT (envelope-from git) Date: Mon, 29 Sep 2025 21:52:38 GMT Message-Id: <202509292152.58TLqcX8051790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 9c61c3f7e4b1 - stable/15 - iichid(4): Do not add 2 leading "length" bytes to input report length List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9c61c3f7e4b1e6e68cddf6ac9ecc33ea11198ef6 Auto-Submitted: auto-generated The branch stable/15 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9c61c3f7e4b1e6e68cddf6ac9ecc33ea11198ef6 commit 9c61c3f7e4b1e6e68cddf6ac9ecc33ea11198ef6 Author: Vladimir Kondratyev AuthorDate: 2025-09-22 08:37:20 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-09-29 21:51:07 +0000 iichid(4): Do not add 2 leading "length" bytes to input report length MFC after: 1 week fixes: 36027361f9cf ("iichid: Stop using split I²C bus transactions") (cherry picked from commit 1e74951b6cd8132ae417177336b7180e174a5e3f) --- sys/dev/iicbus/iichid.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 6d95d6d2d4f8..5ca3f1b84e48 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -540,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 + 2, actual); + sc->intr_handler(sc->intr_ctx, sc->intr_buf + 2, actual - 2); sc->missing_samples = 0; if (sc->dup_size != actual || memcmp(sc->dup_buf, sc->intr_buf, actual) != 0) { @@ -607,7 +607,7 @@ iichid_intr(void *context) if (sc->power_on && sc->open) { if (actual != 0) sc->intr_handler(sc->intr_ctx, sc->intr_buf + 2, - actual); + actual - 2); else DPRINTF(sc, "no data received\n"); } @@ -822,7 +822,7 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, * report in the descriptor, and add two for the length field. */ rdesc->rdsize = rdesc->rdsize == 0 ? - le16toh(sc->desc.wMaxInputLength) : rdesc->isize + 2; + le16toh(sc->desc.wMaxInputLength) - 2 : rdesc->isize; /* Write and get/set_report sizes are limited by I2C-HID protocol. */ rdesc->grsize = rdesc->srsize = IICHID_SIZE_MAX; rdesc->wrsize = IICHID_SIZE_MAX; @@ -832,7 +832,7 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, sc->intr_handler = intr; sc->intr_ctx = context; - sc->intr_bufsize = rdesc->rdsize; + sc->intr_bufsize = rdesc->rdsize + 2; sc->intr_buf = realloc(sc->intr_buf, sc->intr_bufsize, M_DEVBUF, M_WAITOK | M_ZERO); #ifdef IICHID_SAMPLING @@ -1094,7 +1094,8 @@ iichid_probe(device_t dev) } if (le16toh(sc->desc.wHIDDescLength) != 30 || - le16toh(sc->desc.bcdVersion) != 0x100) { + le16toh(sc->desc.bcdVersion) != 0x100 || + le16toh(sc->desc.wMaxInputLength) < 2) { DPRINTF(sc, "HID descriptor is broken\n"); return (ENXIO); } From nobody Mon Sep 29 21:52:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbFKh5dkNz68tp3; Mon, 29 Sep 2025 21:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbFKh0z49z45x3; Mon, 29 Sep 2025 21:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+XK/ZJ/xvF6Fqq3ep0QSbnWwhFqj4wqysJ8DlqYvD64=; b=MhL4Jujz6ssR+YpB2GwD6oXJOgv5lWu5NDh7wtAoIYBHepNhnaLxFtscAYTgOpVnh0IFJB ZbHoJD4mYFrXCLkDTMwwNGVKfjS6GjbRvnkjKmvh1uHvSh5LfvAL8iAOS++rf+JbcQkogV sxAJ5K5DmDjLm34dgj7Qp5SetZBnnIsBzhzy4hu2iqFTuXiweEY+uY72WWlGYzoaP5UC/A 55XjVU+bQF8qHK4XoAcYrL7tryOMIMrmzryRAuV2Pgfdk9WcwbBGilqFQQ59aqXuZT0ivF 9l0ftRnwcauC9wW4lZKh2SryKt7miIExb9RrGsCwaiZOkCAg4jg7rLzauS10DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759182760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+XK/ZJ/xvF6Fqq3ep0QSbnWwhFqj4wqysJ8DlqYvD64=; b=maf++/ritPNC4tF5AGx4su37OljuOfHAExXMLTxj4SRwGqUHaN0FEAJg4SlBXFUQzD1vl9 b1TW3jb61StXYQABX1fLLz61mJ/Ggb/xTayn3uqiPtziwXCYrfzZF5vysZXVV/VVe4PzeB xcaTrMEZk38WPAGHFySIbmJGjyQGDbAamRxvIOekNJv1Wo0M+msOprIizeu3ApXdvlNTTd BaSZcns67MLsjVQWhbm5C0rRxsPcZdzW8bcPBjZWDeUP8cUhWGXhg/j2AFtnUXOkeZ29Oq IRlxx4gyzc1xymRWhzujS7CFQe679cW41NPrU342a8cSrhYrU96WJ9lJWW86qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759182760; a=rsa-sha256; cv=none; b=mTU/R3wLMyp8c8C67boYxFxziyq8g3/liXd+vBxpIbseGhbvoOBHb4pNLw+BItFND7lMUw FUYNBPtX/qqFYjx0gZ/YYZ/VJc9N8AE5UMToYa/KAMOPXcTdzj0MOOhfVjxrdNwf4ukRzN LJMGIvI/pweLfv1f6b6wa27rcPJkJ686vUsgNAv9rlNrJcSEonT7rXjYyIc8nc5PPHmWkB U4xmfbTLPIJTnd4/hLwHCYD1o20Roa1nChxly5CnAaZ8NHtI++pwB+EKFWXoKInTKWpy72 hdnSyRiVt032/dXKmCZ8s+DHhkVnmkyrz5EdptbBtG+XAp++FYpE68oIgV/EXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbFKh0Ttgz1MXs; Mon, 29 Sep 2025 21:52: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 58TLqek9051827; Mon, 29 Sep 2025 21:52:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58TLqePk051824; Mon, 29 Sep 2025 21:52:40 GMT (envelope-from git) Date: Mon, 29 Sep 2025 21:52:40 GMT Message-Id: <202509292152.58TLqePk051824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: ee46f649cb13 - stable/15 - ietp(4): Always overload HID report descriptor List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ee46f649cb1344bdaf220b763efaad66d4c77491 Auto-Submitted: auto-generated The branch stable/15 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ee46f649cb1344bdaf220b763efaad66d4c77491 commit ee46f649cb1344bdaf220b763efaad66d4c77491 Author: Vladimir Kondratyev AuthorDate: 2025-09-22 08:37:19 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-09-29 21:51:36 +0000 ietp(4): Always overload HID report descriptor It is required since "iichid(4): Always use wMaxInputLength bytes as input report length" commit. MFC after: 1 week (cherry picked from commit a9227954b0f01e950cc51d744af27585778ddf84) --- sys/dev/hid/ietp.c | 55 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/sys/dev/hid/ietp.c b/sys/dev/hid/ietp.c index 73a5cb7414d4..a9d0295fb121 100644 --- a/sys/dev/hid/ietp.c +++ b/sys/dev/hid/ietp.c @@ -199,17 +199,32 @@ static const struct hid_device_id ietp_iic_devs[] = { IETP_IIC_DEV("ELAN1000"), }; -static uint8_t const ietp_dummy_rdesc[] = { +static uint8_t const ietp_dummy_rdesc_lo[] = { 0x05, HUP_GENERIC_DESKTOP, /* Usage Page (Generic Desktop Ctrls) */ 0x09, HUG_MOUSE, /* Usage (Mouse) */ 0xA1, 0x01, /* Collection (Application) */ 0x09, 0x01, /* Usage (0x01) */ + 0x15, 0x00, /* Logical Minimum (0) */ + 0x26, 0xFF, 0x00, /* Logical Maximum (255) */ 0x95, IETP_REPORT_LEN_LO, /* Report Count (IETP_REPORT_LEN_LO) */ 0x75, 0x08, /* Report Size (8) */ 0x81, 0x02, /* Input (Data,Var,Abs) */ 0xC0, /* End Collection */ }; +static uint8_t const ietp_dummy_rdesc_hi[] = { + 0x05, HUP_GENERIC_DESKTOP, /* Usage Page (Generic Desktop Ctrls) */ + 0x09, HUG_MOUSE, /* Usage (Mouse) */ + 0xA1, 0x01, /* Collection (Application) */ + 0x09, 0x01, /* Usage (0x01) */ + 0x15, 0x00, /* Logical Minimum (0) */ + 0x26, 0xFF, 0x00, /* Logical Maximum (255) */ + 0x95, IETP_REPORT_LEN_HI, /* Report Count (IETP_REPORT_LEN_HI) */ + 0x75, 0x08, /* Report Size (8) */ + 0x81, 0x02, /* Input (Data,Var,Abs) */ + 0xC0, /* End Collection */ +}; + static const struct evdev_methods ietp_evdev_methods = { .ev_open = &ietp_ev_open, .ev_close = &ietp_ev_close, @@ -433,28 +448,38 @@ ietp_res2dpmm(uint8_t res, bool hi_precision) static void ietp_iic_identify(driver_t *driver, device_t parent) { - void *d_ptr; - hid_size_t d_len; - int isize; - uint8_t iid; + device_t iichid = device_get_parent(parent); + static const uint16_t reg = IETP_PATTERN; + uint16_t addr = iicbus_get_addr(iichid) << 1; + uint8_t resp[2]; + uint8_t cmd[2] = { reg & 0xff, (reg >> 8) & 0xff }; + struct iic_msg msgs[2] = { + { addr, IIC_M_WR | IIC_M_NOSTOP, sizeof(cmd), cmd }, + { addr, IIC_M_RD, sizeof(resp), resp }, + }; + struct iic_rdwr_data ird = { msgs, nitems(msgs) }; + uint8_t pattern; if (HIDBUS_LOOKUP_ID(parent, ietp_iic_devs) == NULL) return; - if (hid_get_report_descr(parent, &d_ptr, &d_len) != 0) + + if (device_get_devclass(iichid) != devclass_find("iichid")) return; - /* - * Some Elantech trackpads have a mangled HID report descriptor, which - * reads as having an incorrect input size (i.e. < IETP_REPORT_LEN_LO). - * If the input size is incorrect, load a dummy report descriptor. - */ + DPRINTF("Read reg 0x%04x with size %zu\n", reg, sizeof(resp)); - isize = hid_report_size_max(d_ptr, d_len, hid_input, &iid); - if (isize >= IETP_REPORT_LEN_LO) + if (hid_ioctl(parent, I2CRDWR, (uintptr_t)&ird) != 0) return; - hid_set_report_descr(parent, ietp_dummy_rdesc, - sizeof(ietp_dummy_rdesc)); + DPRINTF("Response: %*D\n", (int)size(resp), resp, " "); + + pattern = (resp[0] == 0xFF && resp[1] == 0xFF) ? 0 : resp[1]; + if (pattern >= 0x02) + hid_set_report_descr(parent, ietp_dummy_rdesc_hi, + sizeof(ietp_dummy_rdesc_hi)); + else + hid_set_report_descr(parent, ietp_dummy_rdesc_lo, + sizeof(ietp_dummy_rdesc_lo)); } static int From nobody Tue Sep 30 09:17:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbXX76vtkz68m1S; Tue, 30 Sep 2025 09:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbXX76JdJz3CMM; Tue, 30 Sep 2025 09:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5kxolU2B5sxpE3uceTiRdF+Ya0yBmUfUJr7Gjp10VN4=; b=xvhajuKqT6CElvJIGXkyZm1C5p0iOEEoJ0cgTOsRKmDXH4ruP99IwOo9PnchFidwXlPyGR HVqwqnRJJTqwnTDnrC9PTahMy7Am7dGWLxmXr5ttoIzZvQpKdWuidkoQNhReq6zpPHd7hX q9Btr5zm0v5OKXq6A5K3731XiNrW2uqeVHlc2nUx7+2kAdc8+8VCqTHsekQBvFRG2Fh1QK pC8vTJpyUmfAVW+xBqZ/HWlSsZ0ZTJV7jp6vtv5TX9+S1B4DvsDlVlMXyAEQEevBEbR40+ JZ9OdJ9HaUFmhr/Pn0VtqfyV60pw/2uMRoPmTuYPN3jKnYn4+QXNfiKN4JamHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5kxolU2B5sxpE3uceTiRdF+Ya0yBmUfUJr7Gjp10VN4=; b=YCjEevRiU/fMBQX5sCPNEB9aS4tx7pXOhHjmSsZHVX8odXeyDzrLZqCvtLNelP++VQg+i2 QLrQzeTylCd45obCd46XK4M13+q+/MNLXnR/lA1Aib8fF1SONsZGl3KLQXctKRZv1f/hPA kNaRCKeYd0rn03o4/kd6tk7+s6+/iNoUEUxJMh4dgAUgTiHwFglVP1j3nyIPZIjvTztMYy Dvb5cIC/WA/cbYiRLzXfaachF24WWGk5rSejwZ7qa4EZyzuYNwgX5tuLMKyQkJAItqPdmq E5mpIfT4NcCPHgy7nf5/T4FkD9RREVEWtjsPp4+ji7AY2o2Afk6VbmA1uHqf6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759223863; a=rsa-sha256; cv=none; b=FTL7y0Gdb2n13ATYzFn2cQ8yJi3+/5dZ1Dj7kvJUpNQatyUKb+sM2pyosERpivEldvkifB ncc9ZiQjOesVXBY8LmSnODA3CIBshEgfffsY3/4zndBoZCqZ2hY4WGGwENi7lYmLdXktLN xZvcEz4SHwB0ILGVrSbsn5ncpKjq1FROIohuHBuqzhLD2LN2CyPv8i3OuGOsv10+KebUV4 wZiHJADtIIPDCVeFwaiuSNaqiSD8Ri/BL7Us1Z9MIU7yjSFHWRlqP4M5jP0ZRBPCCSlrWw 77IOfBhEVMeRaTW8IL2Fs98QFQHne64g7jk04C0+2IQqmRLVzNhy8+f50G5Ceg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbXX75pnpzDCv; Tue, 30 Sep 2025 09:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58U9HhtM038429; Tue, 30 Sep 2025 09:17:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58U9HhQM038426; Tue, 30 Sep 2025 09:17:43 GMT (envelope-from git) Date: Tue, 30 Sep 2025 09:17:43 GMT Message-Id: <202509300917.58U9HhQM038426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: abdd81f0a5d5 - stable/15 - dtraceall: Enable kinst for aarch64 and riscv as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: abdd81f0a5d5c7192891e4233b9cfb83c94b9640 Auto-Submitted: auto-generated The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=abdd81f0a5d5c7192891e4233b9cfb83c94b9640 commit abdd81f0a5d5c7192891e4233b9cfb83c94b9640 Author: Christos Margiolis AuthorDate: 2025-09-16 15:37:19 +0000 Commit: Christos Margiolis CommitDate: 2025-09-30 09:17:26 +0000 dtraceall: Enable kinst for aarch64 and riscv as well aarch64 and riscv are supported since 2023 so it should be safe to enable it by default. MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D52575 (cherry picked from commit 67f3c0d6a575f74a013974b4d4860a36e4fcc8ab) --- sys/modules/dtrace/dtraceall/dtraceall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/dtraceall/dtraceall.c index 851d33a7e518..1978b9ead362 100644 --- a/sys/modules/dtrace/dtraceall/dtraceall.c +++ b/sys/modules/dtrace/dtraceall/dtraceall.c @@ -74,11 +74,11 @@ MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); defined(__i386__) || defined(__powerpc__) || defined(__riscv) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); #endif -#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) -MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); -#if defined(__amd64__) +#if defined(__amd64__) || defined(__aarch64__) || defined(__riscv) MODULE_DEPEND(dtraceall, kinst, 1, 1, 1); #endif +#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) +MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); #endif MODULE_DEPEND(dtraceall, sdt, 1, 1, 1); MODULE_DEPEND(dtraceall, systrace, 1, 1, 1); From nobody Tue Sep 30 09:17:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbXX91hbBz68m3y; Tue, 30 Sep 2025 09:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbXX86vq6z3CBk; Tue, 30 Sep 2025 09:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAZpWoyq6h0WWrJct7T6pbQAgmg1BFV3qCMZgi8c/bU=; b=quc7jivZ4Hq3mP9ib1uk7I4C99JB3EcneTVB7SHCV0wOkPHTwWlG9aw16XE4uIy8aix4cl bb9C3AcTXf6Ey+i5BWFyk98lOUANEGkbJTL1/TsrrmzBGqiXqf6gRqmOC3IZ33jCcWRnmx uwRl+0cfcmVIAiBmsr7VFlUtx4wWuY5k9NjKxEA5wd6Dw7TNpb4g6c7ex2eKP1RN36mXCS LLrNEhDu7oID+NQIoT84+EI9ZXjcqohgdHIpKkiOl70ro7aZSLcfDaNzdHo+364GxmLqsc maB2y5TBorNv3I717WpS2nYHDyiofdNW0Wxl5oVkEXAPaDGb4wPVcqofg+Gcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAZpWoyq6h0WWrJct7T6pbQAgmg1BFV3qCMZgi8c/bU=; b=wIzqvKhlBiGgqDyhe6wgzDa0X5snyqbMINuKMLQ7zgBfGLUyYUQ2fP0wCHVj5p/r1TOPZ7 9QicHLG8iAxdQaaFfbpqq1WA054/zKUs/6qni3GKBBI8hdRHEdj5sq2JbjNPF8erKJ7mJh Kw0JQmf/z2e3Z6VwZWKbP4WLtS+NDYl2SPDDLU02ZXV88N2mmHx4I6/El0dhCgBT+U6dlv 2XXPLC6Bf1/4bi2JqEkB1C4BMy1sGdpLol+s27nG0bMCg2dvNXtnqMYyNka7gw09SMuqHD qTwa1OBMSV65ycRO5vVVMYduwRpLv7UuzhhkdyYd9XI58ZILVl3VD7YpZ6qRZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759223865; a=rsa-sha256; cv=none; b=pn60I8BolN5xSC+wEXHgNqlzoV+vgl+82sN97R4SjWAuDseRkFwOmrgB3V1b+HxcleSgs4 ZxuZof+SUSlgMOb68bUuNhcVpu6yK2qWNQMPhyk+JUqyk4/bMa1Q8glRYgm2SYY8+7hVQY wVs3EVWre/4VotAQp1ZBN1fPwfV5iEnWVO0IU/bZztsTYW7po/5ClWXgtirddBbkra+KPW WEDCTQsrXGo8J6FSDA2ZTqJW9M5MYwmo8lpZnHMTcWhcptdyXuMwPR7oBWoANgrGblRU6b v1DZNna/sMM0ltaX6qqPPcTotIaJJoC+k62l9FHYkhPQRCI66ahDDnYVrGPIFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbXX86TSmzTbH; Tue, 30 Sep 2025 09:17: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 58U9HiHf038465; Tue, 30 Sep 2025 09:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58U9HiMO038463; Tue, 30 Sep 2025 09:17:44 GMT (envelope-from git) Date: Tue, 30 Sep 2025 09:17:44 GMT Message-Id: <202509300917.58U9HiMO038463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 782a376911eb - stable/15 - sound: Implement COMPAT_FREEBSD32 shims List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 782a376911eb61ee59310bfc779363a2a3939c30 Auto-Submitted: auto-generated The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=782a376911eb61ee59310bfc779363a2a3939c30 commit 782a376911eb61ee59310bfc779363a2a3939c30 Author: Damjan Jovanovic AuthorDate: 2025-09-23 18:59:05 +0000 Commit: Christos Margiolis CommitDate: 2025-09-30 09:17:26 +0000 sound: Implement COMPAT_FREEBSD32 shims PR: 216568 MFC after: 1 week Reviewed by: christos, kib Differential Revision: https://reviews.freebsd.org/D52509 (cherry picked from commit 749a9266982b8e012b5ec370b2fdfef11f34c0b2) --- sys/dev/sound/pcm/dsp.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index da38f52021ae..fe5576baf017 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -671,6 +671,43 @@ dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *ch, return (0); } +#ifdef COMPAT_FREEBSD32 +typedef struct _snd_chan_param32 { + uint32_t play_rate; + uint32_t rec_rate; + uint32_t play_format; + uint32_t rec_format; +} snd_chan_param32; +#define AIOGFMT32 _IOC_NEWTYPE(AIOGFMT, snd_chan_param32) +#define AIOSFMT32 _IOC_NEWTYPE(AIOSFMT, snd_chan_param32) + +typedef struct _snd_capabilities32 { + uint32_t rate_min, rate_max; + uint32_t formats; + uint32_t bufsize; + uint32_t mixers; + uint32_t inputs; + uint16_t left, right; +} snd_capabilities32; +#define AIOGCAP32 _IOC_NEWTYPE(AIOGCAP, snd_capabilities32) + +typedef struct audio_errinfo32 +{ + int32_t play_underruns; + int32_t rec_overruns; + uint32_t play_ptradjust; + uint32_t rec_ptradjust; + int32_t play_errorcount; + int32_t rec_errorcount; + int32_t play_lasterror; + int32_t rec_lasterror; + int32_t play_errorparm; + int32_t rec_errorparm; + int32_t filler[16]; +} audio_errinfo32; +#define SNDCTL_DSP_GETERROR32 _IOC_NEWTYPE(SNDCTL_DSP_GETERROR, audio_errinfo32) +#endif + static int dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td) @@ -829,9 +866,25 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case AIOSFMT: case AIOGFMT: +#ifdef COMPAT_FREEBSD32 + case AIOSFMT32: + case AIOGFMT32: +#endif { snd_chan_param *p = (snd_chan_param *)arg; +#ifdef COMPAT_FREEBSD32 + snd_chan_param32 *p32 = (snd_chan_param32 *)arg; + snd_chan_param param; + + if (cmd == AIOSFMT32) { + p = ¶m; + p->play_rate = p32->play_rate; + p->rec_rate = p32->rec_rate; + p->play_format = p32->play_format; + p->rec_format = p32->rec_format; + } +#endif if (cmd == AIOSFMT && ((p->play_format != 0 && p->play_rate == 0) || (p->rec_format != 0 && p->rec_rate == 0))) { @@ -872,15 +925,41 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, p->rec_format = 0; } PCM_RELEASE_QUICK(d); +#ifdef COMPAT_FREEBSD32 + if (cmd == AIOSFMT32 || cmd == AIOGFMT32) { + p32->play_rate = p->play_rate; + p32->rec_rate = p->rec_rate; + p32->play_format = p->play_format; + p32->rec_format = p->rec_format; + } +#endif } break; case AIOGCAP: /* get capabilities */ +#ifdef COMPAT_FREEBSD32 + case AIOGCAP32: +#endif { snd_capabilities *p = (snd_capabilities *)arg; struct pcmchan_caps *pcaps = NULL, *rcaps = NULL; struct cdev *pdev; - +#ifdef COMPAT_FREEBSD32 + snd_capabilities32 *p32 = (snd_capabilities32 *)arg; + snd_capabilities capabilities; + + if (cmd == AIOGCAP32) { + p = &capabilities; + p->rate_min = p32->rate_min; + p->rate_max = p32->rate_max; + p->formats = p32->formats; + p->bufsize = p32->bufsize; + p->mixers = p32->mixers; + p->inputs = p32->inputs; + p->left = p32->left; + p->right = p32->right; + } +#endif PCM_LOCK(d); if (rdch) { CHN_LOCK(rdch); @@ -913,6 +992,18 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, if (rdch) CHN_UNLOCK(rdch); PCM_UNLOCK(d); +#ifdef COMPAT_FREEBSD32 + if (cmd == AIOGCAP32) { + p32->rate_min = p->rate_min; + p32->rate_max = p->rate_max; + p32->formats = p->formats; + p32->bufsize = p->bufsize; + p32->mixers = p->mixers; + p32->inputs = p->inputs; + p32->left = p->left; + p32->right = p->right; + } +#endif } break; @@ -1635,6 +1726,9 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, break; case SNDCTL_DSP_GETERROR: +#ifdef COMPAT_FREEBSD32 + case SNDCTL_DSP_GETERROR32: +#endif /* * OSSv4 docs: "All errors and counters will automatically be * cleared to zeroes after the call so each call will return only @@ -1644,6 +1738,14 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, */ { audio_errinfo *ei = (audio_errinfo *)arg; +#ifdef COMPAT_FREEBSD32 + audio_errinfo errinfo; + audio_errinfo32 *ei32 = (audio_errinfo32 *)arg; + + if (cmd == SNDCTL_DSP_GETERROR32) { + ei = &errinfo; + } +#endif bzero((void *)ei, sizeof(*ei)); @@ -1659,6 +1761,21 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, rdch->xruns = 0; CHN_UNLOCK(rdch); } +#ifdef COMPAT_FREEBSD32 + if (cmd == SNDCTL_DSP_GETERROR32) { + bzero((void *)ei32, sizeof(*ei32)); + ei32->play_underruns = ei->play_underruns; + ei32->rec_overruns = ei->rec_overruns; + ei32->play_ptradjust = ei->play_ptradjust; + ei32->rec_ptradjust = ei->rec_ptradjust; + ei32->play_errorcount = ei->play_errorcount; + ei32->rec_errorcount = ei->rec_errorcount; + ei32->play_lasterror = ei->play_lasterror; + ei32->rec_lasterror = ei->rec_lasterror; + ei32->play_errorparm = ei->play_errorparm; + ei32->rec_errorparm = ei->rec_errorparm; + } +#endif } break; From nobody Tue Sep 30 09:18:24 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbXXx0438z68mBM; Tue, 30 Sep 2025 09:18: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbXXw6Wmsz3ClY; Tue, 30 Sep 2025 09:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AgtTUo1BrlMnh3V9GKqAGuSB37KVWl/CybLngAxJTOE=; b=hCl0qBT1yjg9eI7XVkx6TdwOOv3CV17eNKvl/NjUCOtTSbolh1wtajaQjtI7X2TsRdJGTK 9ECQ2VPYPI4NBRvc5TLbOHrH1LSlgiSbfYEb1Z2vts4AXHOxgB8uwG/WsHT4Lu8B69YWrU Ogbg9v9hfVYsz6PTXHIosa5QyirPh3SGfwqRMFb0aFOLYbd44/6TrLT7l9/pM+i9O9Dq8o ivwZnh7cjOhrPE/lMg0xEjhPnN93cJAbP+nUtzxhBJvryKBTCWZ8+EObZSTn4yw6qAPkbL SDdEv3V/Q41w/quqoAWC5UuPi1Im7+SYOgKBI4j8nQd0KZPmZ65fmICQeYKeUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AgtTUo1BrlMnh3V9GKqAGuSB37KVWl/CybLngAxJTOE=; b=hXWOUKNkLwwXa61+9Skaicd7v/Z71eO1J+jnd3ZBWw9fs+FJIxzumAEK44hbYFQ8bBPfQn 39M38vACuFcUfuypAy053t/JyZVG8BJ+K+/kgqGIhso/hWKZAD6xA8pyhJ3ryREIwN0isD qpc/AIe2FkIVuKaYzsX9EB8sGgCH5k9xZJPuZGjoPHEqXA7xt/dfA0EDmnfWhKcl2WYrLK nIQojzy5VlKQv1R0I9jtU/rAsMxogCaYiohlJwxl21/hbMkZv2q6q+D2FUidrQYdLWFEAw RMTN1Et6L2adP5mMHzR3RaextfzTSM4r8MBmeGCwIJBo/XKChYfSZUyU8HhQlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759223904; a=rsa-sha256; cv=none; b=lnOQFYqqdkrvmCSBLH5F+xhCV7tzYZQflNh4KVuBUBshqIYBPuz6zlTskVGxTqe5arpAcz VbGzGrSG0GlOnPZsXZFhGSuHsvE2pyeGYItdm6gCRW5fawZXMnx/N73P2FPJ0TAXW2n/j5 2jAE4cqe01ej+P9/n4AH+5EgPjrl90opRWZKaIDPam7OtcHdg9lfaEMuI5NNx3MiIYzJgo Nzsg4Xp2+s7pzcMCEotE1V4plBpF7tABAwT1A6VvcbzQCP47uPXLVFAtjRWj6ljsZDkQ6/ pwVcttxQWyMiKTGssBRBj0EUgRzeCyU433mpYa2WlkzDpZX2Cz6c0kQjaTCmDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbXXw64L4zDCw; Tue, 30 Sep 2025 09:18:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58U9IOTY038802; Tue, 30 Sep 2025 09:18:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58U9IO19038799; Tue, 30 Sep 2025 09:18:24 GMT (envelope-from git) Date: Tue, 30 Sep 2025 09:18:24 GMT Message-Id: <202509300918.58U9IO19038799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: a8e11e3c6208 - stable/14 - dtraceall: Enable kinst for aarch64 and riscv as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: a8e11e3c6208e6b569aed9eb60bd1dca32e0f5ec Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a8e11e3c6208e6b569aed9eb60bd1dca32e0f5ec commit a8e11e3c6208e6b569aed9eb60bd1dca32e0f5ec Author: Christos Margiolis AuthorDate: 2025-09-16 15:37:19 +0000 Commit: Christos Margiolis CommitDate: 2025-09-30 09:18:07 +0000 dtraceall: Enable kinst for aarch64 and riscv as well aarch64 and riscv are supported since 2023 so it should be safe to enable it by default. MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D52575 (cherry picked from commit 67f3c0d6a575f74a013974b4d4860a36e4fcc8ab) --- sys/modules/dtrace/dtraceall/dtraceall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/dtraceall/dtraceall.c index 7d41901f28d5..89710a251f35 100644 --- a/sys/modules/dtrace/dtraceall/dtraceall.c +++ b/sys/modules/dtrace/dtraceall/dtraceall.c @@ -72,11 +72,11 @@ MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1); defined(__i386__) || defined(__powerpc__) || defined(__riscv) MODULE_DEPEND(dtraceall, fbt, 1, 1, 1); #endif -#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) -MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); -#if defined(__amd64__) +#if defined(__amd64__) || defined(__aarch64__) || defined(__riscv) MODULE_DEPEND(dtraceall, kinst, 1, 1, 1); #endif +#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__) +MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1); #endif MODULE_DEPEND(dtraceall, sdt, 1, 1, 1); MODULE_DEPEND(dtraceall, systrace, 1, 1, 1); From nobody Tue Sep 30 09:18:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbXXy1462z68m5k; Tue, 30 Sep 2025 09:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbXXy0Q50z3Crk; Tue, 30 Sep 2025 09:18:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6I1AXLQk/prUNPLavRHI6CpO7te3diwV50ZdcBsgZkM=; b=t4tgr0K7KL5ME3ymFt5d6W2kC54b6BlHc8flCQUf1zH6JSKAcEi6+/o2UoUk5aI6T2Hx/u PDNM6Bi/eiseKaRnubJpLqcEVdj3G+a/+E2wP6fsFd2WzyKfidkwWVjSc0mjbNd9RiSl/G 6fkYST42pKOkB47ni2Nt2IFB+cu4+0QNVYrBZuUnduTR/6FO2H4QP7LsAyj7EqC/wck0Su 5lrvH4Zz3B5NyWDKmG6g9Z6EAiROc74ln5SLmnGvM9E0bCp4+iJcfdOBVlZoqy+nJfP9ZW Ob9CHR3u5npaxcGqpmN6FZV2OQGqkCE1xj7PiwbYKbUp2z5qm3nLCRN1jrW4dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759223906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6I1AXLQk/prUNPLavRHI6CpO7te3diwV50ZdcBsgZkM=; b=RESlePavSVs20QYPGg1TxwN2gFmprzcojdtDcJn5K962dUw5hrkASbAwneXkIPHD54GQcb 0KTpkcajcsg54wkyb3uVs0QP3t1ckTne8IcxQIRMmP4cUNHR+3BGngCYiu6l0MQoFlYqG4 zEQucqbg/zd2QGbAKcgcNqR2b612jNT6qxWB6Swv9sF3Ig41NonCKIYlwvLTWpQsVxsT3X HpN+LBAOmxavXipaIKA0S/tCeFnx5VoS8um1Bak5MU7iY4na+739eXXQBlQBN3tda6zS29 RIXF7qNPf3plmiOS35NI9CelJgs6M0o/wC2pFENVYZH9fwVTFV3nfnzoznMNEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759223906; a=rsa-sha256; cv=none; b=gptvEeniUlXBJvq2/4KlV+YkusRRfoOPxb5LfPpK7WJ0NZzNr6sSQQ3DmlPjhYAG8SGJk7 HS7mT8JO+NexzHcSEHQuIeS2outHer4j+gBXSJu5bTJ8mbU8TN/P7Cs1A+QazgNHPJWyuj 5tQAZV1j3ES2DDDOpYdpoGANm7Xim1Ujbp9rSyuTXe4WYrb7+mEeVQ+72HS2iDe88Vyha+ IT1bw8dPX8SLRj0fBvT4EjhDPvo+seAFUxiApRQLu4kwk9d4MIMoQ168JfE3PvTvMnc2X5 f8zIBA4Vlvoo9vT74bzDQQa9qngUIc05Q2qLsglwYb/xa18Dcf4USLKW8V7JdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbXXx73PxzTtw; Tue, 30 Sep 2025 09:18: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 58U9IPBT038843; Tue, 30 Sep 2025 09:18:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58U9IPkC038840; Tue, 30 Sep 2025 09:18:25 GMT (envelope-from git) Date: Tue, 30 Sep 2025 09:18:25 GMT Message-Id: <202509300918.58U9IPkC038840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: d0e8c9463126 - stable/14 - sound: Implement COMPAT_FREEBSD32 shims List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d0e8c94631267f07c90465faf5b47dcce0e232be Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d0e8c94631267f07c90465faf5b47dcce0e232be commit d0e8c94631267f07c90465faf5b47dcce0e232be Author: Damjan Jovanovic AuthorDate: 2025-09-23 18:59:05 +0000 Commit: Christos Margiolis CommitDate: 2025-09-30 09:18:07 +0000 sound: Implement COMPAT_FREEBSD32 shims PR: 216568 MFC after: 1 week Reviewed by: christos, kib Differential Revision: https://reviews.freebsd.org/D52509 (cherry picked from commit 749a9266982b8e012b5ec370b2fdfef11f34c0b2) --- sys/dev/sound/pcm/dsp.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index da38f52021ae..fe5576baf017 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -671,6 +671,43 @@ dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *ch, return (0); } +#ifdef COMPAT_FREEBSD32 +typedef struct _snd_chan_param32 { + uint32_t play_rate; + uint32_t rec_rate; + uint32_t play_format; + uint32_t rec_format; +} snd_chan_param32; +#define AIOGFMT32 _IOC_NEWTYPE(AIOGFMT, snd_chan_param32) +#define AIOSFMT32 _IOC_NEWTYPE(AIOSFMT, snd_chan_param32) + +typedef struct _snd_capabilities32 { + uint32_t rate_min, rate_max; + uint32_t formats; + uint32_t bufsize; + uint32_t mixers; + uint32_t inputs; + uint16_t left, right; +} snd_capabilities32; +#define AIOGCAP32 _IOC_NEWTYPE(AIOGCAP, snd_capabilities32) + +typedef struct audio_errinfo32 +{ + int32_t play_underruns; + int32_t rec_overruns; + uint32_t play_ptradjust; + uint32_t rec_ptradjust; + int32_t play_errorcount; + int32_t rec_errorcount; + int32_t play_lasterror; + int32_t rec_lasterror; + int32_t play_errorparm; + int32_t rec_errorparm; + int32_t filler[16]; +} audio_errinfo32; +#define SNDCTL_DSP_GETERROR32 _IOC_NEWTYPE(SNDCTL_DSP_GETERROR, audio_errinfo32) +#endif + static int dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td) @@ -829,9 +866,25 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case AIOSFMT: case AIOGFMT: +#ifdef COMPAT_FREEBSD32 + case AIOSFMT32: + case AIOGFMT32: +#endif { snd_chan_param *p = (snd_chan_param *)arg; +#ifdef COMPAT_FREEBSD32 + snd_chan_param32 *p32 = (snd_chan_param32 *)arg; + snd_chan_param param; + + if (cmd == AIOSFMT32) { + p = ¶m; + p->play_rate = p32->play_rate; + p->rec_rate = p32->rec_rate; + p->play_format = p32->play_format; + p->rec_format = p32->rec_format; + } +#endif if (cmd == AIOSFMT && ((p->play_format != 0 && p->play_rate == 0) || (p->rec_format != 0 && p->rec_rate == 0))) { @@ -872,15 +925,41 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, p->rec_format = 0; } PCM_RELEASE_QUICK(d); +#ifdef COMPAT_FREEBSD32 + if (cmd == AIOSFMT32 || cmd == AIOGFMT32) { + p32->play_rate = p->play_rate; + p32->rec_rate = p->rec_rate; + p32->play_format = p->play_format; + p32->rec_format = p->rec_format; + } +#endif } break; case AIOGCAP: /* get capabilities */ +#ifdef COMPAT_FREEBSD32 + case AIOGCAP32: +#endif { snd_capabilities *p = (snd_capabilities *)arg; struct pcmchan_caps *pcaps = NULL, *rcaps = NULL; struct cdev *pdev; - +#ifdef COMPAT_FREEBSD32 + snd_capabilities32 *p32 = (snd_capabilities32 *)arg; + snd_capabilities capabilities; + + if (cmd == AIOGCAP32) { + p = &capabilities; + p->rate_min = p32->rate_min; + p->rate_max = p32->rate_max; + p->formats = p32->formats; + p->bufsize = p32->bufsize; + p->mixers = p32->mixers; + p->inputs = p32->inputs; + p->left = p32->left; + p->right = p32->right; + } +#endif PCM_LOCK(d); if (rdch) { CHN_LOCK(rdch); @@ -913,6 +992,18 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, if (rdch) CHN_UNLOCK(rdch); PCM_UNLOCK(d); +#ifdef COMPAT_FREEBSD32 + if (cmd == AIOGCAP32) { + p32->rate_min = p->rate_min; + p32->rate_max = p->rate_max; + p32->formats = p->formats; + p32->bufsize = p->bufsize; + p32->mixers = p->mixers; + p32->inputs = p->inputs; + p32->left = p->left; + p32->right = p->right; + } +#endif } break; @@ -1635,6 +1726,9 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, break; case SNDCTL_DSP_GETERROR: +#ifdef COMPAT_FREEBSD32 + case SNDCTL_DSP_GETERROR32: +#endif /* * OSSv4 docs: "All errors and counters will automatically be * cleared to zeroes after the call so each call will return only @@ -1644,6 +1738,14 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, */ { audio_errinfo *ei = (audio_errinfo *)arg; +#ifdef COMPAT_FREEBSD32 + audio_errinfo errinfo; + audio_errinfo32 *ei32 = (audio_errinfo32 *)arg; + + if (cmd == SNDCTL_DSP_GETERROR32) { + ei = &errinfo; + } +#endif bzero((void *)ei, sizeof(*ei)); @@ -1659,6 +1761,21 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, rdch->xruns = 0; CHN_UNLOCK(rdch); } +#ifdef COMPAT_FREEBSD32 + if (cmd == SNDCTL_DSP_GETERROR32) { + bzero((void *)ei32, sizeof(*ei32)); + ei32->play_underruns = ei->play_underruns; + ei32->rec_overruns = ei->rec_overruns; + ei32->play_ptradjust = ei->play_ptradjust; + ei32->rec_ptradjust = ei->rec_ptradjust; + ei32->play_errorcount = ei->play_errorcount; + ei32->rec_errorcount = ei->rec_errorcount; + ei32->play_lasterror = ei->play_lasterror; + ei32->rec_lasterror = ei->rec_lasterror; + ei32->play_errorparm = ei->play_errorparm; + ei32->rec_errorparm = ei->rec_errorparm; + } +#endif } break; From nobody Tue Sep 30 15:23:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhf82B4Vz69DjV; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhf81hLYz3L5Q; Tue, 30 Sep 2025 15:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n5j0SLzlBV7bkk2nLj/U59m4jx1+Q6EfQUV77x0u1co=; b=s/MFXe3AiFZqVF4uCStOxYu6+9g/B2SCmPn89RQGmr99OuAO7DTCgNLZv2v6/DaTIGM+gC QHlMwiG9FelLPBN+uy39DnxRvlAuf1HAowSjeyd7dCJHywH6Jfe6jmufxn66AMcnE3WnJ+ e7pU2udcBDQcn1l3u4QMnmGshPCYcsVBDJnPuff9x/Rr3vWT+GiPZ2i/18tdDwwRyrB/7O ZL6BRHb8Z8cWm6yXmZUDj2YbHycoNLri1w7tFRR/PWiWlZztW3EoUisUuMuuLlZzYWEQZr 4ZDUHtX4thZnf92bk4s1eNBP86x9aW0E6P0fecu54+6ixhmjVWcyCSK23Hx/wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n5j0SLzlBV7bkk2nLj/U59m4jx1+Q6EfQUV77x0u1co=; b=Q4vlzCQ5FtpjK8KQc+Z8qAPPFKBKqCUxPgTNMSB4bqHZGpJHhrtfUudFVr14MEM37kgxlM bLCwW3kyH5dCwJOlc8W3A5gdPRCbcfGiJa4+pcUk2KYTKdvTGUL+CtQtMQKQ6CMwAzXhOI rCrL0NXGTc1egypUPLVsF42H3KCNuUEKi3jfyK28VWeWJ9PDTLOF3QdiNEbR7A2nI2fgRH 7CgBLBkdnz8VSL82U93fPts1n/TCxpEaUXeFTNNhmUq9SqHFUaOV5vvAicD7qRcdJL/Oyc S0fZ5rnVR6/n9iquMYvULReaxqOpa33WLHFYC53woSitLy9dJ4YTESD9RShyiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245808; a=rsa-sha256; cv=none; b=TXjisnKsW6TJYPgTbwC+MhPbgtk9YD22mer0DebfPo7iFhaDb9DZQkkNYGKBzUcTbWGbsK NHs4qTYVTG8RtJPJj0zxg2jqMwMZ4xrnvKksO/3wK+VAWWx0H+1dZQxpsLP5VaUiqH9PVE m7eh33zIgJkc0ApBIyPZ9ox30SjQgRh/32meuA+C4U3WoO7GTXlWLTCwERdLmT42PlcpkV R52RyH5/ZJuSGmkPRP1zoThOf9NkkDB8Q4vx4/YxdAlJjS5Fs9UBFwae8MDmYShxalQ+42 0q5gpYmEM6hsc0KpEsOxeYFme3MIm5R8eU+o/4ceQGLs7mbwky8pq0u+zdMkTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhf81Fvjzjf3; Tue, 30 Sep 2025 15:23: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 58UFNSc2045375; Tue, 30 Sep 2025 15:23:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNSR0045372; Tue, 30 Sep 2025 15:23:28 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:28 GMT Message-Id: <202509301523.58UFNSR0045372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ee99cb45ea56 - stable/15 - certctl: Include sys/types.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ee99cb45ea56dd8fee0cf812bb72bbd69552f95d Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ee99cb45ea56dd8fee0cf812bb72bbd69552f95d commit ee99cb45ea56dd8fee0cf812bb72bbd69552f95d Author: Mark Johnston AuthorDate: 2025-09-09 13:47:42 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +0000 certctl: Include sys/types.h This is needed to fix bootstrapping on FreeBSD versions before commit 56ee5c551f89 ("sysctl: make sys/sysctl.h self contained"). Moreover, certctl should really be including sys/types.h directly since it uses size_t. MFC after: 1 week (cherry picked from commit 2024887abc7d1b931e00fbb0697658e98adf048d) --- usr.sbin/certctl/certctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/certctl/certctl.c b/usr.sbin/certctl/certctl.c index 3601f6929fc4..7fdc644bc09f 100644 --- a/usr.sbin/certctl/certctl.c +++ b/usr.sbin/certctl/certctl.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include From nobody Tue Sep 30 15:23:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfB0CmRz69Dws; Tue, 30 Sep 2025 15:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhf96XsSz3LSx; Tue, 30 Sep 2025 15:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzY1wiS8F4VCORUDMI8+lbGA8QkCv12RovXKymktgM8=; b=vcO3PyK5IQKkktKf/j3rTtjP7A+LBznxB3qxFB6KZwPtfmYzSe3sFXpDkI5/QoJt03UxEP aQ16YIJW0Y76W+HJ0+R/9oPb2wsW/XWZsCZraeY0XPIvtVrgO3bak5uX48x6a+if207iyK 6yfiehNuLTN/Qoc2dFI4oFBV40P7ymKELJEpLavIiwDCkRKBXWkNXgg+gs6INQBXWmDBpr 44iPWB9PpDwzF7SOpq8EZs613U1ZGisdtyw1wDg3EII8AzO8X34PRQRaoVFmKCnbw5pXgJ 9RadIqoOBBsJR01Qfe0uZaYlxu6VUU65WOX99wQ+8YHMgQmqm9ENFS1n3H2fVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzY1wiS8F4VCORUDMI8+lbGA8QkCv12RovXKymktgM8=; b=pls+N46WkEJkTjplZPrljX1A2ONmTK8ncevZQrpNNn7LIuNwrK65m9yMnR1m1F6Qa3pbTu NYc54AH7DLOxLnLAOtelUEiH0RUPjEEafGhU6cWEYqkPR/4qekYxHt5mOCWTlgjVbXZBqm 1IBEGVrKeViThrTJRJ5i6c7PwpThBgZVjcsPBvCkdoTe5vZOXaOvW+Rg5290UZDXu4ukXJ 9EdEsb5WsMJ6QsglXviYCU6TA9NnHw42HVTs/Xq1rg75ipalxWB6DsAytSutffh1qiVt3H pqUXlrwFp3SmJ4oV/k7pPxsfG30srkUg5kQFz5RImnGkqb8/jMImiz/iopl3ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245809; a=rsa-sha256; cv=none; b=dBpucXCqJQBP9DrF4Fgm3inzXJpjVvotFzUNnWrf9JLnjW/4Mf+ebpE8hx92ZesWdR3Qnc oNHLFjlp3V0xWP6xxm8OIiIXnX3EEMlAfANtBq5LN39wQj6kLxXBG7H6UO5vQHQCHb1bPk LlHQmblmQwDWkQmygmSonQOb6sbqo3qUhQrYuKdeGcx1gk8x3qA+B4LlBYVZCDpOAPatkt Q42ePrTZgg9Sub9+KIxMlc8if6iAEJsijAwlyHp6eMzzp7tdDyB29skISqiJOMZXj1lspF OAZvnH82FZSHpP/lkjINn0pVTZJdzOz2ONkBOvH0jJZ3Iwt/YtVNDyzBuFrLGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhf92G5czj02; Tue, 30 Sep 2025 15:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UFNT9j045408; Tue, 30 Sep 2025 15:23:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNTpf045405; Tue, 30 Sep 2025 15:23:29 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:29 GMT Message-Id: <202509301523.58UFNTpf045405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 65de7110a6a4 - stable/15 - release: Remove a duplicate package listing in oracle.conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 65de7110a6a40b8acb8092b7239d0b02c95a1f33 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=65de7110a6a40b8acb8092b7239d0b02c95a1f33 commit 65de7110a6a40b8acb8092b7239d0b02c95a1f33 Author: Mark Johnston AuthorDate: 2025-09-09 19:06:31 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +0000 release: Remove a duplicate package listing in oracle.conf sysutils/panicmail is specified again several lines down. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit cc6e21cb946337e2b4584dd2b55209d45805fec2) --- release/tools/oracle.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf index 8a4206c05623..72c8dd9ded78 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -17,7 +17,6 @@ export VM_EXTRA_PACKAGES=" net/py-netifaces net/py-oauth net/rsync - panicmail security/ca_root_nss security/sudo@default sysutils/firstboot-freebsd-update From nobody Tue Sep 30 15:23:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfB4VY9z69DX9; Tue, 30 Sep 2025 15:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfB3NtCz3LKC; Tue, 30 Sep 2025 15:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sRS/QL6N1bPXmqXXoLnDZB5Hhm42V5+14oksDGT/YLY=; b=aQvhpb4AR3rqtnLTVPkcahpC88zIN5ObHVbW5jzGY99Jlk7J4T+3PAUrMI5ykVZ0k9FCte W+JNFUO1wNo2n8bn1Q+p0F/g8UZdOX94N9cgAIJl2B0cvxlBXR5diEk+Vwo8xgBxifVt5X VUtKDyl8uJ18C8zM+qLB/yvtDZKlPRc/c/HhYLBzuRcFJ/rxjQdi09tMbWyopKYw4We3YR 3XqXwtRh25eKF1iBTecjon2Y4QKXwoA2KSs8kCm2deZ+D1ji1e9Ol/hmpMHhhwTf1L8YJS jk/W2TgbDzeXQPQz6kNlkUwlInMijdPPpqGDIH1tcC++Wh6lrtTSpYM5EwRyEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sRS/QL6N1bPXmqXXoLnDZB5Hhm42V5+14oksDGT/YLY=; b=F7bAS9urTnhjr/5FtJrEbUC2hVltXVAvw4tvViNGiEzgpVQQF1TH8aMvuHC7mjZjQp9My7 IiWqk+LFaKe2jLX9I8GzfYd6YaTpeUn2wraPTeu9zGwkxIQ3sqYt+6x1vaqd708VTQN4ML MiXVgEY1UFd/dEOG8IOGunVvefiRjvzAPdhx88yE3ADDaK2svn4yKIlPRAmPFrRtAGHlrT TvWambtnL2rrMjkDZiLDOK+2CABBNne2jYx+48RtoIi7MdqAK173CNJT5rZzHhRgm2+zt0 l4VkKXSxo6toC/jDwFKfetjWlvKKo6j5B1hCtHpcVc4WGXofZ+w6pEoO29M+Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245810; a=rsa-sha256; cv=none; b=MA6Eg4waG3zZmkis0e1zjUxFI48TflemV9AbdlG/QhRvNi7BhnXuTl6YGKlnpHYJVhsN6n Hhjnel4EAlZ764FeqArsMOiBYTP2YH++quG2deEgQDzZTkrtPhLS0vz2VNrDvA1oE25QSC WNfLPReAWqt0gsq4acBSG2Q5pokvNe671Ei2AAKRq+YjpCw0cFOfS24FR+X2AYFthOFrRk ktAuhrUQCXC9R5wJM49EOM7ltOkh4Fs1l/FyFMQVBqfwWcF03ulHfAxhONvdn2UHm00Xim /fdSbWd127mvKi10RpkGscNCiY3kU5zoOraEATnaJeNdqkPMHoBB4csgt0RR4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfB2tJSzjf5; Tue, 30 Sep 2025 15:23: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 58UFNUh2045441; Tue, 30 Sep 2025 15:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNU3d045438; Tue, 30 Sep 2025 15:23:30 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:30 GMT Message-Id: <202509301523.58UFNU3d045438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 87691082d860 - stable/15 - bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 87691082d86090ae3f7c7b2687468b535fb6367f Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=87691082d86090ae3f7c7b2687468b535fb6367f commit 87691082d86090ae3f7c7b2687468b535fb6367f Author: Mark Johnston AuthorDate: 2025-09-11 14:36:00 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +0000 bnxt: Fix the request length in bnxt_hwrm_func_backing_store_cfg() PR: 286720 Reviewed by: zlei MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50491 (cherry picked from commit 5ca390f03bc63bccc8952313d536fd4bcabf2cab) --- sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c index 7dd555cfaadb..9e7f4614d9f9 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c @@ -714,7 +714,7 @@ int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t enables) bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, pg_attr, pg_dir); } req.flags = cpu_to_le32(flags); - return hwrm_send_message(softc, &req, sizeof(req)); + return hwrm_send_message(softc, &req, req_len); } int bnxt_hwrm_func_resc_qcaps(struct bnxt_softc *softc, bool all) From nobody Tue Sep 30 15:23:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfC6lD9z69F04; Tue, 30 Sep 2025 15:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfC4zBTz3LTG; Tue, 30 Sep 2025 15:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnNznOW9jsuZMbFgIonOvNCB9fpjL3PGzEBzSim9+DU=; b=A7E2J/RxrJiYlX+brZRJreq1Ufpd2wG3UG3MwcLE+2zNlYjOHi8/Cz8SDV6vuxPV5J4DX1 LGXBoQxoS7HDRVFijt7/uRblxMlUcevrEuG57o1d1kMJGy5N+3BfJT/sranBMHRGmU2gNl 4W1elQnqdvnbJn03UICrhLPJWw6/AvdcLN5GoXQW7D4C/nk65jPpkPTe6FgPjdyx5kDCQx AIybkfXin1qrU3ExGuGOzEvRIqMZKw/qXf9/u+IqpwgnVViCmneCHKCL83loy9V2nyrNyF EdwBs6k2JJM3OnAF4bvsHgvLrkl86ATg/McRVSZ7lXlPsBOW6cKV65w9u74Mkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnNznOW9jsuZMbFgIonOvNCB9fpjL3PGzEBzSim9+DU=; b=L9Wa797aTbC8mdeMVqAVJTF55P3WfcJSntIL4VrRIf9K5fgSgH1eypsKBbb+hLwgaVHpzv ZKzZ3zhgNuiB+kqBSM7tgrFYp+imnpLGn2aB3hACLvRR0GZ7GS8n+lAgrorjmO8WGgn8hR nZz4i1PtnAemv5/uM+5yvOTyS9+FTKn8SPvBjhMqm1vZPMMzI42A6va+Hf5Z56SjlK6hP9 qcT6U7OSkn0DPPIq070GRtzxAOl5piv0CpoCWxFlpHh7QckXsi8lwaBnn+Coy1E+J12mEs SOTtZ+eM2fO2avoTPgS5UrPjq6Z/2TL4F7ETm73jX56WD6nW66em2n0fDhGidA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245811; a=rsa-sha256; cv=none; b=jXq2n2Y22zM6Bj+dIMvCH0zazuyczBwQQlTdowRLjxtVmNtrR4eZYxvTaf4hi834iSxAt+ jsstp3idC3j3m9DFDbjMWvNjNOhMJYpNvfKIuR/nHxb60NipVm9pSiHHgOd+On1BZOqDo+ 4vY0uVUG7wtzKzguvlTGqMsJWI/CxHyPZRCnVxgYMVb3ywo/At2VWmmko7/Hhh9htQXEl0 B7ZdC4xkOPhCx9b9A4RUqHgBGr8x+x/mhynh3R7Ok73rQHmICxTv/8lZxwcDBdJGs3KIZM /YTfNNOP09IvM5i0SdNdr/3yi5N0mT2vhyQelTKpVpsoDeJtP+CCS/tUxzGjrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfC4GyPzjf6; Tue, 30 Sep 2025 15:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UFNV4l045474; Tue, 30 Sep 2025 15:23:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNVAu045471; Tue, 30 Sep 2025 15:23:31 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:31 GMT Message-Id: <202509301523.58UFNVAu045471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: de79f47a408b - stable/15 - release: Enable installing packages as a non-root user List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: de79f47a408b29c9b594e250ce49656b49c597e5 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=de79f47a408b29c9b594e250ce49656b49c597e5 commit de79f47a408b29c9b594e250ce49656b49c597e5 Author: Mark Johnston AuthorDate: 2025-09-16 16:05:06 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +0000 release: Enable installing packages as a non-root user Provide variables, PKG_REPOS_DIR and PKG_REPO_NAME, to allow the user to configure the source package repository. Configure pkg to emit added files to a metalog which gets concatenated with the main metalog immediately before we build the root filesystem. Reviewed by: cperciva, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52453 (cherry picked from commit 5eb917426e0aab1e82c7b0e7239724d18bae206a) --- release/Makefile.vm | 6 ++++++ release/tools/vmimage.subr | 35 ++++++++++++++++++++++++++--------- share/man/man7/release.7 | 15 ++++++++++++++- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 8375650cd9aa..25c37ade1121 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -138,6 +138,9 @@ cw-${_CW:tl}-${_FS}-${_FMT}: ${QEMUTGT} EC2BASEIMG=${.OBJDIR}/${EC2-BASE${_FS:tu}${_FMT:tu}IMAGE} \ ${WITHOUT_QEMU:DWITHOUT_QEMU=true} \ ${NO_ROOT:DNO_ROOT=true} \ + PKG_CMD=${PKG_CMD:Upkg} \ + PKG_REPOS_DIR=${PKG_REPOS_DIR:U${.OBJDIR}/${.TARGET}/etc/pkg} \ + PKG_REPO_NAME=${PKG_REPO_NAME:UFreeBSD-ports} \ PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \ @@ -191,6 +194,9 @@ vm-image: ${QEMUTGT} QEMUSTATIC=${QEMUSTATIC} \ ${WITHOUT_QEMU:DWITHOUT_QEMU=true} \ ${NO_ROOT:DNO_ROOT=true} \ + PKG_CMD=${PKG_CMD:Upkg} \ + PKG_REPOS_DIR=${PKG_REPOS_DIR:U${.OBJDIR}/${.TARGET}-${FORMAT}-${FS}/etc/pkg} \ + PKG_REPO_NAME=${PKG_REPO_NAME:UFreeBSD-ports} \ PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr \ diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 156987e33457..33a87eb55f53 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -151,19 +151,32 @@ vm_extra_enable_services() { } vm_extra_install_packages() { - if [ -n "${WITHOUT_QEMU}" ]; then - return 0 - fi - if [ -z "${VM_EXTRA_PACKAGES}" ]; then return 0 fi - chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg bootstrap -y - for p in ${VM_EXTRA_PACKAGES}; do + if [ -n "${NO_ROOT}" ]; then + for pkg in ${VM_EXTRA_PACKAGES}; do + INSTALL_AS_USER=yes \ + ${PKG_CMD} \ + -o METALOG=${DESTDIR}/METALOG.pkg \ + -o REPOS_DIR=${PKG_REPOS_DIR} \ + -o PKG_DBDIR=${DESTDIR}/var/db/pkg \ + -r ${DESTDIR} \ + install -y -r ${PKG_REPO_NAME} $pkg + done + metalog_add_data ./var/db/pkg/local.sqlite + else + if [ -n "${WITHOUT_QEMU}" ]; then + return 0 + fi + chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg install -y ${p} - done + /usr/sbin/pkg bootstrap -y + for p in ${VM_EXTRA_PACKAGES}; do + chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg install -y ${p} + done + fi return 0 } @@ -207,6 +220,10 @@ vm_extra_pkg_rmcache() { buildfs() { local md tmppool + if [ -f ${DESTDIR}/METALOG.pkg ]; then + cat ${DESTDIR}/METALOG.pkg >> ${DESTDIR}/METALOG + fi + case "${VMFS}" in ufs) cd ${DESTDIR} && ${MAKEFS} ${MAKEFSARGS} -o label=rootfs -o version=2 -o softupdates=1 \ diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 36c14afe0bf1..05f80374926f 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 20, 2025 +.Dd September 11, 2025 .Dt RELEASE 7 .Os .Sh NAME @@ -286,6 +286,19 @@ is expected to exist by alternative means. Include base system packages for use with .Xr pkg 8 on the install media, instead of legacy tarball distribution sets. +.It Va PKG_CMD +A path to the +.Xr pkg 8 +executable to use when installing packages in release images as a non-root user. +.It Va PKG_REPOS_DIR +An optional path to a directory containing +.Xr pkg 8 +repository configuration files. +These configuration files will be used when installing packages in release +images as a non-root user. +.It Va PKG_REPO_NAME +The name of the repository configuration to use when installing packages in +release images as a non-root user. .El .Sh EMBEDDED BUILDS The following From nobody Tue Sep 30 15:23:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfF0kmYz69Dwy; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfD5xGdz3LCt; Tue, 30 Sep 2025 15:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lwFuAXnIMrfAdtI5TVBG5bq9/miTRPDQ85a2M+F0Ay4=; b=J4LPC+78M3n9BN5o7JhuQsQUTMXAnEyyQR0bXR282juLIfra2mgAHEC6cDMr8UcE8k/KRb uGnFvcuwmoDQJHv5OpKYv9e8OYyg8iOGunKoIYBL612+avIEFI6CtK6Lcl9FfEIgrbn0H4 TmlIRnbMu6eq2ns4ifJ+DWmc+9/0kYY8EymTbOQpYEcdkv/3uSmV+lQS9PiMa/Rki7t4+y pqZoLOkw+zWr6JjecVfl9XJ+KgnaqmrGX49AOl1bnJ6qiEf2tm01aWmrzbR+9qAZsmqSId bYnMN4KaMQnOxBuju2uBeKjBjp8/99wCFrbb/zLF5KW/cmo9q5r4D4suECg0KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lwFuAXnIMrfAdtI5TVBG5bq9/miTRPDQ85a2M+F0Ay4=; b=gf1CtLOXL61VJBbireunpqWgN+8KDckY3wbkbxzR+isWhEo8Mq0thEcUDE17h234gY6FpF ZlNm8XU3IBRYW7oyM4HvhCGZkRn9K6iaN+0twXQ6mxPY4jvfMDbuHgBZd3in7J2TqvHOgS hgCmJbIE3K+lKyy1xhP+B/N18aYnP7CAPtxc8uad62sVgO03shh0QR7hnZ1DcLSRqbS+VO fyYpurnz3hkV858zOVPWlmsCxCFA4KBgLzUJ3Uxl3hknqDautRylLx+lcn0bH2WEKmXLaM P+0TiZw6gSrcvZLgYdcUAt4u285VtWb7t8mLiTffRdv8+tyAK/FO8SfNn8ZQPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245812; a=rsa-sha256; cv=none; b=NehSiHnzARJyhG0ytMJW8mjBTCwGwFH9Tr3Ad/X0g7EFa28zkKNFLLmMQ7eXOY00zeth2f YKRABucYBYjuAPvIuiXY5zFizR/F6aTtnJqNF4nHkpNMqI8JtrV+UjNtzt7sB2RL35ZO17 wbH+3OQYvrMLFqHl7xnXtqPZQ7v+emRSSpZHS83jzp1A/LDI5sAuJLdJ3zZa0Wj9dVHwuk ht7aJrEcJ/Z4Z+Xaf/GRtBzq16BznT01HNujo6q3rfKLiGAfSoznaLsbfmsaHRA3Am0xCS jU1U9ihM7hosnLA+8/fx16EXw+cPpBQz2JSJpUfZgs6y2NVR1ciWd/akfg9ZJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfD55J7zhmd; Tue, 30 Sep 2025 15:23: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 58UFNWto045509; Tue, 30 Sep 2025 15:23:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNWre045506; Tue, 30 Sep 2025 15:23:32 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:32 GMT Message-Id: <202509301523.58UFNWre045506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 59a0361e5f79 - stable/15 - release: Make azure cloudware images buildable as non-root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 59a0361e5f791c2eb6ea882f9c218e5f49c63861 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=59a0361e5f791c2eb6ea882f9c218e5f49c63861 commit 59a0361e5f791c2eb6ea882f9c218e5f49c63861 Author: Mark Johnston AuthorDate: 2025-09-16 16:53:13 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +0000 release: Make azure cloudware images buildable as non-root - Don't chroot to uninstall pkg since we don't install pkg in the first place. - Use pw -R instead of chrooting. - Add metalog entries. Reviewed by: cperciva, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52451 (cherry picked from commit bab6b01bcfead662b8b10dc52a18beeb42794505) --- release/tools/azure.conf | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/release/tools/azure.conf b/release/tools/azure.conf index a633e6e508d4..dfb90f1cd4f6 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -19,20 +19,25 @@ export NOSWAP=YES export VM_BOOTPARTSOFFSET=1M vm_extra_pre_umount() { - mount -t devfs devfs ${DESTDIR}/dev + # Remove the pkg package and repo databases as they will likely + # be out of date by the time the image is used. In unprivileged + # builds this is unnecessary as pkg will not be installed to + # begin with. + if [ -z "${NO_ROOT}" ]; then + mount -t devfs devfs ${DESTDIR}/dev - # The firstboot_pkgs rc.d script will download the repository - # catalogue and install or update pkg when the instance first - # launches, so these files would just be replaced anyway; removing - # them from the image allows it to boot faster. - chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg delete -f -y pkg - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports-kmods + # The firstboot_pkgs rc.d script will download the repository + # catalogue and install or update pkg when the instance first + # launches, so these files would just be replaced anyway; removing + # them from the image allows it to boot faster. + chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg delete -f -y pkg + umount ${DESTDIR}/dev + rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports + rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports-kmods + fi - chroot ${DESTDIR} ${EMULATOR} pw usermod root -h - - - umount ${DESTDIR}/dev + pw -R ${DESTDIR} usermod root -h - cat << EOF >> ${DESTDIR}/etc/rc.conf ifconfig_hn0="SYNCDHCP" @@ -51,6 +56,7 @@ boot_serial="YES" mlx4en_load="YES" mlx5en_load="YES" EOF + metalog_add_data ./boot/loader.conf touch ${DESTDIR}/firstboot From nobody Tue Sep 30 15:23:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfG3tsnz69Dcm; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfF6n6Dz3LVb; Tue, 30 Sep 2025 15:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zPxVgMwyv81TxkBYYCxRfzxV3siEdnPsl4390DtspeM=; b=BT23Qt+OQuceVecuQ9utKqALG4EO/lDUnw7UiJIWXPZUqVXGrrEdFpfJMKJRe9uBY57/pf n9Cd/rZnLVTnuCxNFx35/HN+lnlGsaGdYcD3p0Rm6dxmNsn2cOpWSabOghOKOCMu0rM5bP kAocggKRL2C1QV+9aaQlCxtc+BY3QWfMmZOXIuMjIFHbZc5u4Sy1mcWYeh1hm2bTHjfN0s MjnjQv0BKsNshu+mOtqKbD8lvDPBcB6rIbs6YfdS3TDuvCZHqagw/Bq/MjSkPNy/c8RMcm 0gFUNV9RZMfB5LUXSQ79+6CmWN0FtumLultjMRrIhOhI+MExYbG8BiGGDFGRUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zPxVgMwyv81TxkBYYCxRfzxV3siEdnPsl4390DtspeM=; b=urJPtBvO8R8pS9QRcqDieeii6BtIyD7Ge1E5lSlEaz1LISTUIwUP8d0omOUGa8A4O1qKiE O5R/rPbs71K3DNfTXEtht/Z4ikV/uw7ltlgmvBbBZSK/j60jjYGypmd0lZhOSRM9LNHZIC h+W9dw1xymECApVXSQJWx6jHhCYW4mqmlp4KdCrgVKw10Sm2oCqSEOyVs+KLrQ6SPL/Zkp jpGreNslGmtAfZLoTunnrxlvk3dmKPDS3cDy3Anevttc6hAJmbGzB+oRnk7yAp0uCbg5eD WfqPcuYzO7rtpHoUxhf636BuIs0QwkyVhXroLqP1L2DuRwurLffwq6dP3RuY5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245814; a=rsa-sha256; cv=none; b=OUR8YOSvp1h8o0HNdJLhVhdQJucCPhk2NuPJiSrooD6L6zLirdCI2eivAOjNl3PJCK6Pxr 23bKO1ppj4br+3kPmoxjf5Tc7nwA3jMR7ScmkpcizIXGxi0BG/29GRiDeh4GtaRRUxudWa gXARVxafNP4VaLiKakPC4q/7G5wqNG1kCSIhsU2MKpsTKnuWBeX/F0Fep+mfPqJx0vDKfh +AycRYOUYa4BYQWEGHW+w92hmoWF51en6MHv9JbXbW+8mtHwzHtT0DESuJNgzofkhjfc8l bDnF5eor1aZBKmzMFsjwwtWV7kHK2Tt7Yww6DcEM+uWDr6moClGmRP1b4F6Mog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfF5xtBzjVK; Tue, 30 Sep 2025 15:23: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 58UFNXb8045554; Tue, 30 Sep 2025 15:23:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNXr2045551; Tue, 30 Sep 2025 15:23:33 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:33 GMT Message-Id: <202509301523.58UFNXr2045551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 43a765bdedda - stable/15 - release: Prepare EC2 cloudware images to be buildable as non-root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 43a765bdeddaf53bfc3bf624aa52625251edcc4f Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=43a765bdeddaf53bfc3bf624aa52625251edcc4f commit 43a765bdeddaf53bfc3bf624aa52625251edcc4f Author: Mark Johnston AuthorDate: 2025-09-16 16:53:35 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +0000 release: Prepare EC2 cloudware images to be buildable as non-root - Avoid chrooting to uninstall pkg, as it will not be installed in the first place when in non-root mode. - Add metalog entries. Reviewed by: cperciva MFC after: 3 days Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52452 (cherry picked from commit 8027de008d9f3c5cd5509d586f14846abd0f3db2) --- release/tools/ec2-base.conf | 1 + release/tools/ec2-builder.conf | 5 +++++ release/tools/ec2-cloud-init.conf | 1 + release/tools/ec2-small.conf | 1 + release/tools/ec2.conf | 31 ++++++++++++++++++++----------- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/release/tools/ec2-base.conf b/release/tools/ec2-base.conf index 3ed20474a4e8..b6354db3d9d1 100644 --- a/release/tools/ec2-base.conf +++ b/release/tools/ec2-base.conf @@ -28,6 +28,7 @@ vm_extra_pre_umount() { # be "new" disks; there is no "previous boot" when they might have # been seen and used already. touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen + metalog_add_data ./var/db/ec2_ephemeral_diskseen # Configuration common to all EC2 AMIs ec2_common diff --git a/release/tools/ec2-builder.conf b/release/tools/ec2-builder.conf index 7927fc13a74d..993dffc565eb 100644 --- a/release/tools/ec2-builder.conf +++ b/release/tools/ec2-builder.conf @@ -28,6 +28,7 @@ vm_extra_pre_umount() { # be "new" disks; there is no "previous boot" when they might have # been seen and used already. touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen + metalog_add_data ./var/db/ec2_ephemeral_diskseen # Configuration common to all EC2 AMIs ec2_common @@ -37,21 +38,25 @@ vm_extra_pre_umount() { # Grab a copy of the ec2-base disk image, and compress it zstd < ${EC2BASEIMG} > ${DESTDIR}/image.zst + metalog_add_data ./image.zst # Disable fortune so we don't have extra noise at login chmod a-x ${DESTDIR}/usr/bin/fortune # Install the AMI-building script install -m 755 ${WORLDDIR}/release/tools/mkami.sh ${DESTDIR}/bin/mkami + metalog_add_data ./bin/mkami 0755 # Install an /etc/rc which juggles disks around for us install -m 755 ${WORLDDIR}/release/tools/rc.amibuilder ${DESTDIR}/etc + metalog_add_data ./etc/rc.amibuilder 0755 # We want to mount from the UFS disk and juggle disks first cat >> ${DESTDIR}/boot/loader.conf <<-EOF vfs.root.mountfrom="ufs:/dev/gpt/rootfs" init_script="/etc/rc.amibuilder" EOF + metalog_add_data ./boot/loader.conf return 0 } diff --git a/release/tools/ec2-cloud-init.conf b/release/tools/ec2-cloud-init.conf index 048202e252f6..2a15ae5c57d8 100644 --- a/release/tools/ec2-cloud-init.conf +++ b/release/tools/ec2-cloud-init.conf @@ -27,6 +27,7 @@ vm_extra_pre_umount() { doas: - permit nopass ec2-user EOF + metalog_add_data ./usr/local/etc/cloud/cloud.cfg.d/98_ec2.cfg return 0 } diff --git a/release/tools/ec2-small.conf b/release/tools/ec2-small.conf index 858836717f5a..e2a348d6ba8f 100644 --- a/release/tools/ec2-small.conf +++ b/release/tools/ec2-small.conf @@ -33,6 +33,7 @@ vm_extra_pre_umount() { # be "new" disks; there is no "previous boot" when they might have # been seen and used already. touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen + metalog_add_data ./var/db/ec2_ephemeral_diskseen # Configuration common to all EC2 AMIs ec2_common diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 31f40962b19d..aecaabfcd277 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -22,17 +22,27 @@ export NOSWAP=YES ec2_common() { # Delete the pkg package and the repo database; they will likely be - # long out of date before the EC2 instance is launched. - mount -t devfs devfs ${DESTDIR}/dev - chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ - /usr/sbin/pkg delete -f -y pkg - umount ${DESTDIR}/dev - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports - rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports-kmods + # long out of date before the EC2 instance is launched. In + # unprivileged builds this is unnecessary as pkg will not be + # installed to begin with. + if [ -z "${NO_ROOT}" ]; then + mount -t devfs devfs ${DESTDIR}/dev + chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ + /usr/sbin/pkg delete -f -y pkg + umount ${DESTDIR}/dev + rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports + rm -r ${DESTDIR}/var/db/pkg/repos/FreeBSD-ports-kmods + fi # Turn off IPv6 Duplicate Address Detection; the EC2 networking # configuration makes it unnecessary. echo 'net.inet6.ip6.dad_count=0' >> ${DESTDIR}/etc/sysctl.conf + metalog_add_data ./etc/sysctl.conf + + # Tell gptboot not to wait 3 seconds for a keypress which will + # never arrive. + printf -- "-n\n" > ${DESTDIR}/boot.config + metalog_add_data ./boot.config # Booting quickly is more important than giving users a chance to # access the boot loader via the serial port. @@ -43,10 +53,6 @@ ec2_common() { # default 2048 bytes of entropy; ask for 64 bytes instead. echo 'entropy_efi_seed_size="64"' >> ${DESTDIR}/boot/loader.conf - # Tell gptboot not to wait 3 seconds for a keypress which will - # never arrive. - printf -- "-n\n" > ${DESTDIR}/boot.config - # The emulated keyboard attached to EC2 instances is inaccessible to # users, and there is no mouse attached at all; disable to keyboard # and the keyboard controller (to which the mouse would attach, if @@ -93,6 +99,7 @@ ec2_common() { # by pressing the "Attention button" a second time, but in the EC2 # environment this delay serves no purpose. echo 'hw.pci.pcie_hp_detach_timeout="0"' >> ${DESTDIR}/boot/loader.conf + metalog_add_data ./boot/loader.conf # Disable KbdInteractiveAuthentication according to EC2 requirements. sed -i '' -e \ @@ -127,6 +134,7 @@ REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availabilit echo "-nfsv4,minorversion=1,oneopenown ${FS}.efs.${REGION}.amazonaws.com:/" EOF chmod 755 ${DESTDIR}/etc/autofs/special_efs + metalog_add_data ./etc/autofs/special_efs 0755 # The first time the AMI boots, run "first boot" scripts. touch ${DESTDIR}/firstboot @@ -157,6 +165,7 @@ ec2_base_networking () { /usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1 EOF chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M + metalog_add_data ./usr/local/libexec/rtsold-M 0755 return 0 } From nobody Tue Sep 30 15:23:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfH3Zblz69DZg; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfG73f6z3LBV; Tue, 30 Sep 2025 15:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Jj+V4hyNvNFOxUu5Q7t8DPln1965xqxK91kC+YLJRk=; b=BCub9XFMvfmOuySYAQrg+hNEXe1lXOvJR7ZVs3Qivyw6ml+gq72IXQwU8LzPH2wzH+Ity5 UB0w3qY1F2UR37JHmhtktBdcq7aKHXZYbiWAw8UmWXs5Pz2ewK3Z1wtxDQ1+VYxzvKR8qM Cgvj4/gNERr7nsnRl0iTe21kzIAtJvKTkisyW1rcP0moCTKSjcPNEUvxK0DuKDZXfjmbMC zCVRxnR0Lsbiw0aeRAVmx40vHR/TfZtW86ZIV8n2whWiXgrzMt1G6DvLn4ZDsYPTUjYUhD laPp3wFjlXYWXuC87q5XAPjXsp8ijQLTJBAdkOXBsPlcQqC1xwTkwc9TmFEeqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Jj+V4hyNvNFOxUu5Q7t8DPln1965xqxK91kC+YLJRk=; b=vo9rYutx5wF1nuAc80OXC73VbmWSZ8VBSzFtUyfTRFJ+y2EIdGm+DOxBzvlinYYMqKHhg5 gT7U+jfLG4A1F0gvU3MBzfed9Aij4IltG+nRRbpyIxPxA3Ak9u2VRQG53Htcb/aQ4QWSZp vj5l7taPah+0CpbsL5QDm6OwugvZRBwMAbWAa6TAkxfwLcDq/0HyCd80m52G5IpQkJJzzo n/rEYmUuOuS4sg4S+7IRDorrDuefrBgiqsc+dP/hcUgnnypWavq5LQACg3g8Pstr4JfaiR lhe7uWaZO3Pw/W2hldzbiP+ZhR4K5WUmj0/Lh+Wpd73/JachJbZ6Fng4lZKsiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245815; a=rsa-sha256; cv=none; b=yMD4pT+RAtqCJ4msSUy+pkotrTSRvyJkSmMNi6IVQPgCHuqtQY2TZe9uZLLzpOGizz/16w AQ7sQgLWtDUCTCSM8zlxwleigNEfJfQT6vR3wI3SyUKJqFbo5WqSWRd+rg4JC9TK1p04h7 q7JZuS5e8eZ+OvEbPw36/JoH+KhQWeyORahEGMxSbqDxuFWSjsmw+ZwEU9iPwrHr9K4QxS cQ1XyDUN78haJW/QVlIcvyS+rHSqfTJbXsOhajRZoDyX5jDh/ddL5AZOeZ94uNMnRtUR9o VA9iofu9OvjY6lFXjOelt8PKlzbYuuQHUszw6YLkMez0c08LXlqHJ+N/UT7GaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfG6ZK5zj03; Tue, 30 Sep 2025 15:23: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 58UFNYiI045588; Tue, 30 Sep 2025 15:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNYg4045585; Tue, 30 Sep 2025 15:23:34 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:34 GMT Message-Id: <202509301523.58UFNYg4045585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: afe49951b819 - stable/15 - release: Prepare oracle cloudware images for non-root builds List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: afe49951b819df76bd6bdddcb373271f6ec4f19c Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=afe49951b819df76bd6bdddcb373271f6ec4f19c commit afe49951b819df76bd6bdddcb373271f6ec4f19c Author: Mark Johnston AuthorDate: 2025-09-16 16:53:56 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:07 +0000 release: Prepare oracle cloudware images for non-root builds - Add metalog entries. - Remove a stray entry in the package list. Reviewed by: cperciva, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52454 (cherry picked from commit 8f5791873a30122f72266cc44309933118d7fe36) --- release/tools/oracle.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf index 72c8dd9ded78..debc5c1352dd 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -55,6 +55,7 @@ EOF xz_load="YES" zfs_load="YES" EOF + metalog_add_data ./boot/loader.conf cat <<-'EOF' >> ${DESTDIR}/etc/ssh/sshd_config # S11 Configure the SSH service to prevent password-based login @@ -82,10 +83,11 @@ EOF network: renderers: ['freebsd'] EOF + metalog_add_data ./usr/local/etc/cloud/cloud.cfg.d/98_oracle.cfg # Use Oracle Cloud Infrastructure NTP server sed -i '' -E -e 's/^pool.*iburst/server 169.254.169.254 iburst/' \ - ${DESTDIR}/etc/ntp.conf + ${DESTDIR}/etc/ntp.conf touch ${DESTDIR}/firstboot From nobody Tue Sep 30 15:23:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfJ1Ytvz69Dtf; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfJ0lxBz3LVs; Tue, 30 Sep 2025 15:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Rt9PGcEMUkBXYdyaBCqBHQ72+9eJY9dXJmOrfZSNyk=; b=XdU0OoXx6PqziW4Mc1Wq30G/c+pWnVZWQXjprF8nV+1E6kQLbi9WI8DDFSjYWrRMBdd3iM KyhihyWAORI2z0PgQdeaHY2eOQVU2jrasFvBW62fXhhCMXcDbdjd7OZH3L6YXDYPfKx97F vmGIksXrLFmLBHbq5oi+5XLJEeq4aYjryBi/eI3aanXcfIYWbLicQb6XPhZY//Gjs9klJ1 EyYo9DGHoooeC+WlCRxmmunJfeB3vlzPZ71clv8RGKdJvJCGyRk5/jDOakAnuHYMXb0b4i I4Kk84vrJ82IXbNgMQTerDFOM3V1mpHRAIzJT0e4EndI9gtafMlh+b0OVYFJTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Rt9PGcEMUkBXYdyaBCqBHQ72+9eJY9dXJmOrfZSNyk=; b=g0XHW557YgvUvn6bai273A72D9UI/PQtlgDqDWhZefoZCGVA3u+DyOQY8Jsrv8SsCA+QC2 qIa4uJpOlwXpkCc8dd6nGd8FRFvibnoRMzAJeIC+I1/2pIQg2d3k9XKpS6jwBc9qsNYj6R emPlwOLrR2Zp/mZe08T7F90l2tZJSBq+1DNdbZu8ev5VybmnQkW0F8Ytv3JfUwhHqYSO+W hBleUKMFXPVr9andrNVYUdF48f9K5pOBg8Oreuzo9gJ5ARkayY0pTb8A26lL8DG4/JqUFC FZ6qPle0yeTCdgfoAL0mh4Y6AVKYtuCDL8OAmHsW8WM3WiSH2QCafoSnHE8VtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245816; a=rsa-sha256; cv=none; b=hWDA4sCqO0qIDt+GxFrFdC/5RYfAdvLNam4fHZ+ysdm1IeDo6JnqOagqCVRjC0D9tov54N hP4ydXOICuXOrTV27KoSh4Pr8YOQOpX063/rDL4ehVBRZdyApP/FNOviGdjlpU5twVjnTI DsBrunVdQt1HgIjJxxjEoyS2ejUNookzNhHVAz0hj9Cl9fxW8j+j3RmD0NE4RPs4B7fn8v TN6newW5E/ibrE4A+h0Yt9GUNhFjwp8OyY1kTGpsacQvx50+ik7f6YCqPFx+K7BPmXGxBD DKd0VCuz4sW3umryyKJTF3KG+ZljwlMaqDxgcbWWJWtQDvKSRblHiwLpBMnikA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfJ06QFzjf7; Tue, 30 Sep 2025 15:23: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 58UFNZCB045625; Tue, 30 Sep 2025 15:23:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNZNr045622; Tue, 30 Sep 2025 15:23:35 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:35 GMT Message-Id: <202509301523.58UFNZNr045622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1deb72ac2db6 - stable/15 - release: Prepare GCE cloudware images for building as non-root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1deb72ac2db60c983310edae33f1d33eaf3ac8e9 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1deb72ac2db60c983310edae33f1d33eaf3ac8e9 commit 1deb72ac2db60c983310edae33f1d33eaf3ac8e9 Author: Mark Johnston AuthorDate: 2025-09-16 16:54:11 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 release: Prepare GCE cloudware images for building as non-root - Avoid mounting devfs just to list packages and fetch distfiles. - Add metalog entries. Reviewed by: cperciva, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52455 (cherry picked from commit f1995d6fc13fa4a36f83cea3b90f27bce2aca4d9) --- release/tools/gce.conf | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/release/tools/gce.conf b/release/tools/gce.conf index 382a839786f3..e1c208e69fe5 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -21,6 +21,7 @@ vm_extra_install_base() { echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf echo 'nameserver 169.254.169.254' >> ${DESTDIR}/etc/resolv.conf echo 'nameserver 8.8.8.8' >> ${DESTDIR}/etc/resolv.conf + metalog_add ./etc/resolv.conf } vm_extra_pre_umount() { @@ -94,25 +95,18 @@ EOF # ports.txz distributions to the target virtual machine disk image # and fetch the sources for the third-party software installed on # the image. - if [ ! -c "${DESTDIR}/dev/null" ]; then - DEVFSISOURS=1 - mkdir -p ${DESTDIR}/dev - mount -t devfs devfs ${DESTDIR}/dev - fi if [ -e "${DESTDIR}/../ftp/src.txz" ]; then tar fxJ ${DESTDIR}/../ftp/src.txz -C ${DESTDIR} fi if [ -e "${DESTDIR}/../ftp/ports.txz" ]; then tar fxJ ${DESTDIR}/../ftp/ports.txz -C ${DESTDIR} - _INSTALLED_PACKAGES=$(chroot ${DESTDIR} pkg info -o -q -a) + _INSTALLED_PACKAGES=$(pkg -r ${DESTDIR} info -o -q -a) for PACKAGE in ${_INSTALLED_PACKAGES}; do - chroot ${DESTDIR} \ - make -C /usr/ports/${PACKAGE} fetch + make -C ${DESTDIR}/usr/ports/${PACKAGE} fetch \ + DISTDIR=${DESTDIR}/usr/ports/distfiles + done fi - if [ "$DEVFSISOURS" = "1" ]; then - umount_loop ${DESTDIR}/dev - fi ## XXX: Verify this is needed. I do not see this requirement ## in the docs, and it impairs the ability to boot-test a copy @@ -130,6 +124,5 @@ vm_emulation_cleanup() { if [ -n "${QEMUSTATIC}" ]; then rm -f ${DESTDIR}/${EMULATOR} fi - umount_loop ${DESTDIR}/dev return 0 } From nobody Tue Sep 30 15:23:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfK3Tgsz69Dx7; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfK1cztz3Lkq; Tue, 30 Sep 2025 15:23:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4QBgE7J6pFP6aeUon7Rhr3G3e6PG5fDCPLo3h2UKVr0=; b=oD4lO7aL4E+iDRgch0YDDNqQ7CfXBWuQQBtaBgp9XaEldx6ocVle2UwcUPq7K4WarIp9Uh w5y2091a/SKSaKFF1d0eG+XupIw+jVLHHb15/6lDUWscZpLb92BW7cDS16CsyxbaSRSud6 x11Gnh7hEIwX5Hruk41TolbZv5AcJYD+ZVflB19lZu38HkXv73s5KQvJ/kGqLDF67bPMM6 rDljJfm2Dre0e5nqqIl+9ENew3zQF0v7UoeS29NQJX7qPBGufEjIJQjil6qexciExW4+hz 4a/sGgnRMvD2Jrlr1utPbO6b1CUSRWg42oc375nEwxGvPIzn5QUyythN0Bzlrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4QBgE7J6pFP6aeUon7Rhr3G3e6PG5fDCPLo3h2UKVr0=; b=HTokrWzC98IJOTv4m229m82/zFSVTnTcgWCj7ONhKz1AoHkCGzDGyU0GEmPFv9azB8wClX 8Rg8RuqVCAx/LEXo1OKjDqkKbR52o2CL0b6GidTN0n7a7IiUaGbRVQKhJUk1FuG7TSAflC q7g+83VOkFjVfyXjwfxRU5NwDFSB4hjJjLvJw4J6t1Ds6VugEs4sQOZAU7+UIN2ra9IrgA kk/uGwbQkF6iSX3nLcXFJEPSo7kyLIzuXVloVtgMeHIKAzFYfocQyzVLczbrTRHIUNWtjA WHSvqmn/AykG3PM3ti4aU51Lthd/105S3eb6lLSBS21jtxUfYzYbPrMUsf25eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245817; a=rsa-sha256; cv=none; b=wzOoR4BXW0SoMY3ibQXM1OY8wB5p49c5i5iGNGC3v4HCsq3zYRTwslekrWl34ybqlY1WHz 14Ej0WiNZujPPSKbjY08O1PL9cj06obYDmtQXTVpujnX+ZTWUjtLSzs0qUG89XWbaZMED9 dMno9rm516MLqQKLDYyUMPv1wS0S7WXLEZOWo1xstzKGm8sXBoW5/xeCp4wmo5ycYXzCia kOWu+9DB/CK+OwBd0GBQcYrvvXy1YxqIygmHfj0mkxhsgdK1hQWRDiueCt89oU5jsWfgxU XzLj2p1DTod6htDZIU+ThSVSRnHPB91REF9fv8zh49/+tBkqF2Ovfn9ONuCbaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfK0mTbzjQN; Tue, 30 Sep 2025 15:23:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UFNb0Q045659; Tue, 30 Sep 2025 15:23:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNbDU045656; Tue, 30 Sep 2025 15:23:37 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:37 GMT Message-Id: <202509301523.58UFNbDU045656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 96cd2eb699f7 - stable/15 - release: Prepare Vagrant cloudware images for building as non-root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 96cd2eb699f70e729d81eb65baa5189b9134926d Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=96cd2eb699f70e729d81eb65baa5189b9134926d commit 96cd2eb699f70e729d81eb65baa5189b9134926d Author: Mark Johnston AuthorDate: 2025-09-16 16:54:25 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 release: Prepare Vagrant cloudware images for building as non-root Add metalog entries for various files. This is a bit incomplete as pw(8) doesn't yet have support for emitting metalog entries, which we need since it's used here to create an interactive user. Reviewed by: emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52456 (cherry picked from commit 135cb071e0683ea947c308a2de404d1185558ea6) --- release/tools/vagrant.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/release/tools/vagrant.conf b/release/tools/vagrant.conf index 506174d0ea16..7ab0e1238693 100644 --- a/release/tools/vagrant.conf +++ b/release/tools/vagrant.conf @@ -47,19 +47,22 @@ vagrant_common () { -c 'Vagrant User' -d '/home/vagrant' -s '/bin/csh' # Change root's password to vagrant - echo 'vagrant' | /usr/sbin/pw -R ${DESTDIR} \ - usermod root -h 0 + echo 'vagrant' | /usr/sbin/pw -R ${DESTDIR} usermod root -h 0 # Configure sudo to allow the vagrant user echo 'vagrant ALL=(ALL:ALL) NOPASSWD: ALL' >> ${DESTDIR}/usr/local/etc/sudoers # Configure the vagrant ssh keys mkdir ${DESTDIR}/home/vagrant/.ssh - chmod 700 ${DESTDIR}/home/vagrant/.ssh + echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > ${DESTDIR}/home/vagrant/.ssh/authorized_keys echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1YdxBpNlzxDqfJyw/QKow1F+wvG9hXGoqiysfJOn5Y vagrant insecure public key" >> ${DESTDIR}/home/vagrant/.ssh/authorized_keys - chown -R 1001 ${DESTDIR}/home/vagrant/.ssh chmod 600 ${DESTDIR}/home/vagrant/.ssh/authorized_keys + metalog_add_data ./home/vagrant/.ssh/authorized_keys 0600 + + chmod 700 ${DESTDIR}/home/vagrant/.ssh + chown -R 1001 ${DESTDIR}/home/vagrant/.ssh + echo "./home/vagrant/.ssh type=dir uid=1001 gid=1001 mode=0700" >> METALOG # Reboot quickly, Don't wait at the panic screen echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf @@ -68,6 +71,7 @@ vagrant_common () { # The console is not interactive, so we might as well boot quickly. echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf + metalog_add_data ./boot/loader.conf # The first time the VM boots, the installed "first boot" scripts # should be allowed to run: From nobody Tue Sep 30 15:23:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfL4S5dz69Djl; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfL2R3qz3Ll4; Tue, 30 Sep 2025 15:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QVNswpX8mZtgPIuzJX34N9LAuNPbb9oEziSMvyYxZZU=; b=R+mC2QvyUo3y+TtYw5YJQZ5fbpzPWMxzcZYQl3U0kQGyOL7xG8MKFrzgZHU75NogmtbAbX hewG2a7173D4vVXEuKBEmKAcQ35X3KlTS6HWGRKb4rS31rp7BkZJSsMTTqgQisKzEFxzHX lWby1sCkQvsF3hw5Og72NsNH2aPETgOg+aPGz17XrR9/inNodeqGnFjTc3/uQxHtS+EY5h GGAaC/XuMVI6HHnlSc983MqtczDrsgaYqyKsfFAgyIUudoG3yoGUIKIoaqbWH8i6ybKzvG bWDpdjtuDAStK1HX0rFXG3MHGP0X2VCD31yqHU+i9Ko2P+sYFBlhMzI5RrkRWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QVNswpX8mZtgPIuzJX34N9LAuNPbb9oEziSMvyYxZZU=; b=xQT/a7bDs0fNzteAPwaG6rpYvdK3karR6TnGW37RuzzHmxBYJgIXmK9+jhgvnJHVSmsnad yVGG0bFXRkEY9upSfjcSmQ1FOOp08o0fpisV60N7Fqgm7hOdXSbxZxOad2l99a2bJtzxGM GZ77s3JhPcyAauSrk0NjUMF8VQ97YVBYjGuFZEhcpl+YnMFJ3k7m15TVZjahMu6D6XwVX/ /VRZEqATX+ySZbm6h8/jF5TifRvO6RNErNxdf/mDpa+DGC/SIzE0jJN0tieSQ/sQ+pGrqo G67MsAA3FpJ3smHRNI9Eztq/9D192kBpIQaENwWS1M2KCI20e7JHjoVkgqDEuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245818; a=rsa-sha256; cv=none; b=s+VCW+jOrk4/9ToPOHy/A5PMXRdp/jpfQ/0a0Pz1SUEgz+LFlvo5GgkN42iS/hRkYdR357 5aFAuyGuXYbLz21ZkBKOnQ4TMIM7lHsgfwjTD0Om7fi6eydqquKTsczsgdGm4OHr0dludc ybwI+vGMRDyb6vU598xW4DEYoFiT9OEhr+MauulbNXEFrrjoYWhAUXI+53h5z5app2GPap Nf2fcAppMGeweVLQUKSoWVBf8cxiFWAPay5VQ82ue4Ww6/Gu6ci4TEBnOqu2WArQH04KwT mI59eZ+je9XzbtIVUmlrEeZqU4fMpf3Y/wcu7EndvCOYpC2BQq5hs1mzIGVJmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfL1zTPzj04; Tue, 30 Sep 2025 15:23: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 58UFNcjx045697; Tue, 30 Sep 2025 15:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNcFc045694; Tue, 30 Sep 2025 15:23:38 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:38 GMT Message-Id: <202509301523.58UFNcFc045694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e338aab61374 - stable/15 - share/mk: Fix a heuristic in bsd.cpu.mk List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e338aab61374958acb67838d35b95d792f7c79e3 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e338aab61374958acb67838d35b95d792f7c79e3 commit e338aab61374958acb67838d35b95d792f7c79e3 Author: Mark Johnston AuthorDate: 2025-09-07 16:07:32 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 share/mk: Fix a heuristic in bsd.cpu.mk When cross-building from MacOS we have MACHINE=arm64 MACHINE_ARCH=arm, so bsd.cpu.mk infers that sizeof(long) == 4, but of course it isn't. This breaks the bootstrap build of openssl, which tests MACHINE_ABI:Mlong64 to decide whether to build ecp_nistp224.c. It doesn't, and crypto/openssl/freebsd/include/openssl/configuration.h undefines OPENSSL_NO_EC_NISTP_64_GCC_128, so we end up with a link error. Reviewed by: ngie, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D52340 (cherry picked from commit 4341f92251ae00c3f82904623bfd561bb8ea49fb) --- share/mk/bsd.cpu.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index f6599a0ad802..1225d690e908 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -391,8 +391,11 @@ MACHINE_ABI+= soft-float .else MACHINE_ABI+= hard-float .endif -# Currently all 64-bit architectures include 64 in their name (see arch(7)). -.if ${MACHINE_ARCH:M*64*} +# Currently all 64-bit FreeBSD architectures include 64 in their name +# (see arch(7)). We need a special case for cross-building from macOS +# (which uses arm64/arm). +.if ${MACHINE_ARCH:M*64*} || \ + (defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Darwin" && ${MACHINE} == "arm64") MACHINE_ABI+= long64 .else MACHINE_ABI+= long32 From nobody Tue Sep 30 15:23:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfM56ccz69Dgp; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfM3NnGz3LWY; Tue, 30 Sep 2025 15:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Puw+AoBpVzazISPmzsQJtnPbPsa6CRE1849sPsIDNxI=; b=hH4kmhiGFGi02C6Vwj0HkXcz25tzwMRhJ5MCEQP/1NHlqFL7YBv1/JYccohCVH9Mj9IOjs G3vjoSAQnav/nIrnY1nRRBd5XRZWRYJ84cijA8fI5xXBIYFDRvajyyS7+NQlN50So+uU89 RzKVJHGMqq13xy/vpQrfHAyRf2pcq7w6fWDTal629GAn1hHtd9ZsUo3VcGxGK+DUzQ2iJ+ fOtHRQQ/aiU3JB9d1U5BBlD5xdMVz1kRZjMopBcaF1Qshd/AVNGdMHG5r8kTuyrqgpRvgg /eTTwlf46zb1j+q17bZNXEhgRWuGh8P7rWkw/ZSdjbswQfv/suctpYyZxlhNqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Puw+AoBpVzazISPmzsQJtnPbPsa6CRE1849sPsIDNxI=; b=YviEecp3MJ9ZORat1RT/Ly0A9pW9QcVyuFVfpyoi9qPCsAydCIsIE5pApmAglcxKo2M3fV vrwvsuRJJWs0Fg98LWtLWRWlKnxWDGn83abgN4XWsQofN9suUnIJ+PMdBHikC7LWwYfmzz HYB3rpXcEJOiQOp9SkPJ2UdKCSqwoNB0nlXLUdzJb2b9xSe6i3eoztsCTyfOHt/qJlilg9 Ejd3IL83pLhVvQKF5XoE9std32OVgkas12sGTPPgkd47Dt6Nx/7n1yB3zRtRbRXFHjVKjA 2ZQZYmJSs9x+fHRc5tphnLa/eqfmfBhEt3XknaehTzj42ojcFMZyEFhL+vnDEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245819; a=rsa-sha256; cv=none; b=Feo/bWFw0tQgoFnRdAG7o9zi3fIZT1Ml7WeX8OBVrr2mdSc2qBFzb7F7w0Mt6ic2fe9j5E JhR4foxpHcHE0wUxTpbd86ym4b1pBOVhfjbKx1FEypEocYano2sSSn6Q8seIV0QoDLJpnV E+gAPziKheN/v7mAN6+lDSgKGELfx2NhwNcp4NP5hPc29C+Cvn9CEUl06cz68gyikWYOIp 4Y7/71Nqp0eX9GF1yXePR3NOYwsiiDzZYx9APt7UgY/kJVTxRKNIUM2Q6MnNFtBhuHYQ/R 1NlqqB3XhoxG71NWVxRvQjZTcWHoOn9vl3CqOPpNeBJn7Fnz7HoSF2c/kW3sLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfM2wX2zjQP; Tue, 30 Sep 2025 15:23: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 58UFNdCh045735; Tue, 30 Sep 2025 15:23:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNdDq045732; Tue, 30 Sep 2025 15:23:39 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:39 GMT Message-Id: <202509301523.58UFNdDq045732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 597b606207cf - stable/15 - random: fxrng: Add an entry for RANDOM_RANDOMDEV to the source table List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 597b606207cf48243b430a0bcff8c6ba6f8d2c7d Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=597b606207cf48243b430a0bcff8c6ba6f8d2c7d commit 597b606207cf48243b430a0bcff8c6ba6f8d2c7d Author: Mark Johnston AuthorDate: 2025-09-19 22:58:22 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 random: fxrng: Add an entry for RANDOM_RANDOMDEV to the source table Otherwise we get a NULL pointer dereference when writing to /dev/random. PR: 288826 Reviewed by: cem MFC after: 1 week Fixes: fa8db724ae6e ("random: Treat writes to /dev/random as separate from /entropy") Differential Revision: https://reviews.freebsd.org/D52633 (cherry picked from commit 174d5d9397c492aff67f7ad49e130039697dc1dd) --- sys/dev/random/fenestrasX/fx_pool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/random/fenestrasX/fx_pool.c b/sys/dev/random/fenestrasX/fx_pool.c index d2e6f0db71ee..f4ad1e295d54 100644 --- a/sys/dev/random/fenestrasX/fx_pool.c +++ b/sys/dev/random/fenestrasX/fx_pool.c @@ -164,6 +164,9 @@ static const struct fxrng_ent_char { [RANDOM_CALLOUT] = { .entc_cls = &fxrng_lo_push, }, + [RANDOM_RANDOMDEV] = { + .entc_cls = &fxrng_lo_push, + }, [RANDOM_PURE_OCTEON] = { .entc_cls = &fxrng_hi_push, /* Could be made pull. */ }, From nobody Tue Sep 30 15:23:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfN6ztxz69Dtk; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfN4sjwz3LjP; Tue, 30 Sep 2025 15:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=//AWU9yl9f/cKDhnohwYeK8/JnvhgUWlHXTzTf5b1dM=; b=OjISFCxCJD4bu91SGT2On0NKHscJCOsgk0cGJiuvdaHoRGBRalF5NP6j39iQGGBQ+eZFRV HQxfTS5d9Grdy+2To8P7nCCx3ZraLPINvLmw7HfFUDhsmQlm/hi8Gox4JnreRwC1D6BcrX +pcYcqboa45T9mxx/Q5NNIz5SC5hCzo6S3lChIePtXyq53C9efrITDNScjKEcOmQV5dLZY cr2gBdRz9U6ayOWVAFolem5neIZtYEKkPENOXdy8KLe1k9e3SQ8xzp2wUTAftuLYZOtUQM dt882uWyJxiGawZ/+Coj6xu0mqMoMz5i0/Pt9neLmZxtrGrhldTh96XczP1R/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=//AWU9yl9f/cKDhnohwYeK8/JnvhgUWlHXTzTf5b1dM=; b=e0ERCVmTl3fNQTBuHEzsr06Lpg3KT6deJGYgvlDvu2DNt0STdxb5v6EkQblBvzx6uAHVSY zDDOmE5GnOvFdfbf+Yxi5B+pN3Vjs2XPRgmV4S88yUR5naP9f2Lh9f4l2LkkJR/nn66GS8 +y9BZqJC/QOMxH9OV3bDUEn51qnwbnT4vN6hKNsSfQBzhwaXx4mPgrCIgJmh/+qmjxqBmo x62ff1pIxHKf93P8CscuVZpGLL2C80Po1M1zPHboMt3kD6InlCa8I/ZeH9sahnKuaHgeIA 909CaIajwat1bKoKNrwJNYESzvvZhkaGnCfzj9AxFd0f2aJ7rXsBImyUxo1Z0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245820; a=rsa-sha256; cv=none; b=trwoQ92sKy0dYyTkULArC/KXR3ovWT7guCMAQmmdCOVCVDeYHqLxTxkDjwxtcJPKZdDolK e4lKF2AUzKFWmaXGQ4gLsW+uCTz6rLH8rDtHc3uue8mkCXUClVJpaEJl3KG2Ze8UEgqCjE iuUIFW2ODSj838VbxqcYWlteiTFeU25vxtI4OAkb3FBLWZ+rtqzAH6+17gRqVnzDzfwr6r a6E02h+a4DpYc3DNUp010X8U5IEkxq5RlUE3rwvi2YTqvq2hwR66lCR3qj2d3+rP9PDQDw NkSemPDRbJCYPt1QE3+OPgt2PvQhYMnAA0N5u4VtEHDCZiDtdJz4gdL2vUu/VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfN41MvzjQR; Tue, 30 Sep 2025 15:23: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 58UFNe6j045771; Tue, 30 Sep 2025 15:23:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNeUG045768; Tue, 30 Sep 2025 15:23:40 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:40 GMT Message-Id: <202509301523.58UFNeUG045768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ae2c350540fb - stable/15 - jail: Optionally allow audit session state to be configured in a jail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ae2c350540fb6846901eaee27b10c2e69eae8390 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ae2c350540fb6846901eaee27b10c2e69eae8390 commit ae2c350540fb6846901eaee27b10c2e69eae8390 Author: Mark Johnston AuthorDate: 2025-09-15 17:23:50 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 jail: Optionally allow audit session state to be configured in a jail Currently it is impossible for a privileged, jailed process to set audit session state. This can result in suprising audit event misattribution. For example, suppose a user ssh'es into a jail and restarts a service; normally, sshd sets audit state such that events generated by the SSH session are attributed to the newly authenticated user, but in a jail, the corresponding setaudit(2) call fails, so events are attributed to the user who had started sshd in the jail (typically the user who had started the jail itself by some means). While this behaviour is reasonable, administrators might want to trust the jailed sshd to reset audit state, such that the authenticated user appears in audit logs. Add a jail knob to enable this. Add a simple regression test. This is a reapplication of commit 246d7e9fc23928 following a revert. The audit system calls must preserve the old behaviour of returning ENOSYS if the system call is disallowed within a jail, as some applications depend on that behaviour. Reviewed by: kevans, jamie (previous version) MFC after: 1 week Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51719 Differential Revision: https://reviews.freebsd.org/D52572 (cherry picked from commit 4be491e1b9b3b650494208eb61511f4a45c7db3f) --- sys/kern/kern_jail.c | 13 +++++++++- sys/security/audit/audit_syscalls.c | 47 +++++++++++++++++++++------------- sys/sys/jail.h | 3 ++- usr.sbin/jail/jail.8 | 19 +++++++++++--- usr.sbin/jail/tests/jail_basic_test.sh | 20 +++++++++++++++ 5 files changed, 78 insertions(+), 24 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index a75ba89d2a7e..3697d95fe0e5 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -243,6 +243,9 @@ static struct bool_flags pr_flag_allow[NBBY * NBPW] = { {"allow.unprivileged_parent_tampering", "allow.nounprivileged_parent_tampering", PR_ALLOW_UNPRIV_PARENT_TAMPER}, +#ifdef AUDIT + {"allow.setaudit", "allow.nosetaudit", PR_ALLOW_SETAUDIT}, +#endif }; static unsigned pr_allow_all = PR_ALLOW_ALL_STATIC; const size_t pr_flag_allow_size = sizeof(pr_flag_allow); @@ -4289,7 +4292,6 @@ prison_priv_check(struct ucred *cred, int priv) */ case PRIV_KTRACE: -#if 0 /* * Allow jailed processes to configure audit identity and * submit audit records (login, etc). In the future we may @@ -4298,6 +4300,11 @@ prison_priv_check(struct ucred *cred, int priv) */ case PRIV_AUDIT_GETAUDIT: case PRIV_AUDIT_SETAUDIT: + if (cred->cr_prison->pr_allow & PR_ALLOW_SETAUDIT) + return (0); + else + return (EPERM); +#if 0 case PRIV_AUDIT_SUBMIT: #endif @@ -5034,6 +5041,10 @@ SYSCTL_JAIL_PARAM(_allow, settime, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may set system time"); SYSCTL_JAIL_PARAM(_allow, routing, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may modify routing table"); +#ifdef AUDIT +SYSCTL_JAIL_PARAM(_allow, setaudit, CTLTYPE_INT | CTLFLAG_RW, + "B", "Jail may set and get audit session state"); +#endif SYSCTL_JAIL_PARAM_SUBNODE(allow, mount, "Jail mount/unmount permission flags"); SYSCTL_JAIL_PARAM(_allow_mount, , CTLTYPE_INT | CTLFLAG_RW, diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c index 40b2fb3d1c9f..f50c627b7515 100644 --- a/sys/security/audit/audit_syscalls.c +++ b/sys/security/audit/audit_syscalls.c @@ -54,6 +54,29 @@ #ifdef AUDIT +static int +audit_priv_check_cred(struct ucred *cred, int priv) +{ + int error; + + error = priv_check_cred(cred, priv); + if (error == EPERM && jailed(cred)) { + /* + * The audit system calls historically returned ENOSYS when + * invoked from within a jail, and some userspace applications + * handle that case specially. Thus, convert the error here. + */ + error = ENOSYS; + } + return (error); +} + +static int +audit_priv_check(struct thread *td, int priv) +{ + return (audit_priv_check_cred(td->td_ucred, priv)); +} + /* * System call to allow a user space application to submit a BSM audit record * to the kernel for inclusion in the audit log. This function does little @@ -592,9 +615,7 @@ sys_getauid(struct thread *td, struct getauid_args *uap) { int error; - if (jailed(td->td_ucred)) - return (ENOSYS); - error = priv_check(td, PRIV_AUDIT_GETAUDIT); + error = audit_priv_check(td, PRIV_AUDIT_GETAUDIT); if (error) return (error); return (copyout(&td->td_ucred->cr_audit.ai_auid, uap->auid, @@ -609,8 +630,6 @@ sys_setauid(struct thread *td, struct setauid_args *uap) au_id_t id; int error; - if (jailed(td->td_ucred)) - return (ENOSYS); error = copyin(uap->auid, &id, sizeof(id)); if (error) return (error); @@ -624,7 +643,7 @@ sys_setauid(struct thread *td, struct setauid_args *uap) if (error) goto fail; #endif - error = priv_check_cred(oldcred, PRIV_AUDIT_SETAUDIT); + error = audit_priv_check_cred(oldcred, PRIV_AUDIT_SETAUDIT); if (error) goto fail; newcred->cr_audit.ai_auid = id; @@ -650,9 +669,7 @@ sys_getaudit(struct thread *td, struct getaudit_args *uap) int error; cred = td->td_ucred; - if (jailed(cred)) - return (ENOSYS); - error = priv_check(td, PRIV_AUDIT_GETAUDIT); + error = audit_priv_check(td, PRIV_AUDIT_GETAUDIT); if (error) return (error); if (cred->cr_audit.ai_termid.at_type == AU_IPv6) @@ -674,8 +691,6 @@ sys_setaudit(struct thread *td, struct setaudit_args *uap) struct auditinfo ai; int error; - if (jailed(td->td_ucred)) - return (ENOSYS); error = copyin(uap->auditinfo, &ai, sizeof(ai)); if (error) return (error); @@ -689,7 +704,7 @@ sys_setaudit(struct thread *td, struct setaudit_args *uap) if (error) goto fail; #endif - error = priv_check_cred(oldcred, PRIV_AUDIT_SETAUDIT); + error = audit_priv_check_cred(oldcred, PRIV_AUDIT_SETAUDIT); if (error) goto fail; bzero(&newcred->cr_audit, sizeof(newcred->cr_audit)); @@ -715,11 +730,9 @@ sys_getaudit_addr(struct thread *td, struct getaudit_addr_args *uap) { int error; - if (jailed(td->td_ucred)) - return (ENOSYS); if (uap->length < sizeof(*uap->auditinfo_addr)) return (EOVERFLOW); - error = priv_check(td, PRIV_AUDIT_GETAUDIT); + error = audit_priv_check(td, PRIV_AUDIT_GETAUDIT); if (error) return (error); return (copyout(&td->td_ucred->cr_audit, uap->auditinfo_addr, @@ -734,8 +747,6 @@ sys_setaudit_addr(struct thread *td, struct setaudit_addr_args *uap) struct auditinfo_addr aia; int error; - if (jailed(td->td_ucred)) - return (ENOSYS); error = copyin(uap->auditinfo_addr, &aia, sizeof(aia)); if (error) return (error); @@ -752,7 +763,7 @@ sys_setaudit_addr(struct thread *td, struct setaudit_addr_args *uap) if (error) goto fail; #endif - error = priv_check_cred(oldcred, PRIV_AUDIT_SETAUDIT); + error = audit_priv_check_cred(oldcred, PRIV_AUDIT_SETAUDIT); if (error) goto fail; newcred->cr_audit = aia; diff --git a/sys/sys/jail.h b/sys/sys/jail.h index e12e8c3178c9..e6a13e6719dd 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -271,6 +271,7 @@ struct prison_racct { #define PR_ALLOW_SETTIME 0x00100000 #define PR_ALLOW_ROUTING 0x00200000 #define PR_ALLOW_UNPRIV_PARENT_TAMPER 0x00400000 +#define PR_ALLOW_SETAUDIT 0x00800000 /* * PR_ALLOW_PRISON0 are the allow flags that we apply by default to prison0, @@ -278,7 +279,7 @@ struct prison_racct { * build time. PR_ALLOW_ALL_STATIC should contain any bit above that we expect * to be used on the system, while PR_ALLOW_PRISON0 will be some subset of that. */ -#define PR_ALLOW_ALL_STATIC 0x007f87ff +#define PR_ALLOW_ALL_STATIC 0x00ff87ff #define PR_ALLOW_PRISON0 \ (PR_ALLOW_ALL_STATIC & ~(PR_ALLOW_UNPRIV_PARENT_TAMPER)) diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 421aa9babb4c..d44b7f66a64e 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 7, 2025 +.Dd September 15, 2025 .Dt JAIL 8 .Os .Sh NAME @@ -702,15 +702,15 @@ The super-user will be disabled automatically if its parent system has it disabled. The super-user is enabled by default. .It Va allow.extattr -Allow privileged process in the jail to manipulate filesystem extended +Allow privileged processes in the jail to manipulate filesystem extended attributes in the system namespace. .It Va allow.adjtime -Allow privileged process in the jail to slowly adjusting global operating system +Allow privileged processes in the jail to slowly adjusting global operating system time. For example through utilities like .Xr ntpd 8 . .It Va allow.settime -Allow privileged process in the jail to set global operating system data +Allow privileged processes in the jail to set global operating system data and time. For example through utilities like .Xr date 1 . @@ -719,6 +719,17 @@ This permission includes also .It Va allow.routing Allow privileged process in the non-VNET jail to modify the system routing table. +.It Va allow.setaudit +Allow privileged processes in the jail to set +.Xr audit 4 +session state using +.Xr setaudit 2 +and related system calls. +This is useful, for example, for allowing a jailed +.Xr sshd 8 +to set the audit user ID for an authenticated session. +However, it gives jailed processes the ability to modify or disable audit +session state, so should be configured with care. .El .El .Pp diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index 6802da7b049a..c781eed78756 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -306,6 +306,25 @@ param_consistency_cleanup() fi } +atf_test_case "setaudit" +setaudit_head() +{ + atf_set descr 'Test that setaudit works in a jail when configured with allow.setaudit' + atf_set require.user root + atf_set require.progs setaudit +} + +setaudit_body() +{ + # Try to modify the audit mask within a jail without + # allow.setaudit configured. + atf_check -s not-exit:0 -o empty -e not-empty jail -c name=setaudit_jail \ + command=setaudit -m fr ls / + # The command should succeed if allow.setaudit is configured. + atf_check -s exit:0 -o ignore -e empty jail -c name=setaudit_jail \ + allow.setaudit command=setaudit -m fr ls / +} + atf_init_test_cases() { atf_add_test_case "basic" @@ -314,4 +333,5 @@ atf_init_test_cases() atf_add_test_case "commands" atf_add_test_case "jid_name_set" atf_add_test_case "param_consistency" + atf_add_test_case "setaudit" } From nobody Tue Sep 30 15:23:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfQ121Hz69DZm; Tue, 30 Sep 2025 15:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfP5d4Kz3LvC; Tue, 30 Sep 2025 15:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=laRXo7iVRIEn//1It9IktesUFCCulJ6GER0lkNWkjNQ=; b=HjPvv5BZeYeEN3OPpUUd5YdT/tcWiFu5usuUgbijrE8Ge8uMSf7JoQuku7gf1z5MVAPewT 4wQFsJ17mZGW6RcUvDTSGH0wqKhaYtMBJd6/AU1ANI5ElfhPbd/YOFDPTR6D+M18JuXwQA R8pWsyNp2eig0V26LVRlLGCNhfkAEL/9I7qNGLDyfOF1l0bwg+xlK2bj0lVqVq8IJKYjs4 bxhlrNXcJ3ILMXZH+yjfcwlZPUUquetL95yGRnu7BZYGSVu0mWsnovkhApb6JBPya/d3WX 3gBI8TWHHqZKCvqyOGRcQ7J/cZJCSrTp/lxRWFwj+Ym4KRFHOx4Hv23qIDsLRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=laRXo7iVRIEn//1It9IktesUFCCulJ6GER0lkNWkjNQ=; b=wxNkr4yZv18z72wbwinDK1nj2q0cHTae5+bAtFMtzcB5qR1pqYPOvsZdPUu7ankwabqLCb TSmcfvLD8EWFMi5qa+oYcMUHcAHRrFH3Lc8J7MrRE/E3kNchtKeE4yaa1CuoAcptRxoJtZ 1iWl1s7+Ea3TUciR0dXoyf2KKMaOjcOlhqfErLFMGBHVxZsJE+zGHkAOQKri8tpzvv4waP T7w2C5+ewwn0RmXQvHF+LkhVxCOL8pUASsilKKUGjKA1e3NQ/LlIFcT1Cdmz/i11NWnaHb qDgzy1jJ86s1chudx+8KgXDA1a4f7rfY+9zgW6yH2tjAnb7s/1m6OXIFrVJmkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245821; a=rsa-sha256; cv=none; b=TNfMRtE+BtuhHQ4PpF/jP7P+vY6asy5hJwmKWy4hli2hvEovyjCum4yoaQAkKy0vRnVGsT EZ6tFUN4OcwEoWPqqA6oXOoawxmBb/IdqhFt99y6xlvPbtXKWPFfie4F6ank7oTQaX6I3p bh9yT5tmEBMjHYu5vv0wbFPa2SXDl0LimV1IFxXoTna0aDyaevm9jgswalzSi3WHhrKnjt wqVM7ymUKLQF/sW//tQLKIQV19JM3ZgfogBazjHaxSGaveRUOd/SKMVsUUaUvB6MoO1u2O RBdshxH5e1demnkxcIG1G/s9kIjyCXU7F6oEcM2yh6dr6DS4wqfOcxyXmZp66g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfP4hjQzjQS; Tue, 30 Sep 2025 15:23: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 58UFNfHH045805; Tue, 30 Sep 2025 15:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNf3d045802; Tue, 30 Sep 2025 15:23:41 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:41 GMT Message-Id: <202509301523.58UFNf3d045802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 56965bbf7fd8 - stable/15 - random: Make the min-entropy estimate configurable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 56965bbf7fd879810888d1c808ebcab49eabb95c Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=56965bbf7fd879810888d1c808ebcab49eabb95c commit 56965bbf7fd879810888d1c808ebcab49eabb95c Author: Mark Johnston AuthorDate: 2025-09-08 14:40:42 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 random: Make the min-entropy estimate configurable Right now the cutoff values for the RCT and APT tests are computed with a fixed min-entropy estimate of 1. In preparation for permitting alternative estimates for "pure" sources (i.e., hardware noise sources), extend the code to handle alternative estimates of an integer number of bits. For the RCT test, the cutoff is simply the formula from section 4.4.1 of NIST SP 800-90B. For the APT test, I used Excel to compute a lookup table using the formula provided in section 4.4.2. Reviewed by: cem MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52228 (cherry picked from commit 228302e630dd95586fc22b29b025b8a98b593740) --- sys/dev/random/random_harvestq.c | 52 ++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 84ec174bd08e..20727471f9c7 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -464,7 +464,7 @@ SYSCTL_BOOL(_kern_random, OID_AUTO, nist_healthtest_enabled, "Enable NIST SP 800-90B health tests for noise sources"); static void -random_healthtest_init(enum random_entropy_source source) +random_healthtest_init(enum random_entropy_source source, int min_entropy) { struct health_test_softc *ht; @@ -485,20 +485,52 @@ random_healthtest_init(enum random_entropy_source source) } /* - * Set cutoff values for the two tests, assuming that each sample has - * min-entropy of 1 bit and allowing for an error rate of 1 in 2^{34}. - * With a sample rate of RANDOM_KTHREAD_HZ, we expect to see an false - * positive once in ~54.5 years. + * Set cutoff values for the two tests, given a min-entropy estimate for + * the source and allowing for an error rate of 1 in 2^{34}. With a + * min-entropy estimate of 1 bit and a sample rate of RANDOM_KTHREAD_HZ, + * we expect to see an false positive once in ~54.5 years. * * The RCT limit comes from the formula in section 4.4.1. * - * The APT cutoff is calculated using the formula in section 4.4.2 + * The APT cutoffs are calculated using the formula in section 4.4.2 * footnote 10 with the number of Bernoulli trials changed from W to * W-1, since the test as written counts the number of samples equal to - * the first sample in the window, and thus tests W-1 samples. + * the first sample in the window, and thus tests W-1 samples. We + * provide cutoffs for estimates up to sizeof(uint32_t)*HARVESTSIZE*8 + * bits. */ - ht->ht_rct_limit = 35; - ht->ht_apt_cutoff = 330; + const int apt_cutoffs[] = { + [1] = 329, + [2] = 195, + [3] = 118, + [4] = 73, + [5] = 48, + [6] = 33, + [7] = 23, + [8] = 17, + [9] = 13, + [10] = 11, + [11] = 9, + [12] = 8, + [13] = 7, + [14] = 6, + [15] = 5, + [16] = 5, + [17 ... 19] = 4, + [20 ... 25] = 3, + [26 ... 42] = 2, + [43 ... 64] = 1, + }; + const int error_rate = 34; + + if (min_entropy == 0) + min_entropy = 1; + else if (min_entropy < 0 || min_entropy >= nitems(apt_cutoffs)) { + panic("invalid min_entropy %d for %s", min_entropy, + random_source_descr[source]); + } + ht->ht_rct_limit = 1 + howmany(error_rate, min_entropy); + ht->ht_apt_cutoff = apt_cutoffs[min_entropy]; } static int @@ -653,7 +685,7 @@ random_harvestq_init(void *unused __unused) harvest_context.hc_active_buf = 0; for (int i = 0; i < ENTROPYSOURCE; i++) - random_healthtest_init(i); + random_healthtest_init(i, 0); } SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_init, NULL); From nobody Tue Sep 30 15:23:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfS3LTBz69DZp; Tue, 30 Sep 2025 15:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfR6xC7z3M05; Tue, 30 Sep 2025 15:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O16+ZfQztYfoUKxINzRsNf3X5gyfyNBmXjfxXnw3RpY=; b=HOOzuNIBt8Eacrg/6OdQIfIDRxDkLXL6ywWaawEEcMb+l7sfBY6WpL8yjRkRG+++hdpoqT qvtxkRVu8lFrWacsl4LT/KqmoyLWR4+EMJD/Mxpn/3s9V2YkpLG5TvSJQA3rgqscKYsaqO 9xxMMA2DZ6jBIPyF/3rv6+R0YtGELO8yrZnQc70VaGPH+a/crTKAVPUzBq/MODFBGGRuPv UMgUSK2XaVAgqRFqL5Gms8awviP1LFs8v3qLoUe5QQByUJSErKpslyJfoIT1nd2nJPLOkq RYDb8dhrJiQ/F23n5reBVO68+2ulA5w7wwjAFuWvSdgBUC3ph1n3zZkyWUoZYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O16+ZfQztYfoUKxINzRsNf3X5gyfyNBmXjfxXnw3RpY=; b=CFZtip8vHXqsfPcRSOCSEzzqHZq9rMAY4zyWwICVTEizhmKeZYjqUafuoESnoqNadRKcfj /vJQpED1OdekpKBHg1WqRpK16r2xQ8wGRf3W5BDj2s2Aoqlorf8/w61EOA9CjFYqALBibZ gP7tgGl5JGG0OZymPIeZkLeWK+T+fDHn41wu/62OXAWnyI+daADNgM6utNpEeQBhNALGnh Ly66Ra1Hjo0RioqdaSEsDZSxP/HKsigxKiZJ/jSld085SOBmpBBsajm++iZdjvMk/ASYvp cBPX80b3D1VSYVGAVXKT08zHEpTwrfOObVyhPconVGLL+1n0URAtL58sjj5ddA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245824; a=rsa-sha256; cv=none; b=E/ZvYQ2bfk8Q0ofzGxR3OApzoeraIn2x6a4rQPsrhd04gpRC0hzb7xG++VO98BhlOyKEEH VD0hM4QOurzarUdiPjC6ngYK8exso0N1lvHeHiqgi5PbgWzbG/lJHbpN09K9SJ3tG+j7pu 813mqdeI5cqIH7ScuD3Rv+EZygh+31JJElVocbk9ujOFVLscIxFFBO7GTLUPkrQlLgyRax gC9i7vktH6MiDK7bNRS1fEOf+eP4Vcbh1wjnENXIHlfsqynrMhs3wNVbX73ELohKe6t4mb 0LPhgydwMXTTn8HkD9GpRq3xzyeQtIPtfXe6V3vBtpp/WvGkAnYmW+fdsdwDqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfR6TbHzj05; Tue, 30 Sep 2025 15:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UFNht8045871; Tue, 30 Sep 2025 15:23:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNhrQ045868; Tue, 30 Sep 2025 15:23:43 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:43 GMT Message-Id: <202509301523.58UFNhrQ045868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 730b6d166bfe - stable/15 - random: Fix synchronization of hc_source_mask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 730b6d166bfefd132970db4583a654cc1a8a6a47 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=730b6d166bfefd132970db4583a654cc1a8a6a47 commit 730b6d166bfefd132970db4583a654cc1a8a6a47 Author: Mark Johnston AuthorDate: 2025-09-08 14:42:14 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 random: Fix synchronization of hc_source_mask This variable provides a mask of all registered entropy sources and is updated when drivers attach and detach (or by sysctl). However, nothing was synchronizing accesses to it. Use the harvest lock to provide mutual exclusion for updates, and use atomic_load_int() to mark unlocked reads. Reviewed by: cem MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52230 (cherry picked from commit c942d9e83ef1122a670bb39736d55fe8f90af83e) --- sys/dev/random/random_harvestq.c | 44 +++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index eb3808d692bb..6d1f9daf649b 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -103,8 +103,10 @@ static const char *random_source_descr[ENTROPYSOURCE]; volatile int random_kthread_control; -/* Allow the sysadmin to select the broad category of - * entropy types to harvest. +/* + * Allow the sysadmin to select the broad category of entropy types to harvest. + * + * Updates are synchronized by the harvest mutex. */ __read_frequently u_int hc_source_mask; @@ -572,9 +574,9 @@ random_check_uint_harvestmask(SYSCTL_HANDLER_ARGS) _RANDOM_HARVEST_ETHER_OFF | _RANDOM_HARVEST_UMA_OFF; int error; - u_int value, orig_value; + u_int value; - orig_value = value = hc_source_mask; + value = atomic_load_int(&hc_source_mask); error = sysctl_handle_int(oidp, &value, 0, req); if (error != 0 || req->newptr == NULL) return (error); @@ -585,12 +587,14 @@ random_check_uint_harvestmask(SYSCTL_HANDLER_ARGS) /* * Disallow userspace modification of pure entropy sources. */ + RANDOM_HARVEST_LOCK(); hc_source_mask = (value & ~user_immutable_mask) | - (orig_value & user_immutable_mask); + (hc_source_mask & user_immutable_mask); + RANDOM_HARVEST_UNLOCK(); return (0); } SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, random_check_uint_harvestmask, "IU", "Entropy harvesting mask"); @@ -602,9 +606,16 @@ random_print_harvestmask(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error == 0) { + u_int mask; + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); - for (i = ENTROPYSOURCE - 1; i >= 0; i--) - sbuf_cat(&sbuf, (hc_source_mask & (1 << i)) ? "1" : "0"); + mask = atomic_load_int(&hc_source_mask); + for (i = ENTROPYSOURCE - 1; i >= 0; i--) { + bool present; + + present = (mask & (1u << i)) != 0; + sbuf_cat(&sbuf, present ? "1" : "0"); + } error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); } @@ -658,16 +669,21 @@ random_print_harvestmask_symbolic(SYSCTL_HANDLER_ARGS) first = true; error = sysctl_wire_old_buffer(req, 0); if (error == 0) { + u_int mask; + sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + mask = atomic_load_int(&hc_source_mask); for (i = ENTROPYSOURCE - 1; i >= 0; i--) { - if (i >= RANDOM_PURE_START && - (hc_source_mask & (1 << i)) == 0) + bool present; + + present = (mask & (1u << i)) != 0; + if (i >= RANDOM_PURE_START && !present) continue; if (!first) sbuf_cat(&sbuf, ","); - sbuf_cat(&sbuf, !(hc_source_mask & (1 << i)) ? "[" : ""); + sbuf_cat(&sbuf, !present ? "[" : ""); sbuf_cat(&sbuf, random_source_descr[i]); - sbuf_cat(&sbuf, !(hc_source_mask & (1 << i)) ? "]" : ""); + sbuf_cat(&sbuf, !present ? "]" : ""); first = false; } error = sbuf_finish(&sbuf); @@ -885,8 +901,8 @@ random_source_register(const struct random_source *rsource) printf("random: registering fast source %s\n", rsource->rs_ident); - hc_source_mask |= (1 << rsource->rs_source); RANDOM_HARVEST_LOCK(); + hc_source_mask |= (1 << rsource->rs_source); CK_LIST_INSERT_HEAD(&source_list, rrs, rrs_entries); RANDOM_HARVEST_UNLOCK(); } @@ -898,8 +914,8 @@ random_source_deregister(const struct random_source *rsource) KASSERT(rsource != NULL, ("invalid input to %s", __func__)); - hc_source_mask &= ~(1 << rsource->rs_source); RANDOM_HARVEST_LOCK(); + hc_source_mask &= ~(1 << rsource->rs_source); CK_LIST_FOREACH(rrs, &source_list, rrs_entries) if (rrs->rrs_source == rsource) { CK_LIST_REMOVE(rrs, rrs_entries); From nobody Tue Sep 30 15:23:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfR5L6hz69Dtp; Tue, 30 Sep 2025 15:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfQ61yFz3Lk6; Tue, 30 Sep 2025 15:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=970KlEh+vrmdfzN2TqooSckIbmVi1E/9CdZsOXFW0Ac=; b=MeJ42ZjePCVbfyzU/l0DGDsHv/G2hog01edYjkDWmOTjy8VueZT8m4i7ATIcSamONcVioW 6Livxtv+6m/MKXyKr1slYI8QWUuc7S/HiPW8lB94OD4MX/Jy8yAIWYf+8S/RvJUZZcrTW5 Jtxw1Rlec9cqw7f1NFgZyYEZqwYmwqhC4cyHX32CErnvRttJT/dmkvxkAUY7WSyl8m0ka5 jTgHA/UKZtIuiy60JkX89rpooRyZRNfkJ5jHKnG9Lv8gv+1w0lQiVVPcnBQAmMY+8HnJPw RqwYTL+/mwMq4vVUm4gnxElRAsGGgOXfBuwuGfpll2CXRLyEAufpUb7SC4echQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=970KlEh+vrmdfzN2TqooSckIbmVi1E/9CdZsOXFW0Ac=; b=RUQhvJa7GOPU0ND7TUHOfId+lqJON6MaNPY92McQyCBG/dYwzGTnJ+V414FizB680MdLwB AkDmfapGYOZOWUH+q4WuOw+DP4+XWB6mzb6paqGDnD0o67kpmTV2yA24XUqQi3clnuUcWg LX3AK/nlViXDla/WhDwhaiKAQPplcJWc9rUN6mr6KQ1FBv7OggqS2wZCkDwBbXWkDZhGIm Zh3WzZJVjMCMoLblCKjSfaQw9QvhUgj1YsxzqYOJMJ053tVlaTlsdfCeL5fdcQPUBvbDD1 +bSnj3KsJy6OtfYsv3iZZJ15SvwyMB/UHsvomIZgtSCq6W5BK1P1rmzYAL1M5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245822; a=rsa-sha256; cv=none; b=gcgK/l3zD5+sgakfTskTcVJYp0iOub3Rc1kETM4MKqfyBCcm4xrk46W1I+AKHlBgrhPEzM VbqhAhFKkzzn//b+Zjtrbw3rSKR52r9gwj9htAKk24LWOm2rOX3Zm4goaRoUOfqbCBv/+U hqGE8lAqJQmiKuFC20qbOHXQCU712j6yZiL5D5kDCQDXI9mKTLMO2ZEAIbUjKTyE86c842 8dBXH+cCHF5FL/nmwMBrXLVTG2mM6wOr8k9TxUTD9ip/J/FoMt81byjHtN61gMW44FKbvZ RxF0cxPMx/2Jx2vqmRTqFJ8TIPeXw4ULRRL6nHoBUa5zwwta8mA1GWG4MiIPhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfQ5Y8fzjf8; Tue, 30 Sep 2025 15:23:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UFNgXB045838; Tue, 30 Sep 2025 15:23:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNgsl045835; Tue, 30 Sep 2025 15:23:42 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:42 GMT Message-Id: <202509301523.58UFNgsl045835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 97792a587051 - stable/15 - random: Make the entropy source registration interface more uniform List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 97792a587051fd3cebf7ed30879c6e552ff5c13f Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97792a587051fd3cebf7ed30879c6e552ff5c13f commit 97792a587051fd3cebf7ed30879c6e552ff5c13f Author: Mark Johnston AuthorDate: 2025-09-08 14:41:47 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 random: Make the entropy source registration interface more uniform Most pure sources work under a "pull" model wherein a dedicated thread polls the source at regular intervals (every 100ms). A couple of sources, however, will instead call random_harvest_direct() to provide entropy samples. Such sources were not calling random_source_register() and thus weren't in the global random source list. Modify "push" sources to use random_source_register() like other sources do. Such sources omit an implementation of rs_read and are thus skipped by the above-mentioned thread. This makes it easier to allow pure sources to provide a min-entropy estimate in a uniform way. Reviewed by: cem MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52229 (cherry picked from commit 8635f86977638eed966ec59cd319521fffb4df70) --- sys/dev/random/random_harvestq.c | 29 ++++++++++------------------- sys/dev/random/randomdev.h | 2 ++ sys/dev/tpm/tpm20.c | 13 ++++++++++--- sys/dev/vmgenc/vmgenc_acpi.c | 8 +++++++- sys/sys/random.h | 3 --- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 20727471f9c7..eb3808d692bb 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -278,8 +278,15 @@ random_sources_feed(void) epoch_enter_preempt(rs_epoch, &et); CK_LIST_FOREACH(rrs, &source_list, rrs_entries) { for (i = 0; i < npools; i++) { + if (rrs->rrs_source->rs_read == NULL) { + /* Source pushes entropy asynchronously. */ + continue; + } n = rrs->rrs_source->rs_read(entropy, sizeof(entropy)); - KASSERT((n <= sizeof(entropy)), ("%s: rs_read returned too much data (%u > %zu)", __func__, n, sizeof(entropy))); + KASSERT((n <= sizeof(entropy)), + ("%s: rs_read returned too much data (%u > %zu)", + __func__, n, sizeof(entropy))); + /* * Sometimes the HW entropy source doesn't have anything * ready for us. This isn't necessarily untrustworthy. @@ -866,20 +873,6 @@ random_harvest_direct_(const void *entropy, u_int size, enum random_entropy_sour random_harvestq_fast_process_event(&event); } -void -random_harvest_register_source(enum random_entropy_source source) -{ - - hc_source_mask |= (1 << source); -} - -void -random_harvest_deregister_source(enum random_entropy_source source) -{ - - hc_source_mask &= ~(1 << source); -} - void random_source_register(const struct random_source *rsource) { @@ -890,10 +883,9 @@ random_source_register(const struct random_source *rsource) rrs = malloc(sizeof(*rrs), M_ENTROPY, M_WAITOK); rrs->rrs_source = rsource; - random_harvest_register_source(rsource->rs_source); - printf("random: registering fast source %s\n", rsource->rs_ident); + hc_source_mask |= (1 << rsource->rs_source); RANDOM_HARVEST_LOCK(); CK_LIST_INSERT_HEAD(&source_list, rrs, rrs_entries); RANDOM_HARVEST_UNLOCK(); @@ -906,8 +898,7 @@ random_source_deregister(const struct random_source *rsource) KASSERT(rsource != NULL, ("invalid input to %s", __func__)); - random_harvest_deregister_source(rsource->rs_source); - + hc_source_mask &= ~(1 << rsource->rs_source); RANDOM_HARVEST_LOCK(); CK_LIST_FOREACH(rrs, &source_list, rrs_entries) if (rrs->rrs_source == rsource) { diff --git a/sys/dev/random/randomdev.h b/sys/dev/random/randomdev.h index 6d742447ea8b..0fa92f8c9575 100644 --- a/sys/dev/random/randomdev.h +++ b/sys/dev/random/randomdev.h @@ -52,7 +52,9 @@ random_check_uint_##name(SYSCTL_HANDLER_ARGS) \ } #endif /* SYSCTL_DECL */ +#ifdef MALLOC_DECLARE MALLOC_DECLARE(M_ENTROPY); +#endif extern bool random_bypass_before_seeding; extern bool read_random_bypassed_before_seeding; diff --git a/sys/dev/tpm/tpm20.c b/sys/dev/tpm/tpm20.c index 876dd0bcc40d..067e7ccae8f9 100644 --- a/sys/dev/tpm/tpm20.c +++ b/sys/dev/tpm/tpm20.c @@ -25,8 +25,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include +#include #include "tpm20.h" @@ -184,6 +184,13 @@ tpm20_ioctl(struct cdev *dev, u_long cmd, caddr_t data, return (ENOTTY); } +#ifdef TPM_HARVEST +static const struct random_source random_tpm = { + .rs_ident = "TPM", + .rs_source = RANDOM_PURE_TPM, +}; +#endif + int tpm20_init(struct tpm_sc *sc) { @@ -206,7 +213,7 @@ tpm20_init(struct tpm_sc *sc) tpm20_release(sc); #ifdef TPM_HARVEST - random_harvest_register_source(RANDOM_PURE_TPM); + random_source_register(&random_tpm); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->harvest_task, 0, tpm20_harvest, sc); taskqueue_enqueue_timeout(taskqueue_thread, &sc->harvest_task, 0); @@ -223,7 +230,7 @@ tpm20_release(struct tpm_sc *sc) #ifdef TPM_HARVEST if (device_is_attached(sc->dev)) taskqueue_drain_timeout(taskqueue_thread, &sc->harvest_task); - random_harvest_deregister_source(RANDOM_PURE_TPM); + random_source_deregister(&random_tpm); #endif if (sc->buf != NULL) diff --git a/sys/dev/vmgenc/vmgenc_acpi.c b/sys/dev/vmgenc/vmgenc_acpi.c index 2ad8929dfd34..18519a8e4f22 100644 --- a/sys/dev/vmgenc/vmgenc_acpi.c +++ b/sys/dev/vmgenc/vmgenc_acpi.c @@ -56,6 +56,7 @@ #include #include +#include #include #include @@ -210,6 +211,11 @@ acpi_GetPackedUINT64(device_t dev, ACPI_HANDLE handle, char *path, } +static const struct random_source random_vmgenid = { + .rs_ident = "VM Generation ID", + .rs_source = RANDOM_PURE_VMGENID, +}; + static int vmgenc_attach(device_t dev) { @@ -234,7 +240,7 @@ vmgenc_attach(device_t dev) memcpy(sc->vmg_cache_guid, __DEVOLATILE(void *, sc->vmg_pguid), sizeof(sc->vmg_cache_guid)); - random_harvest_register_source(RANDOM_PURE_VMGENID); + random_source_register(&random_vmgenid); vmgenc_harvest_all(sc->vmg_cache_guid, sizeof(sc->vmg_cache_guid)); AcpiInstallNotifyHandler(h, ACPI_DEVICE_NOTIFY, vmgenc_notify, dev); diff --git a/sys/sys/random.h b/sys/sys/random.h index 5abf762cd200..2a68f0c99b6d 100644 --- a/sys/sys/random.h +++ b/sys/sys/random.h @@ -142,9 +142,6 @@ random_harvest_direct(const void *entropy, u_int size, enum random_entropy_sourc random_harvest_direct_(entropy, size, origin); } -void random_harvest_register_source(enum random_entropy_source); -void random_harvest_deregister_source(enum random_entropy_source); - #if defined(RANDOM_ENABLE_UMA) #define random_harvest_fast_uma(a, b, c) random_harvest_fast(a, b, c) #else /* !defined(RANDOM_ENABLE_UMA) */ From nobody Tue Sep 30 15:23:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfT2txvz69Djx; Tue, 30 Sep 2025 15:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfT0nk3z3M0Z; Tue, 30 Sep 2025 15:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IHi85eoZXGNhBb8tJfIDkhiQe21tBbTPzgyUGpBKA0w=; b=yAcUP4F1kI9Np5v4ne93YEGJrklEDd5d9Ff+aCMtqkXxw4voBW/PcwsNpdoCLsG8s1Nvcm hu04uyDtimIEr8TK3n9w0HK0pLnd54QgcudVFM7cjgF7htroPbLWgcMJfxA2IcnllbigMc 27GH47i04ZLBpF/zyInJjSq0y8XIvfuMsSwAw9/rMPii7oA25sdnIpxLW79ihiS+ZFwhER r2HhN5853pAhIm7Btwt3s0IH6KvO3TzoDtmBrAjqJhoVk0xtPv9mrGIVXpFN+rg/tIdil3 85GPgjHCRpB/nm34/LxFYAv7k4ELmC3dCXXRY9lHVbnEbAZ+bFgp8JiEyvvmZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IHi85eoZXGNhBb8tJfIDkhiQe21tBbTPzgyUGpBKA0w=; b=juQr4v26OmTqFK3k/P0vgJ3axXYyR8D7+feSU4FZAGnaBjZsRclBVn8J7JA8NIsGRwI2Ds uYLbLjVl9HEOPZUQOaYKrE1Vv+HUBs2q8ELqhW26LFAiCKZN0mn9G4fkWUQyRjcRDbyjWh Ko/3KNSGAhqWy9wij6vtAH3iWVr6aWO1hMIkLh17feG/Ec9XLjLk/575P9SyA8Kqk3Sw1a b+z37hBERe40GUP4w7TUPuEquvJbWt0bgBdacLpOvmfipA4F/gS2mHEiWKBBUMHchKyBZg x8NEgEkHN5orzJPg1IXHGaGdeZZ7AXlXGu7EvYL2P3Egc04SlF+2w7xpLBFEvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245825; a=rsa-sha256; cv=none; b=cHtCXsSAYer6qcBZoZrW91kDlIEXM6JQ0JeXMRlj1TvmPhkyoaW/OUkdQLyaonpRh0XjQW sqXU10kjJYCmlbvjAfnO31C3cNQF2BQHEhMoPIaSrQ/GBrHhUnVBATrJskP43gFMW9klOv FyVX4gYmPPepYBRDQyKdjXaZWryvRhoyYFRuNyKiCYAsDoouR5hBDuvRtMKZl/3NxQcv+0 5rXTpS1eeGE9HakCJDaQLysMfml4XWmRNnoN64yJVWvVBKKJ/RPP0o0RNlR4pqn9oml4Ek +rRASq5ceJImMMYGsZAEDdF/eTFftNuAGJ+une8qO/KgbqxEf3i4tQW14hvtTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfT0MV1zjQT; Tue, 30 Sep 2025 15:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UFNiR8045907; Tue, 30 Sep 2025 15:23:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNivw045903; Tue, 30 Sep 2025 15:23:44 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:44 GMT Message-Id: <202509301523.58UFNivw045903@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e5cb6859e285 - stable/15 - random.4: Document the kern.random.nist_healthtest_enabled tunable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e5cb6859e285e76cae855810f6470b6db2a64331 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e5cb6859e285e76cae855810f6470b6db2a64331 commit e5cb6859e285e76cae855810f6470b6db2a64331 Author: Mark Johnston AuthorDate: 2025-09-08 14:45:08 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 random.4: Document the kern.random.nist_healthtest_enabled tunable Reviewed by: cem, emaste MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52231 (cherry picked from commit 27e2afa4f27cda036bd81d72357cc6be98869783) --- share/man/man4/random.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/share/man/man4/random.4 b/share/man/man4/random.4 index 840bc0c3234b..04d46e4d32aa 100644 --- a/share/man/man4/random.4 +++ b/share/man/man4/random.4 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 19, 2019 +.Dd August 28, 2025 .Dt RANDOM 4 .Os .Sh NAME @@ -132,6 +132,17 @@ are listed in square brackets. See .Xr random_harvest 9 for more on the harvesting of entropy. +.Pp +The +.Va kern.random.nist_healthtest_enabled +tunable can be used to enable the entropy source health tests outlined +in section 4 of NIST Special Publication 800-90B. +When enabled, all entropy sources will be subject to the repetition +count and adaptive proportion tests described in that document. +If one of the tests fails, the source will be disabled, i.e., all +subsequent entropy samples from that source will be discarded. +The implementation performs startup testing, during which entropy +sources are discarded. .Sh FILES .Bl -tag -width ".Pa /dev/urandom" .It Pa /dev/random From nobody Tue Sep 30 15:23:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfV3zNLz69DXQ; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfV1v3Lz3LqB; Tue, 30 Sep 2025 15:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2OKHWMHrpZdE/2okfh7DLZUCg5bPS7AsV9V3V2w+OyM=; b=eI/dpmVJCJkxWznG0+oxPnkmwLe3G2hK/XurONCq7XNwA02bCfQi77DP8oiBJFaWIgvEza R8xDZREAkqkIU5JaGjUqBP1MKOABvfNBgeSW4xLuOdcak0BcvrwXWPWPyW806D1WvUPswQ ank89M/vFW06GVwSDkd/ubmHnI6cYdHerDVQ1Uz+c7kmxLCiMDQZDMOYnynie6cq7AgkW2 3XXQ+o3Igxti9yif0nZyNtuTggLpg+rkI53Wu/OMYY/PXT9H7FLDsYqEWrH+eOZXnl2gZr aIzuardSzh8QQbvk+HA6wlUGZu4EngUZFdbNTYkyzjE2zXuJuSDx3RPShlbhiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2OKHWMHrpZdE/2okfh7DLZUCg5bPS7AsV9V3V2w+OyM=; b=k+u/k5gsDrSo+GFFDENGxj0ofRfioC7erWL18Mq6LuOZoZ2H+D5pucutThNh6pw0JpEa9z WypMDx0P02arhQHmSsJvCPmLnc5XsACqxltSAN+8uhS5v9fZH39a+p3k0aVsLiVjfVAX/X X+wwxchG5Y+7Tz5ZHcfAYRrzjKVY7zOUVZEfB3UOQSwfrOPej0lzkLJ6wytEbtxXlNg35z Yr5kB3aKQMRTgbS23HHLSfnb5Hhp9g+YUdM3cZhT+lCGlMMg9TdZTYYGEcRgDxmBznbidm F4Juk03xrx8cveDzsiKez4KhxvHWtmgQFb8UJ9wLWbpIsnptOYQdDZ1e2duYQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245826; a=rsa-sha256; cv=none; b=D57LL2ftHy7uxpUpvVlrkb3K6hND/scXqRbloiMe3o7f+3/a6Fft6FW0DPbVti+G8IoL1J 21EwunaRVZdV8wVxO0cNeBoovqC6/0DFrJk0fr2vnjD/mCdagqdAuvypGtthAtu0G0j8K6 AxjFFKyx+ucUodwh2tsaFLgzkEQAyS9uje4RfYyQGS4s0qbeCFXvXYBcGzkDnCt0sGxuFX cbqzl0tCpAmcw/qKu+nstjY7GCTWphIoTmV2tWUIICcK0RhizH5vbxPwl/ttV+EzzC6WBP nxyfQRVsuXyh/2JavGgQZoXqirzuxpVkby14OQNz/yjgEra2e5QnlQ6xKDmj9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfV166Lzj06; Tue, 30 Sep 2025 15:23: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 58UFNk5K045944; Tue, 30 Sep 2025 15:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNkIW045941; Tue, 30 Sep 2025 15:23:46 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:46 GMT Message-Id: <202509301523.58UFNkIW045941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b466df5ae9f8 - stable/15 - random: Allow pure entropy sources to provide a min-entropy estimate List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b466df5ae9f81a5cf846cdbbff72e60c9bbd3827 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b466df5ae9f81a5cf846cdbbff72e60c9bbd3827 commit b466df5ae9f81a5cf846cdbbff72e60c9bbd3827 Author: Mark Johnston AuthorDate: 2025-09-08 14:45:23 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 random: Allow pure entropy sources to provide a min-entropy estimate The current implementation of the NIST health tests assumes a min-entropy estimate of one bit per sample, which is quite conservative. For so-called "pure" sources (e.g., virtio-random, TPM) it might be nice to support larger estimates so that the tests catch failed devices more quickly. Thus: - let each pure random source provide an estimate, so that downstreams or driver implementors can override defaults if they want to; - increase the default estimate for pure sources; - for pure sources initialize the state machine at source registration time. Reviewed by: cem MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52232 (cherry picked from commit f865264f6a5eba4025c0f6284a48f383717fd74e) --- sys/dev/random/random_harvestq.c | 21 +++++++++++++++++---- sys/dev/random/randomdev.h | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index 6d1f9daf649b..c308f6f80d59 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -478,6 +478,7 @@ random_healthtest_init(enum random_entropy_source source, int min_entropy) struct health_test_softc *ht; ht = &healthtest[source]; + memset(ht, 0, sizeof(*ht)); KASSERT(ht->ht_state == INIT, ("%s: health test state is %d for source %d", __func__, ht->ht_state, source)); @@ -532,12 +533,22 @@ random_healthtest_init(enum random_entropy_source source, int min_entropy) }; const int error_rate = 34; - if (min_entropy == 0) - min_entropy = 1; - else if (min_entropy < 0 || min_entropy >= nitems(apt_cutoffs)) { + if (min_entropy == 0) { + /* + * For environmental sources, the main source of entropy is the + * associated timecounter value. Since these sources can be + * influenced by unprivileged users, we conservatively use a + * min-entropy estimate of 1 bit per sample. For "pure" + * sources, we assume 8 bits per sample, as such sources provide + * a variable amount of data per read and in particular might + * only provide a single byte at a time. + */ + min_entropy = source >= RANDOM_PURE_START ? 8 : 1; + } else if (min_entropy < 0 || min_entropy >= nitems(apt_cutoffs)) { panic("invalid min_entropy %d for %s", min_entropy, random_source_descr[source]); } + ht->ht_rct_limit = 1 + howmany(error_rate, min_entropy); ht->ht_apt_cutoff = apt_cutoffs[min_entropy]; } @@ -707,7 +718,7 @@ random_harvestq_init(void *unused __unused) RANDOM_HARVEST_INIT_LOCK(); harvest_context.hc_active_buf = 0; - for (int i = 0; i < ENTROPYSOURCE; i++) + for (int i = RANDOM_START; i <= RANDOM_ENVIRONMENTAL_END; i++) random_healthtest_init(i, 0); } SYSINIT(random_device_h_init, SI_SUB_RANDOM, SI_ORDER_THIRD, random_harvestq_init, NULL); @@ -901,6 +912,8 @@ random_source_register(const struct random_source *rsource) printf("random: registering fast source %s\n", rsource->rs_ident); + random_healthtest_init(rsource->rs_source, rsource->rs_min_entropy); + RANDOM_HARVEST_LOCK(); hc_source_mask |= (1 << rsource->rs_source); CK_LIST_INSERT_HEAD(&source_list, rrs, rrs_entries); diff --git a/sys/dev/random/randomdev.h b/sys/dev/random/randomdev.h index 0fa92f8c9575..a6ca66c7d92e 100644 --- a/sys/dev/random/randomdev.h +++ b/sys/dev/random/randomdev.h @@ -103,6 +103,7 @@ struct random_source { const char *rs_ident; enum random_entropy_source rs_source; random_source_read_t *rs_read; + int rs_min_entropy; }; void random_source_register(const struct random_source *); From nobody Tue Sep 30 15:23:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfW5FMqz69F55; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfW2kGrz3M1L; Tue, 30 Sep 2025 15:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+5dEEkGwYSoVoQ1LlMb1YWnqBLFzu8R7RVTFBmC8JM=; b=XCZ+1u0XUW77dvqxi0udZGr5UgD8p1IydvWLVGwHkKHI3YsabR6IRFDgyKU0nnq39/6+6o nzHRoH2kohx/yV83PKk2XEYZ61F4A+WirAJswCghRGleF7EbpCLySKekrxCU7HOliTCHLH oZKNHhgh+EtRoSW6gqB7S8UQCXXpKkSCJ1ZvVhmC3DXtTHv9d84N2iRJjbx6b8IYm45v1H A+nQfFyb8ih49cEKZsu9TZqw0iYiyjRIYiwrOCldcuMD9mSjDjbT39yc2Ic1oFcRwsSXrU PA6XAJyZ8tslylpwut2gegg5aRZyp5Z5T1xMT7hWNQvZNt1uxsi5IGSA7KnUmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+5dEEkGwYSoVoQ1LlMb1YWnqBLFzu8R7RVTFBmC8JM=; b=ULd3vN8K3suawypQxLbHfqMiKKNN1mJXtfQd4mG7RcTCUSmHFtLokmlXljUX7+/KAmat79 5iVLB7raqVfM0zuHky7h+p6oJayMsrFFjQ9+F/gls9eyFSyuXIHGG7urwo2BmN9d7zq05X +cprSvCd+5WZlhAtZMrBfnqimKrjhKGgYrwQOc4k2mBgJzEZFNci+TS4E4mnfv57K0oVaj 9nYQ0HlJCC6QqtKlEYIB3wiX1foFDHRkL8fYJP14pEbdaAvmFaws5qwBQ4gJcIsOUoM2B2 hlxg5BDr+qhr+0/fbA6YRafuzbwGcFVIXhxhvmoT1olYt+1yyWV4X4wL1FDDhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245827; a=rsa-sha256; cv=none; b=FSSb64bfooBLAP33uLsxmC90Le3kW9/2EL4MElN9IG09MdjzRudUlf3R1jfzyXo2P8mhRQ 05aaqklT9T6GOMxSgcZSZTFWB7ejvTNJeBbIJFvXa2vzHw7sMgDrvLcix0W3aNhMM6x1TB WpZ32cJh24wqglp4lzyvF6OZFPOn3X5jKxTw6OC8df1fATb9kn2tnSIt3zVQE5ka7v857p AE2vGH2SXPBmDmA130HO55wMTFDPBuRCCrv8XEzWWmfLkrD9xGqpqLUTP/M+kbyVP4sTfY z8ADMS3SZkCdZrHU1tQrDW1RRpJooVcWRiCVRa1KpfJNHsvBMnEcO9T+YFowlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfW2HMPzjGL; Tue, 30 Sep 2025 15:23: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 58UFNl5E045977; Tue, 30 Sep 2025 15:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNlmM045974; Tue, 30 Sep 2025 15:23:47 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:47 GMT Message-Id: <202509301523.58UFNlmM045974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a33ab3001a1e - stable/15 - random: Exclude the timestamp from healthtest for pure sources List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a33ab3001a1e6df38e4c974ea87a641c110cfbe3 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a33ab3001a1e6df38e4c974ea87a641c110cfbe3 commit a33ab3001a1e6df38e4c974ea87a641c110cfbe3 Author: Mark Johnston AuthorDate: 2025-09-08 14:46:12 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 random: Exclude the timestamp from healthtest for pure sources So-called pure sources provide entropy at regular intervals, so the timestamp counter provides little entropy. Exclude it from health testing for such sources. Reviewed by: cem, emaste MFC after: 2 weeks Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52233 (cherry picked from commit 480928ae657d81e41f8c10837cd1cf0ca87b14ae) --- sys/dev/random/random_harvestq.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c index c308f6f80d59..2d7af254c52c 100644 --- a/sys/dev/random/random_harvestq.c +++ b/sys/dev/random/random_harvestq.c @@ -343,7 +343,17 @@ copy_event(uint32_t dst[static HARVESTSIZE + 1], { memset(dst, 0, sizeof(uint32_t) * (HARVESTSIZE + 1)); memcpy(dst, event->he_entropy, event->he_size); - dst[HARVESTSIZE] = event->he_somecounter; + if (event->he_source <= RANDOM_ENVIRONMENTAL_END) { + /* + * For pure entropy sources the timestamp counter is generally + * quite determinstic since samples are taken at regular + * intervals, so does not contribute much to the entropy. To + * make health tests more effective, exclude it from the sample, + * since it might otherwise defeat the health tests in a + * scenario where the source is stuck. + */ + dst[HARVESTSIZE] = event->he_somecounter; + } } static void From nobody Tue Sep 30 15:23:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfY1Sl2z69F2Y; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfX4kv2z3M7m; Tue, 30 Sep 2025 15:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V3DzNv71Z60wxuziZr0IGHN3Nkjkf0SsdcWJJFsf5VI=; b=rQLXFN/r9axC5oMWItU+gTDlKbloQJpW9RixdmRVBCqYhVAbJCDkfskOxBYRg23FBgnBw5 n58EOugCY8XndJsxd8k4APKvBIDopgakVW1CHkiYiapqWZUHcc/4H0ZA3qCWiXW5uJrOjx FIKHVVwlnN6mkMupRwGPQAVP84IfS39N2xx1OUzdCg+Yg/QNjYxNGplMeWPoMKhMRzJJ3u pAqKFXig5Uz/EOKxPQ5n6ygw6hbjgm/HPTMZjkpY5429ORS4MgPftSn7sKPESQSf+VxgIY nY8uFBWWI3ALefCrp+KWstEoek2HIyaOdbYEaZivtk+XuHpVWnqw01sAvMuZSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V3DzNv71Z60wxuziZr0IGHN3Nkjkf0SsdcWJJFsf5VI=; b=F9gL7tlGLpnv7+tM2ejEw1OK7w1KcaSPxEJsyDrEcXSnq7ogzX/9c8bPtm2kEQluxBNZI9 X3MmEfe+nF1f+iDbhZv7mBHCUrxgbdXuJ5he4V92g4j31Pii5S2nQcoFKbnSc0snX+VWoO xYf3RpJHGTrXmOgUoASP3kM4qFKphTKfERDCpW3q96C6ycbMYpbQX3SPyY5WvEVIUBW4rY qP+hiTxO9XrzvPA9ExN8beyd+VXQZZybbMgqnMqdIiz793u86lGWkfpuiNbWBF63Wf+G/J fRSbLvDuxtBjmeMmb1RLeSIq6IffXNj3qMIvgswy6dwL9XnyJDSqLuOWapnZdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245828; a=rsa-sha256; cv=none; b=E3nbx+WNFJNH4vhuwtqQmIZUsg4OwTHheh23AoCQ4aihcCbCg2YOwvrQU3+fmqAepX5gGO myltn8n1MYOswHeNDQhFaa1dnpkwuAG/vi24FcLs3Dl0PgWDTfGzmGmGplZM6VJngVPOoS bmvLpvkWG+a+NCq3GrLGIMWB6xrI8Ew/ym7dR5LgxTVV6hrsB4jAsbuxnB31pFs31I73PS qcM0xcVcTH2hVl1J6+uhyzNsD9yZZYVgaTVh8HGIk++mQCSEHIxjjLFhRU1hM2Ok1GvuFt SD4P/BZrOfdcY3rtHB/dwcU1Jh5+F8JcGbvK6a5XciXu+Zi7LnG/16wX+9ec+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfX3P8Kzj8y; Tue, 30 Sep 2025 15:23: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 58UFNm5t046010; Tue, 30 Sep 2025 15:23:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNmtQ046007; Tue, 30 Sep 2025 15:23:48 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:48 GMT Message-Id: <202509301523.58UFNmtQ046007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cffe51ff98c0 - stable/15 - libnv: Fix handling of nvlist_dump() and nvlist_send() for child nvlists List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cffe51ff98c0e7b6d7c344bef39bf07513066e70 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cffe51ff98c0e7b6d7c344bef39bf07513066e70 commit cffe51ff98c0e7b6d7c344bef39bf07513066e70 Author: Mark Johnston AuthorDate: 2025-09-10 14:33:35 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 libnv: Fix handling of nvlist_dump() and nvlist_send() for child nvlists Suppose an nvlist nvl belongs to a parent nvlist or nvlist array. In this case, nvl contains a pointer to its container. This trips up nvlist_send(nvl) and nvlist_dump(nvl), which intuitively should only operate on nvl and its nvpairs. In particular, both of these functions will traverse to nvl's parent and start sending/dumping the parent's nvpairs, which results in assertion failures or nonsensical output, respectively. Reviewed by: oshogbo MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D52360 (cherry picked from commit 0b68e3ce6e0e437fa480b25a0ef706ee08562257) --- sys/contrib/libnv/nvlist.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 41edc72322c3..73226ee51a78 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -478,7 +478,7 @@ nvlist_dump_error_check(const nvlist_t *nvl, int fd, int level) void nvlist_dump(const nvlist_t *nvl, int fd) { - const nvlist_t *tmpnvl; + const nvlist_t *tmpnvl, *top; nvpair_t *nvp, *tmpnvp; void *cookie; int level; @@ -487,6 +487,7 @@ nvlist_dump(const nvlist_t *nvl, int fd) if (nvlist_dump_error_check(nvl, fd, level)) return; + top = nvl; nvp = nvlist_first_nvpair(nvl); while (nvp != NULL) { dprintf(fd, "%*s%s (%s):", level * 4, "", nvpair_name(nvp), @@ -645,6 +646,8 @@ nvlist_dump(const nvlist_t *nvl, int fd) while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { do { + if (nvl == top) + return; cookie = NULL; if (nvlist_in_array(nvl)) dprintf(fd, "%*s,\n", level * 4, ""); @@ -847,7 +850,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep) { unsigned char *buf, *ptr; size_t left, size; - const nvlist_t *tmpnvl; + const nvlist_t *tmpnvl, *top; nvpair_t *nvp, *tmpnvp; void *cookie; @@ -868,6 +871,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep) ptr = nvlist_pack_header(nvl, ptr, &left); + top = nvl; nvp = nvlist_first_nvpair(nvl); while (nvp != NULL) { NVPAIR_ASSERT(nvp); @@ -958,6 +962,8 @@ nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep) goto fail; while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { do { + if (nvl == top) + goto out; cookie = NULL; if (nvlist_in_array(nvl)) { ptr = nvpair_pack_nvlist_array_next(ptr, From nobody Tue Sep 30 15:23:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfZ01Cgz69DdH; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfY4RtPz3M3Y; Tue, 30 Sep 2025 15:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EV+KgM3KHBMEd//iQF09A8jX4VB2i97FZZHt0SEoBkY=; b=ULS2JclWGvObZMcnKEPce7ZAPLK/mGHrp7YF/qSpCZUolIURBiUi26ba0FfPUSF4TTyew/ 1gSfI1K1yVm9ezMgbMHWRaJxKu+gE1IFEs1KktThqwH1iRMEY3CpUseYmiirSxrSvhXAGO uzxXvcuG6vry5uCNSsQel9EtYijpnWSAhlGBaPTE0MleyCQue3UF7eYYytzvvm/6KFDBwd Lr3Y4lgiXztM8Fc/ECLYWmpMwUNE4yxdQCYqZSWttsBobo5V+zv14dBAvhWXATs+v1OnDz PNNJx20T9mlhWMjVUjWusQi4M+ZTT93Qc2AuNujiSxcGS6BP35WLxMU1wdWHkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EV+KgM3KHBMEd//iQF09A8jX4VB2i97FZZHt0SEoBkY=; b=Bx2zcjpVci9u+h7i2lfZLe6nWZt/3kUwvdofS8Wf8bxpbPvqBOkYOKzSAwEcPY0ChTP5Vw BzHs/30PYV8LEcy2EmhuC5Vza5B4PF3d/fakMW9Yt/spbZ8+kP1IJO5pzVG3/N2LqgZwYD DBE9ZrngWFZmKU5cugRcAVHrVS2nos1ImycSznBqukl/MRDcAR6c1jkjPB9bd74UcA1jGr f3ZmZIkDx7BQVsfHG59dzcMZzN1I4I1o6LtPXjVF9Q/pPWgYe0n0jN4V8TbtVek+PW7ovK UwjyOvz3LCOa4xSIDWOBg4NWWFkeDFdV8hhb2di47hJ/BxXiewRAven/onvjIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245829; a=rsa-sha256; cv=none; b=Rx1LG6PY+VevZkZ4yOy8U5dxxxWw4jMeaG+jI9K9IuizlRLmkF4FmcLiIcJv8sYWuFoABK UKqh4eo5nfF0rpn7BiLplZO6f/Nwj82e+KVXP2HEqAIVX4zaQafmsQXpcfX+lIb5mzRJK9 SxX+PRULnjHRRxFzq/E7RFDTdcBHbLCZc1pLCDtCTi2k8w5NYjwNDi8amsCD1Eswb0r+au dYg4XQpxFNYoYnU9NxUsFex9XoVps2LDGbGh6WnsDALD4xS1oFtxRxI1BA/HXTDJUjqCQ3 /Wyv9YhxWoG6t1m3n7bExaw+aygbjwTm4QeGa1FHgNdjsNxVyZd5V7EVrpaNxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfY40vwzjGM; Tue, 30 Sep 2025 15:23: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 58UFNnPG046043; Tue, 30 Sep 2025 15:23:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNnLk046040; Tue, 30 Sep 2025 15:23:49 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:49 GMT Message-Id: <202509301523.58UFNnLk046040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0ab811d89311 - stable/15 - re: Make sure re_rxeof() is called in net epoch context List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0ab811d89311a37f99da0088d9f6b0063f914c3d Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0ab811d89311a37f99da0088d9f6b0063f914c3d commit 0ab811d89311a37f99da0088d9f6b0063f914c3d Author: Mark Johnston AuthorDate: 2025-09-10 14:35:24 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 re: Make sure re_rxeof() is called in net epoch context It may pass packets up the stack and so needs to be called in a network epoch. When a watchdog timeout happens, we need to enter a section explicitly. Reviewed by: zlei, glebius, adrian MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D51885 (cherry picked from commit b653a281f5a977ba73b3d405874f8af8e8b6b50d) --- sys/dev/re/if_re.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 76d395165df7..d56c975a43d2 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -3560,6 +3560,7 @@ re_ioctl(if_t ifp, u_long command, caddr_t data) static void re_watchdog(struct rl_softc *sc) { + struct epoch_tracker et; if_t ifp; RL_LOCK_ASSERT(sc); @@ -3580,7 +3581,9 @@ re_watchdog(struct rl_softc *sc) if_printf(ifp, "watchdog timeout\n"); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + NET_EPOCH_ENTER(et); re_rxeof(sc, NULL); + NET_EPOCH_EXIT(et); if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); re_init_locked(sc); if (!if_sendq_empty(ifp)) From nobody Tue Sep 30 15:23:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfb1Frvz69DxK; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfZ5QG0z3M3j; Tue, 30 Sep 2025 15:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mUuk8gOAzEYxBdp05PW/bQ2FZqDX9ZVylTHO38wtxY8=; b=hKIfU5jdkv7CacopIxIWAEg0I9F31doDsRFeDGOasXsQROenZme1EHby2SHF1OQV3L1LRK JyU/nVAoL+TxMjhLa5wtgT90luuWCcq0acpEk+FqPeRd1wj/pZpUQ8js/D2N4sPtmenOfP w9/HFJM8kTYb8Q4oHXS0VpMK0kYtC5SUzm8Jrq5DpaqwYSdqbvmtSt+EH4iFSIIiHiz+Ke Vp+NPyQH+PVF/pARSjFlqwuELcyT9ITumqQVKWStVJzKgkyK7ILkEvPQVQz7SvmsCWP8ac iZHoshThZMyyehG7lVRxxEeJUK1Y23EUrmxMiju6IPB5Zxj9OfeZu1xxJ9QAnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mUuk8gOAzEYxBdp05PW/bQ2FZqDX9ZVylTHO38wtxY8=; b=kpBBQ2srYZnFSCCru/S2G5vuFFb2A8/iOAD4dKD85c0iEjkW2rXOYcI7zjUYMf389ws/5A h86vzdQzBTG18fr9+oCMLdLr3/IBY7XDdUlO5EEkHlBNnYpHwpFbX0MJLgX+zK+weL2YeO DpigeSffti7q9i3Yl0dG/wfa9EztoA2f5Zy1o50etHvjDoPzmDKJDBnLEJ5eZzJ+hGK7Y+ mrajYTQCHt7d5Mc1zg6gV5bII3DSkZ6V1LD4nkIWONPU0Tw4sbGvyWR0v6mVuDtaffXpkg vXnG3XjUblqK5rHOrmvesyZ1X9CDeQJ8ar8NWLxrid3haNG3yodGSkG3YMbSQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245830; a=rsa-sha256; cv=none; b=gdUYre1OpYQmxHunB4qUPswojMxHZAJN/vVf9biB2mU+F7IbYLTTHDPRR+9oFkHjtIAlLB VwblrzqHWOf5uQo5vZwYDZywMySyn2CA3YI7G/ybGd1/+zgsg3gi91grrryM3YlMjqqxhZ W7j/HcRUJSCUlTiS+yNxHW93eMZAEAKpyCAroK2UBeECFCr3wzhHltfuynTiotx747Jd08 JZ+ya1rXJLEXmu1LfMyeNR4SWg/1BFoJ8Ak3EuiimyBN2JldgBtdT4ViDq8gkru9sTHZom KKZTvBuOnwkPXdcDoJh+TXp+ywQAqYHH+jef75ibaAVTlzABAwKMYBexdQFZKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfZ4ylGzj07; Tue, 30 Sep 2025 15:23: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 58UFNoh7046083; Tue, 30 Sep 2025 15:23:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNom4046078; Tue, 30 Sep 2025 15:23:50 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:50 GMT Message-Id: <202509301523.58UFNom4046078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f7bce8e1826c - stable/15 - vmm: Suspend the VM before destroying it List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f7bce8e1826c362d848d9fb2caffbc80da2c73a3 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f7bce8e1826c362d848d9fb2caffbc80da2c73a3 commit f7bce8e1826c362d848d9fb2caffbc80da2c73a3 Author: Mark Johnston AuthorDate: 2025-09-10 16:00:36 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 vmm: Suspend the VM before destroying it Otherwise we don't do anything to kick vcpu threads out of a sleep state when destroying a VM. For instance, suppose a guest executes hlt on amd64 or wfi on arm64 with interrupts disabled. Then, bhyvectl --destroy will hang until the vcpu thread somehow comes out of vm_handle_hlt()/vm_handle_wfi() since destroy_dev() is waiting for vCPU threads to drain. Note that on amd64, if hw.vmm.halt_detection is set to 1 (the default), the guest will automatically exit in this case since it's treated as a shutdown. But, the above should not hang if halt_detection is set to 0. Here, vm_suspend() wakes up vcpu threads, and a subsequent attempt to run the vCPU will result in an error which gets propagated to userspace, allowing destroy_dev() to proceed. Add a new suspend code for this purpose. Modify bhyve to exit with status 4 ("exited due to an error") when it's received, since that's what'll happen generally when the VM is destroyed asynchronously. Reported by: def MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D51761 (cherry picked from commit 3d39856d4dfeab5b5a5e6bbdb6ce965db5bc4dc1) --- sys/amd64/include/vmm.h | 1 + sys/arm64/include/vmm.h | 1 + sys/arm64/vmm/vmm.c | 6 ++++++ sys/dev/vmm/vmm_dev.c | 1 + sys/riscv/include/vmm.h | 1 + sys/riscv/vmm/vmm.c | 6 +++++- usr.sbin/bhyve/aarch64/vmexit.c | 2 ++ usr.sbin/bhyve/amd64/vmexit.c | 2 ++ usr.sbin/bhyve/bhyve.8 | 2 +- usr.sbin/bhyve/bhyverun.c | 6 ++---- usr.sbin/bhyve/riscv/vmexit.c | 2 ++ 11 files changed, 24 insertions(+), 6 deletions(-) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index 0b3daed4f69e..e35119af8572 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -46,6 +46,7 @@ enum vm_suspend_how { VM_SUSPEND_POWEROFF, VM_SUSPEND_HALT, VM_SUSPEND_TRIPLEFAULT, + VM_SUSPEND_DESTROY, VM_SUSPEND_LAST }; diff --git a/sys/arm64/include/vmm.h b/sys/arm64/include/vmm.h index 73b5b4a09591..e839b5dd92c9 100644 --- a/sys/arm64/include/vmm.h +++ b/sys/arm64/include/vmm.h @@ -42,6 +42,7 @@ enum vm_suspend_how { VM_SUSPEND_RESET, VM_SUSPEND_POWEROFF, VM_SUSPEND_HALT, + VM_SUSPEND_DESTROY, VM_SUSPEND_LAST }; diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index 3082d2941221..1dcefa1489e9 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -1342,8 +1342,14 @@ vm_handle_smccc_call(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) static int vm_handle_wfi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) { + struct vm *vm; + + vm = vcpu->vm; vcpu_lock(vcpu); while (1) { + if (vm->suspend) + break; + if (vgic_has_pending_irq(vcpu->cookie)) break; diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index 9f2b009d02ec..460a508a60dc 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -901,6 +901,7 @@ vmmdev_lookup_and_destroy(const char *name, struct ucred *cred) sc->cdev = NULL; sx_xunlock(&vmmdev_mtx); + vm_suspend(sc->vm, VM_SUSPEND_DESTROY); destroy_dev(cdev); vmmdev_destroy(sc); diff --git a/sys/riscv/include/vmm.h b/sys/riscv/include/vmm.h index 1221521be368..de7119dd534a 100644 --- a/sys/riscv/include/vmm.h +++ b/sys/riscv/include/vmm.h @@ -49,6 +49,7 @@ enum vm_suspend_how { VM_SUSPEND_RESET, VM_SUSPEND_POWEROFF, VM_SUSPEND_HALT, + VM_SUSPEND_DESTROY, VM_SUSPEND_LAST }; diff --git a/sys/riscv/vmm/vmm.c b/sys/riscv/vmm/vmm.c index 7528ef6e4698..ec4514f70fa6 100644 --- a/sys/riscv/vmm/vmm.c +++ b/sys/riscv/vmm/vmm.c @@ -1036,10 +1036,14 @@ vm_raise_msi(struct vm *vm, uint64_t msg, uint64_t addr, int bus, int slot, static int vm_handle_wfi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) { + struct vm *vm; + vm = vcpu->vm; vcpu_lock(vcpu); - while (1) { + if (vm->suspend) + break; + if (aplic_check_pending(vcpu->cookie)) break; diff --git a/usr.sbin/bhyve/aarch64/vmexit.c b/usr.sbin/bhyve/aarch64/vmexit.c index 3acad4020a3c..2457cbe76b5e 100644 --- a/usr.sbin/bhyve/aarch64/vmexit.c +++ b/usr.sbin/bhyve/aarch64/vmexit.c @@ -122,6 +122,8 @@ vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) exit(1); case VM_SUSPEND_HALT: exit(2); + case VM_SUSPEND_DESTROY: + exit(4); default: fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); exit(100); diff --git a/usr.sbin/bhyve/amd64/vmexit.c b/usr.sbin/bhyve/amd64/vmexit.c index 944f5de34645..14f89563fd0f 100644 --- a/usr.sbin/bhyve/amd64/vmexit.c +++ b/usr.sbin/bhyve/amd64/vmexit.c @@ -418,6 +418,8 @@ vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) exit(2); case VM_SUSPEND_TRIPLEFAULT: exit(3); + case VM_SUSPEND_DESTROY: + exit(4); default: EPRINTLN("vmexit_suspend: invalid reason %d", how); exit(100); diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 89c0b23961a8..c902c265da9e 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -1126,7 +1126,7 @@ powered off .It 2 halted .It 3 -triple fault +triple fault (amd64 only) .It 4 exited due to an error .El diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 9ead49582a7d..bfc0b949a75d 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -561,10 +561,8 @@ fbsdrun_start_thread(void *param) #endif vm_loop(vi->ctx, vi->vcpu); - - /* not reached */ - exit(1); - return (NULL); + /* We get here if the VM was destroyed asynchronously. */ + exit(4); } void diff --git a/usr.sbin/bhyve/riscv/vmexit.c b/usr.sbin/bhyve/riscv/vmexit.c index 3bc83b3bef4e..985f8e4e9065 100644 --- a/usr.sbin/bhyve/riscv/vmexit.c +++ b/usr.sbin/bhyve/riscv/vmexit.c @@ -121,6 +121,8 @@ vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) exit(1); case VM_SUSPEND_HALT: exit(2); + case VM_SUSPEND_DESTROY: + exit(4); default: fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); exit(100); From nobody Tue Sep 30 15:23:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhfc4LbPz69F0f; Tue, 30 Sep 2025 15:23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhfb6VY4z3MFR; Tue, 30 Sep 2025 15:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRd/XqFDnjreOMlvIWyUKFjOWbukIdc169ReXR4MIwk=; b=Okf8L1MxbqWpLVsyJjrymv6Het4dV7F4XIeSt3PSUahbs4C/NXqEqRWyW+Dk16yhDILoD+ yETyW6PppFpG++dC0eEhE+FYd9ry152SPx91T/tlbRIrt8cIhhG/twFJrJhQ7meKuGsLJO vHqsdl+gLiARTlD51M5UZosFTSsxf1GiqdwZaMms3alz8/Ynu30DnizAek6bG0wPYoOBhd RcOX6LLCvKoqVkItib3Ob72Klj2X4toUsLOUl8Vs+DPTXu+JSOiiCm96+p5ZlYUNgprXFi 3S0/z2wW7zUTC3gVPRuz34AWRF1pWMby5JIxcsoEHyI1XeliJmjpMrxla87Gnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRd/XqFDnjreOMlvIWyUKFjOWbukIdc169ReXR4MIwk=; b=lSRULRhYoXsyhBa67rtGnPUl8ilikXH2paVdBsILzaJeE6fpF5PYzpE1+WrYoukB/o1RLx lKh+DiJG2czEzVJzeWiPtV2ryUWfp6QOLs+VSpHuyL+yRQe5eD1kY97gOhr6cusuVBwM6Q gocgt8UdAK6IuCzidx5JvcCrTRXJYkApAlSbBD7dgd2r6vw87fNIDWUSOSH45pMON5+Oya 5oJAEiDlhhZYXIcW2YOYcZd/FROdoEmMF9PjwUFNFZx5uRPABwozzVB/d6864aYouSKW6+ FK850/53/aAZqmjC9sLbY1oV3TjdZx8z26uZoNntNbP3DjAdievACMq0q1WXag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245832; a=rsa-sha256; cv=none; b=rN9CO0ey9mvhCequujfP2p3/vsDL/T0MYxRwdziwJ1h1JUv4PkdiuolWDF9FAoItzr1O1W 9ibQDHMn7wNwJLkv6MwCLJh4/WCr8AH6xJAa4WRKXEOopJ/Ljs+1n4NF3IXxatx0ios24+ NzxnmZFB7DO2GDwgGVywbSXGRqg4TEgkoL/q74BbXozFkav7k08xCYJiueFQwgl9c4rzGR CO5C0mTZ4qmkCwtQYbAC6d/KKTUHc380PGbfw1RnPbQLlWPb76bk0/t6T2eE0iHhEsyPI+ yq8YdsLMTkgAEyoeUCkOLmRizthzqOOmQnXPGFNJF3Ylb+YHYaWzADmjJG6sjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhfb5tM5zj08; Tue, 30 Sep 2025 15:23: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 58UFNpN6046122; Tue, 30 Sep 2025 15:23:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFNpV2046119; Tue, 30 Sep 2025 15:23:51 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:23:51 GMT Message-Id: <202509301523.58UFNpV2046119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 053b8cb7602c - stable/15 - dtrace: Use a size_t to represent a buffer size in the printm action List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 053b8cb7602cf1246f6c37b8db8dfdffd331af48 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=053b8cb7602cf1246f6c37b8db8dfdffd331af48 commit 053b8cb7602cf1246f6c37b8db8dfdffd331af48 Author: Mark Johnston AuthorDate: 2025-09-10 14:33:58 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 09:43:08 +0000 dtrace: Use a size_t to represent a buffer size in the printm action printm is specific to the FreeBSD dtrace port. I believe it's effectively the same as tracemem(), though printm apparently predates it. It stores the size of the buffer of traced data inline. Currently it represents that size using a uintptr_t, which isn't really right and poses challenges when porting to CHERI because `DTRACE_STORE(uintptr_t, ...` requires the destination to be suitably aligned, but this isn't necessary since we're just storing a size. Convert to using a size_t. This should be a no-op since sizeof(uintptr_t) == sizeof(size_t) on non-CHERI platforms (and besides that I don't see a reason to use printm() when tracemem() is available and is simpler to use.) Reviewed by: Domagoj Stolfa, avg MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D52055 (cherry picked from commit 3877025f52ee205fe99ad4ff68229933d57e4bcb) --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c | 9 ++++----- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 11 ++++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c index 385c9d78bdfc..b311b5425587 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c @@ -2242,11 +2242,10 @@ dt_format_bytes_get(dtrace_hdl_t *dtp, caddr_t addr, size_t nbytes) static int dt_format_memory(dtrace_hdl_t *dtp, caddr_t addr) { - - size_t nbytes = *((uintptr_t *) addr); + size_t nbytes = *((size_t *) addr); char *s; - s = dt_format_bytes_get(dtp, addr + sizeof(uintptr_t), nbytes); + s = dt_format_bytes_get(dtp, addr + sizeof(size_t), nbytes); if (s == NULL) return (-1); @@ -2260,9 +2259,9 @@ static int dt_print_memory(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) { int quiet = (dtp->dt_options[DTRACEOPT_QUIET] != DTRACEOPT_UNSET); - size_t nbytes = *((uintptr_t *) addr); + size_t nbytes = *((size_t *) addr); - return (dt_print_bytes(dtp, fp, addr + sizeof(uintptr_t), + return (dt_print_bytes(dtp, fp, addr + sizeof(size_t), nbytes, 50, quiet, 1)); } diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 7192df200ae2..8078f3f6d4b1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -7761,7 +7761,8 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, uintptr_t *memref = (uintptr_t *)(uintptr_t) val; if (!DTRACE_INSCRATCHPTR(&mstate, - (uintptr_t)memref, 2 * sizeof(uintptr_t))) { + (uintptr_t) memref, + sizeof (uintptr_t) + sizeof (size_t))) { *flags |= CPU_DTRACE_BADADDR; continue; } @@ -7773,21 +7774,21 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, * Check if the size exceeds the allocated * buffer size. */ - if (size + sizeof(uintptr_t) > dp->dtdo_rtype.dtdt_size) { + if (size + sizeof (size_t) > + dp->dtdo_rtype.dtdt_size) { /* Flag a drop! */ *flags |= CPU_DTRACE_DROP; continue; } /* Store the size in the buffer first. */ - DTRACE_STORE(uintptr_t, tomax, - valoffs, size); + DTRACE_STORE(size_t, tomax, valoffs, size); /* * Offset the buffer address to the start * of the data. */ - valoffs += sizeof(uintptr_t); + valoffs += sizeof(size_t); /* * Reset to the memory address rather than From nobody Tue Sep 30 15:26:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhjL6pDPz69F5d; Tue, 30 Sep 2025 15:26: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhjL5LpQz3SWb; Tue, 30 Sep 2025 15:26:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tS4/02pz4+q8s1AVsf7ZBQO3s5TUxTudgdd7LtRmpeY=; b=kj/YBV/J8IMjBxTyROxTGJfagGGw7I2Z74XK5S5mTYgUbSdBKd2me/m3mPb/+4ym49Co7z mCPAszaIz61YZCRrVlsdLkD03Bkad1/qexEAEGzqGZ81SvCdH9NrpPW5QTwyph4AUSqhjz ihSy6k2B7IYdo2GCrBTDqO7TgcUnaX98XhvgCbQ7MtYgY+KsYW9qC5VYv9q8bdi8Y0sfog d6NcqUiGjb3WrD/Q6D5PPyoRGgdO2fHsuMDxcR+zUhQowhzbUTJCT2FRFEsv2Zob0MkFsb g2mjSiAwS2TaVrlrdQg9Ze9pZOAxGu0cvfm3mrnMZPaw8KSmPbljVmJ/IAQTZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759245974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tS4/02pz4+q8s1AVsf7ZBQO3s5TUxTudgdd7LtRmpeY=; b=E+tKQJ5Dcd/G3wk6j8hccNSnmXtPrbLopqnt7UaWmnEMdnIywaRSzAR92NV4HE8tmmj57r phO5IsP4ep8TqLXfHE0n1d1XTsQ07G/zhz1a19MdAfBvO2ZXHrMFA/l+YEgtH0x7u7KPQf r36izfZqGXdrhod+ZARhqDnMr1HjRjGtEfAHcrNivbBmoiTU3bdQXgc3FoSBMZR3QRoZLc rJ4YPYdeoX56ZD3m6KsVUqQB94RLFo/JicZthVgAduw7vrl62fppUlXHdaho411Zq+suvB zEpDViXPhXfr/94q52ukNpvTrabc/DAj9PV/Rnl/7wX5Aw0y12Ob+SXabwzx7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759245974; a=rsa-sha256; cv=none; b=XOIE/rrek1C1n8M3wES+FcS/rTyzZEsi6MAFdqNELtGLBp0il4PRCSVKa+4LHxkDwPgxv2 gaztQCoO0RvbNeOe2MP6OvsPYJpA11bf4w9k2YG9t9+vSw5HXNAMu+sOvY2oEI9ztevFjG 3WSR9yavRtU8o3cYisIqc3su3KlrZ1Njc8hVajnBHIAe0HBr4sD9zUkd5op028a+AaqVAJ tR6wqS4ZYPCd9E7mtPqxiBm5tuov9Wkvnhiz+K248mfa26/YIdPvcb7Gru4UiZMtLCaqDv wM5Oc8w/74w0L72ibIYXNRcBLPuDUKqPNwYxu4JwwVzHcKLiOf9+RJG8Ja2zcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhjL4t5zzjQY; Tue, 30 Sep 2025 15:26: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 58UFQEQa047177; Tue, 30 Sep 2025 15:26:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFQE1D047174; Tue, 30 Sep 2025 15:26:14 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:26:14 GMT Message-Id: <202509301526.58UFQE1D047174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 4d6fd774b5b3 - stable/15 - Fix multiple security issues in OpenSSL. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4d6fd774b5b3161314805f4dc6ba260ef977f583 Auto-Submitted: auto-generated The branch stable/15 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=4d6fd774b5b3161314805f4dc6ba260ef977f583 commit 4d6fd774b5b3161314805f4dc6ba260ef977f583 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:23:01 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:26:09 +0000 Fix multiple security issues in OpenSSL. Out-of-bounds read & write in RFC 3211 KEK Unwrap (CVE-2025-9230) Timing side-channel in SM2 algorithm on 64 bit ARM (CVE-2025-9231) Out-of-bounds read in HTTP client no_proxy handling (CVE-2025-9232) Obtained from: OpenSSL Approved by: so Security: FreeBSD-SA-25:08.openssl Security: CVE-2025-9230 Security: CVE-2025-9231 Security: CVE-2025-9232 (cherry picked from commit aa1afb69dcedfc68859815987c46997500f834c3) --- crypto/openssl/crypto/cms/cms_pwri.c | 2 +- crypto/openssl/crypto/ec/ecp_sm2p256.c | 101 +-------------------------------- crypto/openssl/crypto/http/http_lib.c | 1 + 3 files changed, 5 insertions(+), 99 deletions(-) diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c index a7d609f83791..ee1b8aa6ed61 100644 --- a/crypto/openssl/crypto/cms/cms_pwri.c +++ b/crypto/openssl/crypto/cms/cms_pwri.c @@ -242,7 +242,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen, /* Check byte failure */ goto err; } - if (inlen < (size_t)(tmp[0] - 4)) { + if (inlen < 4 + (size_t)tmp[0]) { /* Invalid length value */ goto err; } diff --git a/crypto/openssl/crypto/ec/ecp_sm2p256.c b/crypto/openssl/crypto/ec/ecp_sm2p256.c index 7668b61378b6..ffb58399dfd0 100644 --- a/crypto/openssl/crypto/ec/ecp_sm2p256.c +++ b/crypto/openssl/crypto/ec/ecp_sm2p256.c @@ -56,10 +56,6 @@ ALIGN32 static const BN_ULONG def_p[P256_LIMBS] = { 0xffffffffffffffff, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffeffffffff }; -ALIGN32 static const BN_ULONG def_ord[P256_LIMBS] = { - 0x53bbf40939d54123, 0x7203df6b21c6052b, - 0xffffffffffffffff, 0xfffffffeffffffff -}; ALIGN32 static const BN_ULONG ONE[P256_LIMBS] = {1, 0, 0, 0}; @@ -177,13 +173,6 @@ static ossl_inline void ecp_sm2p256_mod_inverse(BN_ULONG* out, BN_MOD_INV(out, in, ecp_sm2p256_div_by_2, ecp_sm2p256_sub, def_p); } -/* Modular inverse mod order |out| = |in|^(-1) % |ord|. */ -static ossl_inline void ecp_sm2p256_mod_ord_inverse(BN_ULONG* out, - const BN_ULONG* in) { - BN_MOD_INV(out, in, ecp_sm2p256_div_by_2_mod_ord, ecp_sm2p256_sub_mod_ord, - def_ord); -} - /* Point double: R <- P + P */ static void ecp_sm2p256_point_double(P256_POINT *R, const P256_POINT *P) { @@ -454,52 +443,6 @@ static int ecp_sm2p256_is_affine_G(const EC_POINT *generator) } #endif -/* - * Convert Jacobian coordinate point into affine coordinate (x,y) - */ -static int ecp_sm2p256_get_affine(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x, BIGNUM *y, BN_CTX *ctx) -{ - ALIGN32 BN_ULONG z_inv2[P256_LIMBS] = {0}; - ALIGN32 BN_ULONG z_inv3[P256_LIMBS] = {0}; - ALIGN32 BN_ULONG x_aff[P256_LIMBS] = {0}; - ALIGN32 BN_ULONG y_aff[P256_LIMBS] = {0}; - ALIGN32 BN_ULONG point_x[P256_LIMBS] = {0}; - ALIGN32 BN_ULONG point_y[P256_LIMBS] = {0}; - ALIGN32 BN_ULONG point_z[P256_LIMBS] = {0}; - - if (EC_POINT_is_at_infinity(group, point)) { - ECerr(ERR_LIB_EC, EC_R_POINT_AT_INFINITY); - return 0; - } - - if (ecp_sm2p256_bignum_field_elem(point_x, point->X) <= 0 - || ecp_sm2p256_bignum_field_elem(point_y, point->Y) <= 0 - || ecp_sm2p256_bignum_field_elem(point_z, point->Z) <= 0) { - ECerr(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE); - return 0; - } - - ecp_sm2p256_mod_inverse(z_inv3, point_z); - ecp_sm2p256_sqr(z_inv2, z_inv3); - - if (x != NULL) { - ecp_sm2p256_mul(x_aff, point_x, z_inv2); - if (!bn_set_words(x, x_aff, P256_LIMBS)) - return 0; - } - - if (y != NULL) { - ecp_sm2p256_mul(z_inv3, z_inv3, z_inv2); - ecp_sm2p256_mul(y_aff, point_y, z_inv3); - if (!bn_set_words(y, y_aff, P256_LIMBS)) - return 0; - } - - return 1; -} - /* r = sum(scalar[i]*point[i]) */ static int ecp_sm2p256_windowed_mul(const EC_GROUP *group, P256_POINT *r, @@ -689,44 +632,6 @@ static int ecp_sm2p256_field_sqr(const EC_GROUP *group, BIGNUM *r, return 1; } -static int ecp_sm2p256_inv_mod_ord(const EC_GROUP *group, BIGNUM *r, - const BIGNUM *x, BN_CTX *ctx) -{ - int ret = 0; - ALIGN32 BN_ULONG t[P256_LIMBS] = {0}; - ALIGN32 BN_ULONG out[P256_LIMBS] = {0}; - - if (bn_wexpand(r, P256_LIMBS) == NULL) { - ECerr(ERR_LIB_EC, ERR_R_BN_LIB); - goto err; - } - - if ((BN_num_bits(x) > 256) || BN_is_negative(x)) { - BIGNUM *tmp; - - if ((tmp = BN_CTX_get(ctx)) == NULL - || !BN_nnmod(tmp, x, group->order, ctx)) { - ECerr(ERR_LIB_EC, ERR_R_BN_LIB); - goto err; - } - x = tmp; - } - - if (!ecp_sm2p256_bignum_field_elem(t, x)) { - ECerr(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE); - goto err; - } - - ecp_sm2p256_mod_ord_inverse(out, t); - - if (!bn_set_words(r, out, P256_LIMBS)) - goto err; - - ret = 1; -err: - return ret; -} - const EC_METHOD *EC_GFp_sm2p256_method(void) { static const EC_METHOD ret = { @@ -747,7 +652,7 @@ const EC_METHOD *EC_GFp_sm2p256_method(void) ossl_ec_GFp_simple_point_copy, ossl_ec_GFp_simple_point_set_to_infinity, ossl_ec_GFp_simple_point_set_affine_coordinates, - ecp_sm2p256_get_affine, + ossl_ec_GFp_simple_point_get_affine_coordinates, 0, 0, 0, ossl_ec_GFp_simple_add, ossl_ec_GFp_simple_dbl, @@ -763,7 +668,7 @@ const EC_METHOD *EC_GFp_sm2p256_method(void) ecp_sm2p256_field_mul, ecp_sm2p256_field_sqr, 0 /* field_div */, - 0 /* field_inv */, + ossl_ec_GFp_simple_field_inv, 0 /* field_encode */, 0 /* field_decode */, 0 /* field_set_to_one */, @@ -779,7 +684,7 @@ const EC_METHOD *EC_GFp_sm2p256_method(void) ossl_ecdsa_simple_sign_setup, ossl_ecdsa_simple_sign_sig, ossl_ecdsa_simple_verify_sig, - ecp_sm2p256_inv_mod_ord, + 0, /* use constant‑time fallback for inverse mod order */ 0, /* blind_coordinates */ 0, /* ladder_pre */ 0, /* ladder_step */ diff --git a/crypto/openssl/crypto/http/http_lib.c b/crypto/openssl/crypto/http/http_lib.c index fcf8a69e07a8..022b8c194cbe 100644 --- a/crypto/openssl/crypto/http/http_lib.c +++ b/crypto/openssl/crypto/http/http_lib.c @@ -263,6 +263,7 @@ static int use_proxy(const char *no_proxy, const char *server) /* strip leading '[' and trailing ']' from escaped IPv6 address */ sl -= 2; strncpy(host, server + 1, sl); + host[sl] = '\0'; server = host; } From nobody Tue Sep 30 15:28:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhm66nwTz69FCD; Tue, 30 Sep 2025 15:28: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhm66Jggz3T08; Tue, 30 Sep 2025 15:28:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZWqUVPIOtwPPCCU2UhfEYv9Z1+S6HPFcgeGOw86zZA=; b=wKfHrdWzS6MDmCu1heWuDwLzZS2JwqdlkgYRFCPYVp+dOguQXbn7KM2yAoeQM8sSfUKdwP g0LHlpNkvn9UhkyGNk8IHQ5s6krKyfuD4WonGgwkT44LezkIZfuIz2RwDQcEsXuzfG8B6J lIz8viaKjXQJKybCGDznEo0rilvTx5IXRlq0qSnvo5nCeHlRxkNPySlD5M6FneAVz45pFO zcnNkCGjYnVTiblM+M4fahMUHBaaiQg90fYnBVv4DvBGwvEIxN5fUhrMKoixjZ+e4Mgvrk BZKMUffIKZJYZPUGdfpSpVqmt8PFf9ntcgkl1lH7qwisNsHvHuptKHYoPkJZAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZWqUVPIOtwPPCCU2UhfEYv9Z1+S6HPFcgeGOw86zZA=; b=jsCECXHkFWoaUxfTd0hiWWca5vvx1ZtTmqYq3krhI4kxr+kMrvHH6qq1MroCMBFXYVgjqK 1u16M2x+j/6Mv44+kRbleTuhFOY9xc7G+estMPEPQpqlxfO6lAhxFcxpV2+BKICFdsYaMM OGCn8hAPcJVmRbSxiyWT5JX3x8h1WlyeoYXxPEn1dVsgO13tWFRF9nC769iljK/0+9CUha iDT2fAbm5FcGkWMGf7l+XqkONXDkX/8XutPd4kBoMUe0J1s9OrIpnLiTavv/s2y+CJOAtd hBCNuSg6ZFEFKjWNNp2odTy+oLgQ19zKkyoA/xW96VZfaD1bUil9fdIrhkjGyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246118; a=rsa-sha256; cv=none; b=mnhaNYP1D27Sv9/AkCzJtKTdNqi3p6/qH/fmiBnJ8wZ5JNvwidgnUIeT+qToK3HY9NrExp qRJnH43uYjF0tPMk778pn8Anvk3BUklQcUV8QAxCOZm6RgNEBiiUmHrk8lBbWj/zzKxYi7 X51Osin2/X8Q4C9/XTU3GavLtuQSm5V5r8fPn9Do93kIqxzp2adpv+w8Sq/9oQdi3FaWqy /ZbGGHRHSBJ6VNczGIG91YtiQd69lF8xfDJ0acpWeVplHqnJRIks3oGChPO144KJVRFXkx RGe8iqYJazrCo8lTC8xK8cvHuOc7iuYyvQNpzHOHzBobvh4uyJELfPO8o8deUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhm65dm9zjQZ; Tue, 30 Sep 2025 15:28: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 58UFScXr047994; Tue, 30 Sep 2025 15:28:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFSchQ047991; Tue, 30 Sep 2025 15:28:38 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:28:38 GMT Message-Id: <202509301528.58UFSchQ047991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 270158508d7c - stable/14 - Fix multiple security issues in OpenSSL. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 270158508d7c55a0737c2a9915cd4afc8fabdaf0 Auto-Submitted: auto-generated The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=270158508d7c55a0737c2a9915cd4afc8fabdaf0 commit 270158508d7c55a0737c2a9915cd4afc8fabdaf0 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:27:08 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:27:08 +0000 Fix multiple security issues in OpenSSL. Out-of-bounds read & write in RFC 3211 KEK Unwrap (CVE-2025-9230) Out-of-bounds read in HTTP client no_proxy handling (CVE-2025-9232) Obtained from: OpenSSL Approved by: so Security: FreeBSD-SA-25:08.openssl Security: CVE-2025-9230 Security: CVE-2025-9232 --- crypto/openssl/crypto/cms/cms_pwri.c | 2 +- crypto/openssl/crypto/http/http_lib.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c index 2373092bed55..6b507c3f0176 100644 --- a/crypto/openssl/crypto/cms/cms_pwri.c +++ b/crypto/openssl/crypto/cms/cms_pwri.c @@ -228,7 +228,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen, /* Check byte failure */ goto err; } - if (inlen < (size_t)(tmp[0] - 4)) { + if (inlen < 4 + (size_t)tmp[0]) { /* Invalid length value */ goto err; } diff --git a/crypto/openssl/crypto/http/http_lib.c b/crypto/openssl/crypto/http/http_lib.c index 9c41f57541d7..614fd200b7c0 100644 --- a/crypto/openssl/crypto/http/http_lib.c +++ b/crypto/openssl/crypto/http/http_lib.c @@ -267,6 +267,7 @@ static int use_proxy(const char *no_proxy, const char *server) /* strip leading '[' and trailing ']' from escaped IPv6 address */ sl -= 2; strncpy(host, server + 1, sl); + host[sl] = '\0'; server = host; } From nobody Tue Sep 30 15:30:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhnk5vjpz69FCJ; Tue, 30 Sep 2025 15:30: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhnk5HKnz3T23; Tue, 30 Sep 2025 15:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fI2JQ4Leu3Ustg/bcObV2Djg37fN/S/91rg9wbgTRrQ=; b=gQPBJRXDrAXi00ZSHSFekHkYuxAtv63k2/+RY/m6QxqBNLCzIQrPUMjDIbdlS1zu1cTLTi 4bboCBhU6YhTfvBMTvP0NFlLv817Zvr4LZ2zIa57zprF24Z6/q8Xt7q5Vc9nWY2ngNbYfp zAgt+P3MoXzCnSsWn4yIssG6ZGMnlRTGqWSmhEgD4t1JWadvWE7wUhX1roXTFku3PS2VT1 Ka8MqIY8wrZEbidx7VM1L8H/anRb1J1eoWOT0C2GvPpTPQerl01E3j0z6Y7Zj/DSogQr0t eRCe3VYZTj8T5dYqnmUKCg9nwqi3OOYcKaPS2Ko+vZ/vXyo6za3vglssmNrUog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fI2JQ4Leu3Ustg/bcObV2Djg37fN/S/91rg9wbgTRrQ=; b=BblLdnVN5hKZw5mAXFBqkprIGoGD5YtO1E5LJygvdm7KHSPS4z2BWvXNb1vlf/jD6Lkg/b svTA/BVrX09950bvlP6/y/RSG/lLzJUhAwQN1+SPa4wQHUUuOtcblSWdpgxsyFV1Qr6QEJ 8RGR6lDoGv9nFJ4VMuNBpe3o6fK2onEhcLx7XCKTDpfPcgiD5+4qyOqKkxGvGIF35GzFgJ i2FLjjP28SA3PrZ3QAC9agif+bbx8IQMrHv+zUv2NBw41CWjBJUzUbJBMDoXWGd3Ajg412 Dxs90cqCFiIHPANliXOe9IDlIovygCG9DruPWmIcgNDSTA4THaN1vQP81FQKUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246202; a=rsa-sha256; cv=none; b=tRJrctpdR/XZQqmz3L+AYGTCDY4KJJvDgtdCKHzKqIjrDLCQ5dLLPn/iUYFNzreSESuv4B jlYTGqu9volUzS8XhvaIlmML7ldWb9FWM+Ai5ruYHEVj/Y9tH91N6LmS6c7vslZilo9GH8 ZhdIRezZOW2rOr79/5gNaprk3zz6hVWaBVT7NuDMH9hkD8OFJLDoGGfaAgZaEiOjk9zud/ EvEU/7LqUuAJgFpOp/ovNNapD6vMlJ/CcDgp4C4LeiL0siAQ4QY+o+xw9AE1t0qKNLY0sA hBpe3LUFvDczuBNnbpL1MiGOkGQlqFNjRZe/M7ZG1L5bfRgvCcOuX4wAnAOsdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhnk4md8zjGT; Tue, 30 Sep 2025 15:30: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 58UFU2j1050597; Tue, 30 Sep 2025 15:30:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFU2fr050592; Tue, 30 Sep 2025 15:30:02 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:30:02 GMT Message-Id: <202509301530.58UFU2fr050592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: c0dbaf2b5dbd - stable/13 - Fix issue from OpenSSL. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c0dbaf2b5dbd16c113a6346ee748fd474fe192e5 Auto-Submitted: auto-generated The branch stable/13 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c0dbaf2b5dbd16c113a6346ee748fd474fe192e5 commit c0dbaf2b5dbd16c113a6346ee748fd474fe192e5 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:28:59 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:28:59 +0000 Fix issue from OpenSSL. Out-of-bounds read & write in RFC 3211 KEK Unwrap (CVE-2025-9230) Obtained from: OpenSSL Approved by: so Security: FreeBSD-SA-25:08.openssl Security: CVE-2025-9230 --- crypto/openssl/crypto/cms/cms_pwri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c index d7414883396c..9f98840244ea 100644 --- a/crypto/openssl/crypto/cms/cms_pwri.c +++ b/crypto/openssl/crypto/cms/cms_pwri.c @@ -215,7 +215,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen, /* Check byte failure */ goto err; } - if (inlen < (size_t)(tmp[0] - 4)) { + if (inlen < 4 + (size_t)tmp[0]) { /* Invalid length value */ goto err; } From nobody Tue Sep 30 15:37:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhy34yyNz69FRv; Tue, 30 Sep 2025 15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhy340Xnz3TSv; Tue, 30 Sep 2025 15:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lVuxlW7iAdoDoiwxMRBJAKzIA8Jv2kRFAN+NGT/0XZk=; b=U/B0xshR/sWsa8XNsS25TRWIYCOpUMoa41WlfmiqqhCgsDid0rdrxLd2RI9b0ScCIwblim k969hoazJJEkvJKqxT7E00cEK+m7GqIUB/YL0WYDnAXOshx6XmLa8M5q+gYEiroZgVxo4D Zz9JJdKqhL3QG4s4dc9JxqVUQWnYkaxq8vC86YB53sCkbSrdSQBMixVDCs4OQYWydc1k6k obGbmrzKmh4kYNud90IN64v0Ru6YMPIpYnxqYDISA//GAl6Pol393YryQP7+qXLEGWH+zr 9CSxNHCMGVPbBfk57qYthGJRNFxvoC97VTljIODLnojTTkWsnRyoSOM8EkAgVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lVuxlW7iAdoDoiwxMRBJAKzIA8Jv2kRFAN+NGT/0XZk=; b=muUDRurDwJO4Or/Ts6WiAY7w1MHbswhEyE44MejCdz38dr7pEVEc29d0tIO44KxswyP2UX F91Pth5Q0cJ28etY2089+4JUOwFOBE/nXpyf5DOkHmJMsLzbJHPztJtHMlsg8CjvT1qndx bsnKct5Bfk+izdjsAkwLzaCQjCikUjf5bMAWcpDLZrmLMnUtJkCPdMQRRvR/rDR0Xeh0uZ 5fL3Q+qFRRYag0HTFciCNp5Lii2z9V34by07bbof51s9npExpiGlM0dTIS+S+OMt/P+RrM dOtsDCzFay+AnsHhaX+sMdjgSdRiSnh7Xm80/+Aj3pBeDdexeB3CVuRDggJEGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246635; a=rsa-sha256; cv=none; b=FCx5TiHeLaqVFGXeIp6HM4k6WXXSI2HRPlybj0/g2pEVFOVRnZUUuUr2kt9IXOnIArXBWH ahrhLA516E4hse8Szg+7QR6PZFI227YYknhY7eiYx2KfuT6iq3PUZliGb/ef7gYJ6uBl+a RVMQsGw9xkgSkbNqDLT2znuqsSG0NwEfsSf7SUEDlfkXY+gp5voMiWpy2BorxPijp73Ean PN6yan0VwyZKSXno/eo+Vrzd0jyVSi0o8I+tKhwVHaXHLIhDZtAB7U0dIRtJ92ynp+kGMB t9zOt/2Q1JfeGa+O+Okl4N3L4/HM8Xb/j+andVSzso4mJtCAqPUejwQkAjcA3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhy33bgGzjgv; Tue, 30 Sep 2025 15:37: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 58UFbFOn067514; Tue, 30 Sep 2025 15:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbFNg067511; Tue, 30 Sep 2025 15:37:15 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:15 GMT Message-Id: <202509301537.58UFbFNg067511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 978e04ff5bcf - releng/14.3 - freebsd-update: Library ordering List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 978e04ff5bcf0a750cd3ef19561f5e0f67860620 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=978e04ff5bcf0a750cd3ef19561f5e0f67860620 commit 978e04ff5bcf0a750cd3ef19561f5e0f67860620 Author: Colin Percival AuthorDate: 2025-09-23 06:55:08 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 04:57:23 +0000 freebsd-update: Library ordering Upgrading from 14.x to 15.x with freebsd-update broke because libc depends on the new libsys library; freebsd-update installed the new libc before creating libsys, and every step after that failed because all the tools (including gunzip and install) are dynamically linked and need a working libc. Enforce ordering when installing shared objects: First libsys, then libc, then libthr, and then all the rest of the shared object files. This is a candidate for an Errata Notice since the issue this fixes breaks upgrades. PR: 289769 Reported by: Graham Perrin Reviewed by: kib MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D52688 Approved by: so Security: FreeBSD-EN-25:18.freebsd-update (cherry picked from commit 7ece602e00e85195fc426a2401c49921cd39735e) (cherry picked from commit e26928669f39c8683aea74040b9e2472e944c43a) --- usr.sbin/freebsd-update/freebsd-update.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index f575f89bcf82..cf314a256b81 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3063,10 +3063,28 @@ Kernel updates have been installed. Please reboot and run grep -E '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 - # Install new shared libraries next + # Next, in order, libsys, libc, and libthr. grep -vE '^/boot/' $1/INDEX-NEW | grep -vE '^[^|]+\|d\|' | grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libsys\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libc\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libthr\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + + # Install the rest of the shared libraries next + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -vE '^[^|]*/lib/(libsys|libc|libthr)\.so\.[0-9]+\|' | grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 From nobody Tue Sep 30 15:37:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhy46ty7z69FgN; Tue, 30 Sep 2025 15:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhy44X46z3TsT; Tue, 30 Sep 2025 15:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7FJBEYPg2b7e4Sc7OgjD73OtYMa/Un9yO4yZ/NNilzE=; b=hi4E0JM4SX1aTB/KJeL04BRNlxtn1TmuRYn2rqh8Im+yWAq4cZyDUIr9I3MgUfPQ+xb/qD i4VOpKZbMFFOp58bM84g+nwyvlvnBYWrdCc0qVTmtPhVBPDDqTsmfzNJYtGUeMkqB0vC6a xI27Y+pFu7LYwTW4IaUlu6sUe5pfmKUvTyQWChVG/BQgASr2c8ExQhXixEUXXjLT+aFock 2cr0jba2wzvtPfSS+GkbKUx1nUNcwVv492IP1XWtymj4MQPKmBHWntOahmx5fGOywmIqDh 17ceKbjIsNfW8ZotzEO65dhCdifEvrkUTxZ+FD2cRaMqNiI4sLtDdwsxw7H0XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7FJBEYPg2b7e4Sc7OgjD73OtYMa/Un9yO4yZ/NNilzE=; b=k7u29eXIHRjMEyLgEpOAcoRCf4dBuW6OiqxjQDo4vUf5f8Om58Hcs49mY5BKAOegWr20Te rPckk3GGirF1e3UV/Hb1s6rX/dN64iAsZKtW20w8WLbxP3VCI6k9ICPQaeRWXN+Z8/TTyj YE4siUE+zFn0d/vZo8hSsBsTXWZg3ZS6a4WGzJTPsUGvZttQ6IsEHsD8YzSHBjH+3blD3j GF+WpnX8kyNfBcBq0n7Eg85ulzdSisb5K2ITRU/HNuEpcMok9Y3Znl3iuZ6uRJ0VgT6KCs uU4BMXwVcEa2GebJtjBEFaPu8Po0l00IEylY4ypKGjA/oPdIpRIY5L64ccG79g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246636; a=rsa-sha256; cv=none; b=FqZ0nNzmV/DaYt1FYlmpfBwO3StBERT5wPgphy2aqnHZBRjrX8y1fN2UXf3qZqePQcmJ3Y UbixAPSsYU+JzaxZi5UgtAQEzcGDslTCEFCPyMdNCyJNG+9MGagGDr+riJIRk0FigCqHxA amn04NeGXz+9+47W+hq/fTep34u/lFvKsjR1i2g/LoHA7smVQMGTKXICJE9Gg9fqXRWFh9 r73bjel8JafTf6aXt1R9yC0Uqob1I0Mk8nQIA/VZ9ae8AY2HNLQA07pY6aAC3oRVxQkSrV QakndwDv5SMc2DKnQP42WzljgJO4QC4HDwH735+KuhSfa5+ZSq+g83xhzAeeWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhy446hczjgw; Tue, 30 Sep 2025 15:37: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 58UFbGVf067546; Tue, 30 Sep 2025 15:37:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbGgk067543; Tue, 30 Sep 2025 15:37:16 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:16 GMT Message-Id: <202509301537.58UFbGgk067543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 75d258af9fe9 - releng/14.3 - Fix multiple security issues in OpenSSL. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 75d258af9fe98e79ead9c54d7f15b30f970155a7 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=75d258af9fe98e79ead9c54d7f15b30f970155a7 commit 75d258af9fe98e79ead9c54d7f15b30f970155a7 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:27:08 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:31:43 +0000 Fix multiple security issues in OpenSSL. Out-of-bounds read & write in RFC 3211 KEK Unwrap (CVE-2025-9230) Out-of-bounds read in HTTP client no_proxy handling (CVE-2025-9232) Obtained from: OpenSSL Approved by: so Security: FreeBSD-SA-25:08.openssl Security: CVE-2025-9230 Security: CVE-2025-9232 (cherry picked from commit 270158508d7c55a0737c2a9915cd4afc8fabdaf0) --- crypto/openssl/crypto/cms/cms_pwri.c | 2 +- crypto/openssl/crypto/http/http_lib.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c index 2373092bed55..6b507c3f0176 100644 --- a/crypto/openssl/crypto/cms/cms_pwri.c +++ b/crypto/openssl/crypto/cms/cms_pwri.c @@ -228,7 +228,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen, /* Check byte failure */ goto err; } - if (inlen < (size_t)(tmp[0] - 4)) { + if (inlen < 4 + (size_t)tmp[0]) { /* Invalid length value */ goto err; } diff --git a/crypto/openssl/crypto/http/http_lib.c b/crypto/openssl/crypto/http/http_lib.c index 9c41f57541d7..614fd200b7c0 100644 --- a/crypto/openssl/crypto/http/http_lib.c +++ b/crypto/openssl/crypto/http/http_lib.c @@ -267,6 +267,7 @@ static int use_proxy(const char *no_proxy, const char *server) /* strip leading '[' and trailing ']' from escaped IPv6 address */ sl -= 2; strncpy(host, server + 1, sl); + host[sl] = '\0'; server = host; } From nobody Tue Sep 30 15:37:17 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhy64VV9z69FDP; Tue, 30 Sep 2025 15:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhy55nhwz3TVY; Tue, 30 Sep 2025 15:37:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94KnUecRM5R+IF7/Qt/w6lspG+ME6Md9hNLAItgj0hI=; b=W4MPo+57gFKNkEHsUNwuKTa/GUWiQ9mMNY9zy6P1TfvhvWLWOOmIiVH/d1psLLjIC6Nf7c mYc181x86rwBw3ebRDYDTzIMtkU3aeFI3GGgP0ukGcnZ74NQLK6oYnqz4Sw71sa5vZl8ZW j2uc4FS6T7E+9d8I/aYUS887Tzgl8yysrW4nYt2o9fVfR95WcebOG/QwNrTs3ovzD8osPX RDIm3vqH0SvlWCEUREE4BdpibSXwXpnEiO7ppR3pKGqna7lfss8Ehv1rUQ6cZA84RnqY+z aOrqwgfueROHP+U0ho4EmZHIsiZ9CYut7N2eT3yWbffgz+oAMoDAG06cSItp1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94KnUecRM5R+IF7/Qt/w6lspG+ME6Md9hNLAItgj0hI=; b=VBPkDoO8CSIIxlwidtwLAtVEpDECTRNnuvzDHuTL8C9T+ylpAvt0Fqwz4Y8xgBtbfd+Mgg /HH6HpuWwcbRJBRoQs5ZyLdpbylFeFLhVzwV/gO/IUsm5JfbGWDOPs5ecDW6jo37WW1+vX gOfGB6CjU/ACVPGAhGWkOIDXhqCnPcMOFFGaYg3Wux1zoZOLTQZSolzcP4aHkrELoT0fYR 54VMP7uoB6hjg+l009ckyZoRJzLNiaC8S8UzB/Y++W5KB6DXCpr0xS+uhP63YShf0LD23g 9NENALMCS8eLHjzNYQIqqU3YTLaZ6aYhZlx2BxG5KGlwabHuoS2U2uvhg+4qEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246637; a=rsa-sha256; cv=none; b=mzMfKW4pWNO8OoWvoeBAkyZXJ8iYOKy9aWWUhaR6JdtPnQ12VjKlCWe65TJpNfiGvyhbWt WxZc8myiGrKMIngqjj2iDBE93IlhLG1Ng8OYMgkqFIImNBFuK2SyV2vlP64BbAg5JzMqs+ ms5GIdw8OXEqYBP6A6VVM1cpgwJuMnIXsuIbQDpFir2rPjGpbbDx61bHVhVmmbGOLNYikU UFGSmXNpG3SpcKtJHaUTeSt4eRDyP1Ab2tg3ejZHd9GIcQQ7oYfxEzMF48w1A/DnoNl5BK jG1KwBu1qdQF/aWU1tQ7sJLXsA4+7VvtPjsmkayOsM2QgirckoNXtfS6d3JrVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhy555Z7zjwV; Tue, 30 Sep 2025 15:37: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 58UFbH2O067578; Tue, 30 Sep 2025 15:37:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbHac067575; Tue, 30 Sep 2025 15:37:17 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:17 GMT Message-Id: <202509301537.58UFbHac067575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 7f1785f09fb2 - releng/14.3 - Add UPDATING entries and bump version. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 7f1785f09fb2a35290c45bcc604b5c0ad1b25b99 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=7f1785f09fb2a35290c45bcc604b5c0ad1b25b99 commit 7f1785f09fb2a35290c45bcc604b5c0ad1b25b99 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:35:49 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:35:49 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 8 ++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index f118e838c926..9987252e8b2c 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,14 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250930: + 14.3-RELEASE-p4 EN-25:18.freebsd-update + SA-25:08.openssl + + Fix freebsd-update(8) installing libraries in incorrect order. [EN-25:18.freebsd-update] + + Fix multiple vulnerabilities in OpenSSL. [SA-25:08.openssl] + 20250916: 14.3-RELEASE-p3 EN-25:15.arm64 EN-25:16.vfs diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 59e359d9f452..8cc1fac788e5 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.3" -BRANCH="RELEASE-p3" +BRANCH="RELEASE-p4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Sep 30 15:37:24 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhyD6Q8Zz69FS1; Tue, 30 Sep 2025 15:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhyD5Gp2z3TxV; Tue, 30 Sep 2025 15:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M8EEOiBbySc0BscJUbX1Ryo2bS49IZDvEEQ6J1Qpv5o=; b=mSpQcdU48o6K+O/aOiYSK2zSqp7S3q5NezbXGNCkdg6kSeQfhulJUh4yQIyiXgPmfSRjUG eTQJHW0v3uUxYZMVV3ogEJ1uCMhkrIgThKgUVrL9bnM+Y9RBCcSfm9Kent3HiDNYXxAWw7 jcBJiZnwy1PDcVX445vTixiUSN+zeD167zDK00hIRuUwUqDndnr6VzShBeWGFWs/Nx38CV Bgh0KzVneH4P1utKBD1qgEBnyf9qU6A7Cmij9H6hHim/iaXjsqKM+6awFhBMfxrI0M1V+B GXejY31L3yVlOYwuzUuVsxVsWfiCtA98RKGEqKStyNqXfgX4Apanm6F7EIPSCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M8EEOiBbySc0BscJUbX1Ryo2bS49IZDvEEQ6J1Qpv5o=; b=svZEL60NUoj1d1PX+8iUB76TUDec2axIBYfmb0Spe0WymJnsB9w+53tDJi0xMyn7VkZiUn Pb1P2V0mqM9WYgrqdH6X2SYi6blXCrmif6VbyjR5xDZTeyPXt5u6wlhQeMXaRXGZQG104Z vUPG7anc1yeU/DIFQgUC+VcTK+iUBVsXiGIcy7nNFQJHXPVGabcrp6hqjWhD5hLzJGPUht 64Ix1iNMd/HlGLW8C3bFsQ3A264HgufI/V7CC2aYes5g/5uTMXerKEwEsF/pHWUG6H3Lv7 ofR/mKhVhVVVgbL5lXtcrlvKroZpRKpmAB/m/hME3UBOKAbYkQ7XzeRTQVLgRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246644; a=rsa-sha256; cv=none; b=l4ci+L6Hqpvo57B55ni+oKTmketWHiUUfjVTu+RzW7Lhmi2zluovgtbewFB/xrt/tWjGR+ 0yRFDlcB2UFV8pV1L0MsR/p7eXX2uyq4pF9MaRLkvi9ItaF8xDw4cS9vgjXUalIvj1YvZq l5eA80T6u9eeU7e7kokxN0hCjCidIkZRVVwq7AjWZcHxBfpB0hSSQSH7lu5i2nAhhMw5Hq Bcl7sDgZBNht00cIIdBXs4jbOoJYG5baBc/rR84emjvWbgb+/pjezZbb+6zVYEA7WH8iAh cGLIMICFX5NQBjdGDZEu9LTxghV41Chd+WeJbdfiE93KxvqElW40NsfBNQtE+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhyD4Vg6zjkJ; Tue, 30 Sep 2025 15:37: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 58UFbOaS067754; Tue, 30 Sep 2025 15:37:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbOhg067751; Tue, 30 Sep 2025 15:37:24 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:24 GMT Message-Id: <202509301537.58UFbOhg067751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 3447fea3523b - releng/14.2 - freebsd-update: Library ordering List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 3447fea3523b56a235b9f8fe9234893f00795379 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=3447fea3523b56a235b9f8fe9234893f00795379 commit 3447fea3523b56a235b9f8fe9234893f00795379 Author: Colin Percival AuthorDate: 2025-09-23 06:55:08 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 04:58:01 +0000 freebsd-update: Library ordering Upgrading from 14.x to 15.x with freebsd-update broke because libc depends on the new libsys library; freebsd-update installed the new libc before creating libsys, and every step after that failed because all the tools (including gunzip and install) are dynamically linked and need a working libc. Enforce ordering when installing shared objects: First libsys, then libc, then libthr, and then all the rest of the shared object files. This is a candidate for an Errata Notice since the issue this fixes breaks upgrades. PR: 289769 Reported by: Graham Perrin Reviewed by: kib MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D52688 Approved by: so Security: FreeBSD-EN-25:18.freebsd-update (cherry picked from commit 7ece602e00e85195fc426a2401c49921cd39735e) (cherry picked from commit e26928669f39c8683aea74040b9e2472e944c43a) --- usr.sbin/freebsd-update/freebsd-update.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 77b12a3756c2..cc462c6c921e 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3043,10 +3043,28 @@ Kernel updates have been installed. Please reboot and run grep -E '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 - # Install new shared libraries next + # Next, in order, libsys, libc, and libthr. grep -vE '^/boot/' $1/INDEX-NEW | grep -vE '^[^|]+\|d\|' | grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libsys\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libc\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libthr\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + + # Install the rest of the shared libraries next + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -vE '^[^|]*/lib/(libsys|libc|libthr)\.so\.[0-9]+\|' | grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 From nobody Tue Sep 30 15:37:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhyG0zrwz69Fd5; Tue, 30 Sep 2025 15:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhyF5DVxz3V5c; Tue, 30 Sep 2025 15:37:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zUQeZtlpRUgwGLm6LFcLD2oeGBw9wfaYVeUvUntBviQ=; b=aRv7zB1eG9pI/j9AkspjF2BFqCqR+X2yNOZ4ee1bQdVdKteVJVTpAjr/z/A/NYsBsDCucF 6Bk1s46nhT0IzwMSejuQC+WDBWx2Q2ctZBfEMOYR9oztFOMEoz3+04qE9SnVyS74AWopH4 s0LDPw2LxKqr468HtEmqETLYM3DLaWZ/q8GNOWZBaKk+oBsGIsX0ewpGX38KM4bsnPpHy+ Y88S0tPsrKJFfmAyP1BdTE+9g1oebqJMoiarTrZs7cd0p0jJ9o6jW2w+FXXSoYKBzMKmMd law+qP1B+I2ZkJNP84ss888AjeRtVgQTh5XfXv+asI/2dfA/Hrg1eHtgqgppMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zUQeZtlpRUgwGLm6LFcLD2oeGBw9wfaYVeUvUntBviQ=; b=oF1zDsguzDKxO7wnjg0iF9P4b3CWsUgrAt2JfRykvUIQC5BNqEk9k2JkE+SHipOfHDnZOG h/RKp5UpLuylaz5qzcYnOwQH4r4mP9tjUO/zuWD3s4S+RTcPWRJ4Vt/7VKHt0jOqvmLBj2 2KGJ0+Ja5RS9f5sc6M26gE+StBiwXryMTh3DQl+9lj4V3AJk/E7bb3nooyHg6FXMyEf2HP tXU+BCV45pvhOL81Vn8uWSRhWY+9kvNAou5s6BddnmarovSnqYNjGPupGpnAAUeKr+d6f/ 69Ej9pkstxXc9EuE+Ju+SQM5Qz7T6WeZFaSPrbw+pyxr88fC93itiZTmwPhhwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246645; a=rsa-sha256; cv=none; b=yk07uAZmFLW2OlZDSEkK6B3gsxJfyO9UtsNRRGRr9X+SxFDIRI3khzTcua57yjjIMK+OUY Cf+QOLvhpph8tOFDiP/1UmJkRhJBUpNxfIOVqNbnB7v67dP3vYLuJgND6uHcj5QjZUL8hH lbkm54Y5Xq1vWToudffWcnK/qNyGYfHOBIQqFQuTVgeevNBTr5AYdoVHif67hcJ79sP4le qFVdbLRgpg/JEhTRyh6ktzR4Oiym23F6y1lfcpKR/MwLfWS76D3YEvaHmjDtK1mkV0lzI3 9ucJ1KOmBG5vMXJYFFuzQfUvsU56ABFqs5ycx82dSvxEhNVeJ+1vSHJJ4074XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhyF4lvczjkK; Tue, 30 Sep 2025 15:37: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 58UFbPwE067795; Tue, 30 Sep 2025 15:37:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbPix067793; Tue, 30 Sep 2025 15:37:25 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:25 GMT Message-Id: <202509301537.58UFbPix067793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 6a0d914d9c3e - releng/14.2 - Fix multiple security issues in OpenSSL. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 6a0d914d9c3ebd8c150b7f90e79616d16efefee8 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=6a0d914d9c3ebd8c150b7f90e79616d16efefee8 commit 6a0d914d9c3ebd8c150b7f90e79616d16efefee8 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:27:08 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:31:54 +0000 Fix multiple security issues in OpenSSL. Out-of-bounds read & write in RFC 3211 KEK Unwrap (CVE-2025-9230) Out-of-bounds read in HTTP client no_proxy handling (CVE-2025-9232) Obtained from: OpenSSL Approved by: so Security: FreeBSD-SA-25:08.openssl Security: CVE-2025-9230 Security: CVE-2025-9232 (cherry picked from commit 270158508d7c55a0737c2a9915cd4afc8fabdaf0) --- crypto/openssl/crypto/cms/cms_pwri.c | 2 +- crypto/openssl/crypto/http/http_lib.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c index 2373092bed55..6b507c3f0176 100644 --- a/crypto/openssl/crypto/cms/cms_pwri.c +++ b/crypto/openssl/crypto/cms/cms_pwri.c @@ -228,7 +228,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen, /* Check byte failure */ goto err; } - if (inlen < (size_t)(tmp[0] - 4)) { + if (inlen < 4 + (size_t)tmp[0]) { /* Invalid length value */ goto err; } diff --git a/crypto/openssl/crypto/http/http_lib.c b/crypto/openssl/crypto/http/http_lib.c index 9c41f57541d7..614fd200b7c0 100644 --- a/crypto/openssl/crypto/http/http_lib.c +++ b/crypto/openssl/crypto/http/http_lib.c @@ -267,6 +267,7 @@ static int use_proxy(const char *no_proxy, const char *server) /* strip leading '[' and trailing ']' from escaped IPv6 address */ sl -= 2; strncpy(host, server + 1, sl); + host[sl] = '\0'; server = host; } From nobody Tue Sep 30 15:37:26 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhyH1xCzz69FDV; Tue, 30 Sep 2025 15:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhyG6YRrz3Txm; Tue, 30 Sep 2025 15:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5zDW7MPMWMaP4neY9P0WpuBvuEtomFDztwMhKt7JPSM=; b=hlHW34HNDpiVFcJNlLIBEppCC/tVWGzO6nxoJcN6uSr6jUbLgJdh+UwRgM3AU8YIzHnpsD F2kBBhZaD+1B/eIVAH9kjmjev+6PIWviIJmx1R49GeOghdW2VdJLrNoHIMi+0SN7TIuTkb HTcON1nFzEuKXv/CU+Ey3BR8pAa00TwyUQfXLPZGhaXx2B3RfXaBNVZ6sUdOLwX2DkKh8c UtM13VSVAxulUt5CxetrsqUJx/W05PPGvH1wyBYZ1dMOA72H6SlmfpwOnqHOd/xZTHhOSf onx4UfPir8aD6VSgcS6hUYFj0/Ewk1zNdPzlcgm0MCAG9ZGFey8CMdwhxaErUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5zDW7MPMWMaP4neY9P0WpuBvuEtomFDztwMhKt7JPSM=; b=g3Hklurf+40HixopzR/xvCWCJ/zF1z3elmV12a8tlCcRWjTp8mB45Js+20d3MVA/oh0cGU Lxi3T6EGNDcf5RbxfPaZaUETq2wp3AWpsHiVifsB36/sjZJKALZBEwfMa1Fv4OFA7096i7 yO+iVWcf2kyW/Ixu/RvRHSGpCGXEOjcTK0xHvzLPsRgorTK+Kb/LQY1mm8Yn3W6qf0DSwT 286XVfAdv3drjldvjLHj6mM6psbiFcAfn844Gth9UkaPRR6+vInAkHihqgdcByrwOd50bo Qex6PSsCy+utVOQQVwzcaQxmG9Gh6PQfcLaPr9wPLAiO3R1Mvz+cq5IPkmDu+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246646; a=rsa-sha256; cv=none; b=RGNymIlhJlFEOy0uaU04QFl0tUjHrbepvA7W3kXyIZIwX+LpcBAiYH55Vb47W8WTp3Omin 2JTBlsqouXZCkizjXmA6+IZ9l8TtC1nENeIQXb7RJwm5E0WuGeypHtUdg95pd0/75us1UM QobYRFv0BSOtzuJZM9s/HgvYCHDaJbNiUaXhk6htdVZznBVti2DOSbrohjdQykp87XzioE Bz3YvVyzArAMmT3dhYgsc7L0viT2lbs3Lkbxr+fQGd1TbfNsDT23zRMEGo3Q+Ksf9/XDkk mj1wSM/HlZaXUH/nDkMnQ19y3y0jB4S//2ws+5rjSFVM9u9t35xMigOGwcay3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhyG618yzjkL; Tue, 30 Sep 2025 15:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UFbQGi067828; Tue, 30 Sep 2025 15:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbQ68067825; Tue, 30 Sep 2025 15:37:26 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:26 GMT Message-Id: <202509301537.58UFbQ68067825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 16a79708d089 - releng/14.2 - Add UPDATING entries and bump version. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: 16a79708d089423ec0c3d32f25e7ca97ae58e97b Auto-Submitted: auto-generated The branch releng/14.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=16a79708d089423ec0c3d32f25e7ca97ae58e97b commit 16a79708d089423ec0c3d32f25e7ca97ae58e97b Author: Gordon Tetlow AuthorDate: 2025-09-30 15:36:37 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:36:37 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 8 ++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 5bf203683480..ae6814d10461 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,14 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250930: + 14.2-RELEASE-p7 EN-25:18.freebsd-update + SA-25:08.openssl + + Fix freebsd-update(8) installing libraries in incorrect order. [EN-25:18.freebsd-update] + + Fix multiple vulnerabilities in OpenSSL. [SA-25:08.openssl] + 20250916: 14.2-RELEASE-p6 EN-25:15.arm64 diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 18bd593fa59f..abeca4e36593 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.2" -BRANCH="RELEASE-p6" +BRANCH="RELEASE-p7" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Sep 30 15:37:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhyR10Bdz69FJ9; Tue, 30 Sep 2025 15:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhyQ6P5bz3Vbw; Tue, 30 Sep 2025 15:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9LAon8fbCStbWdlLg6SnCggMmp9L1LWJRh1SA50hDM=; b=F399KklY0VZEDALxXQ5L1Wm4ydU6MF35YLyV9HZsyjxmSAg/eop8u8SxwMNMxFMNfpxa4O D68dCQN2Lpce9D//fkIfWAtECD5/0cAdyCE1XZyL4hChEG4X9U8MgpnWcXSxaqms77S9/E I3lZIh3lD0d6c2ePf3uijptCQLkrCQkbe/R0F+gxpAcGUFSopMKIRW+jmREs9CNu3UcogS 2lSh2uU/CoNaqgH8uLZ4TzeHf33t8JgZJbdWd0+a97rbOUQZRHttueA9OjEVKXEgyAVuG2 5K6vC/n4G261SCkifyV5c7p/XkMdK5OfjTmeXdIsvCMZCcka1LFbYk39TWWf0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E9LAon8fbCStbWdlLg6SnCggMmp9L1LWJRh1SA50hDM=; b=rJqzmrLruzQmi1BvWNwiVGYtwqrR4LPzGg84+bqKJrAKwJnXlltWz+GtG8FDItwXzPRa0e Blq7bXXY83Vh+KA/tU4izIYWXwghDHM4fKRjMlbyyIjOymKl5ZhPNMKLPCM5wx2h1Y1PXj O02A6VBPCZRn+owFe7A0P6qnszCB+RCOREYoe/Xt933kQBHGiLNWrR+HkY97eqPO7iyha8 tfRrK5FD06q7qSUSM725CaRCDssWjxjccZH32Jm7lKIneqLhZjifKrRsHDfT+OPuQhvrFS ox6tXmixNz0GXagO6SQ0e2y+YmGmfu5W29Mv4Y1E7QpntkN7lMv/bCBn/c39cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246654; a=rsa-sha256; cv=none; b=G7y1FS76NRdQTEAtDaz2cxUCbiKW96R6qjllVJ7wl4UN/VGTeMvW2rvVXxTcTcfKz4g8VC b6h2i91gYxBGG9qir0A6pp2oHtA+td3pe7mSD8DCoOGw50RYB282+yZWErYaHqmxtD5Qyd ODtfPI9YTwJJYj2DyFdDaziZKTbhJKYIJ8brsgzy0isx6RXplHSTUmpwdQTJYJIB/2vGgm QSjajL2RYOF1iCgeQU0HjE26hYAU+8FvDtQLZUDbr1n/BKn7621WfGVgyGqfT/HfQysATY OeqrsTyDymw9LpSs1DYFG++RkKp0kKM/YZwfBfqvfedBoFKnfl+qJkw2y3YkZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhyQ5f5JzjkN; Tue, 30 Sep 2025 15:37: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 58UFbYAP068008; Tue, 30 Sep 2025 15:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbYP4068005; Tue, 30 Sep 2025 15:37:34 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:34 GMT Message-Id: <202509301537.58UFbYP4068005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: ab91dd76ff72 - releng/13.5 - freebsd-update: Library ordering List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: ab91dd76ff72707d992cc54d2ebe1e424689d9cb Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=ab91dd76ff72707d992cc54d2ebe1e424689d9cb commit ab91dd76ff72707d992cc54d2ebe1e424689d9cb Author: Colin Percival AuthorDate: 2025-09-23 06:55:08 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 04:58:26 +0000 freebsd-update: Library ordering Upgrading from 14.x to 15.x with freebsd-update broke because libc depends on the new libsys library; freebsd-update installed the new libc before creating libsys, and every step after that failed because all the tools (including gunzip and install) are dynamically linked and need a working libc. Enforce ordering when installing shared objects: First libsys, then libc, then libthr, and then all the rest of the shared object files. This is a candidate for an Errata Notice since the issue this fixes breaks upgrades. PR: 289769 Reported by: Graham Perrin Reviewed by: kib MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D52688 Approved by: so Security: FreeBSD-EN-25:18.freebsd-update (cherry picked from commit 7ece602e00e85195fc426a2401c49921cd39735e) (cherry picked from commit 87eb52f1b061989a948d3eb08953c81a4e1281f0) --- usr.sbin/freebsd-update/freebsd-update.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 4a6a8d78330b..ead3b975a78e 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -3043,10 +3043,28 @@ Kernel updates have been installed. Please reboot and run grep -E '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 - # Install new shared libraries next + # Next, in order, libsys, libc, and libthr. grep -vE '^/boot/' $1/INDEX-NEW | grep -vE '^[^|]+\|d\|' | grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libsys\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libc\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -E '^[^|]*/lib/libthr\.so\.[0-9]+\|' > INDEX-NEW + install_from_index INDEX-NEW || return 1 + + # Install the rest of the shared libraries next + grep -vE '^/boot/' $1/INDEX-NEW | + grep -vE '^[^|]+\|d\|' | + grep -vE '^/libexec/ld-elf[^|]*\.so\.[0-9]+\|' | + grep -vE '^[^|]*/lib/(libsys|libc|libthr)\.so\.[0-9]+\|' | grep -E '^[^|]*/lib/[^|]*\.so\.[0-9]+\|' > INDEX-NEW install_from_index INDEX-NEW || return 1 From nobody Tue Sep 30 15:37:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhyS31hwz69FJB; Tue, 30 Sep 2025 15:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhyS05b6z3VZJ; Tue, 30 Sep 2025 15:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W/Gvh5N6AKe7pPM11PqGhg81KA8HhNQpCpxJCwVb01g=; b=cIRuFaYrz9sGQ2NnL6D1lOcXRx6SykDv/gWnaQCUuD/rlh8tsrKfJ7cueytske4dUIpWNv Rl2oHnHiCqWkDCE91yjyy3bARnAeR0qafzScItQTFL7NFSNWQEyysAOXKTP5peR97ymnVR 7nM5j4mUf3jA7Hz1L/P/CgcV8OXP35N/ItzS/JQwTaLQk+NIRsilYqb0rbYMYRRkJpYG7z 0N+K3aEvROrg1k6G06DzAeOJM+JJIszAgz0ZHqdm3wSXBY3dJZzP+wbv7Z5Il0NCUAx/oY 3Ot2qFOx1BGDmg6bCuTGL4y1/wJ7Rm7+RyQ0mFV3UiNoP6jSojGkAP3YFJRFXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W/Gvh5N6AKe7pPM11PqGhg81KA8HhNQpCpxJCwVb01g=; b=BxkQI3B+WEFjy5iFYIIVZKMAzZhjO0STp2FB36IUmENQe5NGM6KpnBMf5w9TmEAmfNUG9x t8QmvJjb/QCokgeB0I4hZvFy325+ib1f9FNVYyh5gcpObT+Vo76uejPZY+zZKKEkvMmXfy u9Id7KHki/j1V/jF4Z5pXw9xKIYFE9nMZSERndE/PoaTxRXYQp9zQafwZM57MGnIbSSKQS Ph/07pbTc9e7fHuGunzsDTxkMOtxxd4w9StOX3vYi7MjnFV1ziBE2zKayDLp+fHO/XmeoU L1FcLer6J48iUApmHrDLkrRZPlRXqRHQeSb3NFJ1LuSz1zYv8oIbdPK9cspeug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246656; a=rsa-sha256; cv=none; b=ZE1DB21NWqwr3umPXWmKZEr1mBI2itG0V9DXX3h+SZooGpPp0U1xFXmJXYBt0AwBK/G/Ph sAi4lvzYc/vHoVU5oqASlTXfss8Wzxg1ooYL7ck+bTmm76NddwlBs9qnAafxkzyUc4EXKv 9Cjcy6FzVbtS2s3v4Xvbqj+F7ZJ80UYFL9JFEs/LnFK0usQA0GEArhVPkbozA7bztuex+U 79yKCX7pdLehXaBw9GWh88zbYjuzQTnehCTbILpne1r+SgpxYMqrq5eAyus5sH+bayhNPK O4JJmZChsMQZhGmuwNacy2latHkocw4xNLvWHZqGSI/D5xdNuOGvtpThQw0Fdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhyR6q1QzjkP; Tue, 30 Sep 2025 15:37: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 58UFbZHA068045; Tue, 30 Sep 2025 15:37:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbZTL068040; Tue, 30 Sep 2025 15:37:35 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:35 GMT Message-Id: <202509301537.58UFbZTL068040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: ae7c74cfa531 - releng/13.5 - Fix issue from OpenSSL. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: ae7c74cfa5315e590cf7ef6fe8fe5e72330597e9 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=ae7c74cfa5315e590cf7ef6fe8fe5e72330597e9 commit ae7c74cfa5315e590cf7ef6fe8fe5e72330597e9 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:28:59 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:32:35 +0000 Fix issue from OpenSSL. Out-of-bounds read & write in RFC 3211 KEK Unwrap (CVE-2025-9230) Obtained from: OpenSSL Approved by: so Security: FreeBSD-SA-25:08.openssl Security: CVE-2025-9230 (cherry picked from commit c0dbaf2b5dbd16c113a6346ee748fd474fe192e5) --- crypto/openssl/crypto/cms/cms_pwri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c index d7414883396c..9f98840244ea 100644 --- a/crypto/openssl/crypto/cms/cms_pwri.c +++ b/crypto/openssl/crypto/cms/cms_pwri.c @@ -215,7 +215,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen, /* Check byte failure */ goto err; } - if (inlen < (size_t)(tmp[0] - 4)) { + if (inlen < 4 + (size_t)tmp[0]) { /* Invalid length value */ goto err; } From nobody Tue Sep 30 15:37:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbhyT4JwZz69Fjp; Tue, 30 Sep 2025 15:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbhyT0JYXz3VPg; Tue, 30 Sep 2025 15:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EE/EKUpjsRZutlbdd/m5C7S7+ynyM/ZfqIFUzG8t98o=; b=Heat14gRdx9uoOuLWBEEfEtrSZCYwfBpck+kXJms5G7eUoNItFtSd3CyXPi6eDRnC0VQUd bc7JC/8bHZnI9i0S0vpaGVkR9B2EymQ2ST2GlqMouCXn2dZg4wlleMnH/RfwcFZ6fGoiYk fvBubKe2ZFd1CvI9x2MZDYF2E14Ze6MF/cSO+HsbjU+ylNiwlyiY1xQttVMNOpOUIUrFKX UH6LxT7FrLPb4SZ41W+Sf8fE9yDkJr0S1PrgSisotrYYngkqkI4nQvRF8Y0cYC1uNspsEq uI02MBi5Ga+enL3qMr782qDTGigGsWbA2DGHSZTmOQPCHP0QZ0PmRhr1MfXjrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759246657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EE/EKUpjsRZutlbdd/m5C7S7+ynyM/ZfqIFUzG8t98o=; b=ta+nXco68vH7StTXic6JmTYThUewfTZszL9Lp2BpHca/7crtAI2lk/up9sZPvkSy4E9K13 /1H9PqJu74Ozu40aVy5jXfT0cXgOV3w+pCT5oVlII93gsXmMkq1wKOPb7Pjsl1AoufiTII ssEnMZsHSEpfS1c+gIdcns63910sHJ7nyTqJ4CM4QNKEN1Lzd/B9Dkxz9XmudrsFcGf/AJ zZjKox/WTTR1hoafFwzrSmi3bSu6tsnAlhdxqZUW2sevIT7iDmDfCfUGQYAyaIcshswgzX /1gAoLtL1TdP38v1afDQwfIeUF3y2oRl0JKb/LfBJJgG/cjDL1buSt+7L96D8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759246657; a=rsa-sha256; cv=none; b=ewkRg0ACfUnHepY6z8ekEubShSbqdG50VvirLg2Al51zxIMBsUkMJ7Qu84xDPN0Fi3aix4 laxP3+76nMayEOIf3jwkTi+jG9uFUFqGAHeL9Y1Sa5fwBjfNppbomxTPPNJLI6QCTbbCb5 EkRnugTsiV7+BTqQMgLtejJaWCLsTTDDEV7RVF+FQbBNCGwFsTEk8YOSHLyQasw17LlSFr UZVcq9cqv3KLvayxq6Ik5DwvrWJX9tqbd2Hgn4KSMkB4UqeMT9EXyYDwZRmUn5MIQNPZ/C jPWSo4YaEwUMaQCrl5BNXxV3klToyUjp0TgfR42bEyc0orB3Nmk+ha4072b/Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbhyS71VfzjWH; Tue, 30 Sep 2025 15:37: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 58UFbaqc068086; Tue, 30 Sep 2025 15:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UFbaBr068083; Tue, 30 Sep 2025 15:37:36 GMT (envelope-from git) Date: Tue, 30 Sep 2025 15:37:36 GMT Message-Id: <202509301537.58UFbaBr068083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: c106ed332507 - releng/13.5 - Add UPDATING entries and bump version. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.5 X-Git-Reftype: branch X-Git-Commit: c106ed3325076a75e8aabaa78c60c6c5d0e69c65 Auto-Submitted: auto-generated The branch releng/13.5 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c106ed3325076a75e8aabaa78c60c6c5d0e69c65 commit c106ed3325076a75e8aabaa78c60c6c5d0e69c65 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:36:55 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:36:55 +0000 Add UPDATING entries and bump version. Approved by: so --- UPDATING | 8 ++++++++ sys/conf/newvers.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 741ccf307151..e74c2509c715 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,14 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250930: + 13.5-RELEASE-p5 EN-25:18.freebsd-update + SA-25:08.openssl + + Fix freebsd-update(8) installing libraries in incorrect order. [EN-25:18.freebsd-update] + + Fix multiple vulnerabilities in OpenSSL. [SA-25:08.openssl] + 20250916: 13.5-RELEASE-p4 EN-25:15.arm64 diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 82dd69582b28..57b4721a1bfa 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.5" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Sep 30 16:58:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbkmB2jm8z69LmX; Tue, 30 Sep 2025 16:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbkmB0qTkz45qn; Tue, 30 Sep 2025 16:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759251530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDw1C4NPrHOpdVWY90wV2zSGWDRMNS19MlW46Wlw6yE=; b=xD6uUs49Xe2QnLIiv43cnRWMch+ZAarlTyxG/d3zqKnJBLPhus0H3zFwuAhfzRjdCT/OG4 UEuvyLeeEacNV8WMZArsUwF4eavrM3bIgLtmUvtTvMPrrf9IToiytLyVbrT702QlyPi/Lo fE+mdmH8q/5LZutaTw0oZ6ybGUwUbPVyE/cYwCObr1/B8qUdNIOuwI1RqYTWiGOTQc0VyL 3DZkkxTUTVSkmxrq/5UXbbKPBs0CpI1LniBnUxR9Pd1PmPTXhbdUw0ee5qYg4MmWnFa9Ns UhjSQMAdtjT6nwIjrIPL9vdn0I+hI1iGUc1Yek3pBwuTJzv7NIeEj9XzzuwirQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759251530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VDw1C4NPrHOpdVWY90wV2zSGWDRMNS19MlW46Wlw6yE=; b=tJLysFFTZFXkttEp0nOM7uMazOybE8suklWX8jhmr2uIF6h3MJJHUX6ltU0fzbBuQ19Upv Y2xRTMfTFyQv9OmxPZ3TMf6hWq/mXk09pbX5oAc8PZOxq7UR8fk3nyXRjZPN+16fVWzCzD DP1Ad4t/gIGeyBwd3S39WFEobQlmBXrij0hDUD5NsVTm+CM8bt2/qVPabZjr4Y5TL8TkaV oLoHoUpmz4xIMCoQ2w+oSl6metWh7zZwPsKjDwuf2Ew7coszceZ6+7xtlVawxJMnwxVW6Y hcsYjt7rjiOCjde8icMqGW+MV0PZCmGBd/bvT1z+8aANHvN+0wyKl0aoNYpdOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759251530; a=rsa-sha256; cv=none; b=X3fw5w5fneCEc0jYWDqmA6RAlwXfrGpvSAy/9HrTJWAv1eCnUlVYv1sYXDKpQM54lFctck ILVxREUmrzx6C03Jma/91/HmltXoHJjIMhvW5oIiwtMgSaPzSzRA/METOK3YFBpuD8dZHR exC4jknIgPjrNDSTuCP6FItjNRPtgi3qoLWxkMDP1pgx17R+aRjvCzNIOMY/3dLWNh+s9/ qD3XeeiUvBbpS5Xa/nErC62DEe6SYQi+cDhhOW8zOpMCvEoD3DcVZ9fmsRelMAg9oFnNHT HLgk3B7YJT+zud3Ov3O5CQgvwe1EBp9YGRNQpfD86uSnLxJXMgp3sXsVO0IuyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbkmB0P2Dzm3D; Tue, 30 Sep 2025 16:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58UGwnVW018762; Tue, 30 Sep 2025 16:58:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UGwnaQ018759; Tue, 30 Sep 2025 16:58:49 GMT (envelope-from git) Date: Tue, 30 Sep 2025 16:58:49 GMT Message-Id: <202509301658.58UGwnaQ018759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6f0d113e7ed8 - stable/15 - atf_pytest: fix xfail detection from pytest report List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6f0d113e7ed804a59ef3e9ff1040ea86882a8391 Auto-Submitted: auto-generated The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6f0d113e7ed804a59ef3e9ff1040ea86882a8391 commit 6f0d113e7ed804a59ef3e9ff1040ea86882a8391 Author: Siva Mahadevan AuthorDate: 2025-09-17 20:34:58 +0000 Commit: Ed Maste CommitDate: 2025-09-30 16:58:15 +0000 atf_pytest: fix xfail detection from pytest report The location of the 'wasxfail' attribute was moved from the 'reason' attribute back to the parent 'report'. This fixes an issue where xfails are wrongly reported to ATF as skipped tests. Signed-off-by: Siva Mahadevan Pull-request: https://github.com/freebsd/freebsd-src/pull/1849 Sponsored by: The FreeBSD Foundation (cherry picked from commit df997faca8411bdf8008c25de5db3ed719019d21) --- tests/atf_python/atf_pytest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/atf_python/atf_pytest.py b/tests/atf_python/atf_pytest.py index 19b5f88fa200..02ed502ace67 100644 --- a/tests/atf_python/atf_pytest.py +++ b/tests/atf_python/atf_pytest.py @@ -256,7 +256,7 @@ class ATFHandler(object): # Record failure & override "skipped" state self.set_report_state(test_name, state, reason) elif state == "skipped": - if hasattr(reason, "wasxfail"): + if hasattr(report, "wasxfail"): # xfail() called in the test body state = "expected_failure" else: @@ -264,7 +264,7 @@ class ATFHandler(object): pass self.set_report_state(test_name, state, reason) elif state == "passed": - if hasattr(reason, "wasxfail"): + if hasattr(report, "wasxfail"): # the test was expected to fail but didn't # mark as hard failure state = "failed" From nobody Tue Sep 30 19:25:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbp183wlpz697fF; Tue, 30 Sep 2025 19:25: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbp183BXHz3XHp; Tue, 30 Sep 2025 19:25:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759260316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ylqmgKsgbvdM6wrZbrRNJpwMPhbB3X9G+gN2o3TFma4=; b=a/8RmXVWeuqTCif0yEfnRQFYW5NstsN5dL5ED6xqbupQj/knIJoCjJl3/UF/UE5IW/23SA 79ciicit+C86oCr1ksCvef8+YVdOmpJ7baBwntTPFiuWa/hjCSAe66nylblDUuID1yMrkU A3KQS44NvFsiE6e3jxJ938KmSHH12aMfBBx6OsQBMbNhet26RGyQtNud9TjliMDOeOTHnL yESvs93KfVVbwGaBhNrL4v7Xj6O/ACjFrv9TWBa778w/ZAPL/sr4R2aFDl/+Zi9iSeh3OI CHcBaW4N2Fz8+HIcrhJkJKjGZi9dbV+TvQ89/dj/RSx2Xzq4nq8WFmUA4iYsZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759260316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ylqmgKsgbvdM6wrZbrRNJpwMPhbB3X9G+gN2o3TFma4=; b=OzmPtiXfxOghnCMQNmqjSy0BBzMT2ipCjzEkwZv9zb2PY5QhLnrDK6q5nnZaSokkL9ol7o 9NZ54Clmep6rnFGdbjM0VAufJP4DnbpeoyEoFzUCpbDNC2W1U+VcqzCfUWUXePUHoYaS1n pj9BM3vXurboc2q0s2LqBZGT3eAAGBcCc30UDPcdCEfOcPvktT2z7anwn+7Px3KsdiUECY ves5/JwtmmMzBtApilGgGqL1ME2eDnxN8BWRUjCJO+iAr++SeEikzAEDD/6fnvCih60VtR VgAEAF63dO0oRu+lHNfoE1BO276Y7qPFFOqnJhAdL6XcpumDb2ysUjmQhrCR/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759260316; a=rsa-sha256; cv=none; b=uUklCK/m+XoHyRj+W+pR2YgMq5lJphJm+QecELsS24NubFgOepOkERSo8g8bx/Aqg/F9eL z4eYXH0d5DqCflhLXEWhp+rW2xS2JFoFLsAdjTTo0tWrlHnwJ/sWDlFNZMPQDfngztRC5W Nj5zy7Gw01VtwOfaYAtBv3EiluOu+p+JLZGN1kTz9vW1PSgnYRqVLKC+SCwE7QScawuYCR GefIpuGOP92hjDPkC3g3rPxnmCkToeaABc9wAZ4oO9e0pvwbgfNEB6aBTINj1Mg06E9Q/g tZ3r2NbC14YWxmHrnrBUKvEJnl6SrmEJJDkXUsvAf/gbp4RQqkoXi6H5/PFBxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbp182jQmzqJh; Tue, 30 Sep 2025 19:25: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 58UJPGZ8001586; Tue, 30 Sep 2025 19:25:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UJPGG3001583; Tue, 30 Sep 2025 19:25:16 GMT (envelope-from git) Date: Tue, 30 Sep 2025 19:25:16 GMT Message-Id: <202509301925.58UJPGG3001583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: fd07941961f9 - stable/15 - linuxkpi: Move string_helpers.h to string_choices.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fd07941961f92702d20ff1b99e1e8655153c7db8 Auto-Submitted: auto-generated The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fd07941961f92702d20ff1b99e1e8655153c7db8 commit fd07941961f92702d20ff1b99e1e8655153c7db8 Author: Ed Maste AuthorDate: 2025-09-18 20:46:56 +0000 Commit: Ed Maste CommitDate: 2025-09-30 16:58:15 +0000 linuxkpi: Move string_helpers.h to string_choices.h Chace Linux change fca76071bab2 ("lib/string_helpers: Split out string_choices.h") from v6.5. Everything that we implemented from string_helpers.h has moved, so rename the file, update the include guards, and add a new dummy string_helpers.h that just #includes it. This matches Linux for the functionality that we have. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52606 (cherry picked from commit 4d6d5f5a21abc4abd715c63c0d99c82aaa3955c0) --- .../linuxkpi/common/include/linux/string_choices.h | 71 ++++++++++++++++++++++ .../linuxkpi/common/include/linux/string_helpers.h | 67 ++------------------ 2 files changed, 75 insertions(+), 63 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/string_choices.h b/sys/compat/linuxkpi/common/include/linux/string_choices.h new file mode 100644 index 000000000000..74aa3fd019b2 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/string_choices.h @@ -0,0 +1,71 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Jean-Sébastien Pédron + * + * 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 unmodified, 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. + */ + +#ifndef _LINUXKPI_LINUX_STRING_CHOICES_H_ +#define _LINUXKPI_LINUX_STRING_CHOICES_H_ + +#include + +static inline const char * +str_yes_no(bool value) +{ + if (value) + return "yes"; + else + return "no"; +} + +static inline const char * +str_on_off(bool value) +{ + if (value) + return "on"; + else + return "off"; +} + +static inline const char * +str_enabled_disabled(bool value) +{ + if (value) + return "enabled"; + else + return "disabled"; +} + +static inline const char * +str_enable_disable(bool value) +{ + if (value) + return "enable"; + else + return "disable"; +} + +#define str_disable_enable(_v) str_enable_disable(!(_v)) + +#endif diff --git a/sys/compat/linuxkpi/common/include/linux/string_helpers.h b/sys/compat/linuxkpi/common/include/linux/string_helpers.h index 2c6fe0b1708d..07d113c0cb21 100644 --- a/sys/compat/linuxkpi/common/include/linux/string_helpers.h +++ b/sys/compat/linuxkpi/common/include/linux/string_helpers.h @@ -1,71 +1,12 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2023 Jean-Sébastien Pédron - * - * 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 unmodified, 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. +/* + * Copyright (c) 2025 The FreeBSD Foundation * - * 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. + * SPDX-License-Identifier: BSD-2-Clause */ #ifndef _LINUXKPI_LINUX_STRING_HELPERS_H_ #define _LINUXKPI_LINUX_STRING_HELPERS_H_ -#include - -static inline const char * -str_yes_no(bool value) -{ - if (value) - return "yes"; - else - return "no"; -} - -static inline const char * -str_on_off(bool value) -{ - if (value) - return "on"; - else - return "off"; -} - -static inline const char * -str_enabled_disabled(bool value) -{ - if (value) - return "enabled"; - else - return "disabled"; -} - -static inline const char * -str_enable_disable(bool value) -{ - if (value) - return "enable"; - else - return "disable"; -} - -#define str_disable_enable(_v) str_enable_disable(!(_v)) +#include #endif From nobody Tue Sep 30 19:29:06 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbp5b0VZZz698JV; Tue, 30 Sep 2025 19:29: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbp5Z6w0mz3Xdv; Tue, 30 Sep 2025 19:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759260547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r3wXOvnGAVDwA9bxQ7WYW/1m0lWzs/atKDgJdte7uUU=; b=XcDlL4b3ytShrYpjhVo3/Nt8moGj5Za+/hYwpOB44GJ8WRpaPhYneEfKi+zDL4QjIOjvnQ EHx5m3cExiPmDKDHryfhW9Pz6diw1x8TOLuHfdScOC2UhR/Mk3NL2KzlCxBHD+ysq77Q1c nJVSLHUBqCNKs/DjvogTvA+DM+cMxTFbLU3xxzHjg0o4+xc7Q4IphfYni0APeqsdPgP7GQ WlXbVSJY4uduGjEN1ltdSrwFb7URn8AKp6c3N/K5bglwfRFKMG2X/YnWzF242jUH14kS3n XrWruQkb72snzDh9QdHzYFPSuc+dG1yS1GZ7tYSOOfvmGRXYHjqmNlpfoZikKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759260547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r3wXOvnGAVDwA9bxQ7WYW/1m0lWzs/atKDgJdte7uUU=; b=od7mZXGhjSioGTOl427zWZlNbovV8+VemtVSU8iA57frhQfZHpxILssc+ljeidrOKb54bn nn04N5mHs2PCL3Qa+TEyzrJUAlW0L9vzdSl4x1jF0JPbd4SnDYltZL0ScsHYAFNLTaMokv 2tgXmdgDmBpnAUf5Tilf5ejkAXRx6lnnj8XDfybkPygx6E+SVb21NIQjivU702RbJTk38I RTSNQAiE8wi/Eya69vHzZS1LlhJ9Kxt06FqZ2bZOKcXYLlFvQW1DNTH+IGgAE3lpcathXN hY6JIwG+XWq72CX/TjNEjcyCR/kYLqc1SkkokQLuMMmld1jU+dOx5NzgOpa1tQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759260547; a=rsa-sha256; cv=none; b=FkwacYl1nhVGX8KTptGZxB1NzSeqz/FM9Iz6x3M7W0Up8bQ+oa2uv8NS86E0xpOZdmAK6s l1puWDksU0VZuABEePGN9/uKmHrX5GwMDh+WhU1k8Z+BN/Hhh5yGiSFZ5GPSfVyeSyYK6v ZA3PC3+aDqzuz2zrJEzxaKCdm+3fg5jEZcXHeJ1czXN7w5XQHiMpPWKeeuuqTaHjCEYVgZ vBeeZtxPlCgwc2TJ8P4pHQfEyqGR+zoSChhJbpJzacZDnrZUpfTsrDOeTQ5Uszq5PIetHH 7vQHUxAXuPfkzjm3ocUiDZB5Nj8FUKppHnqz3xObvavnJaSyfDMC0GjE9E3dww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbp5Z6T1Zzq4m; Tue, 30 Sep 2025 19:29: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 58UJT60a002854; Tue, 30 Sep 2025 19:29:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UJT6IT002851; Tue, 30 Sep 2025 19:29:06 GMT (envelope-from git) Date: Tue, 30 Sep 2025 19:29:06 GMT Message-Id: <202509301929.58UJT6IT002851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 29810aa6ae70 - stable/14 - libc: Move tzset.3 to stdtime List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 29810aa6ae70a5883dcb55c09a36ee38801dcd63 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=29810aa6ae70a5883dcb55c09a36ee38801dcd63 commit 29810aa6ae70a5883dcb55c09a36ee38801dcd63 Author: Warner Losh AuthorDate: 2024-03-12 04:19:15 +0000 Commit: Warner Losh CommitDate: 2025-09-30 16:43:23 +0000 libc: Move tzset.3 to stdtime This really belongs in stddime, since it documents interfaces implemented in stdtime. Suggested by: brooks Sponsored by: Netflix (cherry picked from commit 7a0a6b276cfd7e072346842fe4746d08ee30e617) --- lib/libc/gen/Makefile.inc | 1 - lib/libc/stdtime/Makefile.inc | 4 +++- lib/libc/{gen => stdtime}/tzset.3 | 0 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 3e5f6ae8d602..6423091f48be 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -329,7 +329,6 @@ MAN+= alarm.3 \ timespec_getres.3 \ timezone.3 \ ttyname.3 \ - tzset.3 \ ualarm.3 \ ucontext.3 \ ulimit.3 \ diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc index 07ca69aab4c5..5d0ce7765b63 100644 --- a/lib/libc/stdtime/Makefile.inc +++ b/lib/libc/stdtime/Makefile.inc @@ -20,7 +20,7 @@ CFLAGS.localtime.c+= -DALL_STATE -DTHREAD_SAFE CFLAGS.localtime.c+= -DDETECT_TZ_CHANGES .endif -MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 +MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 tzset.3 MAN+= tzfile.5 MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \ @@ -30,3 +30,5 @@ MLINKS+=ctime.3 asctime.3 ctime.3 difftime.3 ctime.3 gmtime.3 \ MLINKS+=strftime.3 strftime_l.3 MLINKS+=strptime.3 strptime_l.3 MLINKS+=time2posix.3 posix2time.3 +MLINKS+=tzset.3 daylight.3 \ + tzset.3 timezone.3 diff --git a/lib/libc/gen/tzset.3 b/lib/libc/stdtime/tzset.3 similarity index 100% rename from lib/libc/gen/tzset.3 rename to lib/libc/stdtime/tzset.3 From nobody Tue Sep 30 21:14:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbrRN1bllz69LQt; Tue, 30 Sep 2025 21:14: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbrRM4gVbz3tJ1; Tue, 30 Sep 2025 21:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mw+RWOUCA3VoaXY5sJLiH1KNeUhkZ/96jDenyw6br98=; b=FmjkiB4aHW8OqX5jq+mvvaLheuPk/CPjRFVp0YGSBQPmYf/3OmaHCO2ztsnGDOcFBMSEfZ SI6TB4CIaCSXyIVG9xzSX/YAkCogaOcw75z13T2BB7mAMSThiakVbDp5ktypcT5L0lrZcf HPU4T1QPZvYCidwYuU8wk9Tzlpw6xbt7kgFnt82oJ8YNoCTGN0r/hE20haAkDsB4T/vVCI 3krpjEDEWGXhhw7JhirVwySNgam5URhjcvO8eU1iUGGvYxu21BR/qQdxn5YDJWOrDEPa8H jq6xBlrD2uVxDL5FI3If/BY2kHqGBgx/ZqqsxDa8BM7FOEmpcdjXYjrwmIlM4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mw+RWOUCA3VoaXY5sJLiH1KNeUhkZ/96jDenyw6br98=; b=xi3adPCJIUoBqP2g75A7oF39rbaeOJ4bEG4PDJY63PSMW0nmhq7MMnSo0Gjugppj++iJrn muSgxcpR1bNAlxPaiXwiucRqNLI7XS8ux5wAEYLNpzjClT8ctCmQPaBKn7KfSY4trSzNLs MuVE7XaIChEJFsZtmrfDkIBakJn/Y8ndMhS6yEHdsRBxmHcDB28eucyRlhM2EPmdE2b1hO kmlt+Gc3tH13x8OSMxmL/s9/RcpOnzczbpADyrBsl16bZIWrJYHbWxZPVl9zmWZBQbQgl1 0doaTEK4//I4EiatBVA5JyuCu74bYH0ZpddUzkMy5PagkVO3Q3+lmd3ZDnYbxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759266879; a=rsa-sha256; cv=none; b=yUT9xQ0kUzESqluwYx/MvyxTXX3ctfMXbuznEbHquQR+iVSVQHWurZsF5DzSGfOE8nUhrV WmtU568nfC3pWhaIRdi7sQi8Cg/0xKHXcTjMWlA209wt1+UCSlcfa4pbVjPkvQli6UxR/w Gb3A42R1py/9wplHdud73ORRVpUD4LPkKeWJ+miqAxOFl1jn9oWNGctZBjdyLUUattEQuL Td8PRmGDBmJ2WYridSeThGWjVABBoXUC1eFA4TKLH0TsqfXAugI/sNGBSQ3gK/fHTwxd4O cBdCufYkPXSJfRwtMT61S3TJIr0o75mdIBXoNSHtCgwh8E22/UWTpgX0893WSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbrRM4GqLzsqZ; Tue, 30 Sep 2025 21:14: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 58ULEdn1010320; Tue, 30 Sep 2025 21:14:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58ULEdeo010317; Tue, 30 Sep 2025 21:14:39 GMT (envelope-from git) Date: Tue, 30 Sep 2025 21:14:39 GMT Message-Id: <202509302114.58ULEdeo010317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8545586793f2 - stable/14 - share/mk: Deduplicate some handling of debug info List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8545586793f22fd7f67f8c46ec6fa12b766d0446 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8545586793f22fd7f67f8c46ec6fa12b766d0446 commit 8545586793f22fd7f67f8c46ec6fa12b766d0446 Author: Mark Johnston AuthorDate: 2025-08-21 14:06:19 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 21:14:29 +0000 share/mk: Deduplicate some handling of debug info bsd.prog.mk and bsd.lib.mk contain a bunch of duplicated logic used to handle DEBUG_FLAGS and standalone debug file info (enabled by MK_DEBUG_FILES). In anticipation of adding more duplicated logic, let's try factoring it out into a separate bsd.debug.mk first. bsd.debug.mk now handles the following: - MK_ASSERT_DEBUG - installation rules for debug files (the consumer has to set DEBUGFILE) - updating CFLAGS and CXXFLAGS based on DEBUG_FLAGS - optionally stripping installed files No functional change intended. Reviewed by: bdrewery Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D51805 (cherry picked from commit 3a239e46c4aa1dc62a74b40f6a0feb030f089a0c) --- share/mk/Makefile | 1 + share/mk/bsd.README | 1 + share/mk/bsd.debug.mk | 46 ++++++++++++++++++++++++++++++++++++++++++ share/mk/bsd.lib.mk | 51 ++++++++--------------------------------------- share/mk/bsd.own.mk | 7 ++++++- share/mk/bsd.prog.mk | 55 ++++++++++----------------------------------------- 6 files changed, 72 insertions(+), 89 deletions(-) diff --git a/share/mk/Makefile b/share/mk/Makefile index 21d512c74c80..e3d2410fb34f 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -23,6 +23,7 @@ FILES= \ bsd.confs.mk \ bsd.cpu.mk \ bsd.crunchgen.mk \ + bsd.debug.mk \ bsd.dep.mk \ bsd.dirs.mk \ bsd.doc.mk \ diff --git a/share/mk/bsd.README b/share/mk/bsd.README index b68d7b66402d..d04012666fba 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -21,6 +21,7 @@ bsd.compiler.mk - defined based on current compiler bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.crunchgen.mk - building crunched binaries using crunchgen(1) +bsd.debug.mk - handling debug options for bsd.{prog,lib}.mk bsd.dep.mk - handle Makefile dependencies bsd.dirs.mk - handle directory creation bsd.doc.mk - building troff system documents diff --git a/share/mk/bsd.debug.mk b/share/mk/bsd.debug.mk new file mode 100644 index 000000000000..fc80bc103061 --- /dev/null +++ b/share/mk/bsd.debug.mk @@ -0,0 +1,46 @@ +# +# This file configures debug options for compiled targets. It is meant +# to consolidate common logic in bsd.prog.mk and bsd.lib.mk. It should +# not be included directly by Makefiles. +# + +.include + +.if ${MK_ASSERT_DEBUG} == "no" +CFLAGS+= -DNDEBUG +# XXX: shouldn't we ensure that !asserts marks potentially unused variables as +# __unused instead of disabling -Werror globally? +MK_WERROR= no +.endif + +.if defined(DEBUG_FLAGS) +CFLAGS+=${DEBUG_FLAGS} +CXXFLAGS+=${DEBUG_FLAGS} + +.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +CTFFLAGS+= -g +.endif +.else +STRIP?= -s +.endif + +.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ + empty(DEBUG_FLAGS:M-gdwarf*) +.if !${COMPILER_FEATURES:Mcompressed-debug} +CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +.else +CFLAGS+= ${DEBUG_FILES_CFLAGS} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS} +.endif +CTFFLAGS+= -g +.endif + +_debuginstall: +.if ${MK_DEBUG_FILES} != "no" && defined(DEBUGFILE) +.if defined(DEBUGMKDIR) + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ +.endif + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \ + ${DEBUGFILE} ${DESTDIR}${DEBUGFILEDIR}/${DEBUGFILE} +.endif diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index d6a7786e17fd..f2ed34b11edc 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -47,23 +47,6 @@ SONAME?= ${SHLIB_NAME} CFLAGS+= ${CRUNCH_CFLAGS} .endif -.if ${MK_ASSERT_DEBUG} == "no" -CFLAGS+= -DNDEBUG -# XXX: shouldn't we ensure that !asserts marks potentially unused variables as -# __unused instead of disabling -Werror globally? -MK_WERROR= no -.endif - -.if defined(DEBUG_FLAGS) -CFLAGS+= ${DEBUG_FLAGS} - -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" -CTFFLAGS+= -g -.endif -.else -STRIP?= -s -.endif - .for _libcompat in ${_ALL_libcompats} .if ${SHLIBDIR:M*/lib${_libcompat}} || ${SHLIBDIR:M*/lib${_libcompat}/*} TAGS+= lib${_libcompat} @@ -124,18 +107,6 @@ CXXFLAGS+= -ftrivial-auto-var-init=pattern # bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports). .sinclude "bsd.sanitizer.mk" -.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ - empty(DEBUG_FLAGS:M-gdwarf*) -.if !${COMPILER_FEATURES:Mcompressed-debug} -CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -.else -CFLAGS+= ${DEBUG_FILES_CFLAGS} -CXXFLAGS+= ${DEBUG_FILES_CFLAGS} -.endif -CTFFLAGS+= -g -.endif - .if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" CFLAGS += -mno-relax .endif @@ -150,6 +121,7 @@ _SHLIBDIR:=${SHLIBDIR} .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" SHLIB_NAME_FULL=${SHLIB_NAME}.full +DEBUGFILE= ${SHLIB_NAME}.debug # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory .if ${_SHLIBDIR} == "/boot" ||\ ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ @@ -276,16 +248,16 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .endif .if ${MK_DEBUG_FILES} != "no" -CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug -${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ +CLEANFILES+= ${SHLIB_NAME_FULL} ${DEBUGFILE} +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${DEBUGFILE} + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \ ${SHLIB_NAME_FULL} ${.TARGET} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) # Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR @${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif -${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} +${DEBUGFILE}: ${SHLIB_NAME_FULL} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} .endif .endif #defined(SHLIB_NAME) @@ -396,8 +368,8 @@ installpcfiles-${pcfile}: ${pcfile} installpcfiles: .PHONY .if !defined(INTERNALLIB) -realinstall: _libinstall installpcfiles -.ORDER: beforeinstall _libinstall +realinstall: _libinstall installpcfiles _debuginstall +.ORDER: beforeinstall _libinstall _debuginstall _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -411,14 +383,6 @@ _libinstall: ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ -.if ${MK_DEBUG_FILES} != "no" -.if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ -.endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ - ${_INSTALLFLAGS} \ - ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/ -.endif .if defined(SHLIB_LINK) .if commands(${SHLIB_LINK:R}.ld) ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -512,6 +476,7 @@ SUBDIR_TARGETS+= check TESTS_LD_LIBRARY_PATH+= ${.OBJDIR} .endif +.include .include .include .include diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index aec88d64850f..ad6e07bfb7ba 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -44,6 +44,10 @@ # # DEBUGMODE Mode for debug files. [${NOBINMODE}] # +# DEBUGOWN Owner for debug info files. [root] +# +# DEBUGGRP Group for debug info files. [wheel] +# # # KMODDIR Base path for loadable kernel modules # (see kld(4)). [/boot/modules] @@ -199,7 +203,8 @@ LIBMODE?= ${NOBINMODE} DEBUGDIR?= /usr/lib/debug DEBUGMODE?= ${NOBINMODE} - +DEBUGOWN?= ${BINOWN} +DEBUGGRP?= ${BINGRP} # Share files SHAREDIR?= /usr/share diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 0d3bac406e23..fa15370a82c6 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -12,22 +12,6 @@ CFLAGS+=${COPTS} .endif -.if ${MK_ASSERT_DEBUG} == "no" -CFLAGS+= -DNDEBUG -# XXX: shouldn't we ensure that !asserts marks potentially unused variables as -# __unused instead of disabling -Werror globally? -MK_WERROR= no -.endif - -.if defined(DEBUG_FLAGS) -CFLAGS+=${DEBUG_FLAGS} -CXXFLAGS+=${DEBUG_FLAGS} - -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" -CTFFLAGS+= -g -.endif -.endif - .if defined(PROG_CXX) PROG= ${PROG_CXX} .endif @@ -101,20 +85,6 @@ CFLAGS += -mno-relax .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} -.else -.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ - empty(DEBUG_FLAGS:M-gdwarf-*) -.if !${COMPILER_FEATURES:Mcompressed-debug} -CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} -.else -CFLAGS+= ${DEBUG_FILES_CFLAGS} -.endif -CTFFLAGS+= -g -.endif -.endif - -.if !defined(DEBUG_FLAGS) -STRIP?= -s .endif .if defined(NO_ROOT) @@ -151,6 +121,9 @@ PROG_FULL= ${PROG} .if defined(PROG) PROGNAME?= ${PROG} +.if ${MK_DEBUG_FILES} != "no" +DEBUGFILE= ${PROGNAME}.debug +.endif .if defined(SRCS) @@ -215,11 +188,12 @@ ${PROG_FULL}: ${OBJS} .endif # !defined(SRCS) .if ${MK_DEBUG_FILES} != "no" -${PROG}: ${PROG_FULL} ${PROGNAME}.debug - ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \ +CLEANFILES+= ${PROG_FULL} ${DEBUGFILE} +${PROG}: ${PROG_FULL} ${DEBUGFILE} + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \ ${PROG_FULL} ${.TARGET} -${PROGNAME}.debug: ${PROG_FULL} +${DEBUGFILE}: ${PROG_FULL} ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET} .endif @@ -258,9 +232,6 @@ all: all-man .if defined(PROG) CLEANFILES+= ${PROG} ${PROG}.bc ${PROG}.ll -.if ${MK_DEBUG_FILES} != "no" -CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug -.endif .endif .if defined(OBJS) @@ -300,19 +271,12 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}} .endfor .if !target(realinstall) && !defined(INTERNALPROG) -realinstall: _proginstall -.ORDER: beforeinstall _proginstall +realinstall: _proginstall _debuginstall +.ORDER: beforeinstall _proginstall _debuginstall _proginstall: .if defined(PROG) ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} -.if ${MK_DEBUG_FILES} != "no" -.if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ -.endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ - ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug -.endif .endif .endif # !target(realinstall) @@ -383,6 +347,7 @@ TESTS_PATH+= ${.OBJDIR} OBJS_DEPEND_GUESS+= ${SRCS:M*.h} .endif +.include .include .include .include From nobody Tue Sep 30 21:14:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbrRP113Rz69LvH; Tue, 30 Sep 2025 21:14: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbrRN5msrz3t5H; Tue, 30 Sep 2025 21:14:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=th/neJ0sbqbCa1OKuDqoR3QkmhjdvQDQ+ccWUFLkl9E=; b=PQQq16ZHMA978prOWSCZOnJnRKq09blOSf2/zc57ZBp/Q3UlAmC5JWzJ+48SeqY0+YL3Xe lTv278mZ4EdkXArw8dJwRrL37b3dtmwrPJzQcwrQJOh+V6R3Zz9wiWfxEq/PvPFEqhZTBq yL8WTNT3ucyffcYkNfuzxNp2bfYxQaQsyG3UK5sQEbXyY2/DxoqxZxLfuXBebQf/ICVxrv LpJOv6bMtL/DMIWMLmFGSNdfPl3hZmdg758glX4PBALcKY2RcWZkiWlUVUi+f0ZfUFTgfl VJPmT28aAaOGb/6NVSbKvj34yltExtpO9YTn01wvbcOFf/lILpFJaDZ4DYzzPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=th/neJ0sbqbCa1OKuDqoR3QkmhjdvQDQ+ccWUFLkl9E=; b=Z+G/0O9BZaU7V3uiafXhWnEyeIio7bqgeujn7eRF0sbvRLovsIGTT6EdjTqP9Wa6ZPfcS/ PtHlukSl0oVAhoMlrU9dHWWEBOtAJijWJMygQabCViqji1xaaFZRplvDu59p3SjaWsR98N DQ97kkOHQEXP/tH6pzxYqJvcv6t/lh+6cMRx7GmjeUIAy9AP2QKzKaV3KG+oKj51gquqTS iX/SLHPzm7CKhMyofHklxQqbypawsVVzcKUR43ifr6lxlzD5B3LF74nQsYsyRQxUQsccut zndqi4qIA5a8BS5SpA4wiJTdGT8c6uueBOcY6R5i2vvJo9rFU86A5SfgND7vzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759266880; a=rsa-sha256; cv=none; b=G3JF4sUuJVBa2gH25yVR5zl/wKgdyJgrYqfGwKH7lronAzcUMg06+/WUekGx5AyNbifdtB ctoxTnXTgI/SZfDUwqLg2qvgTb08eOdQx11CTHriuIOTwkMpyLv+tR6MK6CbEUzrrTqOQZ uBGSOUDOcx95QbkgskBfmydqR2cY0akLlzHLxoe5C6acBv18SGVwf3GamNx8pzD9ooLgcR EVxyVGHe5JudIj//zFM/Cx+aAEJrl5Mv6hKgJi317F0MKXW/KetNAdAigpHTYX1fGzBu1a DYwT326EUF3vTQ8F5ESSGZnABpy66Kps+TG9uIWYo5XB9FaD/OzGa1KIgxR52w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbrRN5K7SztSP; Tue, 30 Sep 2025 21:14: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 58ULEedG010361; Tue, 30 Sep 2025 21:14:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58ULEeVw010358; Tue, 30 Sep 2025 21:14:40 GMT (envelope-from git) Date: Tue, 30 Sep 2025 21:14:40 GMT Message-Id: <202509302114.58ULEeVw010358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c89e5c0bfca6 - stable/14 - share/mk: Substitute reproducible prefixes in dwarf info List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c89e5c0bfca639f39735572ee518e11f30ed8b20 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c89e5c0bfca639f39735572ee518e11f30ed8b20 commit c89e5c0bfca639f39735572ee518e11f30ed8b20 Author: Mark Johnston AuthorDate: 2025-08-21 14:06:34 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 21:14:29 +0000 share/mk: Substitute reproducible prefixes in dwarf info Ensure that worlds/releases built from different source paths are reproducible. Currently they are not since src and obj paths are embedded in DWARF info. There are some uses of __FILE__ in the src tree as well, and they are similarly handled by this change. Use /usr/src and /usr/obj as the canonical src and obj paths when WITH_REPRODUCIBLE_BUILD is defined. Define a DEBUG_PREFIX variable which is used to ask the compiler to substitute paths in output files using -ffile-prefix-map. Compat builds (i.e., lib32) complicate things since they override OBJROOT to point to obj-${compat} but still refer to headers from the native objroot (e.g., llvm headers). MFC after: 1 month Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50951 (cherry picked from commit 4f81c42fbd76e25c9fe696fa08296b79c55fbf09) --- share/mk/bsd.debug.mk | 22 ++++++++++++++++++++++ share/mk/bsd.opts.mk | 1 + 2 files changed, 23 insertions(+) diff --git a/share/mk/bsd.debug.mk b/share/mk/bsd.debug.mk index fc80bc103061..cf2fb4356aef 100644 --- a/share/mk/bsd.debug.mk +++ b/share/mk/bsd.debug.mk @@ -13,6 +13,28 @@ CFLAGS+= -DNDEBUG MK_WERROR= no .endif +# If reproducible build mode is enabled, map the root of the source +# directory to /usr/src and the root of the object directory to +# /usr/obj. +.if ${MK_REPRODUCIBLE_BUILD} != "no" && !defined(DEBUG_PREFIX) +.if defined(SRCTOP) +DEBUG_PREFIX+= ${SRCTOP:S,/$,,}=/usr/src +.endif +.if defined(OBJROOT) +# Strip off compat subdirectories, e.g., /usr/obj/usr/src/amd64.amd64/obj-lib32 +# becomes /usr/obj/usr/src/amd64.amd64, since object files compiled there might +# refer to something outside the root. +DEBUG_PREFIX+= ${OBJROOT:S,/$,,:C,/obj-[^/]*$,,}=/usr/obj +.endif +.endif + +.if defined(DEBUG_PREFIX) +.for map in ${DEBUG_PREFIX} +CFLAGS+= -ffile-prefix-map=${map} +CXXFLAGS+= -ffile-prefix-map=${map} +.endfor +.endif + .if defined(DEBUG_FLAGS) CFLAGS+=${DEBUG_FLAGS} CXXFLAGS+=${DEBUG_FLAGS} diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index b4761333d8c5..b56afb89a44d 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -80,6 +80,7 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_ZERO \ INSTALL_AS_USER \ PROFILE \ + REPRODUCIBLE_BUILD \ RETPOLINE \ STALE_STAGED \ UBSAN From nobody Tue Sep 30 21:14:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbrRQ1XSFz69LR2; Tue, 30 Sep 2025 21:14:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbrRP6gnZz3t5L; Tue, 30 Sep 2025 21:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eO8cG1V4aOiCE4hokgzFmI6oXtmW+OpV1TBcLdOt9c8=; b=MWtnWugm9Z4m1sSfjXSwWNDbS/vlJIip/WeLNEAGRCPIu3kwB+52BbEfuuQX5Es4HqXZkZ jolOWm9W0aMMcFb9Utx3/KZiV0WU9FRo7rB9ASOboHqZG4cIadi1VAuerSCLB3PUVYk32O rKHoYUQghTop0KWwo3YijK6pXrxZds3NOKrGGPMxg5v/12yO97NU/X/uN17XQz88UIHucB tVOjIFV6nFzBtqHbp1Jm8yR0uTS32TmwF34njnK/QA2hFX1YuhQ87lXlTITTJOMJrdLWnp XJ9cEVa02qHaYTRCLC6S9CGsKx8dqXfkOtXAvjUrrdpmn2AciH9M4fFS6PPyIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eO8cG1V4aOiCE4hokgzFmI6oXtmW+OpV1TBcLdOt9c8=; b=VsheEBnkirIzxn6WldQVcfHjphkzt9PvCJxaUBF4GX4IWyfxVHJdKLVgMAiIXrW9Xxh6JZ 2BkDhUuvVSTdjlrmni1R06wRIe3RKB7pUh9zU7dlKGClQ5OPzV93ioWWk1FIXJK3wBRNvF TRohXYVIrFyWLs6d7h08dbk9/Wv7my/Bc6fRZE9IZzzWvF8ndqytbtgqxRIhw2gzo1c53M uCy0wcq7JF36jZWPBzSXzQjIEYNxVQBk6KIoUKtfdWQ23pkEW1U/gbR0+Nn+F14tQTfvEH rXc4TQytVoD7vGi+xFvKKxcdhLjdAhNHTL7u8AJGQ6cp7G+4W8NtN2Z+gHmEpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759266881; a=rsa-sha256; cv=none; b=EUMa6V7G7iZPccv2nI+KE6NTwzh/zMkf2l2ZDeGnDSXA9pHMKOe5VM8tZ3PcGnDODsFTbP J+zV9lB+ylz7ZoEp53h+zWx08pJw3bFKRtG/UuNUB0aze55J7/3qB/ASQDct+92HsvN17O n5b+Hx7a8SbAYiWr6XvF+C8miUuoiSQgK5TU6S1NEr94lzDrnAhFBGqPcuK6rTmwQilqLp COsa/8usnPmOac5nCeR+YxZ6Q52K5nj19I/CFDCpOUT61XGD1DZ3biOZ3GLNpWIO80mjSV V882E8YiMlKgeAhEg1DRX8MY15w84k7uW6tlSaD2u7cq0jD/czfWwNG2HybvRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbrRP6Fvbzsqb; Tue, 30 Sep 2025 21:14: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 58ULEfe6010395; Tue, 30 Sep 2025 21:14:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58ULEfX0010392; Tue, 30 Sep 2025 21:14:41 GMT (envelope-from git) Date: Tue, 30 Sep 2025 21:14:41 GMT Message-Id: <202509302114.58ULEfX0010392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 18a65998107a - stable/14 - sys/conf: Remap paths for reproducibility List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18a65998107a01972ee74576897b36c51a1e6564 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=18a65998107a01972ee74576897b36c51a1e6564 commit 18a65998107a01972ee74576897b36c51a1e6564 Author: Mark Johnston AuthorDate: 2025-08-21 14:04:14 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 21:14:29 +0000 sys/conf: Remap paths for reproducibility As in bsd.lib.mk and bsd.prog.mk, we need to remap paths in the kernel and in kernel modules when reproducible builds are configured. Add directives to kern.post.mk and kmod.mk to remap the src, obj and sysroot dirs. For the sysroot, we need to pass the value of the SYSROOT variable to the kernel makefiles, which involves changing Makefile.inc1. In so doing I reverted a portion of commit 35fb812adfc21; I can't see any harm in passing the SYSROOT variable down. MFC after: 1 month Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50953 (cherry picked from commit eebadc7d8590ff8d38fdbcfd90651c931e713648) --- Makefile.inc1 | 2 +- sys/conf/kern.post.mk | 17 +++++++++++++++-- sys/conf/kmod.mk | 23 +++++++++++++++++++++-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 84fe2a2eceaf..e3a451b72b10 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1022,7 +1022,7 @@ DESTDIR_MTREE= ${DISTR_MTREECMD} ${DESTDIR_MTREEFLAGS} METALOG_SORT_CMD= env -i LC_COLLATE=C sort # kernel stage -KMAKEENV= ${WMAKEENV:NSYSROOT=*} +KMAKEENV= ${WMAKEENV} KMAKE= ${TIME_ENV} ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} # diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 320410a337c9..c4e1c9edb65d 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -365,6 +365,19 @@ _ILINKS+= x86 _ILINKS+= i386 .endif +.if ${MK_REPRODUCIBLE_BUILD} != "no" +PREFIX_SYSDIR=/usr/src/sys +PREFIX_OBJDIR=/usr/obj/usr/src/${MACHINE}.${MACHINE_CPUARCH}/sys/${KERN_IDENT} +CFLAGS+= -ffile-prefix-map=${SYSDIR}=${PREFIX_SYSDIR} +CFLAGS+= -ffile-prefix-map=${.OBJDIR}=${PREFIX_OBJDIR} +.if defined(SYSROOT) +CFLAGS+= -ffile-prefix-map=${SYSROOT}=/sysroot +.endif +.else +PREFIX_SYSDIR=${SYSDIR} +PREFIX_OBJDIR=${.OBJDIR} +.endif + # Ensure that the link exists without depending on it when it exists. # Ensure that debug info references the path in the source tree. .for _link in ${_ILINKS} @@ -372,9 +385,9 @@ _ILINKS+= i386 ${SRCS} ${DEPENDOBJS}: ${_link} .endif .if ${_link} == "machine" -CFLAGS+= -fdebug-prefix-map=./machine=${SYSDIR}/${MACHINE}/include +CFLAGS+= -fdebug-prefix-map=./machine=${PREFIX_SYSDIR}/${MACHINE}/include .else -CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_link}/include +CFLAGS+= -fdebug-prefix-map=./${_link}=${PREFIX_SYSDIR}/${_link}/include .endif .endfor diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 9310f1572b41..806007763de2 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -303,6 +303,25 @@ all: ${PROG} beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} +.if ${MK_REPRODUCIBLE_BUILD} != "no" +PREFIX_SYSDIR=/usr/src/sys +CFLAGS+= -ffile-prefix-map=${SYSDIR}=${PREFIX_SYSDIR} +.if defined(KERNBUILDDIR) +PREFIX_KERNBUILDDIR=/usr/obj/usr/src/${MACHINE}.${MACHINE_CPUARCH}/sys/${KERNBUILDDIR:T} +PREFIX_OBJDIR=${PREFIX_KERNBUILDDIR}/modules/usr/src/sys/modules/${.OBJDIR:T} +CFLAGS+= -ffile-prefix-map=${KERNBUILDDIR}=${PREFIX_KERNBUILDDIR} +.else +PREFIX_OBJDIR=/usr/obj/usr/src/${MACHINE}.${MACHINE_CPUARCH}/sys/modules/${.OBJDIR:T} +.endif +CFLAGS+= -ffile-prefix-map=${.OBJDIR}=${PREFIX_OBJDIR} +.if defined(SYSROOT) +CFLAGS+= -ffile-prefix-map=${SYSROOT}=/sysroot +.endif +.else +PREFIX_SYSDIR=${SYSDIR} +PREFIX_OBJDIR=${.OBJDIR} +.endif + # Ensure that the links exist without depending on it when it exists which # causes all the modules to be rebuilt when the directory pointed to changes. # Ensure that debug info references the path in the source tree. @@ -311,9 +330,9 @@ beforebuild: ${_ILINKS} OBJS_DEPEND_GUESS+= ${_link} .endif .if ${_link} == "machine" -CFLAGS+= -fdebug-prefix-map=./machine=${SYSDIR}/${MACHINE}/include +CFLAGS+= -fdebug-prefix-map=./machine=${PREFIX_SYSDIR}/${MACHINE}/include .else -CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_link}/include +CFLAGS+= -fdebug-prefix-map=./${_link}=${PREFIX_SYSDIR}/${_link}/include .endif .endfor From nobody Tue Sep 30 21:14:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbrRR4lWGz69LRF; Tue, 30 Sep 2025 21:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbrRR0bZHz3tJ5; Tue, 30 Sep 2025 21:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kJh80HETCpAeiFsvGxVO+mhyZDmhHvKfne5gmOl0Hew=; b=AfrGDfIbRsDPwqN6KV6R3d3j1FVoaAJXu/zUpzz9pkYdSuKiYBSGtjsN7tR9ZdGnBiNYgj tcGa1HKgAaAP04m9XZkbiwf+umojc6JxS9CPOZP8GGzjhAoELy2UQOYXWc4crYhd66Tttk L103A/h+XG0iwqJ+OgxJADlTkwopYF0wXe4FJ8Sf1K0Zfjj1crhpJXSgY9xvPihGavWvKm e0BNRC4wh9K7Mqo+7m7DF0Rq7i/lDrJhivbEMvew3sInYTAvIwNovbkGREc5zEgj6q1EiF T6S7DkRUWOFFop/AnbFyvTftBlJ6ZQEB1fh9BvMqUlWRcU4+QnoWbYYrn2RrDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kJh80HETCpAeiFsvGxVO+mhyZDmhHvKfne5gmOl0Hew=; b=YRFlWLn2KD1YUPI7x1LqREhnhjGHs48/SHrt5+AofS0pxqcp3wc/nRAaB2ts11lqOli/6x Q6yw7aKU/EfaofZ7kSobKCuBJ7YSGndL0luEm2lcBfERe0gngrGbyCSpoZNtAxnOu3dmm7 ALvaC9oYt4viwW9P8djy1tvaSL2PLVDTM2h7AioihyO8FL0F8WjhSnWhsKdKaGw9e5WFDe TKIgXjgU22SjShofCHuMOrgICkaxblkY67PJqfiSJK1uj6dPTACEP/k59s/V22m0cZWTTN srytugt829wA/PCtCAGfLFtCZrnGlr49LL7l4aQhjyu168x59feJImy4BKGv4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759266883; a=rsa-sha256; cv=none; b=E+fbrwSxFRMnfIsxz0fI1D+rPkRn8lJVsQuEIRXguym6L4v4rOWbhYK6hFJbx89JGFFXzN QtZ/yoyiTjw93QHmFd9agWUNSlZNEQQvgO031cC9dJ0qi3OF7CdSsDlKmVAfaVPnCFyZxe T2xSkiHwYp/lfjzC5Inwc3I98KJntlbeVXgFIH0vsxzIYIT9y4mrJdM5Q9/pA7NW/mULTM Rm8+b+TBnFwz04SoFKWldgfEya1QlgIxHcSkGfaFUah7NNYgsqvsVxoYjYQhkslo0Z7N/E uYh469x+adp4ASvYU3HNRxbdkvK5CPx9MG7UsCLn9FQMF3NZA0anxNl9FQMrkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbrRR08cZzsqc; Tue, 30 Sep 2025 21:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58ULEgnY010432; Tue, 30 Sep 2025 21:14:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58ULEgLp010429; Tue, 30 Sep 2025 21:14:42 GMT (envelope-from git) Date: Tue, 30 Sep 2025 21:14:42 GMT Message-Id: <202509302114.58ULEgLp010429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: de659254dcb6 - stable/14 - newvers: Add a builddir parameter List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: de659254dcb67d5992f65f2450e5a704553e0f65 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=de659254dcb67d5992f65f2450e5a704553e0f65 commit de659254dcb67d5992f65f2450e5a704553e0f65 Author: Mark Johnston AuthorDate: 2025-08-21 14:05:19 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 21:14:29 +0000 newvers: Add a builddir parameter When reproducible builds are configured, we should use /usr/obj as the canonical objdir. Add a parameter to newvers.sh to ensure that build metadata is reproducible. Reviewed by: emaste MFC after: 1 month Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50954 (cherry picked from commit 3238878379d3bd4bb9796ccb41c090139bbde94f) --- sys/conf/kern.post.mk | 2 +- sys/conf/newvers.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index c4e1c9edb65d..a4c6f6fc187e 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -460,7 +460,7 @@ config.o env.o hints.o vers.o vnode_if.o: NEWVERS_ENV+= MAKE="${MAKE}" .if ${MK_REPRODUCIBLE_BUILD} != "no" -NEWVERS_ARGS+= -R +NEWVERS_ARGS+= -R -d ${PREFIX_OBJDIR} .endif vers.c: .NOMETA_CMP $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP:Nvers.*} ${NEWVERS_ENV} sh $S/conf/newvers.sh ${NEWVERS_ARGS} ${KERN_IDENT} diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index f93be1990cf1..13f6c2de9bde 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -112,14 +112,18 @@ COPYRIGHT="$COPYRIGHT # We expand include_metadata later since we may set it to the # future value of modified. +builddir=$(pwd) include_metadata=yes modified=no -while getopts crRvV: opt; do +while getopts cd:rRvV: opt; do case "$opt" in c) echo "$COPYRIGHT" exit 0 ;; + d) + builddir=$OPTARG + ;; r) include_metadata=no ;; @@ -189,7 +193,7 @@ fi touch version v=$(cat version) u=${USER:-root} -d=$(pwd) +d=$builddir h=${HOSTNAME:-$(hostname)} if [ -n "$SOURCE_DATE_EPOCH" ]; then if ! t=$(date -r $SOURCE_DATE_EPOCH 2>/dev/null); then From nobody Tue Sep 30 21:14:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbrRS6jmxz69Lxv; Tue, 30 Sep 2025 21:14: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbrRS1gwnz3tG0; Tue, 30 Sep 2025 21:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AlVkPxMxJM14F9FZqpNTHi1tLmU4O5XlYJkKPsyMbn8=; b=sutQlMQbdhenmyhf/z5T/4U5TUo1J4aueVBuDmPsXcndjiPPIP6TJ4N2wPRX+9J+Dd0kXW Y/YbHk5S2//k9D11tQnUb1EftvX2pgbmHSlv7UyyxJlumKb7CMSRpmi7DTFiegIVUr9t7B xVJnhL5AdCNF80OvYjJqivr/DNJCS+aNFK7GVUXQSfzObv6K1PK0+6FZF7cvdJ+U2wdDVR 0MKiR3gOyCMKlugF+2VELwFOHYoXMbtsGdg1idddmi8aex4vHcS5cWFRLNulZwSBneLqoK PRHXGMvDFtp9taAQt5K/sUxhUK0ySLWRfKuv2RZndRszEEvBwfu6byivev6egA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AlVkPxMxJM14F9FZqpNTHi1tLmU4O5XlYJkKPsyMbn8=; b=X1vDCuGrJI5RMO146SNWrU/ZCOygWGOHdKbs83bEOh0whIiE9aH03Iyi5zfTUfGipXun2G BKALnPpOntQpBFApBzhYVOemsohOolVvtmJZSBNmh/JqgbkX1pFt4c9kp/czr/mqnfu2JL kOF8a91CZxlsciLKZRtxylEd6VJzneRoH1zXSAHbpofQjdbfZJv53IE6zB3DUPXFpVCXI3 zk1bb7CcJkrxa4y/sJJokdX9Cd2Upeb+hq2D7wT5G0rWEMqof0GjLi2IN/nlpLuitOmx7+ UiIQUJ+gxqkvwJ8U5mTXTafBdV32fS6n/XuZnSx9+ni+8pwgJQwZUD4iK+aPgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759266884; a=rsa-sha256; cv=none; b=hlN/e8A78swiXIJJvtNXgZLVsJBEguTwjkLcJS+XvxunBBipbCzgFb5dozXe2DiOaicuHJ n5M+cTuAQV7/pc20Zo226yibAe1lQR5b9jYpqiS101yfq82DnPl3sZEdFiPVHWpwWYJCkQ GIpK9BD2nOMd6u78r71TTsa/jxYeGGAxrDbGPqxR2wa0IFNwtsJvbF+3QoaJ88H3Vgbtoj wH7IyOmawx4fKoxzwxkjRjSCulFk+3gOlqVpmh6zuREk0iB/PP5K4+usDU0O8mcQeYy8cd 6Lfc9wUMlf1dFHTngzqDK5yJVnr5MQ/dM++kVp+MWYsw0QR99thAsuW5psx0WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbrRS1315ztVD; Tue, 30 Sep 2025 21:14: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 58ULEiBX010465; Tue, 30 Sep 2025 21:14:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58ULEiba010462; Tue, 30 Sep 2025 21:14:44 GMT (envelope-from git) Date: Tue, 30 Sep 2025 21:14:44 GMT Message-Id: <202509302114.58ULEiba010462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 72ac96ed8fa9 - stable/14 - libnv: Fix handling of nvlist_dump() and nvlist_send() for child nvlists List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 72ac96ed8fa9415c2be1a5ceb0289b45578ba7bd Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=72ac96ed8fa9415c2be1a5ceb0289b45578ba7bd commit 72ac96ed8fa9415c2be1a5ceb0289b45578ba7bd Author: Mark Johnston AuthorDate: 2025-09-10 14:33:35 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 21:14:29 +0000 libnv: Fix handling of nvlist_dump() and nvlist_send() for child nvlists Suppose an nvlist nvl belongs to a parent nvlist or nvlist array. In this case, nvl contains a pointer to its container. This trips up nvlist_send(nvl) and nvlist_dump(nvl), which intuitively should only operate on nvl and its nvpairs. In particular, both of these functions will traverse to nvl's parent and start sending/dumping the parent's nvpairs, which results in assertion failures or nonsensical output, respectively. Reviewed by: oshogbo MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D52360 (cherry picked from commit 0b68e3ce6e0e437fa480b25a0ef706ee08562257) --- sys/contrib/libnv/nvlist.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 92d6e655876a..058ec032d3a3 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -486,7 +486,7 @@ nvlist_dump_error_check(const nvlist_t *nvl, int fd, int level) void nvlist_dump(const nvlist_t *nvl, int fd) { - const nvlist_t *tmpnvl; + const nvlist_t *tmpnvl, *top; nvpair_t *nvp, *tmpnvp; void *cookie; int level; @@ -495,6 +495,7 @@ nvlist_dump(const nvlist_t *nvl, int fd) if (nvlist_dump_error_check(nvl, fd, level)) return; + top = nvl; nvp = nvlist_first_nvpair(nvl); while (nvp != NULL) { dprintf(fd, "%*s%s (%s):", level * 4, "", nvpair_name(nvp), @@ -653,6 +654,8 @@ nvlist_dump(const nvlist_t *nvl, int fd) while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { do { + if (nvl == top) + return; cookie = NULL; if (nvlist_in_array(nvl)) dprintf(fd, "%*s,\n", level * 4, ""); @@ -855,7 +858,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep) { unsigned char *buf, *ptr; size_t left, size; - const nvlist_t *tmpnvl; + const nvlist_t *tmpnvl, *top; nvpair_t *nvp, *tmpnvp; void *cookie; @@ -876,6 +879,7 @@ nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep) ptr = nvlist_pack_header(nvl, ptr, &left); + top = nvl; nvp = nvlist_first_nvpair(nvl); while (nvp != NULL) { NVPAIR_ASSERT(nvp); @@ -966,6 +970,8 @@ nvlist_xpack(const nvlist_t *nvl, int64_t *fdidxp, size_t *sizep) goto fail; while ((nvp = nvlist_next_nvpair(nvl, nvp)) == NULL) { do { + if (nvl == top) + goto out; cookie = NULL; if (nvlist_in_array(nvl)) { ptr = nvpair_pack_nvlist_array_next(ptr, From nobody Tue Sep 30 21:14:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbrRV6Qxcz69M0j; Tue, 30 Sep 2025 21:14: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbrRV3cQ5z3tGP; Tue, 30 Sep 2025 21:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DOhBDV8IJ2YxwXR1zkZ0FtCYk3rCBP0Bcla8XRz05bY=; b=Dr6dcukwVju2Guq5Xx19PknpDkzXH0wT0Z9lPbJq/rKhEItQHS1Xo5ToQMgrbmk1+qmwqi Ae6y6PyyXcfDB0oVLePSb60PIXNfDYUbUslEpAh4Tr03/zNLgXGORu+W1wLrZn+Ec9s4MM TXTw+j79deDzxQZT98yUK7B+MRinhNJH2LawUMgXbuPQF7UijjOvNphUY/hNFr+6uBeDlZ ggQtxacOyTBPau6ui+uSWnNVOPWTW4wS4L/t13jarbuTwR4KTPEWVn4R4f1MqjM7v1PokT eBeVQBszD+xCEe2jreZgIDZqUflehdasNsw5opiMAfMbA8JoGPPQVYqoFQDARA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DOhBDV8IJ2YxwXR1zkZ0FtCYk3rCBP0Bcla8XRz05bY=; b=xTqovk/KXj4lwfz9NNZJ5gKJ6HS8AkhFCLV/yqtkL98g1vBY6r5IqVw390sml0N3CNQGl9 J0YQsWaEkf2HS1bevJW/mU0mGo+DaP5Jw8plmlHxNBG8WDkg9EburIqKKSFa/1uEHgBK6i PkqItQpr+0cTN/SjtAW3hgDGj6TSkbikHCMPOVhvMGGvAYWOYQ0UjemYtF8aw7eKvFhGR3 svunbvyaPBRg1A6ArEJpx7or2SXbD5DJWAk/nBU7BK3cBGoinqWhgDPpfdWUzxJtokL9zz lAcORi08r0KwXmi4xBUh6oHWg8wczqBHaUz1x2cYRpg43T1hdtFD34ToEXPDbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759266886; a=rsa-sha256; cv=none; b=kMBanL3vPnItIkWQIL5ppvUgSYIAUNf99wr7uVzdSDkQkEiejMxUsQEIT4npGBR7OxnkXj mZLX84j9E6XMkVQhfhkcvNpnTXaJdxJDJjB90pagUx9J0ZQE3wdBM9Iql4L1xtWRvMsciv bPBbB3biGEh2SfI3+BPxmdbtL67AqJ24oSJRXF0BKnLiT9eCY12esPUvgo/N+3fYM1tVIN JVdSqE6np68gHiaQZnw4dVq97bmXlDSOF9Ygkba2AOiq9SKdxUnMh1eKsVep5hCLgkBvzn db8tb8+jxFyLb73BC6yyj7hZ8OGP4z9tdGQZP4EeqZgcsbB5+Z0uRTpouviwfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbrRV2YPcztVF; Tue, 30 Sep 2025 21:14: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 58ULEkRh010536; Tue, 30 Sep 2025 21:14:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58ULEk4L010533; Tue, 30 Sep 2025 21:14:46 GMT (envelope-from git) Date: Tue, 30 Sep 2025 21:14:46 GMT Message-Id: <202509302114.58ULEk4L010533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2b84c4c39148 - stable/14 - dtrace: Use a size_t to represent a buffer size in the printm action List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b84c4c39148001b1f2455b0b047212d9e54d833 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2b84c4c39148001b1f2455b0b047212d9e54d833 commit 2b84c4c39148001b1f2455b0b047212d9e54d833 Author: Mark Johnston AuthorDate: 2025-09-10 14:33:58 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 21:14:29 +0000 dtrace: Use a size_t to represent a buffer size in the printm action printm is specific to the FreeBSD dtrace port. I believe it's effectively the same as tracemem(), though printm apparently predates it. It stores the size of the buffer of traced data inline. Currently it represents that size using a uintptr_t, which isn't really right and poses challenges when porting to CHERI because `DTRACE_STORE(uintptr_t, ...` requires the destination to be suitably aligned, but this isn't necessary since we're just storing a size. Convert to using a size_t. This should be a no-op since sizeof(uintptr_t) == sizeof(size_t) on non-CHERI platforms (and besides that I don't see a reason to use printm() when tracemem() is available and is simpler to use.) Reviewed by: Domagoj Stolfa, avg MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D52055 (cherry picked from commit 3877025f52ee205fe99ad4ff68229933d57e4bcb) --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c | 9 ++++----- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 11 ++++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c index a760642c33bb..56418d7283b6 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c @@ -2242,11 +2242,10 @@ dt_format_bytes_get(dtrace_hdl_t *dtp, caddr_t addr, size_t nbytes) static int dt_format_memory(dtrace_hdl_t *dtp, caddr_t addr) { - - size_t nbytes = *((uintptr_t *) addr); + size_t nbytes = *((size_t *) addr); char *s; - s = dt_format_bytes_get(dtp, addr + sizeof(uintptr_t), nbytes); + s = dt_format_bytes_get(dtp, addr + sizeof(size_t), nbytes); if (s == NULL) return (-1); @@ -2260,9 +2259,9 @@ static int dt_print_memory(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr) { int quiet = (dtp->dt_options[DTRACEOPT_QUIET] != DTRACEOPT_UNSET); - size_t nbytes = *((uintptr_t *) addr); + size_t nbytes = *((size_t *) addr); - return (dt_print_bytes(dtp, fp, addr + sizeof(uintptr_t), + return (dt_print_bytes(dtp, fp, addr + sizeof(size_t), nbytes, 50, quiet, 1)); } diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 7192df200ae2..8078f3f6d4b1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -7761,7 +7761,8 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, uintptr_t *memref = (uintptr_t *)(uintptr_t) val; if (!DTRACE_INSCRATCHPTR(&mstate, - (uintptr_t)memref, 2 * sizeof(uintptr_t))) { + (uintptr_t) memref, + sizeof (uintptr_t) + sizeof (size_t))) { *flags |= CPU_DTRACE_BADADDR; continue; } @@ -7773,21 +7774,21 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, * Check if the size exceeds the allocated * buffer size. */ - if (size + sizeof(uintptr_t) > dp->dtdo_rtype.dtdt_size) { + if (size + sizeof (size_t) > + dp->dtdo_rtype.dtdt_size) { /* Flag a drop! */ *flags |= CPU_DTRACE_DROP; continue; } /* Store the size in the buffer first. */ - DTRACE_STORE(uintptr_t, tomax, - valoffs, size); + DTRACE_STORE(size_t, tomax, valoffs, size); /* * Offset the buffer address to the start * of the data. */ - valoffs += sizeof(uintptr_t); + valoffs += sizeof(size_t); /* * Reset to the memory address rather than From nobody Tue Sep 30 21:14:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbrRT4mGrz69M5J; Tue, 30 Sep 2025 21:14: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbrRT2Grxz3t7r; Tue, 30 Sep 2025 21:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nwsZ0OjVpKdIvs928ipaU8GEghFta3mc7zmA4VZNUi8=; b=TK9iJuZK5rRdZ6gei6tCnYla93uvKiUOiPslHJo1Qw46ctGjz4kdtYYKSzDKGX+fSsaXSl qDYn9eSlFYdKIowcT1YtsjCw+zkSPab0FBZRt4I3Q1oZFAbvuFyS/f376XBFT+f9nD74lZ Ly/FAc00ORaX2GAVBXQ1StSjYGxYzn6N/WQuvQH4UmAo4uYds7Xcf/yLiVAJdcsBgZib2U LhhfCpOVLukL9pkbH/fXrdFdbQX/QjjWqmzy4ZyHjazJ0SfAuU8VRGXYRUOFVmQ554U9Z4 TfLfqzsBOk3vUUcHo2xqSoTbsFqPODezhdEcEgcdeEvaCixl0ztiy3Ln1+Xr0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759266885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nwsZ0OjVpKdIvs928ipaU8GEghFta3mc7zmA4VZNUi8=; b=x1PUhjmp1OWKK/khQ1lPvPUvd/8jEDhqrWce7595mzEDSPbS2eZuaojQDBRlOHNCN0h0eY eAMvLCOOC4jqXOPxOf0km7AENpmgf3t/FCapwMPTWDfDLWjvFzmjqytohql3FkcBm4/wd4 +PuS0UaCXNZL6+AxtZj1gGKdnKNH9lB05TDQglxzqy/RJaDVGgOY6nVGUzK0t0EywrJA/6 tCuLBeNOFQMzc7uJ4PtTCZpbC03Fm0Zf0zveMxlx0GSr3IITC+yvtszXzhmmjYvLD6cJmx ZZEy6vA2UjDmbmYnq2uyOyoh7xe6yFMIiFhBw/OvXMm2krhZTB6G1RfVISty5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759266885; a=rsa-sha256; cv=none; b=N95H5msuDJJa0DhYTkKSLIr+8CJOchPtxdCtULmiAe/auLg0/6jpXfjpUm4eK3qixA0Ppi bhngbwWCH89yaiEiIr4Jc3UL2Bb3PRzsh6bWWdNgXohcZRWTz0DKzXQ4EXisRiZaituYmv 4691Zn9aPC2GDwFsOPrtjna3soGLtJpXVJ3Ij377IZRe6/b33zaO/cQ+KhFd0is9XNDLBc MvO6MUJm3EZOzuZXwLCgqz3hVgpLbPFGr+TSWJirrz/RjFiM9nNWyBEvbWM/CBER3q3Bwu niqYW4av66RvzxjV/SgjEpPkqa8iitZmyYurt/hvfc8JmKPTKQpV51oRli01Ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbrRT1kRvztSQ; Tue, 30 Sep 2025 21:14: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 58ULEj9q010498; Tue, 30 Sep 2025 21:14:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58ULEjes010495; Tue, 30 Sep 2025 21:14:45 GMT (envelope-from git) Date: Tue, 30 Sep 2025 21:14:45 GMT Message-Id: <202509302114.58ULEjes010495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4008dd50c8f9 - stable/14 - re: Make sure re_rxeof() is called in net epoch context List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4008dd50c8f90fb076280a8ea56390f25d7519a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4008dd50c8f90fb076280a8ea56390f25d7519a9 commit 4008dd50c8f90fb076280a8ea56390f25d7519a9 Author: Mark Johnston AuthorDate: 2025-09-10 14:35:24 +0000 Commit: Mark Johnston CommitDate: 2025-09-30 21:14:29 +0000 re: Make sure re_rxeof() is called in net epoch context It may pass packets up the stack and so needs to be called in a network epoch. When a watchdog timeout happens, we need to enter a section explicitly. Reviewed by: zlei, glebius, adrian MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D51885 (cherry picked from commit b653a281f5a977ba73b3d405874f8af8e8b6b50d) --- sys/dev/re/if_re.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index a74f4898fa4a..be2bfe5384de 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -3562,6 +3562,7 @@ re_ioctl(if_t ifp, u_long command, caddr_t data) static void re_watchdog(struct rl_softc *sc) { + struct epoch_tracker et; if_t ifp; RL_LOCK_ASSERT(sc); @@ -3582,7 +3583,9 @@ re_watchdog(struct rl_softc *sc) if_printf(ifp, "watchdog timeout\n"); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + NET_EPOCH_ENTER(et); re_rxeof(sc, NULL); + NET_EPOCH_EXIT(et); if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); re_init_locked(sc); if (!if_sendq_empty(ifp)) From nobody Tue Sep 30 22:21:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbsw05yY0z69SGk; Tue, 30 Sep 2025 22:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbsw03BfFz42f3; Tue, 30 Sep 2025 22:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759270864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2x9CzpnV1zAfvwQlP5t9afE+iShYNuUtycoH6OYEKc=; b=jO+Q+WcR3sDN7fGknWCa1NO1p+rhUr6xDWdJmLjHwQwgCRK00LwwbQSWiB0pay/ox5zBry /jc3al0VqL0Is3vgwkw1QUSyqssGKACy++4MDNRH1CbkSAVJ4hTDTcCo9eHooDmDjA5RLn QQJDG8bV3gqnZWO43iyQ5PIVI24ium0S4pTV6w1noOXIOuWtlsnzFq6Nc9/PCralmCJz2Y 3qKTzHhQuqMrLHQloaDuChoZOTf4dd0D6bQR7w1HioEgF0POu6d82r4zwPI2XGF2xvxY6F lwBnPpWx0ugwpChB3b90gKY8rIRIIrpZgz6FtzBZrOEkJ/ufQHYz2A1Gk13x3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759270864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2x9CzpnV1zAfvwQlP5t9afE+iShYNuUtycoH6OYEKc=; b=UqyI0DLmWG31wU6KlkobMhGXuhIKOw/U08GNnbuGbdnmbiCJ9Ay0dXTt2FY42qeHNBlKTA 8JmNr2/zGvE1YQIWTN7jbX9HFTvlsgjEQaxCTq9haxi6hmp64anrR6MZFbNRsJdKPw0OPk cUsiaEtGxtJVY4xxgKCjUxg+IE3X7c1lTVXWUdbe4/w3vNII4Vv2qcGq1FFj7FIF01ZMh5 2cICVlUFqVBbd1UKz6RCdSuX3ViRvgcBQn1gy4huX+GmQ9+0WDAa0wUdtTFgWyT5nvpfsU N5Wn5jIMVjRciO3+reqSWA+KyLyL8mV37hUK41zsgy7T9ZiYzk180bkhnGoeqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759270864; a=rsa-sha256; cv=none; b=AZwLF9EBwhWjLNAShKNq20ua4gBCiTrB3FnxBYJv5vQZgJEQj/UGHzPYmrJx3mwQg0kQyO SandGNEuae3KFyu1h8E8sAA0LCV5EGM5Y3vKF1ofmj0ociQtYGEyFjQ9jFQp7Ggf/UPIQf Uc8/Ro4nzyLFzrRSoBIs4UhcBukE1+ajwTyK3jYnqOiqGoopPb+jE6MgaNWtNXfc2NPLMx pwzE35y9TI6WAzea7lzAh2iXiaEsOzuVj4/PljcQYC/1E59r29SdrGM4uk4zl4ajFKfJnX DpC9ABhE5sCmBbybif/gzfHHlq2BdrSS1Ci/PqOKNKuXZ9YcKjrsE7hvLoJ6Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbsw02XdYzvk5; Tue, 30 Sep 2025 22:21: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 58UML4jH038438; Tue, 30 Sep 2025 22:21:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UML4VL038435; Tue, 30 Sep 2025 22:21:04 GMT (envelope-from git) Date: Tue, 30 Sep 2025 22:21:04 GMT Message-Id: <202509302221.58UML4VL038435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d8972ad2f6e7 - stable/15 - LinuxKPI: pci: allocate entire pci_dev hiereachy up to root port on attach List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: d8972ad2f6e7113d779d4ec975ce32552030b2a3 Auto-Submitted: auto-generated The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d8972ad2f6e7113d779d4ec975ce32552030b2a3 commit d8972ad2f6e7113d779d4ec975ce32552030b2a3 Author: Bjoern A. Zeeb AuthorDate: 2025-09-04 20:22:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-09-30 21:45:28 +0000 LinuxKPI: pci: allocate entire pci_dev hiereachy up to root port on attach In linux_pci_attach_device() allocate a LinuxKPI pci_dev for each device in the hierarchy up to the root port[1] as we cannot do that later on demand as we may be in a context where we may not sleep. Take special care of DRM as there is a non-PCI device in the chain which needs to be skipped. iwlwifi(4) can hit this case called from a callout. While here leave a comment as the cleanup order of linux_pci_attach_device() needs correction seperately. Sponsored by: The FreeBSD Foundation (initially) PR: 283027 PR: 289647 Suggested by: jhb [1] Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52069 (cherry picked from commit bbeeb585315645db20118ef349a4e3dc83b148cc) (cherry picked from commit 3860afe99ec39b9942967941181f28f27f3fc548) (cherry picked from commit 123c2dc6e15a62ceba3469caf0f1a6801214a7d3) --- sys/compat/linuxkpi/common/src/linux_pci.c | 47 +++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 43fd6ad28ac4..d0f1d5e3f9c5 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -342,6 +342,7 @@ lkpi_pci_dev_release(struct device *dev) static int lkpifill_pci_dev(device_t dev, struct pci_dev *pdev) { + struct pci_devinfo *dinfo; int error; error = kobject_init_and_add(&pdev->dev.kobj, &linux_dev_ktype, @@ -362,15 +363,24 @@ lkpifill_pci_dev(device_t dev, struct pci_dev *pdev) pdev->path_name = kasprintf(GFP_KERNEL, "%04d:%02d:%02d.%d", pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); + pdev->bus = malloc(sizeof(*pdev->bus), M_DEVBUF, M_WAITOK | M_ZERO); - /* - * This should be the upstream bridge; pci_upstream_bridge() - * handles that case on demand as otherwise we'll shadow the - * entire PCI hierarchy. - */ - pdev->bus->self = pdev; pdev->bus->number = pci_get_bus(dev); pdev->bus->domain = pci_get_domain(dev); + + /* Check if we have reached the root to satisfy pci_is_root_bus() */ + dinfo = device_get_ivars(dev); + if (dinfo->cfg.pcie.pcie_location != 0 && + dinfo->cfg.pcie.pcie_type == PCIEM_TYPE_ROOT_PORT) { + pdev->bus->self = NULL; + } else { + /* + * This should be the upstream bridge; pci_upstream_bridge() + * handles that case on demand as otherwise we'll shadow the + * entire PCI hierarchy. + */ + pdev->bus->self = pdev; + } pdev->dev.bsddev = dev; pdev->dev.parent = &linux_root_device; pdev->dev.release = lkpi_pci_dev_release; @@ -395,7 +405,7 @@ lkpinew_pci_dev_release(struct device *dev) pdev = to_pci_dev(dev); if (pdev->root != NULL) pci_dev_put(pdev->root); - if (pdev->bus->self != pdev) + if (pdev->bus->self != pdev && pdev->bus->self != NULL) pci_dev_put(pdev->bus->self); free(pdev->bus, M_DEVBUF); if (pdev->msi_desc != NULL) { @@ -551,6 +561,7 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, { struct resource_list_entry *rle; device_t parent; + struct pci_dev *pbus, *ppbus; uintptr_t rid; int error; bool isdrm; @@ -594,6 +605,27 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, list_add(&pdev->links, &pci_devices); spin_unlock(&pci_lock); + /* + * Create the hierarchy now as we cannot on demand later. + * Take special care of DRM as there is a non-PCI device in the chain. + */ + pbus = pdev; + if (isdrm) { + pbus = lkpinew_pci_dev(parent); + if (pbus == NULL) { + error = ENXIO; + goto out_dma_init; + } + } + pcie_find_root_port(pbus); + if (isdrm) + pdev->root = pbus->root; + ppbus = pci_upstream_bridge(pbus); + while (ppbus != NULL && ppbus != pbus) { + pbus = ppbus; + ppbus = pci_upstream_bridge(pbus); + } + if (pdrv != NULL) { error = pdrv->probe(pdev, id); if (error) @@ -601,6 +633,7 @@ linux_pci_attach_device(device_t dev, struct pci_driver *pdrv, } return (0); +/* XXX the cleanup does not match the allocation up there. */ out_probe: free(pdev->bus, M_DEVBUF); spin_lock_destroy(&pdev->pcie_cap_lock); From nobody Tue Sep 30 22:21:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbsw14txWz69SPS; Tue, 30 Sep 2025 22:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbsw13hQTz42qV; Tue, 30 Sep 2025 22:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759270865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8IhKsguVqza+6jmLJ6mGXRX1EGH01J1c+bj/8AA3+M=; b=HKa7ZG1Rttj0Tmt2uJXbBWtx//wy7ORAHuYGM5aum4BMc60rshnI5Y5UzXMX4TwK4/hkTN 0WNrlxDxMErXuMiN3riwsPlSY/u76bDO3PPBYL0qtlgTVnzB7HMHHD3p642ENINUBUgEBz U+sHN7g3mC+KaqtUzUqI4oS1ARrEJCAK+kHVL9mIe0CDxGbOZm3k9RRjDEVBjdfWuQ7wPI YU6vkvgZBgd594Gt2Mfr3YxSlAxkz3AmRGvZikr/aJLFQ5duQL45qeq2RO3+cxV4sLSC/t Egkq3YFNA2GrnMV45HIpZzzJF4/e4c0Y8HMaFxhczcuPQdLr5jSx3i+zG/pYag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759270865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8IhKsguVqza+6jmLJ6mGXRX1EGH01J1c+bj/8AA3+M=; b=yqYmzy0uQcivy0zuBsokv8jWP9JVWGuhhUJnQP6sCO2g7TvLkAOk1QlQnOWjEr90Maf6k9 61jalQoxug/GL0phxN53Fz17+M3I3dV12FyoqzcuUnhMVa8yiol+nkm3y+eYgtyWP0J7mO YNkOfqaMfrLEbrol9ZSWzbAgKskY197/KwCKeV6sJM75VB1O7l1HpEQYBncnvCoGV6ygqF Cd+Bh5IyK2v2vfe3c/TOXrubSk3ckT2HHEbV5SulKOntq42xKxDGD+vl/bkV1ZW4dkllfe cI7w2ouf5LpEr0Ffma4pt4PpFsenr9TWxGhNsQYXEaeo3RRSrlELp7cLC4HOgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759270865; a=rsa-sha256; cv=none; b=ja361O9iinxXMtOK0RJhcH1k5aWNK4S3oXG6Cs0Gw7BUh6+/2CyVPl4vap9rq06PElvAZU auin/DEBSKdvC4ZKoalxx0UMyEHyHrLostHytXR4LA5sFImpecILXEa/ZVACBp50uBayit s7jMQ4/KuQPbeuwavJOS4XDzlNiLvtY3cruDvaJgviSFweoEs9/8zyd64EFbrghs94b1K/ a7htL7YigV74chi0NdLk3pI9rgwzL8sE6suy+dH639hTqWzVVjtReyOiYoVX0Pqu0TbV7A dJTW36GPTAgIFGVLPCwxzPEEgyeWvwtR5TDP/AKFp3HyjdbkbAiBFJr3lfJkVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbsw13FxGzvCf; Tue, 30 Sep 2025 22:21: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 58UML5xf038474; Tue, 30 Sep 2025 22:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UML5OD038471; Tue, 30 Sep 2025 22:21:05 GMT (envelope-from git) Date: Tue, 30 Sep 2025 22:21:05 GMT Message-Id: <202509302221.58UML5OD038471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 62c3b77d1d10 - stable/15 - LinuxKPI: pci: implementation of [lkpi_]pci_get_slot() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 62c3b77d1d1084dc46663eed52e288307b5c7e64 Auto-Submitted: auto-generated The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=62c3b77d1d1084dc46663eed52e288307b5c7e64 commit 62c3b77d1d1084dc46663eed52e288307b5c7e64 Author: Bjoern A. Zeeb AuthorDate: 2025-09-04 20:19:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-09-30 21:45:29 +0000 LinuxKPI: pci: implementation of [lkpi_]pci_get_slot() Like lkpi_pci_get_domain_bus_and_slot() implement lkpi_pci_get_slot() using pci_find_bsf() instead of pci_find_dbsf() (no domain). This is needed for a wireless driver. Unfortunately the name [pci_get_slot()] collides with the native PCI function. Add a guard around it and disable the use when the native version is required (in lkpifill_pci_dev() and in bnxt/bnxt_en; if the latter gets fixed we can probably also fix work around it in the former; further conflicts in drm-kmod 6.1-lts, 6.6-lts, and master were resolved). Sponsored by: The FreeBSD Foundation (initially) Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52065 (cherry picked from commit 4179e6b78297369f0cf0eae1076e01e5151c5cbe) --- sys/compat/linuxkpi/common/include/linux/pci.h | 6 ++++++ sys/compat/linuxkpi/common/src/linux_pci.c | 15 +++++++++++++++ sys/dev/bnxt/bnxt_en/if_bnxt.c | 1 + 3 files changed, 22 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index d891d0df3546..ffc2be600c22 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -1332,6 +1332,12 @@ struct pci_dev *lkpi_pci_get_domain_bus_and_slot(int domain, #define pci_get_domain_bus_and_slot(domain, bus, devfn) \ lkpi_pci_get_domain_bus_and_slot(domain, bus, devfn) +struct pci_dev *lkpi_pci_get_slot(struct pci_bus *, unsigned int); +#ifndef WANT_NATIVE_PCI_GET_SLOT +#define pci_get_slot(_pbus, _devfn) \ + lkpi_pci_get_slot(_pbus, _devfn) +#endif + static inline int pci_domain_nr(struct pci_bus *pbus) { diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index d0f1d5e3f9c5..8507a59a8df3 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -67,6 +67,7 @@ #include #include #include +#define WANT_NATIVE_PCI_GET_SLOT #include #include @@ -485,6 +486,20 @@ lkpi_pci_get_domain_bus_and_slot(int domain, unsigned int bus, return (pdev); } +struct pci_dev * +lkpi_pci_get_slot(struct pci_bus *pbus, unsigned int devfn) +{ + device_t dev; + struct pci_dev *pdev; + + dev = pci_find_bsf(pbus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); + if (dev == NULL) + return (NULL); + + pdev = lkpinew_pci_dev(dev); + return (pdev); +} + static int linux_pci_probe(device_t dev) { diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index feac3ce54a29..471e26a4b252 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -48,6 +48,7 @@ #include #include +#define WANT_NATIVE_PCI_GET_SLOT #include #include #include From nobody Tue Sep 30 22:21:06 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbsw30BYpz69SDt; Tue, 30 Sep 2025 22:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbsw25XJ1z42vj; Tue, 30 Sep 2025 22:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759270866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W8hoIBhjLy3rv4yY5CnWL2aUJcOqfMhG4QhwrYOsH64=; b=r94nTbjVjhqYhK7WCH1jJ2O9+uyPMpB5rYWi2Y4w7Ni5q408JNFYiolV0N6fY59SRQdJVQ HGGylvfiRxK5N7ZN/SEfor0HCDdF6F+mSXwNExaWVBbdP9xXl/hc+jk2oJRP1Jj9NO4nYv Hb/Jzkl4ZdpdXbBEqpCUW1nQYaNDlIKBKXjpi9aoUXUGO9T08tv0CcCvuk+6H4lp8S3Nsc W+wFUm3pvw/vkJDtLeWu97QtIJ6iyVozXAgP2mV3Z6P3zScMTTTenFpVkLJmuXTRqhCnY7 ZB0+oaPUsSfKNg1eSgJm/AhIBXjEMxp5I5+8AHRhZax0cpWZpqa5aARlYUcrUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759270866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W8hoIBhjLy3rv4yY5CnWL2aUJcOqfMhG4QhwrYOsH64=; b=kFcOQDaYuq2MDIyeTtqUkf/PfMLOqTxzNoV14mFzwDQTbIdkoAy9R20qi9cRHnF2gKkK+o BWO08tkI556b02SIaVH5EY+FeUgpiLL5+jcUhMegDZaPKX1d8ZngCmO6SYSEEctRUjZYll ThwheynvRuL2rKLnN+7bsNDAx0qwhvg6NDMKTNYPriRVWh1cmfFPlhKtexqxo0er1DKacP fVSdG2bP9Y+RO2VpiwNH0uAkTlBaYj23eFvjd0gQGQc+iZf6TBxjPnG6WtYx5pYy9xVitS KUIF9UoYqh6SjrKU47P/mhKnPiypp6+MixZLdkwzlkheWa57+qPVvv3oAWeN/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759270866; a=rsa-sha256; cv=none; b=MekvtudYpPl0El7UIidva8OhPY0BME/wiwlZINoLYKw+Mwcd0Z9W+eA63Jgd+KjbC5nmGD NOXpSiZ8SrcRM2YGg8nGmR8Qsa6hrB6HTwSDCILH6sPZHj4Mg/iFp+MLslTDnUgukfaIit T53ju4m533YAAR/bIgFAhRwt9J2rEectw6P4Fo8KMkocQCrBUEK21Ahn3pUWP6jv9qFi0b dBLMeBRnqLtASaCRVc+5WhsrIWVP5F5otvLoNq/3rePmpzUagSyIekNkvhNqaG9/nwJotp Zl4zjjFF4DP8J3ivg5h8rWp2DobNQg5qd/OSg/Vb3nkZIEYqQmN5/mmCkSGtsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbsw24X0GzvhT; Tue, 30 Sep 2025 22:21: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 58UML6UA038513; Tue, 30 Sep 2025 22:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UML67N038510; Tue, 30 Sep 2025 22:21:06 GMT (envelope-from git) Date: Tue, 30 Sep 2025 22:21:06 GMT Message-Id: <202509302221.58UML67N038510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a38672e64a1c - stable/15 - UPDATING: bump __FreeBSD_version for drm-kmod/nvidia-drm vs. LinuxKPI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: a38672e64a1ce9a156d1888ffc505252da3e4cf1 Auto-Submitted: auto-generated The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a38672e64a1ce9a156d1888ffc505252da3e4cf1 commit a38672e64a1ce9a156d1888ffc505252da3e4cf1 Author: Bjoern A. Zeeb AuthorDate: 2025-09-29 23:10:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-09-30 22:20:36 +0000 UPDATING: bump __FreeBSD_version for drm-kmod/nvidia-drm vs. LinuxKPI Both drm-kmod and nvidia-drm were updated to keep compiling and/or working after the latest LinuxKPI PCI changes. Some of what should have worked for a long time but did not or conflicted was hidden behind native PCI calls instead of using LinuxKPI. We cleaned this up. Bump __FreeBSD_version so that users will get the updated packages. PR: 289647 (cherry picked from commit 52ce810302f70cc7b995651eb1b19adfa014b351) --- UPDATING | 7 +++++++ sys/sys/param.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 127540ebed39..01c10700e1e3 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,13 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250929: + Both drm-kmod and nividia-drm ports had to be updated to either no + longer conflict on LinuxKPI vs. native PCI changes and/or to keep + working after some LinuxKPI PCI adjustments which were previously + hidden behind native PCI. + Bump __FreeBSD_version so users will pick up updated packages. + 20250924: Several changes which affect pkgbase users (only): diff --git a/sys/sys/param.h b/sys/sys/param.h index c21c086e15ad..5a66f6cee279 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 1500064 +#define __FreeBSD_version 1500065 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Tue Sep 30 23:22:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvGL25MLz69XTQ; Tue, 30 Sep 2025 23:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvGL1NXXz4BNx; Tue, 30 Sep 2025 23:22:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LhXSQA8LhN1A7I6JNTkttZ7wInYYh9B8txDeDoy1DrY=; b=PyDEVl71QG3cSQxLiPWRbDLwoTYD1weW4bCIOx2VmYh4YVGcCAg3X/C0NTq61Tkbt6bvi0 PDnj3tyMUAfjEjmgs8FKoacrGct0ntasuzQN+CvFnMsrpeYOjzN/sjBILtrMyc91csDiSh G+teOnR7nQ4+HXgVyFNr3ZYTLsaoEtVDvmkSOwIoagMkqnQFFkpsNkP6SY8ySuQ57DXEba GMYripYe0F+Dg5cWumsj7na1Ub20aS8KpFx+xf47YpxiYD5BVds1/4P17OLSJVRnZ0kik7 /05c8hg241jRSfIV9W9ii9k6ZegIKAVOK8cxBthJpi6BnItzWOu2wUoMmTOmjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LhXSQA8LhN1A7I6JNTkttZ7wInYYh9B8txDeDoy1DrY=; b=YaJZDivuTjL+rWWr5FartukkVPN3oJj1dogI76n98YEHYJ/tbdHVrUf1peSeVbvqCwHSBc YfllwQqnE7tpViEdwHDq0OuD9QozLJ8+IYakN0ahGtUCI04zJe50DS1Vh+jM7vVnni4+cv +6VGCsZBGJAgAytSygIxML7QtzAlx1ZaJe+FVfKi+VfAvqB9xKxUq8qauanl5X6437CKqW fpDQC1oB5l67E5uWlVYJMuTXOebqfvbhyEvgpemGMGYDc1k37QdxIqH28R2OtJ0xMFjO6f feG5MSSGcW4DHIaoa3Xlsvgdm0Ub0L3Yk+3mp2gbHMHdkchMzEG4AVoLwWHHrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274522; a=rsa-sha256; cv=none; b=G1I/tM/GX+TAnN3pomIP3QpgMMMXrN5H6gzdkAWcyN3dfj7GGquVr+mmDZ7CnpZm++OWHX 4zFa2BUtU95sWFViY8SwDpgv1wYVt7xovrLxAS3dCK6iYhkvTz73X/3sZ1WMtgNxeGU5Vv mIcASQrHx4FXjZwyFkhF8gvShzubkqGu9gANzRiHUY5ptr4RDhoQO8C2dDbVLC83rdrDAF pWqWTh/kLD9WNkDaismyJTUn2X4peuXN4chSAL60Gx3/qvdFiHdwmh9WlkVEdMElXS3NXX qZMOAdSWcMMu+q3l5d4mPSgpeyAUfCb1UacOOulWFcfdPwZBWLZM3i3k+5B29g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvGL100xzxjf; Tue, 30 Sep 2025 23:22: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 58UNM2fG050468; Tue, 30 Sep 2025 23:22:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UNM2Qm050465; Tue, 30 Sep 2025 23:22:02 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:02 GMT Message-Id: <202509302322.58UNM2Qm050465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 8f4e196e7ee7 - stable/15 - rc.d: Fix ftpd flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8f4e196e7ee79afdf00f1ca2c41db5dcb7846d22 Auto-Submitted: auto-generated The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8f4e196e7ee79afdf00f1ca2c41db5dcb7846d22 commit 8f4e196e7ee79afdf00f1ca2c41db5dcb7846d22 Author: Jose Luis Duran AuthorDate: 2025-09-28 09:12:41 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:15:42 +0000 rc.d: Fix ftpd flags After f99f0ee14e3a ("rc.d: add a service jails config to all base system services"), the FTP service ignores the flags configured in ftpd_flags: # sysrc ftpd_flags=-B ftpd_flags: -> -B # service ftpd enable ftpd enabled in /etc/rc.conf # service ftpd start Starting ftpd. # pgrep -fl ftpd 1234 /usr/libexec/ftpd -D Notice the absence of the "-B" flag. PR: 285600 Reviewed by: 0mp, emaste Approved by: emaste (mentor) Fixes: f99f0ee14e3a ("rc.d: add a service jails config to all base system services") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52745 (cherry picked from commit 2872ced18742aaf9480c9a43059cba7e24dd7e59) --- libexec/rc/rc.d/ftpd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ftpd b/libexec/rc/rc.d/ftpd index e25a561a520a..5a4fd49e36f1 100755 --- a/libexec/rc/rc.d/ftpd +++ b/libexec/rc/rc.d/ftpd @@ -12,12 +12,11 @@ name="ftpd" desc="Internet File Transfer Protocol daemon" rcvar="ftpd_enable" command="/usr/libexec/${name}" +command_args="-D" pidfile="/var/run/${name}.pid" : ${ftpd_svcj_options:="net_basic"} load_rc_config $name -flags="-D ${flags} ${rc_flags}" - run_rc_command "$1" From nobody Tue Sep 30 23:22:03 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvGM3YSNz69Xg3; Tue, 30 Sep 2025 23:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvGM1bhsz4C96; Tue, 30 Sep 2025 23:22:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZS0hl+T4zg23YAJ5p6lbL9ZUW991WlXnopcdp6g3I4s=; b=mHScspRffOvV9qnY0JaH5QIYqghRt/X50BjoRFzM3bvKliWbzCdKVVerhNGnnK8LBoxWxU NQCfBWZzFXwOi9XoY7voXJkyvP5FyRdbJK7G3p3ky7/xvA8rCG9vUBha8LFDp1I0VE8hig XlC7ot/o0I2cbO1fCgWKh1XQxv0M/STil89pFPGRGv7zNuQCjTUuK/lMt/PsIzgWMOkNHr eviOyiFpgUZL81YuxqYQcz0kKmFEblQlOx/algSV2XlUjF68BiYHI0YF0sf79u7oCCyk7v GIM3A0kPvFruQkT1FjAhDj05hDBHiOC7fNw+MyP5saet/VBXkw7duy5sogoRjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZS0hl+T4zg23YAJ5p6lbL9ZUW991WlXnopcdp6g3I4s=; b=pPffe5IR4nuNjqM3AmQ+o9NvLFfKIVoeuG8StWjGA/aikxdzTFeolK0AO/FrVICtnSO5F4 uUMHd5rjPc62cIzUl/MROdmTz8mLF/IuqT/pX6mizmEr2wooZf3k1ERfs2sgRCcmG+t+tR huSvqGnnHYhYYn4HBOfbjME3fT8DRza4kWL/6IiorI31b5CdFSVJhzxtUWsacpTppFCNbx RzQLGUtTltAS8/WwmLzFZGy7Jyoz78jqBbc06/BaZawcj/6id22UJGiNP9LOcDTGHf1yDe +KbeZLI+W0I9Ovj0aAKNJ8ksfOkxjKz3CwYWavo4yPurdDRSAfl3TpLP5S862A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274523; a=rsa-sha256; cv=none; b=i3UmWkWPoEA5NLJJEYLFbuhg4wcAxy0fhSAAi8vg4rTQWAQD7EDaYM0orHD0KmvelAB06V Yt6JrtrLxBLB9weL/NpI+w3aLDEnzZ3GuDfTVnxeDPRYpBioUUTH2DlX50qh4C7l8HhHMY faH9ymZKXPY60OkmOtRO65MbzHCS6ox4A/Ysh2FWRuEv0YlNeMA8lpjwzCchzJOG5VlTAZ wwLVjXmxTKLfW+pdwTQ4opDGsoNRLKNIgepQCMBzCtYU/t4QHiUOU4AQq60JIiuOZfotG0 4+aa5niPP+ou7DQnh6l5YT7+tU26KAQk3/XgGtNrzgTt4eqTCiSmYv65icPIEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvGM1Bd6zx9g; Tue, 30 Sep 2025 23:22: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 58UNM3vH050510; Tue, 30 Sep 2025 23:22:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UNM3Sp050506; Tue, 30 Sep 2025 23:22:03 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:03 GMT Message-Id: <202509302322.58UNM3Sp050506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 268e74d14913 - stable/15 - ftpd: blocklist: Add an extra probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 268e74d14913ddd539ed6e4f0b19c9d04a1971cb Auto-Submitted: auto-generated The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=268e74d14913ddd539ed6e4f0b19c9d04a1971cb commit 268e74d14913ddd539ed6e4f0b19c9d04a1971cb Author: Jose Luis Duran AuthorDate: 2025-09-29 16:26:54 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:16:45 +0000 ftpd: blocklist: Add an extra probe Add a blocklist probe when user access is denied. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52747 (cherry picked from commit 307929b211e07f91260105211b57678e906327af) --- libexec/ftpd/ftpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 751d77b218b7..3861036a5a8a 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1043,6 +1043,7 @@ user(char *name) (checkuser(_PATH_FTPUSERS, name, 1, NULL, &ecode) || (ecode != 0 && ecode != ENOENT))) { reply(530, "User %s access denied.", name); + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Access denied"); if (logging) syslog(LOG_NOTICE, "FTP LOGIN REFUSED FROM %s, %s", From nobody Tue Sep 30 23:22:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvGN4mR1z69Xg4; Tue, 30 Sep 2025 23:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvGN3GDyz4C9R; Tue, 30 Sep 2025 23:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MnN/baBrKxQRAZk7nkroY8UYMSASPVWuGx4DhOTSa7I=; b=FCVOHZLINtk+auoboVqoyS/rJVKiFOKkY/vnJ3yWHAgLfqm1epkrbtB9+6dI5g9BjjADJD CsEFVBDiAeMbAvBStUgpBN2+OlBo2ejXkNTlWigf9j2VuJq80Lf7TChu8oy1Aa+p4uOllS K8LKkr8TDjA4URVllKxab7Ew6n7gH/fxUUvpXvKqYlnX8xbvNYhjeu1CUNQ6mVoXZVFQub M+hpKoZiplEM0CJQi3M7XS6CmS2SkTLBPoZthuE7B3EvV1wxTb0Eb7EA/rUtbJ/TXg35kG sDQVeGPCMKtU/Aqp3I8I4c02yRbYTW/dYCaUuMNsfkxEb6OmFr/RzC8ddKonog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MnN/baBrKxQRAZk7nkroY8UYMSASPVWuGx4DhOTSa7I=; b=I9fM+SiNBUG+nXAGPxpdoZzASfbZOqsuw3yI2ozzBPitWoWqpbtUuH8V+np1Ai1TkfecG3 Azt5Vb9SoXANa44knZG6l5bR8Qm51kWX54jlSqvuJg2VGU6bMvvGsFdgeHVkZDo00lf+kz lD7UtzoSC5MJmDO5/O+hTxSXHOUIZUU2L0FM9PfQm9vL2xBbEVVeULxix23n+Nfo8I+uHp JKx/TcUTgimN7eVtmH0wzUp/NAyp6E5HTjyCk+hF+7yXR4ugHNwgDWunTJv2OjJBS6mneJ QIQyZC0YbDziQoyUdtAvZwXM4UUnDL9Orf+zxZClWKlVqWH7gTZRSUgJjRRIHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274524; a=rsa-sha256; cv=none; b=xBr7NVSnLeFfR9CT9Abnn2Vu32ti1czgdd1bwdSjBNPaTHzzZi8kp5i8y0R3KcHWg4h3Gf cYKIMIVve3RiudCm1Ew3RrYAoud/O1sPR6JnJzbc8rj4KJPk7UYocfWBlZCGCHSGEgusYY YhtjzcxMXgt3RoiiDnhM6vacpsrZTpAXwV38mipeeWYR4fENCARjfwHxgAf41oiy/hC+Ao Sfc9d7tpv1PUVbMV3rsl3lDGy2cmzhYQT8UHVZLOdTXKcxYa95cbzE6dmvY2HxdLL9XhOP t+o4J4DZM/9OJCYruMpU9gtQQgNqJTYvv5N6EtXrPFS/hQw3aY9QwdpWaKZt+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvGN2JLTzxjl; Tue, 30 Sep 2025 23:22: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 58UNM4NP050552; Tue, 30 Sep 2025 23:22:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UNM4Co050549; Tue, 30 Sep 2025 23:22:04 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:04 GMT Message-Id: <202509302322.58UNM4Co050549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: ec4771b17b42 - stable/15 - ftpd: blocklist: Add a permission denied probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ec4771b17b421fcee29cd275f53d34c2f46f9d04 Auto-Submitted: auto-generated The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=ec4771b17b421fcee29cd275f53d34c2f46f9d04 commit ec4771b17b421fcee29cd275f53d34c2f46f9d04 Author: Jose Luis Duran AuthorDate: 2025-09-29 16:27:24 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:17:02 +0000 ftpd: blocklist: Add a permission denied probe Reviewed by: emaste Approved by: emaste (mentor) Obtained from: NetBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52746 (cherry picked from commit 1060684b04b0ee1e07c6c91f7c52978835ff676a) --- libexec/ftpd/ftpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 3861036a5a8a..9c3516710133 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1425,6 +1425,7 @@ skip: *remote_ip = 0; remote_ip[sizeof(remote_ip) - 1] = 0; if (!auth_hostok(lc, remotehost, remote_ip)) { + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Permission denied"); syslog(LOG_INFO|LOG_AUTH, "FTP LOGIN FAILED (HOST) as %s: permission denied.", pw->pw_name); From nobody Tue Sep 30 23:22:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvGP5VxGz69Xg7; Tue, 30 Sep 2025 23:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvGP3sD2z4BHp; Tue, 30 Sep 2025 23:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7q+/mdERkX7bDMV12ttmU04an7qZS9SVEhjcYCQuWE=; b=k+ZmdHlLSXBQRN7GLDdu6r8nwTkRa+i2gK23tx1qQ89Vv3rdDUiOPa5rjrS+Tz7Dmj3dnC c2aqPJ9K9n4qJvrqswBEKIt064TpA7tcVciSebq6taqY8Xp/sv/15ASKRMw57/doA3G4SX 7/OJLFJJgsylVMG+XYvH/MgTvbrJrO6R4aVFp1F3zertmrl8f59VShhJeNzoSsaCagUnSl /3UpLueHJO3dTrZLMRejSIHT/WEVo8joUiG4ulOPBn5UDXI5NmRvX4BjCsUcccMi+89SHH 0UOHEY42PE41vvmQZy18uP4mrW4QwFkEqylLvcOAcJMBDN9rXw01CtNv9Cv6Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7q+/mdERkX7bDMV12ttmU04an7qZS9SVEhjcYCQuWE=; b=C79mu80zsprNbw3X779CfISSpBh6DQMZjOqs8/q/WcDT/m3mSjrVmgGkZekhx0VobMpan1 84eA933DNuc1GZci9xOINeixZD/Wnv1KQFUiRS/2KZ6CaQz5BMg6JYCrjAEy4mSeotZWLy 2Sc7TLjGFRg9Bs2Daodd9QoLX/ARridAagR1N58CpTqRNKvGUQxp1gZrmhDxKzlTORLarK 0ELfwd/JuQIvx1a295/MYy2rsLw+T/l6QOsC2CEJkIA16nTi8lYDMdmzwWW+oUof6BwQA9 WpgJg7A7PNDOB3u48yhvqVtNxMYG6b2g5tG0KEVTyf+DpjOMq/f97a4U+G+4aA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274525; a=rsa-sha256; cv=none; b=XWecjgnr34+yNE+aVAVxceU/5jyFNlEsy5GRVFSzbU1o815sP+grBRs8KBGZWzMdsgvA+3 LgGycYGe214QLMvoAJK5YR5B+dY0j0rLCC7U1XeWe7WonQgpVgrfJBWzt5zHuEzz0O/7nb xPobujSD/ZAwqrt0BKwi505vN754765TFTncGxrwcGIbpJ8cRsQ0Xubkgg4v9/Vp4dP8wr grbk2jwJ8F5EKK+2p4XlLwggvsO1v7uwnOz7KJ9TTyZM+2rSmol6Ukqc9r9nws1mucHjdf qgvmJCjDI1iNHuAYX0sp63HC8DstC5TBKODa32NH1zKkDkTOmboekkGiBvWJDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvGP3PB6zxPL; Tue, 30 Sep 2025 23:22: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 58UNM5qc050589; Tue, 30 Sep 2025 23:22:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UNM58g050586; Tue, 30 Sep 2025 23:22:05 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:05 GMT Message-Id: <202509302322.58UNM58g050586@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 53dc967db74f - stable/15 - openssh: blocklist: Use NetBSD probes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 53dc967db74fba0d7b5bed413a7bc3216f16c55d Auto-Submitted: auto-generated The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=53dc967db74fba0d7b5bed413a7bc3216f16c55d commit 53dc967db74fba0d7b5bed413a7bc3216f16c55d Author: Jose Luis Duran AuthorDate: 2025-09-29 16:32:36 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:17:21 +0000 openssh: blocklist: Use NetBSD probes Use NetBSD probe locations for consistency. We have submitted all improved or missing probes, keeping them synchronized with NetBSD (our blocklist upstream) should simplify upgrades and maintenance, as the locations of these probes are a moving target, depending on upstream OpenSSH changes. Additionally, use BLACKLIST_AUTH_FAIL exclusively for now. At the time of this commit BLACKLIST_BAD_USER, is a no-op. However, it will change in a future upgrade. Also, enhance blacklist notification messages for better debugging by making them more descriptive. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52749 (cherry picked from commit e02003bce726333872d65b7b9a1557d97b6d91a0) --- crypto/openssh/auth-pam.c | 4 ++-- crypto/openssh/auth.c | 6 ++++-- crypto/openssh/auth2.c | 5 +---- crypto/openssh/monitor.c | 14 ++++++++++++-- crypto/openssh/packet.c | 2 -- crypto/openssh/sshd-session.c | 15 +++++++++++---- 6 files changed, 30 insertions(+), 16 deletions(-) diff --git a/crypto/openssh/auth-pam.c b/crypto/openssh/auth-pam.c index f95f6abbcbe0..df08dbd99a9d 100644 --- a/crypto/openssh/auth-pam.c +++ b/crypto/openssh/auth-pam.c @@ -937,8 +937,8 @@ sshpam_query(void *ctx, char **name, char **info, sshbuf_free(buffer); return (0); } - BLACKLIST_NOTIFY(NULL, BLACKLIST_BAD_USER, - sshpam_authctxt->user); + BLACKLIST_NOTIFY(NULL, BLACKLIST_AUTH_FAIL, + "PAM illegal user"); error("PAM: %s for %s%.100s from %.100s", msg, sshpam_authctxt->valid ? "" : "illegal user ", sshpam_authctxt->user, sshpam_rhost); diff --git a/crypto/openssh/auth.c b/crypto/openssh/auth.c index 961082b76667..0a1c8f71b390 100644 --- a/crypto/openssh/auth.c +++ b/crypto/openssh/auth.c @@ -289,7 +289,8 @@ auth_log(struct ssh *ssh, int authenticated, int partial, else { authmsg = authenticated ? "Accepted" : "Failed"; if (authenticated) - BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, "ssh"); + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, + "Authenticated"); } if ((extra = format_method_key(authctxt)) == NULL) { @@ -338,6 +339,7 @@ auth_maxtries_exceeded(struct ssh *ssh) { Authctxt *authctxt = (Authctxt *)ssh->authctxt; + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "Maximum attempts exceeded"); error("maximum authentication attempts exceeded for " "%s%.100s from %.200s port %d ssh2", authctxt->valid ? "" : "invalid user ", @@ -498,7 +500,7 @@ getpwnamallow(struct ssh *ssh, const char *user) aix_restoreauthdb(); #endif if (pw == NULL) { - BLACKLIST_NOTIFY(ssh, BLACKLIST_BAD_USER, user); + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "Invalid user"); logit("Invalid user %.100s from %.100s port %d", user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); #ifdef CUSTOM_FAILED_LOGIN diff --git a/crypto/openssh/auth2.c b/crypto/openssh/auth2.c index eac1d26a4aaf..82f6e6211259 100644 --- a/crypto/openssh/auth2.c +++ b/crypto/openssh/auth2.c @@ -52,7 +52,6 @@ #include "dispatch.h" #include "pathnames.h" #include "ssherr.h" -#include "blacklist_client.h" #ifdef GSSAPI #include "ssh-gss.h" #endif @@ -443,10 +442,8 @@ userauth_finish(struct ssh *ssh, int authenticated, const char *packet_method, } else { /* Allow initial try of "none" auth without failure penalty */ if (!partial && !authctxt->server_caused_failure && - (authctxt->attempt > 1 || strcmp(method, "none") != 0)) { + (authctxt->attempt > 1 || strcmp(method, "none") != 0)) authctxt->failures++; - BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "ssh"); - } if (authctxt->failures >= options.max_authtries) { #ifdef SSH_AUDIT_EVENTS mm_audit_event(ssh, SSH_LOGIN_EXCEED_MAXTRIES); diff --git a/crypto/openssh/monitor.c b/crypto/openssh/monitor.c index 2179553d3401..b826ecdb9065 100644 --- a/crypto/openssh/monitor.c +++ b/crypto/openssh/monitor.c @@ -85,6 +85,8 @@ #include "misc.h" #include "servconf.h" #include "monitor.h" +#include "blacklist_client.h" + #ifdef GSSAPI #include "ssh-gss.h" #endif @@ -353,16 +355,24 @@ monitor_child_preauth(struct ssh *ssh, struct monitor *pmonitor) } } if (authctxt->failures > options.max_authtries) { + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, + "Too many authentication attempts"); /* Shouldn't happen */ fatal_f("privsep child made too many authentication " "attempts"); } } - if (!authctxt->valid) + if (!authctxt->valid) { + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, + "Authenticated invalid user"); fatal_f("authenticated invalid user"); - if (strcmp(auth_method, "unknown") == 0) + } + if (strcmp(auth_method, "unknown") == 0) { + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, + "Authentication method name unknown"); fatal_f("authentication method name unknown"); + } debug_f("user %s authenticated by privileged process", authctxt->user); auth_attempted = 0; diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index cc114c837e31..9dea2cfc5188 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -96,7 +96,6 @@ #include "packet.h" #include "ssherr.h" #include "sshbuf.h" -#include "blacklist_client.h" #ifdef PACKET_DEBUG #define DBG(x) x @@ -2022,7 +2021,6 @@ sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap) case SSH_ERR_NO_KEX_ALG_MATCH: case SSH_ERR_NO_HOSTKEY_ALG_MATCH: if (ssh->kex && ssh->kex->failed_choice) { - BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "ssh"); ssh_packet_clear_keys(ssh); errno = oerrno; logdie("Unable to negotiate with %s: %s. " diff --git a/crypto/openssh/sshd-session.c b/crypto/openssh/sshd-session.c index 902718524279..62c76cc1c8aa 100644 --- a/crypto/openssh/sshd-session.c +++ b/crypto/openssh/sshd-session.c @@ -217,6 +217,8 @@ mm_is_monitor(void) static void grace_alarm_handler(int sig) { + BLACKLIST_NOTIFY(the_active_state, BLACKLIST_AUTH_FAIL, + "Grace period expired"); /* * Try to kill any processes that we have spawned, E.g. authorized * keys command helpers or privsep children. @@ -1201,6 +1203,8 @@ main(int ac, char **av) ssh_signal(SIGCHLD, SIG_DFL); ssh_signal(SIGINT, SIG_DFL); + BLACKLIST_INIT(); + /* * Register our connection. This turns encryption off because we do * not have a key. @@ -1277,8 +1281,10 @@ main(int ac, char **av) } if ((r = kex_exchange_identification(ssh, -1, - options.version_addendum)) != 0) + options.version_addendum)) != 0) { + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "Banner exchange"); sshpkt_fatal(ssh, r, "banner exchange"); + } ssh_packet_set_nonblocking(ssh); @@ -1298,8 +1304,6 @@ main(int ac, char **av) fatal("sshbuf_new loginmsg failed"); auth_debug_reset(); - BLACKLIST_INIT(); - if (privsep_preauth(ssh) != 1) fatal("privsep_preauth failed"); @@ -1425,7 +1429,10 @@ cleanup_exit(int i) audit_event(the_active_state, SSH_CONNECTION_ABANDON); #endif /* Override default fatal exit value when auth was attempted */ - if (i == 255 && auth_attempted) + if (i == 255 && auth_attempted) { + BLACKLIST_NOTIFY(the_active_state, BLACKLIST_AUTH_FAIL, + "Fatal exit"); _exit(EXIT_AUTH_ATTEMPTED); + } _exit(i); } From nobody Tue Sep 30 23:22:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvGj5sFFz69YH9; Tue, 30 Sep 2025 23: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvGj2V9Gz4DKY; Tue, 30 Sep 2025 23: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=1759274541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DfPtbf2x5MXmWhddD1r/g+6T6OYRCFlJNk4mYOFLKRo=; b=uMdS9LEDH7dPTTZ+HEEl8NoXtwC/OzX9EQ1X/ddNjCKf13DAJkQLmk2UjJ+5LwyGicRpnZ YdiVqUQWullb/o9eJTttl36pt89oHbraIznmiWt1/yBSccXBEv5XLWUQ+oxcZ+2rr4ggoX 3ahkP6nHY4/i7Y+nJZ0nCvoeW7zA89D1vSREH4VjtF5rmxpc39Wtx3zLOuHryxdZcs+lVb ANcc8pINI2V16Rnx6R1fQxjQUZEzbpFODjAmd2pZM7GxnV4WGb69taW3hISATGuhx5nFaA crtGA+KaajvejWySIo9IGmGdhS0yTuFiUdjWcFhvJggH2+b1lAKeJh2UGmexHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DfPtbf2x5MXmWhddD1r/g+6T6OYRCFlJNk4mYOFLKRo=; b=u9zRTH363bcwygKfIXZpZPpqg6WY+r6m3bkW+hxbgMUG4OQurBodPsmRUA8dbjNHD2lve2 UhxkQQCXJ6giX86xmFHk7oPha8cx6hzz9pZ9jQXvcX59zNXbYMlpFR3BCdbwUjmZfdI107 eW+LHdRjEnpOxB302qTRzxwryGl1cIaoFyvUUBRmWIKSVOohQHhzoW54vJLgPtu5g8QeZD rUOExKvWTau9itXkWcH3XNsRYuREPxZJVjUJZKkLYXy5FzINOQejbPCG7nt+2rHsLjOOp8 Xz+4Y/M/PBn7Rd2vSX1A3stbJEpafGPi3TrOkhOkwxOoPWE7UpHdhAuilZtOhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274541; a=rsa-sha256; cv=none; b=fgDyD/faicAeGQXklVdaj6OxvC8UE5t7qB81fjB5G3elZUXcOIYLOr9DTIn+0J6E2w3rta 01zWLbD7v6Pyzv7sE9PKZp01IPTsG+oujOeMPWDQny522GX05N7nKMWqQi7Wpiuqye3Rxp EC3ZfHTZsUq1Qylh1J2iKEPDkBnWcLG4XkIBvwrvzzbzCs20ogacUEq8cosIdF9/fxfMXx x9YY0rLG7GeBFNMW41jy54GTpz5SoyUMbQQ3NDfKqMzGg/pEi1szothLEnIttTKZEpqeO9 /FnLa6L8iPkXFd0IHp2+nrxkb/+6NIYBPpAJ8AZ/EVYiP+IgkJev7Ho6eHt0tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvGj1hnFzxCk; Tue, 30 Sep 2025 23: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 58UNMLRd052086; Tue, 30 Sep 2025 23: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 58UNMLd0052083; Tue, 30 Sep 2025 23:22:21 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:21 GMT Message-Id: <202509302322.58UNMLd0052083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: c16bb89bff43 - stable/14 - ftpd: blocklist: Add an extra probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c16bb89bff4317d27ac81a273eb435f835606a3e Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=c16bb89bff4317d27ac81a273eb435f835606a3e commit c16bb89bff4317d27ac81a273eb435f835606a3e Author: Jose Luis Duran AuthorDate: 2025-09-29 16:26:54 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:18:33 +0000 ftpd: blocklist: Add an extra probe Add a blocklist probe when user access is denied. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52747 (cherry picked from commit 307929b211e07f91260105211b57678e906327af) --- libexec/ftpd/ftpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 11811da35cb5..d8e233acae61 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1047,6 +1047,7 @@ user(char *name) (checkuser(_PATH_FTPUSERS, name, 1, NULL, &ecode) || (ecode != 0 && ecode != ENOENT))) { reply(530, "User %s access denied.", name); + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Access denied"); if (logging) syslog(LOG_NOTICE, "FTP LOGIN REFUSED FROM %s, %s", From nobody Tue Sep 30 23:22:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvGm0frYz69Y8R; Tue, 30 Sep 2025 23:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvGk3b0hz4DHK; Tue, 30 Sep 2025 23:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdaCEOZjU7r9wki2NdMWJ+7gvNz6T4deJMx83uQSq/E=; b=mNHOQYkCJYUK+jclcreh1m8M5FicMMhaZTGiPZSYY1EdSZ0huBefQDOLW4xIOKDzAsAiTG WdJP5ixIUa50/qzb9f0zIUgK+FyWCgAoliukrkdfAFpDE0yZkAic2jXhMSC66xiM9Yz9sw C0+a/JMKR/Vprt7M3kPTX6oGG7x8FqGQZju7QnvnIyjF0rclfhXGb2rRRVVDXq86+vWMH5 YlDoXT9isYiW/ml69Oq7ZuTQoMh6KeJi6bDzN9uTUvCGX/RCaYsprN+8M1bEGyAQTJZCNc /JBxeQQTMk688aPyQdxNAcConvcz5z2gpA9PZXjv+6SIlq5lE81B0n0O206b1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdaCEOZjU7r9wki2NdMWJ+7gvNz6T4deJMx83uQSq/E=; b=ThCOXAqGvEKGihFik6em/6nzcZqkIeqIYb2T4zEX7we2pNSbMugL2WCCh8DA3/YRihAKyj hQKvYCsYoEjovarwEznaJZ7no8GaMVpJWOfk2/UPtD6ZGLWUaf0HAtaoiawVMuGEHKkJ8k 6hgcXKvxHp9jw7yT/2Os3MDdghTB8vki5ePEd3FHseLw7hvwC5nMHN53g769tq61htBPUB rx6s+Y0UXvyfwtKkrKeV0iZVOAKB8IacMZS1ggYb7KWw9SmQxj/g4B33ekxfmmSbbCjTDo ieQPhhbDmMS8BmstJ4lOtpky7hG/dqnZCiu0ugRd7OmUUIWU2qSILRI0XjLggw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274542; a=rsa-sha256; cv=none; b=AGzCL2eu2Bca7ha5PrKsDbkqGKzWXPq0NQC9i0lo/l5M2wRrq04pa1bDMyVVAcJFNO8PKo 3kBMF7a0q9ZNwwHlGpOunDC0pugxb5SfOSpdUxwZAGwMeKTRj1gUpWvMFCm1F/CV8rlykD 4HK3S5ru+ApwYliJKmtaNtvcK8V4AfGad0C34Zb3+g9CzR2vuO6CH3RJ2hKIxPb6V4FRO3 CVVnMZsixW4T4JKCPMKYZ1pc9hg4zbJlmU41q41YDTIsm2Rm9jv7pEpodMDjje5lqT793w MqWpgwxtDURpxhuy8FGCzJBB7A7otpRFir0XdN5cuCcxyfxyZfLDdbs4CLlvDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvGk2xVjzxXx; Tue, 30 Sep 2025 23:22: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 58UNMM86052128; Tue, 30 Sep 2025 23:22:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UNMMWQ052125; Tue, 30 Sep 2025 23:22:22 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:22 GMT Message-Id: <202509302322.58UNMMWQ052125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 2814da5d5dc9 - stable/14 - ftpd: blocklist: Add a permission denied probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2814da5d5dc9d0e29a7ad4b9d10f452c1bd63ca5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=2814da5d5dc9d0e29a7ad4b9d10f452c1bd63ca5 commit 2814da5d5dc9d0e29a7ad4b9d10f452c1bd63ca5 Author: Jose Luis Duran AuthorDate: 2025-09-29 16:27:24 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:19:53 +0000 ftpd: blocklist: Add a permission denied probe Reviewed by: emaste Approved by: emaste (mentor) Obtained from: NetBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52746 (cherry picked from commit 1060684b04b0ee1e07c6c91f7c52978835ff676a) --- libexec/ftpd/ftpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index d8e233acae61..7eebe7c2cb53 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1429,6 +1429,7 @@ skip: *remote_ip = 0; remote_ip[sizeof(remote_ip) - 1] = 0; if (!auth_hostok(lc, remotehost, remote_ip)) { + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Permission denied"); syslog(LOG_INFO|LOG_AUTH, "FTP LOGIN FAILED (HOST) as %s: permission denied.", pw->pw_name); From nobody Tue Sep 30 23:22:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvH24yPvz69YF0; Tue, 30 Sep 2025 23:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvH23GBBz4DS7; Tue, 30 Sep 2025 23:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Huyo83ZRO6LmoqAD/r76/KCeMGjCd/d247IKkFxY1ec=; b=pR6KBvdTMw4GbdZBhTDHcozEBUWRiCfT/4F5IrXL6JmSOfUjmBgsNocbVrO9DaZcDwjVTN a68IPIGHFsXJub4iO7f1P15yoG8AhgEptAUsIEb/ynGOfh5EBRj7mHWx88sWkpe/e6qVG1 EDw6U+j/RaI7h+2uYJav6Rrx4HTU5I5vSaI9vWmsx/cd0D6Wih3i1nffEpaWxhaXoannli BfHXbBu0XJswQnEDiBFv0O+pyX/Kq/R5Seall7parTPsrY4Ac9JU5L0BNMZ8i5qu3+zsyp tpghcYmeCrr7BD8J4IjJfU32NfubeklfjPvhl4oH0uiNiExJtWuuuonCkw9Rkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Huyo83ZRO6LmoqAD/r76/KCeMGjCd/d247IKkFxY1ec=; b=Dhz80B5XvaZYZBTY4XMilypcMnWd4EWjVzKZBjidFAih7tYM/1odJfa1v+XFSi5E3BgJQ5 XM0u27BcsTU8vC1o6hKkyf4nxtae4lySd6YkbmaZLWOorb6YZN6w0bq5K+SDoNN7cOG1BP HXWNRxTdfUbtgKMbti0mCVgyiMlxr32GKVUaoH37EIqnrIg6Mo85+IJAUoh3dYtWJ8LGhG lE3eI6f6GPIGmfs8qVtHIYGDCtLAedi202b71DkfgXkZJ0J1CyQBk3G+GHddcBq8lgI/Rv EZ+Pakj/bpEZWSQilLMoZQHZm1XIjCutHI170RHMBgBHW2oKRYeVDgivkpA0ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274558; a=rsa-sha256; cv=none; b=ll3hWUz1lsK/sticwpIM0koDyNWgYuS//j4h/gTYy3NkC0kmf5zNL6c5tXJr+eehMrb4Of EVqf+MpVgnWUCsxjbQ407cO35LqjVQjcPfOHi8s/A3J2PWcnpeun/Mvw8lCbVxomRIFpCu N1r4qvgEPAMZR+P6I42uH0aRR2VcX36IffLlh3fETh+FupIebPIe0ByaL1vrZAff/2Z0PC OIpTAGlgwcI6Zk4nG/n+I3SYUrS9IYp/Z96nWNba9Zj9oehBNFudo0GxYHnG7SA6GHa8+b GeFI1hASm1Z+kXF5qgJIRlFtkegh+IlnAqsyRO/KrRDUyBTFIU9WzLq8cA84wA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvH21MrHzxPQ; Tue, 30 Sep 2025 23:22: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 58UNMcoe055629; Tue, 30 Sep 2025 23:22:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UNMcNH055626; Tue, 30 Sep 2025 23:22:38 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:38 GMT Message-Id: <202509302322.58UNMcNH055626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: da2437b62ec1 - stable/13 - ftpd: blocklist: Add an extra probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da2437b62ec1ddda5c25dc872ab0b1a84d6306aa Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=da2437b62ec1ddda5c25dc872ab0b1a84d6306aa commit da2437b62ec1ddda5c25dc872ab0b1a84d6306aa Author: Jose Luis Duran AuthorDate: 2025-09-29 16:26:54 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:21:06 +0000 ftpd: blocklist: Add an extra probe Add a blocklist probe when user access is denied. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52747 (cherry picked from commit 307929b211e07f91260105211b57678e906327af) --- libexec/ftpd/ftpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index da087cec4cfe..b525ed99fe48 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1052,6 +1052,7 @@ user(char *name) (checkuser(_PATH_FTPUSERS, name, 1, NULL, &ecode) || (ecode != 0 && ecode != ENOENT))) { reply(530, "User %s access denied.", name); + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Access denied"); if (logging) syslog(LOG_NOTICE, "FTP LOGIN REFUSED FROM %s, %s", From nobody Tue Sep 30 23:22:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbvH35nBqz69YHW; Tue, 30 Sep 2025 23:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbvH32m1Pz4DSJ; Tue, 30 Sep 2025 23:22:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=blcSO7mgcx8qlsSgFvEmqNQvhov4Rgzjf4QrRkrpN2w=; b=ykZvkdBSY09m5QIl1SvUxcRrm0h+e37VJH7xlQMm/+LfUhYyWdClbYclBBamaWu9yapslg q8UG3zngmTo37YsKpEowbntxPZZs1YCAbLy+a7PLTUMTa0juiKa4TUN5XZ9nj6ePDrE/uG sHpuN8DgqTPBjYAIgRk6qTc9NBWdMTTxPGWqC9oy/LpQewpwn7QEQwmMoet+bsJF0/eMXF KtDb6mhqQx0j9e2YA9Y74isAkmJi7pPbe9TLcTujtg95PlZ+YLnXNogIkySXDQiWYWLqEM miq5LAAdPsSAiDsa2R+832wKeE9PD6VpxiFzUWQE5lFakSJgbjJWEbIOBGPntg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759274559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=blcSO7mgcx8qlsSgFvEmqNQvhov4Rgzjf4QrRkrpN2w=; b=C7xyRR4xoBEgOj78YK9XGwwz77Tn1jkR1U6nWPxHKZv8O4orLUbRVoHg2p9tairn7yyAA+ MGUhyq90WK2iTW3aFv9RLYDOhjub1O0FQRaLfIcVS68rlp9v1QQSJYoC83FjWFd0MSmPen E1g0cDX53i6BMWw58CgalCCfsQ+OMtcbUgopjxYj05Onv/6estUyCrpuXHaJIgOF7Wf4xr f0f9fZCFWGGN+PmHX9ceU+R1QvgtOBxqcewch9y8RT02tHnGRN4qGYXX8IJVGmKGKS6EAr UkbUM4XtqgXgcmoqVRt4osj4D6pT7K+tHU6cC4o3f7hX3DyT8j7+cOydiM3Q7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759274559; a=rsa-sha256; cv=none; b=Ib9Ibyzh2b/IPS2hrY6gGuAHu7YqTamQrw5XTLbVp2TUpvuKRFQb60mMCYksiT3IBVAFoU /FG8QVudFq2jji/VcfEJMqaGOq7QiD2ulesYSBW5jK5d71T2c6SULfntifnoF7lA/xGgIO 4Q28zFUaWBnr8gk8JdXDTmI5laSOKa30ObbzvL9IbDxWlDIFwoh/F0ptahE7QehRHM82V1 yOA3ZVJg71gORRQQSaD9tfQyxieWLYIQWJ5+0yyBnC6rcY/aGS9IngNhPEw90qgo5E//FC LBXFcBwhlJcG9ZfDZONOdiqHuhE2VRdHoeVkiG7nF2iMj+ZGzGWqQtS6hra99g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbvH32LCWzxS8; Tue, 30 Sep 2025 23:22: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 58UNMdrC055666; Tue, 30 Sep 2025 23:22:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58UNMdBp055663; Tue, 30 Sep 2025 23:22:39 GMT (envelope-from git) Date: Tue, 30 Sep 2025 23:22:39 GMT Message-Id: <202509302322.58UNMdBp055663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: f60ddbd0fb90 - stable/13 - ftpd: blocklist: Add a permission denied probe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f60ddbd0fb9005aa82985142518a9403a4f30f84 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=f60ddbd0fb9005aa82985142518a9403a4f30f84 commit f60ddbd0fb9005aa82985142518a9403a4f30f84 Author: Jose Luis Duran AuthorDate: 2025-09-29 16:27:24 +0000 Commit: Jose Luis Duran CommitDate: 2025-09-30 23:21:18 +0000 ftpd: blocklist: Add a permission denied probe Reviewed by: emaste Approved by: emaste (mentor) Obtained from: NetBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52746 (cherry picked from commit 1060684b04b0ee1e07c6c91f7c52978835ff676a) --- libexec/ftpd/ftpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index b525ed99fe48..d031d8815fd2 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1455,6 +1455,7 @@ skip: *remote_ip = 0; remote_ip[sizeof(remote_ip) - 1] = 0; if (!auth_hostok(lc, remotehost, remote_ip)) { + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, STDIN_FILENO, "Permission denied"); syslog(LOG_INFO|LOG_AUTH, "FTP LOGIN FAILED (HOST) as %s: permission denied.", pw->pw_name); From nobody Wed Oct 1 00:56:24 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbxMD5LLlz69hGH; Wed, 01 Oct 2025 00:56: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbxMD4bFCz4M6N; Wed, 01 Oct 2025 00:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759280184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZ9dza/JDp94PlUu7olh0aUrx81KANsAEADWx88gfrM=; b=kT5gY3kWa3jyfULqxRG4HbjANm77rKqVUEu8gnLAgcaSo2gLHSsZ3gH3caUlPPhpydXLro xT9GaedMLXk/lvD0uyuUOuQh+vrfSj4/jZUcov/efoKDgFSmkJROg8EWaAc+rYLZiQgacn iUJsuCD9rdFRvRLf2AgEd62xXI3zG6sKzmKzlNF8WD0rQEel2GT4ZsuQGd+xgCkRJf9mHA 2QvRH5KzM+q7/oC7H2SdjnocWv6V19fEetM1/xGDcFHFm9RpnRUHKC6Aw0Xd67b6zBCm5v cw4l1GVeqm4PxehYlIa+O5XS/eZO6jM54fuIxSNmR8Vxasi7d6X4Lnx4gXCqcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759280184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZ9dza/JDp94PlUu7olh0aUrx81KANsAEADWx88gfrM=; b=yUrTJRWRP0b6SSv3bhqbwVeipceRR69Kvs8Iv6clRWxVswddJcCx+lQW+SFHj0MjOzEOVw DGFoFktVBuz+/Mw59JmMoz3DROBD/ICwA3vbf188zzMgLsMd/zow8MY1zx7PFceSgxCWBR 8BohlAag1Ha8vSMOde+h2fzK7B/SClQbA5kAzfXRSACNJ0kX5MYEj1l3IljLZcGcZ1hoBP wwqHwzg7UmH2sVOsAstAVLjEnvM2pSVtUfQWTONjwhKjeIY1x7Aq3jaycF5ZM1DILvf6G6 gWZYE5aenbpz05TYfXUb6JNd4gEUT14UKT2z7A+cPfo2ycncQTBIIvhWhWdW1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759280184; a=rsa-sha256; cv=none; b=wxftVAWblE7cUjnJu6wEAXNDFybzHSR4sBaVWMS3yWbVCBa4qADTvl6HYsgHGdN/Up+Wbj hph50CWBFQmvdrfyUuNHPLJXZXkKpL0aZm6IsO6Wq9f2FkZfMJ2W9lbbRZ6BL4RurdCMcF jGk49fDeJ/TcO0vzfa7qPXvLqF9+o3qE8UXGf2o8wiGjObOmLNnAqPaV34v3svvT2saQvs Dq8RzQlhfIvCmDrX7WjQU+HLppdBu+GfHvauF1fzCbzP/fTQx/YIwSEy+VVSHZm7rydakH K3gviaDYjmXAcGazFmL7ZxYG2TWOhiii55WY59FOtX4wQyOihvyiIbjEYpZZeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbxMD4BFZz10xW; Wed, 01 Oct 2025 00:56: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 5910uOSt024218; Wed, 1 Oct 2025 00:56:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5910uOR9024215; Wed, 1 Oct 2025 00:56:24 GMT (envelope-from git) Date: Wed, 1 Oct 2025 00:56:24 GMT Message-Id: <202510010056.5910uOR9024215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 4771b65fde48 - stable/15 - rpc_generic.c: Fix a rpcbind core dump when rpcinfo is done List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4771b65fde4893ffbb36f53fcd20e3b850a50b6a Auto-Submitted: auto-generated The branch stable/15 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4771b65fde4893ffbb36f53fcd20e3b850a50b6a commit 4771b65fde4893ffbb36f53fcd20e3b850a50b6a Author: Rick Macklem AuthorDate: 2025-09-28 14:56:17 +0000 Commit: Rick Macklem CommitDate: 2025-10-01 00:52:46 +0000 rpc_generic.c: Fix a rpcbind core dump when rpcinfo is done Commit c5d671b added netlink support to server side rpcbind. However it did not add a case for AF_NETLINK to __rpc_taddr2uaddr_af(). (Reported as PR#289625.) As such, without this patch the r_addr field of the netlink rbllist is NULL, which causes a crash in svc_sendreply() for a Dump query (what rpcinfo does). PR: 289625 (cherry picked from commit 70730cd21c9f2b0a80ff07e4491c0fe30f2d87c5) --- lib/libc/rpc/rpc_generic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c index 0e563f6a5996..8019f2d8f236 100644 --- a/lib/libc/rpc/rpc_generic.c +++ b/lib/libc/rpc/rpc_generic.c @@ -610,6 +610,10 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf) return NULL; break; #endif + case AF_NETLINK: + if (asprintf(&ret, "%s", (char *)nbuf->buf) < 0) + return NULL; + break; case AF_LOCAL: sun = nbuf->buf; if (asprintf(&ret, "%.*s", (int)(sun->sun_len - From nobody Wed Oct 1 02:14:55 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbz5q62vmz69nmy; Wed, 01 Oct 2025 02:14: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbz5q56DRz3FK1; Wed, 01 Oct 2025 02:14:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759284895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZSEsbWYcQNh5lF0KRfjyKzkVeUN7rmWt7oGINRhvHU4=; b=hZ/kQM1F91fe9CkRwTfZWprIWE4uwuAY0BJSBmei2mPhzyKpGLwljYUNG+uqD019QURuKm NoKtUMBeFhLPr/urhhmclZLgdjrn7UZ7oq7gIyaL/7lOSfllwAu11sekYGF2e9U6E4s2YI hZ2fCQkbocLbdakdzhAXQgU1S6KdSwhoCMHLW4B9ml7nXca/JcUzJ5gjCYDCoRDt0r0/3t XmOTolv58aWh5MY7M3pWGVbaah3QuNnixfZ+bBVNxrRyfBcs8PHG+fILO7k1KC7h6lBUXg GogJCCtcxcHYPkOKiXRrd1OWFY2RxyKU0fu76d9caiLGaAkuqDnu03439mF0nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759284895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZSEsbWYcQNh5lF0KRfjyKzkVeUN7rmWt7oGINRhvHU4=; b=b22UkyF6vdUc/xSUh7pKP5uc1Qxu97eq5T+5l6HD+XDa8y8issG4fSU5B0ku4usJra4KGA 4d8Jv4JruZUlVXPctfX4vHQAikeG12xJCtq5t5q8lIJ50uJm4N07D8D3v3oCYZMbtQ4D8X Ft+Y/sK/23Ow+JeuBTCNDF2qmoFMKRNA4f4Z2PzVNzC0/LrErLff9mJLFd2F0AsRx8Gg5Y XhFYIcenf8+CzRXo9dDl4yWAdtgQ5hu/bzyZNOEZi2GujqZ6Y+wC/yUUGgHLgsFiuxcyI0 qWaz+ZGIdh/rTVvNkPteZ7JQVy37tfjvaLd2zxhyKz1ChOgtUVbLXKRtJRaJ4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759284895; a=rsa-sha256; cv=none; b=Eb1mS7W32G4kDuMIYBNgmRnQDws6Xxdu4AS+YVNBcPpzGxvkuYhO1clME6JVCogCPp2Ucx KSVjVMVHsNm0Dgj5aEvlAxGuFd1rjqLjMd7M8XWx+28QzJLN/wT1ha31God+LFxw/e4/5i PAa3XGdMuVgcseX+KhYsbJdS9JStyd98vVBJHp/HfRxR1K5reutlgWKNLh1Ps9W7+momLw RVZzBx2v3Y9ekMK93CZOTa3xF+NRHvN+o7rucL7CwUHD3elAHl3ueRb3qpfXTcQAx27nIk 5xZwH2skJaYzQTb2IMe2c2DaeIDxywXs6/H06ane3ykOhcgL8R3OgfxGJexWiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbz5q4gsCz12kY; Wed, 01 Oct 2025 02:14: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 5912EtnI074458; Wed, 1 Oct 2025 02:14:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5912Etf5074455; Wed, 1 Oct 2025 02:14:55 GMT (envelope-from git) Date: Wed, 1 Oct 2025 02:14:55 GMT Message-Id: <202510010214.5912Etf5074455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3dc9f96a489c - stable/15 - witness: Record the first acquired file and line for recursable locks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3dc9f96a489cd53710af8205a1f3901c11b760a5 Auto-Submitted: auto-generated The branch stable/15 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc9f96a489cd53710af8205a1f3901c11b760a5 commit 3dc9f96a489cd53710af8205a1f3901c11b760a5 Author: Zhenlei Huang AuthorDate: 2025-09-17 16:48:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-01 02:13:54 +0000 witness: Record the first acquired file and line for recursable locks and the last acquired file and line to witness object. For recursable locks, unfortunately current implementation records only the recurse count and the last acquired file and line, but does not restore the previous acquired file and line on unlock. Hence it is possible to report false acquired file and line, and that may mislead developers and make the report by users a little harder to analyse. Since subsequent recurse locks do not affect how witness order check, record the first acquired file and line so that the logic is much clear. Reported by: bz Reviewed by: kib (previous version), markj See also: https://lists.freebsd.org/archives/freebsd-current/2025-June/007944.html MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D52496 (cherry picked from commit 2d85bc89294baa04daf509e81ec3880bff79cc10) --- sys/kern/subr_witness.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index a65c3ca128d9..c937f6a82757 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -1515,6 +1515,10 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) else lock_list = PCPU_PTR(spinlocks); + /* Update per-witness last file and line acquire. */ + w->w_file = file; + w->w_line = line; + /* Check to see if we are recursing on a lock we already own. */ instance = find_instance(*lock_list, lock); if (instance != NULL) { @@ -1522,15 +1526,9 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) CTR4(KTR_WITNESS, "%s: pid %d recursed on %s r=%d", __func__, td->td_proc->p_pid, lock->lo_name, instance->li_flags & LI_RECURSEMASK); - instance->li_file = file; - instance->li_line = line; return; } - /* Update per-witness last file and line acquire. */ - w->w_file = file; - w->w_line = line; - /* Find the next open lock instance in the list and fill it. */ lle = *lock_list; if (lle == NULL || lle->ll_count == LOCK_NCHILDREN) { From nobody Wed Oct 1 02:16:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cbz7w2Sk4z69pBR; Wed, 01 Oct 2025 02:16: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbz7w1xg4z3Fw8; Wed, 01 Oct 2025 02:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759285004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih/ZapKIkZGBA6kYEF9xkfnv4Q7+o5xYQUsMVFbkzQI=; b=NTKTPIs7esvs4ZZ3jOZK2jNjZbDBpqdD1u9mY/fw9ASHTwGTxDsEW2Kbv/rnv1EfG3hSv+ NlvZQpJ6ap8rWUKopCGpbeFhumiSB5AdTI7Z5uEyCmlPB0cC/0L8kpyWtNhnLaCKRyvpVD v3dwhZLeKwcG6AiO6LWxbVEX9zkKxfarTQ8VbDY3Xdyq4SV7xXJo9nnVUuIDZCu4eq18VS cPptOHXxYXt0SCvuTiFJhF3qdxRBFEGPZ+BctGCQoBmdeE9ZpeBxWf6TDWOejTb8aGwoJR v3xyhuRVruIo3hDDDxgKjw9WDRp0uuPiV1ns9FveITZnZVdODsRaGGhE8wJHRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759285004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih/ZapKIkZGBA6kYEF9xkfnv4Q7+o5xYQUsMVFbkzQI=; b=urtxtiKf7rhnXUQWT2Mv6IkBbaXoc60d78jg/8HM2ZDkmZbzKPKK+hMhUmGW5s8jasP43W d3/7Fn30J5I1Wl6Iw0MQbzgxAWTCVoRz3+9B1h39037L3x1aAcU+sYvQNaMfCRvj+G1mhn uKuLKtaxssFlfBGI/HhwUfQR/oEUh9lpPiLcHMi2LxvXx2ELa1g2Zi2q7IcSFu8OslGaxv FhmWhPfbbCaowlP7CFBHyE4GHkYuk1ag6x9CjrX5Jh7FYokszVuJYUdAqbxNWcpBt8Pzdn cH9RsO8yo4imCAA9w6Foaw29ojd7ElSo/LfxH/8S1/F6PAtpCPtjdcCD6J3JsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759285004; a=rsa-sha256; cv=none; b=PeMsgdnan1PorYfjXtw52cnuThH4kKf/QaVLz5aM2QDFYeyf4m71m586sSPihwmWrqRnqS WzD3T41rM2tgExuxELUnYGSVFI4sqyk994EtbkDkxVBK+hi/hrWp9NqiY4Ntt/1tzvaTqG KEdczEb0YgO7ZREW7wZif95ZpInwLPuFlvYOwlOBY5jBAmWJ6C3jFJavmw+xb4yDrK7JYs TuV4q7VWyonYoMunSp84AExlQG/bzgGqSmCTK7KAwo6rUnbsk4yrGts85T/VYDL97j/ev+ XABjc7X6NsVJrlfIo+t8Hbnzp2hXbTFap28qhp03qbne0DESwXwUUREX9bWU/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cbz7w1D45z12y0; Wed, 01 Oct 2025 02:16: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 5912Ghni075101; Wed, 1 Oct 2025 02:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5912Ghpn075098; Wed, 1 Oct 2025 02:16:43 GMT (envelope-from git) Date: Wed, 1 Oct 2025 02:16:43 GMT Message-Id: <202510010216.5912Ghpn075098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 7838ad85fb1a - stable/14 - witness: Record the first acquired file and line for recursable locks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7838ad85fb1a75464e53525b4cdb064ca1e97a47 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7838ad85fb1a75464e53525b4cdb064ca1e97a47 commit 7838ad85fb1a75464e53525b4cdb064ca1e97a47 Author: Zhenlei Huang AuthorDate: 2025-09-17 16:48:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-01 02:16:04 +0000 witness: Record the first acquired file and line for recursable locks and the last acquired file and line to witness object. For recursable locks, unfortunately current implementation records only the recurse count and the last acquired file and line, but does not restore the previous acquired file and line on unlock. Hence it is possible to report false acquired file and line, and that may mislead developers and make the report by users a little harder to analyse. Since subsequent recurse locks do not affect how witness order check, record the first acquired file and line so that the logic is much clear. Reported by: bz Reviewed by: kib (previous version), markj See also: https://lists.freebsd.org/archives/freebsd-current/2025-June/007944.html MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D52496 (cherry picked from commit 2d85bc89294baa04daf509e81ec3880bff79cc10) (cherry picked from commit 3dc9f96a489cd53710af8205a1f3901c11b760a5) --- sys/kern/subr_witness.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 58066a738cc2..1cc7c3fd75a0 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -1516,6 +1516,10 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) else lock_list = PCPU_PTR(spinlocks); + /* Update per-witness last file and line acquire. */ + w->w_file = file; + w->w_line = line; + /* Check to see if we are recursing on a lock we already own. */ instance = find_instance(*lock_list, lock); if (instance != NULL) { @@ -1523,15 +1527,9 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) CTR4(KTR_WITNESS, "%s: pid %d recursed on %s r=%d", __func__, td->td_proc->p_pid, lock->lo_name, instance->li_flags & LI_RECURSEMASK); - instance->li_file = file; - instance->li_line = line; return; } - /* Update per-witness last file and line acquire. */ - w->w_file = file; - w->w_line = line; - /* Find the next open lock instance in the list and fill it. */ lle = *lock_list; if (lle == NULL || lle->ll_count == LOCK_NCHILDREN) { From nobody Wed Oct 1 03:13:11 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc0P36TSmz69tB2; Wed, 01 Oct 2025 03:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc0P35lVLz3L7Q; Wed, 01 Oct 2025 03:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lCZ0qSkNlJYlmCPAOaDCEElwRA7m7Rs7tUUuA1C2//Y=; b=YrDpoxo5N90Mp158oXvCxQvWnX9Ig8kbv6rnfySWri5Avyg8LR6oMHo9TVmLVYuu1hp+hM Ce9vuCu7AIg5QiezJ+w2YGP1nCdKKI3p3TZl6JPW1r+no6J/Skuj+neA6k3cjxv2tBLFgS 6FhgPsjoCqpjLUVbHSHw2J7SrcvDqhCsKgsjrsNG05cOhPQGjSF4M4j+YWWbicGEYGixk/ tSzano5e52MGhwZjdNbldeGsGq6IPNxMQNkwuCG0EiwbR0AMzWnHTci82ANXQh2+XwmT30 KzZUy9IQ0bGg1aWJPt5NEqZwhjgrI0j2+4w5r5MfWM5k53b0b1ksM43TkjGJPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lCZ0qSkNlJYlmCPAOaDCEElwRA7m7Rs7tUUuA1C2//Y=; b=xjvgzB6giMwFJS3E6UGi//V8h5fhP8wC24a5OW4SbsERGDA9vbLc/xnE0dH2wwi84qaVgE DNEGjVJoyPFpC6oMyel3rRusUU1uh9vynpxMlThL/ImsVaOMSZEO/wJaXmpcl+ViGE24+f hfqU8O23bn0S9ntWkws/qUrPyGXqeAfxV/T3hGIUj8eiG84bLOM+dHHYkjY1ZfjXzTkmme 5a74RBCOSRZNyQ7Jz75ePKh1ivmdXWv4HCxgmBosL31Au4PkqZo4sWFnNwjd5asqYhNhMD HVgX11Z01j3Nf7oK8td/J/1Tt8wk5TPA1VUF5gpjOdjF6XRhZtFTH9rn4FIJyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759288391; a=rsa-sha256; cv=none; b=OdRZXYH19Sr9sAfESGGDLUziyWdiUrbAp3beph1sETx2bVrIsEeW4ZR8yRSUXU2eFwzbDS XTH5/8JTCfHZjMF+EtNfqSqK7HV7KeHJiaEdo2hVfnimradCmFeng5vFyQ//tmn3PN7l6K y4epTXFiV1QQcHeDFjtzfzof0K6qHbtP7PDvTgAUEQEhd/FQjcEvFxy4rWobiXEppOcoaz q7EiibnTcGQlg3k3YfPSKRjv/KeUhExybEvPp7TodC2Wj1ppnRR9sT3eZAYcj3EgYa0S0z L1UZYEX/LEo6dyDKKMQipT8dm3SKedvlZC+N6cTcm4vVvruLlgLVRVS8tNKJ0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc0P357Mkz13JV; Wed, 01 Oct 2025 03:13: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 5913DBAF089636; Wed, 1 Oct 2025 03: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 5913DBUg089633; Wed, 1 Oct 2025 03:13:11 GMT (envelope-from git) Date: Wed, 1 Oct 2025 03:13:11 GMT Message-Id: <202510010313.5913DBUg089633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d4f91b6d25cb - stable/15 - amd64: add wrmsr_early_safe(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d4f91b6d25cbae9658035f86ee15e454141fae8e Auto-Submitted: auto-generated The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4f91b6d25cbae9658035f86ee15e454141fae8e commit d4f91b6d25cbae9658035f86ee15e454141fae8e Author: Konstantin Belousov AuthorDate: 2025-09-18 21:55:19 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-01 03:00:08 +0000 amd64: add wrmsr_early_safe(9) (cherry picked from commit a319696875451229f492b6c15e58a0ac54dbcda1) --- sys/amd64/amd64/machdep.c | 33 +++++++++++++++++++++++++++++++++ sys/amd64/amd64/support.S | 16 ++++++++++++++++ sys/amd64/include/md_var.h | 4 ++++ 3 files changed, 53 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 9ff60439d1ec..2fce1a7e64b6 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1822,6 +1822,39 @@ clear_pcb_flags(struct pcb *pcb, const u_int flags) : "cc", "memory"); } +extern const char wrmsr_early_safe_gp_handler[]; +static struct region_descriptor wrmsr_early_safe_orig_efi_idt; + +void +wrmsr_early_safe_start(void) +{ + struct region_descriptor efi_idt; + struct gate_descriptor *gpf_descr; + + sidt(&wrmsr_early_safe_orig_efi_idt); + efi_idt.rd_limit = 32 * sizeof(idt0[0]); + efi_idt.rd_base = (uintptr_t)idt0; + lidt(&efi_idt); + + gpf_descr = &idt0[IDT_GP]; + gpf_descr->gd_looffset = (uintptr_t)wrmsr_early_safe_gp_handler; + gpf_descr->gd_hioffset = (uintptr_t)wrmsr_early_safe_gp_handler >> 16; + gpf_descr->gd_selector = rcs(); + gpf_descr->gd_type = SDT_SYSTGT; + gpf_descr->gd_p = 1; +} + +void +wrmsr_early_safe_end(void) +{ + struct gate_descriptor *gpf_descr; + + lidt(&wrmsr_early_safe_orig_efi_idt); + + gpf_descr = &idt0[IDT_GP]; + memset(gpf_descr, 0, sizeof(*gpf_descr)); +} + #ifdef KDB /* diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 870cd255abb7..27694a95653c 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -1565,6 +1565,22 @@ msr_onfault: POP_FRAME_POINTER ret +ENTRY(wrmsr_early_safe) + movl %edi,%ecx + movl %esi,%eax + sarq $32,%rsi + movl %esi,%edx + wrmsr + xorl %eax,%eax +wrmsr_early_faulted: + ret + +ENTRY(wrmsr_early_safe_gp_handler) + addq $8,%rsp + movl $EFAULT,%eax + movq $wrmsr_early_faulted,(%rsp) + iretq + /* * void pmap_pti_pcid_invalidate(uint64_t ucr3, uint64_t kcr3); * Invalidates address space addressed by ucr3, then returns to kcr3. diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index b6ddc6eaaebe..b6d8c469cdf6 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -99,6 +99,10 @@ void get_fpcontext(struct thread *td, struct __mcontext *mcp, int set_fpcontext(struct thread *td, struct __mcontext *mcp, char *xfpustate, size_t xfpustate_len); +void wrmsr_early_safe_start(void); +void wrmsr_early_safe_end(void); +int wrmsr_early_safe(u_int msr, uint64_t data); + #endif /* !_MACHINE_MD_VAR_H_ */ #endif /* __i386__ */ From nobody Wed Oct 1 03:13:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc0P51B11z69t2h; Wed, 01 Oct 2025 03:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc0P46YrHz3L4q; Wed, 01 Oct 2025 03: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=1759288392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lvOCUqCKhHjwWPKhabBpPbt2nEog/8ESkunKL/xB9SM=; b=nDMDTyni2Lrt7a98E7/bjtN/y1U8svRSNo/2ftD8G6kPiu52L5+s+k/YAxnFSiYrIJ9s4c UcSHCvr+gZbwh83Uov1aIw7xDtbbMs0rsb9/GNvUHn6qTA3A4/s/n6tS/uqn0XrG2IDhRV IyfJjYQ8EVKdYKV6jxKPCwRmoz5DKnKT+kHqqGJUpstKHVOE9ZBDNpqKl3obSeBj5chge+ rfGoyQ+7UMfdTx69GvaY83XE1moF9YW7OxZPU0pmCRI7fXfpkVPc1YhX112logI+h/kK/I cZOQR3xdMyEF5Wwnmgid/92io+yEzCwBhMW/DB+8wM0sLexchYMCuXVMT8fETQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lvOCUqCKhHjwWPKhabBpPbt2nEog/8ESkunKL/xB9SM=; b=H5gR0wYm5teNf1yX5s8msYQTryXqU67RtRh7NDDRUNKqfbnyGynRiSNzi0VeZ+k+YmAlBl moNCu6KL3VxqDzl7rKer8p2NGyXrojzasRkaDQfRAdazS0Wa4nuE/4Nfd+abcu6BNHhQhZ 8LGDJLKSpaY2XZIjT0LJGNaVr8KsnhtSc4b1iOcbFUma5nsDWRwMdtbixCWMJCwLl2gix9 XJ7LURzXTRX/acTRvUxQlX4tTe2xjq2dJU2e+w6Ac5iwz7K3HVV0mNmb+6LDWNSweqwEaR eypV6TvDkHNQOBAk//xE8V6csijkNpSHfm2hIbtqJC+WHmqe7h/VkJ4F4s0aTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759288392; a=rsa-sha256; cv=none; b=AmDUuf5j2Mjl8+ufT1v7bANQSn8qrFJP0SmQJp0OSBtRDeRNmh4pPCvhGT7yME0vFA1/UB WDdLy1zpyPHzxhJZTNRtZkaL40MR8FZrQxjUN3wcybRBZOQz9FlHnPEk/4dF5lQJAF0K6c V9Ovb76oKaFsEq1HTG8TO+nas0wX6fpx30d/xTq9tziFvPJWrCCTkE3odSvG36ZbbMRHhi Wt2H/Ux759nABqr9/YjZvslrlG20SbBexUXrCKtGsefggwpT1aXwpJqWByt6ymyB4pP0E2 xlhiDt2mfn3dW9xosBacbN4FJcm6o5PdVf+9mWw9M67w9PrWEggElrO7o9i0+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc0P464Wvz14SB; Wed, 01 Oct 2025 03: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 5913DC6c089670; Wed, 1 Oct 2025 03:13:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5913DC3Q089667; Wed, 1 Oct 2025 03:13:12 GMT (envelope-from git) Date: Wed, 1 Oct 2025 03:13:12 GMT Message-Id: <202510010313.5913DC3Q089667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 45f786241c92 - stable/15 - mlx5 ipsec: Add VLAN tag to IPSec rules to prevent duplicates List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 45f786241c9211f8162cb48997c8166051585c36 Auto-Submitted: auto-generated The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=45f786241c9211f8162cb48997c8166051585c36 commit 45f786241c9211f8162cb48997c8166051585c36 Author: Ariel Ehrenberg AuthorDate: 2025-09-17 13:17:46 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-01 03:00:08 +0000 mlx5 ipsec: Add VLAN tag to IPSec rules to prevent duplicates (cherry picked from commit 84d688af4e625e159af65cd2432af88609d4962a) --- sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c index fb9ca94278db..d1f454a5ec41 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec_fs.c @@ -1134,6 +1134,11 @@ static int tx_add_kspi_rule(struct mlx5e_ipsec_sa_entry *sa_entry, setup_fte_no_frags(spec); setup_fte_reg_a_with_tag(spec, sa_entry->kspi); + if (sa_entry->vid != VLAN_NONE) + setup_fte_vid(spec, sa_entry->vid); + else + setup_fte_no_vid(spec); + rule = mlx5_add_flow_rules(tx->ft.sa_kspi, spec, flow_act, dest, num_dest); if (IS_ERR(rule)) { err = PTR_ERR(rule); @@ -1169,6 +1174,10 @@ static int tx_add_reqid_ip_rules(struct mlx5e_ipsec_sa_entry *sa_entry, flow_act->flags |= FLOW_ACT_IGNORE_FLOW_LEVEL; if(attrs->reqid) { + if (sa_entry->vid != VLAN_NONE) + setup_fte_vid(spec, sa_entry->vid); + else + setup_fte_no_vid(spec); setup_fte_no_frags(spec); setup_fte_reg_c0(spec, attrs->reqid); rule = mlx5_add_flow_rules(tx->ft.sa, spec, flow_act, dest, num_dest); @@ -1181,6 +1190,11 @@ static int tx_add_reqid_ip_rules(struct mlx5e_ipsec_sa_entry *sa_entry, memset(spec, 0, sizeof(*spec)); } + if (sa_entry->vid != VLAN_NONE) + setup_fte_vid(spec, sa_entry->vid); + else + setup_fte_no_vid(spec); + if (attrs->family == AF_INET) setup_fte_addr4(spec, &attrs->saddr.a4, &attrs->daddr.a4); else @@ -1322,6 +1336,11 @@ static int tx_add_policy(struct mlx5e_ipsec_pol_entry *pol_entry) goto err_mod_header; } + if (attrs->vid != VLAN_NONE) + setup_fte_vid(spec, attrs->vid); + else + setup_fte_no_vid(spec); + flow_act.flags |= FLOW_ACT_NO_APPEND; dest[dstn].ft = tx->ft.sa; dest[dstn].type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; From nobody Wed Oct 1 03:13:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc0P61DqDz69tB4; Wed, 01 Oct 2025 03:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc0P608xGz3LKH; Wed, 01 Oct 2025 03:13:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tgS8atSi4sUW82TQXvAj9Xxsa8D4uVcOJhdLlExfIsM=; b=c39wywLsxNK2MYMX1aRyVLWh/qlaSDuXPDtoR+YUuymSQ9M0FBN7GcR0xWy4CnPIPnauGQ mWJ9VzQQ8jSOw27q/6PCR3tVVLMIm6MO7FDu9f+jBBIWXKqBZeqG2celJgOQDq1iNG4OUX H9lgQIl2OcnCOojNegEGA8tKOK8X2a7T3Nm98PeUy83ZW6eCmi+rj/qkwwpQw0Q3GSnpkd BAxQ5+OfNXyCm8dutnyoXmylFYBe8xsmSaqqSscikPIiiS27zJwrwtxkT2ozZ8WZduGzlI xQN3sPtKY+Wdy0iQx2BVasJBsPu0UfT1wx8z3umyviMWFgj0JcCUg3/WqSf+og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tgS8atSi4sUW82TQXvAj9Xxsa8D4uVcOJhdLlExfIsM=; b=fHLwaHdGmMsX26dn2da5qs5YWYSLVERJ/JF9Qszj9aSIwYfl1aRffwQvXTmjY5lubVjwy8 N/bGPGrYzrNXYCzIoVrgqL836k2b1Ln+Mi6FFn5hrPT3sloSL+WhtNXCzaoSoFYeNAYygb OgBIMau+zixSX39c6dwMgQ7UiUKqxSL9HEN/mtda/Z77ZsNqbPbUW2kz4gPkFnPG85FAsq TyKGjzDNToAWAg0my15+0FMDVSJE199WRMuD3N3E6GJMizBwBDI3g7ZJ3nI60lr22mVjcI RvbnHyT79NPMnm5juzAn2JkD1GYdg2oDVQmhWCu3IhyXPXRiUmDk4Jj6hYE3aA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759288394; a=rsa-sha256; cv=none; b=Hek5mpUBK3IcYniwbCbia9MU0qLUnU5Dn7DZtzSiv4gjRFSVpqXJupkBvqZyqzfCWwOsjc 6pYdw5mZyrCVSzrupf4WQMDp4Vtc/d1arx/2TSPcdgzBZ5p9C09P3STVx7y3Cb7JKdcM8G vPfPRzoNV1cpaKInaF+at0+5Xr10X9I6393d4BVVRpmlHn59CEL2K6E64tMrrfprABL5BO NMzPVz/PbwIQcsIt/KKPdhyDhhMEzAypJCEremL8dBaYqYg6dfCxl0F9fARI40Q084n0Co PwP9pzrL7MP5zST0i54RRv5sxf4h3OKhCYn86hWsLSbNjfOtUXu3aUu35guGzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc0P56l1Sz14GL; Wed, 01 Oct 2025 03:13: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 5913DDm5089703; Wed, 1 Oct 2025 03:13:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5913DDTl089700; Wed, 1 Oct 2025 03:13:13 GMT (envelope-from git) Date: Wed, 1 Oct 2025 03:13:13 GMT Message-Id: <202510010313.5913DDTl089700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8a8d6e18611f - stable/15 - libc: un-namespace gen-compat.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8a8d6e18611fb05297e6323d38cca69dd836d8a0 Auto-Submitted: auto-generated The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8a8d6e18611fb05297e6323d38cca69dd836d8a0 commit 8a8d6e18611fb05297e6323d38cca69dd836d8a0 Author: Konstantin Belousov AuthorDate: 2025-09-25 00:58:33 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-01 03:00:08 +0000 libc: un-namespace gen-compat.h (cherry picked from commit f15d3694db60d0256d236320fcb9e2c6d871b0a1) --- lib/libc/gen/fts-compat.c | 2 +- lib/libc/gen/fts-compat11.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index f87cabf085f7..62a1e0a81f62 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -44,9 +44,9 @@ #include #include #include -#include "gen-compat.h" #include "fts-compat.h" #include "un-namespace.h" +#include "gen-compat.h" #include "gen-private.h" diff --git a/lib/libc/gen/fts-compat11.c b/lib/libc/gen/fts-compat11.c index 0351ce5ac690..5abb378f5f08 100644 --- a/lib/libc/gen/fts-compat11.c +++ b/lib/libc/gen/fts-compat11.c @@ -43,9 +43,9 @@ #include #include #include -#include "gen-compat.h" #include "fts-compat11.h" #include "un-namespace.h" +#include "gen-compat.h" #include "gen-private.h" From nobody Wed Oct 1 03:13:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc0P85kzCz69t5s; Wed, 01 Oct 2025 03:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc0P83888z3LX9; Wed, 01 Oct 2025 03:13:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXpgkXpvxxUgnuAqRWPC0vuo6XmpOZ4fnM96YXuohgY=; b=MvTVuvr+j9rxSr07XLTp9VZGYmu9uKLNT01+5OXFrIDtQQM8ebVbqotnZZ3WFljEJC+6Hs NzYJixl3chWzgCtWuYOtV7IlVM+doZZi7MJe2NXkDr9lCU1VmSA8K9Bv/7CK2px85PB4Cz NYuAOzHZd2ENpU+OtN2JjNeN5MUd7xX4Ic9+uDKAqBVb7fllH1ANkrINfH5en0P+xsNa27 pAJPHuy3rvWXfhKkEevJqD8QkZ4FYzzzVtZLF4te79lpALwUHzA86StQz5uBp8RfBuTCTs hvXsPVtk8o5oBkLIWo9U196/J1PxzahBWmiTeCr3jsF45ueJqLjBfuomCVJMrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXpgkXpvxxUgnuAqRWPC0vuo6XmpOZ4fnM96YXuohgY=; b=gypOIHFrVH3MTzQCkzmgH9MB53+WnGXrvffony7nUQETCAcX7kZA8IiLEwv9odrOL/JDfy gjGH5CxF0K/Vkozi7tOADIxop+mkRrbC1GJmO+SDC1Xj55o71uUVSh1rJTm7V3e6wT4acH Zr9suDgp56lJ3sofJ7ETyBo6YrAMy+6oZhzupI+gv9EMFAVMbxCrNO4VtfjoZhRBlciQNY NKnWq4JT3KQaYhVTCrbfgTp9iNKKEy1J0hj82zfUGzuH1Fu5D2MPGDSOPcvtAqaRsxylUu 5RPvZxnCoFfoMTqXY5J/gAxFJyT0mmTSjNpJ7YHGmkwWovlUriBBoXSUDxOzvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759288396; a=rsa-sha256; cv=none; b=XxBWe/5KBY4aciX5XBMsQVOrSAWGW82fU0j4/xcRHHvjFfUxz7EgJBarePumdlmm/pIA9Z 28KN4YLskY4NRijovg2riZh+PxaEc3FZuzjwnhu1QVhoQY0SeAglF7+U8jsrhDTJGqgmKM z95CivGIfDjEm+nxTWEdRsPvM1y5WQJdJJS177Mx+6OFU0YFRar2DZkD5HBC0ZtnHsB/IB WqbtLW5XUvydlzqxR+Qw7QUXvSEakfarV7ifWrMtHU52wqwKo4f2ag2E3LE0za6dGjnjZQ o82y3rfD3KTKKs80J+ImLOgXoYsifbktA0+aY0xuYx/P03gQqLnX4+ee3Djykw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc0P81s9Hz1420; Wed, 01 Oct 2025 03:13: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 5913DGLQ089775; Wed, 1 Oct 2025 03:13:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5913DGas089772; Wed, 1 Oct 2025 03:13:16 GMT (envelope-from git) Date: Wed, 1 Oct 2025 03:13:16 GMT Message-Id: <202510010313.5913DGas089772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 799fae57caa7 - stable/15 - libsys: drop private exports no longer needed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 799fae57caa7c3adf275d29b75a32cc626636fd9 Auto-Submitted: auto-generated The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=799fae57caa7c3adf275d29b75a32cc626636fd9 commit 799fae57caa7c3adf275d29b75a32cc626636fd9 Author: Konstantin Belousov AuthorDate: 2025-09-22 23:34:34 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-01 03:00:08 +0000 libsys: drop private exports no longer needed (cherry picked from commit 495813bfd7a28759b23204d66826ff9b3ee7ab61) --- lib/libsys/Symbol.map | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/libsys/Symbol.map b/lib/libsys/Symbol.map index eb71c813ae86..ae12124ca210 100644 --- a/lib/libsys/Symbol.map +++ b/lib/libsys/Symbol.map @@ -4,10 +4,4 @@ FBSDprivate_1.0 { __getosreldate; __libsys_interposing_slot; _elf_aux_info; - freebsd11_fstat; - freebsd11_fstatat; - freebsd11_getfsstat; - freebsd11_lstat; - freebsd11_stat; - freebsd11_statfs; }; From nobody Wed Oct 1 03:13:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc0P80X5Lz69tB5; Wed, 01 Oct 2025 03:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc0P71cxGz3LKb; Wed, 01 Oct 2025 03:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/4afh1lvij3c6SBhs/o2cekb/n2/YnIESRc10uRrYVQ=; b=IcmyA8Dk0vpR8k5aQoHD/iYPVFEGMfcM6CKYm3e99bUgPQpdvze0SZRhX2UJ9PV0nQV5/d JbRwn0rWfIyj3zvzadSxu7M7o8LSfa/DMuZZCWYQiPf7xaGgYizL/B5f9SV6YiszCgzijZ s6xfOLw+EPAimPMmmSSGqXivNsRAPheCB/PyVoKgYUBikrxNNJyNpe3TNOLZO4yrKHgA0p ymgvOHuMDQ8ccJF3O919Y3UxjwfqzOiyXFOzJ/efPsPKoK0zohqj8og8BRrQpQDjJAGIe5 siSQ5txKr/5N6Go0ZFM/ZD9mk18MyEShlkltJItISq9qTqeYvKl6ilHZuC8RGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/4afh1lvij3c6SBhs/o2cekb/n2/YnIESRc10uRrYVQ=; b=FPYWCSsf3vUFCn4BXQCjGgt5RXIcNRQQdWU4Erc9PrDEVxJ6uREo85HhK7sEdOMsiZbF8O l9gijkxPtD2MqpVW9rQzw1/DwrFN6IR33FQMBzDUsZCAUYx9PEi9StR6d1fXDlfo4G3lL+ 8vLK2h9PnMIOvC/sc+au8rvXAUPP1sFExCzcR1UWegNI3gK6+Uau0+qMGpKbBqdTzhPDNO xvxIM2NFOwz2rAM2JyKtWK2GI3I7LGqWv57+DtBRSm7uW21PwHVRNl2rUn9c/+QfNCmY7T 9MX7j6MyVXNwtIjBxxLUeAVECe7N0qcSb6ujQz9av0LzpyMt2Dnu4tzp9D/8sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759288395; a=rsa-sha256; cv=none; b=wY+VEq43xJyz+VxldpCp9nqBO9PnGcMNnYz0GmKj++5XNF9lIGsACUUXyYfQKfmi7BC4XO 07tCPa3d8AznidVK00CgCSwc+MSsDvtderSNwKjH1A4pGs5GHXBrUIRLb+PV4Jut64ArZR fo2Q6K48MVdmcLxV9LxvYxQreKd07OPrV3NaULwb8tA0IX2H/HMA+q9B6q8m7IVB6wzN4B pswbFYtoXWCJI9Mrv7UQSaPji1Prap/ZV3uTxpvuxbl6QplSSiib5UNSDTDSOYn1yKknom YASz/lw680wQ0AUtm7n6sjt6OhKWJyql4vRoJECkSEzS69n2eiNQPi3vvjKuzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc0P70xgzz141y; Wed, 01 Oct 2025 03:13: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 5913DFvN089737; Wed, 1 Oct 2025 03:13:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5913DF03089734; Wed, 1 Oct 2025 03:13:15 GMT (envelope-from git) Date: Wed, 1 Oct 2025 03:13:15 GMT Message-Id: <202510010313.5913DF03089734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 47f5f89dbd27 - stable/15 - libc: properly forward the compat syscall references to libsys List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 47f5f89dbd277caf1a0523d3863a259562c4c6b9 Auto-Submitted: auto-generated The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=47f5f89dbd277caf1a0523d3863a259562c4c6b9 commit 47f5f89dbd277caf1a0523d3863a259562c4c6b9 Author: Konstantin Belousov AuthorDate: 2025-09-22 23:27:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-01 03:00:08 +0000 libc: properly forward the compat syscall references to libsys (cherry picked from commit e194103bd35d9e08a5d271d814d6184ec159eadf) --- lib/libc/gen/gen-compat.h | 48 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/lib/libc/gen/gen-compat.h b/lib/libc/gen/gen-compat.h index 74678301af6f..19b9addb4321 100644 --- a/lib/libc/gen/gen-compat.h +++ b/lib/libc/gen/gen-compat.h @@ -40,24 +40,50 @@ struct freebsd11_statfs; struct freebsd11_dirent *freebsd11_readdir(DIR *); int freebsd11_readdir_r(DIR *, struct freebsd11_dirent *, struct freebsd11_dirent **); -int freebsd11_stat(const char *, struct freebsd11_stat *); -int freebsd11_lstat(const char *, struct freebsd11_stat *); -int freebsd11_fstat(int, struct freebsd11_stat *); -int freebsd11_fstatat(int, const char *, struct freebsd11_stat *, int); -int freebsd11_statfs(const char *, struct freebsd11_statfs *); -int freebsd11_getfsstat(struct freebsd11_statfs *, long, int); int freebsd11_getmntinfo(struct freebsd11_statfs **, int); char *freebsd11_devname(__uint32_t dev, __mode_t type); -char *freebsd11_devname_r(__uint32_t dev, __mode_t type, char *buf, int len); +char *freebsd11_devname_r(__uint32_t dev, __mode_t type, char *buf, + int len); -#define F14SG int freebsd14_setgroups(int gidsize, const __gid_t *gidset) +/* + * We want freebsd11_fstat in C source to result in resolution to + * - fstat@FBSD_1.0 for libc.so (but we do not need the _definition_ + * of this fstat, it is provided by libsys.so which we want to use). + * - freebsd11_fstat for libc.a (since if we make it fstat@FBSD_1.0 + * for libc.a, then final linkage into static object ignores version + * and would reference fstat, which is the current syscall, not the + * compat syscall). libc.a provides the freebsd11_fstat implementation. + * Note that freebsd11_fstat from libc.a is not used for anything, but + * we make it correct nonetheless, just in case it would. + * This is arranged by COMPAT_SYSCALL, and libc can just use freebsd11_fstat. + */ #ifdef PIC -static F14SG __attribute__((__weakref__("setgroups@FBSD_1.0"))); +#define COMPAT_SYSCALL(rtype, fun, args, sym, ver) \ + rtype fun args; __sym_compat(sym, fun, ver); #else -F14SG; +#define COMPAT_SYSCALL(rtype, fun, args, sym, ver) \ + rtype fun args; #endif -#undef F14SG + +COMPAT_SYSCALL(int, freebsd11_stat, (const char *, struct freebsd11_stat *), + stat, FBSD_1.0); +COMPAT_SYSCALL(int, freebsd11_lstat, (const char *, struct freebsd11_stat *), + lstat, FBSD_1.0); +COMPAT_SYSCALL(int, freebsd11_fstat, (int, struct freebsd11_stat *), + fstat, FBSD_1.0); +COMPAT_SYSCALL(int, freebsd11_fstatat, (int, const char *, + struct freebsd11_stat *, int), fstatat, FBSD_1.1); + +COMPAT_SYSCALL(int, freebsd11_statfs, (const char *, + struct freebsd11_statfs *), statfs, FBSD_1.0); +COMPAT_SYSCALL(int, freebsd11_getfsstat, (struct freebsd11_statfs *, long, + int), getfsstat, FBSD_1.0); + +COMPAT_SYSCALL(int, freebsd14_setgroups, (int gidsize, const __gid_t *gidset), + setgroups, FBSD_1.0); + +#undef COMPAT_SYSCALL #endif /* _GEN_COMPAT_H_ */ From nobody Wed Oct 1 03:22:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc0bp1B6Rz69v30; Wed, 01 Oct 2025 03:22: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc0bp0b8Cz3Mr4; Wed, 01 Oct 2025 03:22:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4fCAZxLRdkPJeSJMbDfq12bWofjijn+9oRhC54fZIbo=; b=lM3Hm05yDOiZLy7j9NfbXCt0/ayZ0EMS/XCNc235oDSEdSs23hEeJwDrHS3oJqzLWiwclY 4CxPg0HhZCtk7xJF8L1t8By1QMjSPtYuVzRn/FpgS+XsKZx4BsqQLmILSFj1Dt6LpGYZOv PFyhmX8ERvu7VnJl/eVm7hh+djbdWh58P+p2SnNddAboNEXS7foXguH+fly/2891NdA6T4 Q/LJs2aVjbs9umEsMMmMmLJ5rHlKM+GWdSmEQQXiC9+4ihCp+5WHbrMeEWl8AWIzDvMJhc UtKmEJCNEP4xBgoWjZKDAlipmeYcbj3Ku7x4pENXO2f56BlwD8v2FCP2rD5YJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759288950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4fCAZxLRdkPJeSJMbDfq12bWofjijn+9oRhC54fZIbo=; b=f65uAoENtNxZ41IS5+L7jKKVi/mJ6qKeySupAVyXDrk1RTCPcy9Ivt2m6lGZPYWployrj1 9d2l33XH3o6yO4lcthi1d80/7XeAdORuhp+pYoV68hT7WKWAKQn8N72PMAmU2Yl29+oOsR tJCOQGHmLtiEUGa7VvKZbSRIULsm/m/dWWIFwnFyKSprP2zqyP45qd46mEV8r9KoDmxem5 KJJWeWvwawNfFascWLRucrnNPa4TdHDtZ3WpzJJ1y9GZa7C4aub+W1wge1StiNiE7H7gKu 14u0DHHOToEvc23zbMZrrkjl50eZgGM9ipJ6mBcRmehsOVl4vVhJ18e4XEkx9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759288950; a=rsa-sha256; cv=none; b=HG9eTIlMNe2OwFcU/xhZnavQ7Zh0Y4KpMDEPbXpHYnEPoc+b7CiLTWTSWD1qv0yKTpTy/a 2r9h0ZoT3hd8eSHVzj4uxvGP1QrZy68ZVMjCijZZAkI7p7RM08e2LziuHW+sJgGNTuCmvj ll29omy1bTUg7Nxt63aZyIN/klMNMVZHvBIPqyz5rJddPZvHeZvtSbyEJK7iq9WT2dO9Eh 0jn6qbdQGa2HEyBhonE3QefN7bVIQHmu1VaJHha2/2XaskXuoHdn//RZxGurR4sAFpiepm w5YcP5iY9BWfkNqHs6n/lg0lDv2Cceu5zeNsUfPHBDiaQ/9jI6QYV2I/Pv6Zaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc0bp05pzz14YQ; Wed, 01 Oct 2025 03:22: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 5913MTn6008091; Wed, 1 Oct 2025 03:22:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5913MTWD008088; Wed, 1 Oct 2025 03:22:29 GMT (envelope-from git) Date: Wed, 1 Oct 2025 03:22:29 GMT Message-Id: <202510010322.5913MTWD008088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d83bd3bb94fe - stable/14 - amd64: add wrmsr_early_safe(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d83bd3bb94fe6ddc52c96e5e824607dadb1c47a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d83bd3bb94fe6ddc52c96e5e824607dadb1c47a4 commit d83bd3bb94fe6ddc52c96e5e824607dadb1c47a4 Author: Konstantin Belousov AuthorDate: 2025-09-18 21:55:19 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-01 03:20:08 +0000 amd64: add wrmsr_early_safe(9) (cherry picked from commit a319696875451229f492b6c15e58a0ac54dbcda1) --- sys/amd64/amd64/machdep.c | 33 +++++++++++++++++++++++++++++++++ sys/amd64/amd64/support.S | 16 ++++++++++++++++ sys/amd64/include/md_var.h | 4 ++++ 3 files changed, 53 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 70a7aa677c9f..f5733eef685e 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1833,6 +1833,39 @@ clear_pcb_flags(struct pcb *pcb, const u_int flags) : "cc", "memory"); } +extern const char wrmsr_early_safe_gp_handler[]; +static struct region_descriptor wrmsr_early_safe_orig_efi_idt; + +void +wrmsr_early_safe_start(void) +{ + struct region_descriptor efi_idt; + struct gate_descriptor *gpf_descr; + + sidt(&wrmsr_early_safe_orig_efi_idt); + efi_idt.rd_limit = 32 * sizeof(idt0[0]); + efi_idt.rd_base = (uintptr_t)idt0; + lidt(&efi_idt); + + gpf_descr = &idt0[IDT_GP]; + gpf_descr->gd_looffset = (uintptr_t)wrmsr_early_safe_gp_handler; + gpf_descr->gd_hioffset = (uintptr_t)wrmsr_early_safe_gp_handler >> 16; + gpf_descr->gd_selector = rcs(); + gpf_descr->gd_type = SDT_SYSTGT; + gpf_descr->gd_p = 1; +} + +void +wrmsr_early_safe_end(void) +{ + struct gate_descriptor *gpf_descr; + + lidt(&wrmsr_early_safe_orig_efi_idt); + + gpf_descr = &idt0[IDT_GP]; + memset(gpf_descr, 0, sizeof(*gpf_descr)); +} + #ifdef KDB /* diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index c95696bbe7ef..3393b8fadbba 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -1577,6 +1577,22 @@ msr_onfault: POP_FRAME_POINTER ret +ENTRY(wrmsr_early_safe) + movl %edi,%ecx + movl %esi,%eax + sarq $32,%rsi + movl %esi,%edx + wrmsr + xorl %eax,%eax +wrmsr_early_faulted: + ret + +ENTRY(wrmsr_early_safe_gp_handler) + addq $8,%rsp + movl $EFAULT,%eax + movq $wrmsr_early_faulted,(%rsp) + iretq + /* * void pmap_pti_pcid_invalidate(uint64_t ucr3, uint64_t kcr3); * Invalidates address space addressed by ucr3, then returns to kcr3. diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index b6ddc6eaaebe..b6d8c469cdf6 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -99,6 +99,10 @@ void get_fpcontext(struct thread *td, struct __mcontext *mcp, int set_fpcontext(struct thread *td, struct __mcontext *mcp, char *xfpustate, size_t xfpustate_len); +void wrmsr_early_safe_start(void); +void wrmsr_early_safe_end(void); +int wrmsr_early_safe(u_int msr, uint64_t data); + #endif /* !_MACHINE_MD_VAR_H_ */ #endif /* __i386__ */ From nobody Wed Oct 1 07:33:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc68w6ZFNz693Zt; Wed, 01 Oct 2025 07: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc68w5qhzz3sPx; Wed, 01 Oct 2025 07: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=1759303984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JdRyH7XEcc81sHbLhBTB5Tve+2JnDVgQt2bnw+V1NSs=; b=ESM5vLSaMtqX/mZm4YKxSs8If2aFjr+cvhIM/Kcg/WbhbgJnergd0G3xFnRa16ex6Jbo+5 WFkG1KZIQaluyeTqhGhUc/bsVzt3Cucyhn0EKIR061qPQb26hu9SnbHSgLw1KVxnXx7gx/ rTPc8PntjwYSIsMJcyUEwKupSAcfVRFDni1/g/korAmFZKotiSgoK4XHyLgu41QsaBLBOZ h3DX+eRg34x2C2mICQQIzH6qPX7SfRZqP2to7TUocTFZMdsyJ18HctfvLbCRVN9JzUk9Bv HZZ7QVJcSLiCunIrWtFSJOgFZGynHDf7Po3nZWiqhVRQj7nA+WRS1xIBiSb/NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759303984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JdRyH7XEcc81sHbLhBTB5Tve+2JnDVgQt2bnw+V1NSs=; b=uJkm4HeUOGuViPnn2rH02YvaxzQBhPbP8RwPlQP8NFsVFDSOgyQTOxd6N5kU5FSb6JAjlj otR/FqHeGrJvp5CDhS8aVwhQD5cP8pSLM8ArnlijKlLno6XIpkL3TtrPsiZcSZyo5AHjWl CKXWKD1DlOtwGkKPDrGqShSZ7SOtK1S/mEzJreWQYS0/A38UrYFMUxKxAFkxYgWjSn+7lA 4LSqVMYOS5OkCMRm/NjT6BwEQFZPEUv72C2MJrfHzmXk8j+NqAfJRwv6v512oWskvFYTqN iefRUM34rrgnm2+satBk4a5mZ+bDuj4+GgW9XtGM+6U+udPpUAalB7hLOmlUsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759303984; a=rsa-sha256; cv=none; b=j9B0PxC0gyswLYPtvHDsstRkotczJby0iEc+8c2g7T0l7SkMKcx0JsLPC/F3tFuWuUUghM uVYBa8wyUI1SIsdDoXDhAN6xY1j/NEoVXUp+nqA15PvPEV67hhGv05HyrZj0Y7gdWvXzv4 U13j5EhQHFMbKj2sLXJAmIUMGEohGebdsEC3NTnFV7hP9xzjoY0uVRszvZTAPsegmMufDr 8ZXa/Jq1W56Qz0yZzqpMg6+uBXvV0f8UfBQi3p2E25+XRAjRlWFxovzdwT+sMBIxQcrVuC Sx+LrNK6w/2GG89tLOhAOZafxCudORIVJHnXfHNNNgXQGvU0miZsjlelc7UcTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc68w5QQQz1C1f; Wed, 01 Oct 2025 07: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 5917X4r7081212; Wed, 1 Oct 2025 07: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 5917X4kZ081209; Wed, 1 Oct 2025 07:33:04 GMT (envelope-from git) Date: Wed, 1 Oct 2025 07:33:04 GMT Message-Id: <202510010733.5917X4kZ081209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: bd7f55a1d815 - stable/15 - vtnet: improve control of transmit offloading List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: bd7f55a1d815f841bd20e04bb1d8df0a5c023778 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bd7f55a1d815f841bd20e04bb1d8df0a5c023778 commit bd7f55a1d815f841bd20e04bb1d8df0a5c023778 Author: Michael Tuexen AuthorDate: 2025-09-28 09:01:18 +0000 Commit: Michael Tuexen CommitDate: 2025-09-30 21:49:23 +0000 vtnet: improve control of transmit offloading Keep the hwassist flags for transmit checksum offload and transmit segment offload in sync with the enabled capabilities. Reported by: Timo Völker Reviewed by: Timo Völker Differential Revision: https://reviews.freebsd.org/D52765 (cherry picked from commit f2575d56c8c9a8acad4a61a3586546dff4febce1) --- sys/dev/virtio/network/if_vtnet.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index a4bb57adc609..634ba0de2d55 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1345,14 +1345,22 @@ vtnet_ioctl_ifcap(struct vtnet_softc *sc, struct ifreq *ifr) VTNET_CORE_LOCK_ASSERT(sc); - if (mask & IFCAP_TXCSUM) + if (mask & IFCAP_TXCSUM) { if_togglecapenable(ifp, IFCAP_TXCSUM); - if (mask & IFCAP_TXCSUM_IPV6) + if_togglehwassist(ifp, VTNET_CSUM_OFFLOAD); + } + if (mask & IFCAP_TXCSUM_IPV6) { if_togglecapenable(ifp, IFCAP_TXCSUM_IPV6); - if (mask & IFCAP_TSO4) + if_togglehwassist(ifp, VTNET_CSUM_OFFLOAD_IPV6); + } + if (mask & IFCAP_TSO4) { if_togglecapenable(ifp, IFCAP_TSO4); - if (mask & IFCAP_TSO6) + if_togglehwassist(ifp, IFCAP_TSO4); + } + if (mask & IFCAP_TSO6) { if_togglecapenable(ifp, IFCAP_TSO6); + if_togglehwassist(ifp, IFCAP_TSO6); + } if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO)) { /* From nobody Wed Oct 1 07:37:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc6Fm1PCLz6941n; Wed, 01 Oct 2025 07:37: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc6Fm0XSqz3sTy; Wed, 01 Oct 2025 07:37:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759304236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SzQUF75erA/eoXWsXdh+6umHYYfMAbqHclp1b5hKvEo=; b=gm9P8lA07laYTNuQZxVWBjJ9J/qCepYOT7brytaxYf09kTd0wjpuSirqecag1jKGmw7LSr A2BaW6WuWrFl7e0wFBPra7D5gsdSfuE8S5jZCyj+oirFrtQdpQdbLUrvZbUDqQ9S5dFsHu ceNBRqPc7+b19Y7jsYK0iAdCoz1xFjpXW1FTKy3v1CsVZWBwmd/VEn3XTS733A1twhKVZJ 1E4l8u2bnDJR20U8jSdkWTc9azdLzGhIzypCa7Xwo92kCf1URTz6nfEyWrE0kezwDm2myu Sco1yEuVqMUqEhVUE91rJ+GpoFKHBcBARL1WJyO7xqaYBbuABiHUPguhE9uEjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759304236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SzQUF75erA/eoXWsXdh+6umHYYfMAbqHclp1b5hKvEo=; b=Yo1gR4junGK5kEAZEAB6HGzSWBkEvzs4S0OT51bFmTgtuNWVuqz6Gz1Ve0EnK2cXWzBBdW FsiL6c707n+Z8lUPqUwr6iqNSS3AGtCt0p5FBi5tMDoEPkkcM7A7kTRJNd/NZaHHK9KUZM hxXu+gEzxe4tNNPJhYfYwpQMNnkCNFUR9KO9dLMQjhh8vzewG2F76VJe9V6vzxeBhP1sTp 5AkR0bGidKESQbZIFu/9XjVoo2WZ+8GF7yEffyf886rvf7r/UjmAfzgD87sVPNM8u+iRRp WQMbzNZoqLljM3k1CP+SyVNjIqTLxvT3bWmmcDWE4VSKYYMfV+bXsf88H2TSxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759304236; a=rsa-sha256; cv=none; b=gkOxWEIo9SKevccz6Kn8v2X1NMwTBEyAgiOvTXb5kxP9jHQ2jO86u12DxdoWxWFUHYl2zv zvp4FDtKOhC6amMNbhRcLOkoKMiAlEvdIMpRzoxGhj26gwhKo07T+MR+9aRBTNBAKqRuWX 2AL1htQohlsnVG+uUndk4EZuaLlLx8innpDBqKzZ+Ag1T8cqhGurNyLIP0Try5/PJ1ViYF 6xJDvdeiFX+W/5p3ARZYA4cpwmTYGTDTY7vFJqxXDlXoIdIUjisYgn+3kchcJibtEDMswA aM0vOABfdytyngsTJ3eRZ+YWtLQMB+UybauW5VteGToZAgpbwNPVjwrObWywQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc6Fl6qqtz1Bp3; Wed, 01 Oct 2025 07:37: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 5917bFKE082550; Wed, 1 Oct 2025 07:37:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5917bFDM082547; Wed, 1 Oct 2025 07:37:15 GMT (envelope-from git) Date: Wed, 1 Oct 2025 07:37:15 GMT Message-Id: <202510010737.5917bFDM082547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a98b5f3ff34e - stable/14 - vtnet: improve control of transmit offloading List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: a98b5f3ff34e7ff851f6127a64ebd88818c8d004 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a98b5f3ff34e7ff851f6127a64ebd88818c8d004 commit a98b5f3ff34e7ff851f6127a64ebd88818c8d004 Author: Michael Tuexen AuthorDate: 2025-09-28 09:01:18 +0000 Commit: Michael Tuexen CommitDate: 2025-10-01 07:36:43 +0000 vtnet: improve control of transmit offloading Keep the hwassist flags for transmit checksum offload and transmit segment offload in sync with the enabled capabilities. Reported by: Timo Völker Reviewed by: Timo Völker Differential Revision: https://reviews.freebsd.org/D52765 (cherry picked from commit f2575d56c8c9a8acad4a61a3586546dff4febce1) --- sys/dev/virtio/network/if_vtnet.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index c2f55bb37054..38e7e0f48cf4 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1343,14 +1343,22 @@ vtnet_ioctl_ifcap(struct vtnet_softc *sc, struct ifreq *ifr) VTNET_CORE_LOCK_ASSERT(sc); - if (mask & IFCAP_TXCSUM) + if (mask & IFCAP_TXCSUM) { if_togglecapenable(ifp, IFCAP_TXCSUM); - if (mask & IFCAP_TXCSUM_IPV6) + if_togglehwassist(ifp, VTNET_CSUM_OFFLOAD); + } + if (mask & IFCAP_TXCSUM_IPV6) { if_togglecapenable(ifp, IFCAP_TXCSUM_IPV6); - if (mask & IFCAP_TSO4) + if_togglehwassist(ifp, VTNET_CSUM_OFFLOAD_IPV6); + } + if (mask & IFCAP_TSO4) { if_togglecapenable(ifp, IFCAP_TSO4); - if (mask & IFCAP_TSO6) + if_togglehwassist(ifp, IFCAP_TSO4); + } + if (mask & IFCAP_TSO6) { if_togglecapenable(ifp, IFCAP_TSO6); + if_togglehwassist(ifp, IFCAP_TSO6); + } if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | IFCAP_LRO)) { /* From nobody Wed Oct 1 09:30:19 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8mD0FFTz69FQY; Wed, 01 Oct 2025 09:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8mC6cCzz3FNn; Wed, 01 Oct 2025 09:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsGVjtmWxBIVt56K6wPruNS8z7T7BnYHLkRgdues8Mw=; b=U/ELmgV7AU3ZIbBFgTdYuoyzKzDByUj2q8ZraOowkxdn51Gr4egc+PTuH161BOyN/Cj+0d YmQ79Z/yXzJdPQa1pRzi9m2iEdLUHfu5Kd7AOWsaDBLcBnFrr6px+xQELjg6SsHM9+3e1N tiwro3EHcTz27L+vEbgQ+O/F0GvLcKiu3n25HzTMel3VFrNuKFBGZCEHQDxjyjmG/nQ1CN Bw2H0zrYFpSec6CI/tXGfGFl5Ut4V78G7Kfwlk+5d8yDCKWVb3QA1imhD4X24S4m6HHgOh GHl+1KJp0vtbhjR2k7EShiJa2wLTwgILipGyq18c3gvAiYdwdDKswZu4aF/1xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsGVjtmWxBIVt56K6wPruNS8z7T7BnYHLkRgdues8Mw=; b=dTcazYQnCzVvbikwIfpMk8cTao2wDYy9X0YqqCCFj8uHp84CVU5Gm3PHaM0Kg84R74Pzn5 C3ZRSHpOHZ8O0yoBXYJ5ko2hKjgoY1Ksi0/nZwQ10xmEsZLQk7A1QuHXcIA4iNQTl8oc6l DU2nJDBmiVqeJPZm9+laxLwOGz3S1OuVJW4zzc4h3RXN138MXj6gAjhhSbqSELi9P10Lnn 27JE/C3ITi1LulKBUiOxa8TGddujrvT6BO3c+BZ+otDgESmDddBSRgjI4g1OBpwlYDhFdi FCxmzHPCNBRJpulhcO8g05eGSQfbgFCiJKJaqIYMpwnxyY7dkn4lvhvC3svK4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311019; a=rsa-sha256; cv=none; b=iDBWyw0o3j8sERUZbWH5gl3SFUGFvoiw2QwdCFxBs24fZh93eLE7jTDbSiut1bz4mS/gNX /plzTvbm8ablawutQ80EgFIUY5BSHpnt/9D6pJj3IIYtPpQPkAU4ICTMRNvVy7/ci4HKZn cw3qZQkuxjKPxV9Yf3T/15OrPs9VOsc4vYYCK+OaeTePAee7URq0G/gCnJnh0LuTvf3Zk2 JNjeHtpFRVQixG2cdgmxEcT/CDWdpFJ3AD88rp1y4VWR5zskunanMU8ZAbnWHuWNqY+6UR ljYasapEZ0NXPUDOQYvMDKNzl5L5aIKjMvqA8kQ84nhFtqMJlmwdcqvTHfyKMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8mC5vvGz1XZ; Wed, 01 Oct 2025 09:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919UJ1n006818; Wed, 1 Oct 2025 09:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919UJTw006815; Wed, 1 Oct 2025 09:30:19 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:30:19 GMT Message-Id: <202510010930.5919UJTw006815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Aymeric Wibo Subject: git: 929a887b321e - stable/15 - Revert "acpi_powerres: `acpi_pwr_get_state` and getting initial D-state for device" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 929a887b321e845ce82eb60e2c534f58bb8fed9f Auto-Submitted: auto-generated The branch stable/15 has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=929a887b321e845ce82eb60e2c534f58bb8fed9f commit 929a887b321e845ce82eb60e2c534f58bb8fed9f Author: Aymeric Wibo AuthorDate: 2025-09-28 16:06:53 +0000 Commit: Aymeric Wibo CommitDate: 2025-10-01 09:28:20 +0000 Revert "acpi_powerres: `acpi_pwr_get_state` and getting initial D-state for device" Setting ACPI D-states is generally broken on FreeBSD and this change surfaced an issue. So reverting for the time being whilst I write a proper fix for this. This reverts commit 02a8fadd2c4dc4b78d6d93d9d8b70e9348a6de6d. Reported by: glebius, phk Tested by: glebius Sponsored by: The FreeBSD Foundation --- sys/dev/acpica/acpi_powerres.c | 164 ++--------------------------------------- sys/dev/acpica/acpivar.h | 1 - 2 files changed, 5 insertions(+), 160 deletions(-) diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c index 0a8b67a5fa84..0baa5c595470 100644 --- a/sys/dev/acpica/acpi_powerres.c +++ b/sys/dev/acpica/acpi_powerres.c @@ -117,8 +117,6 @@ static struct acpi_powerresource *acpi_pwr_find_resource(ACPI_HANDLE res); static struct acpi_powerconsumer *acpi_pwr_find_consumer(ACPI_HANDLE consumer); -static ACPI_STATUS acpi_pwr_infer_state(struct acpi_powerconsumer *pc); -static ACPI_STATUS acpi_pwr_get_state_locked(ACPI_HANDLE consumer, int *state); /* * Register a power resource. @@ -346,9 +344,8 @@ acpi_pwr_register_consumer(ACPI_HANDLE consumer) return_ACPI_STATUS (status); } - /* Find its initial state. */ - if (ACPI_FAILURE(acpi_pwr_get_state_locked(consumer, &pc->ac_state))) - pc->ac_state = ACPI_STATE_UNKNOWN; + /* XXX we should try to find its current state */ + pc->ac_state = ACPI_STATE_UNKNOWN; ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "registered power consumer %s\n", acpi_name(consumer))); @@ -392,137 +389,7 @@ acpi_pwr_deregister_consumer(ACPI_HANDLE consumer) } /* - * The _PSC control method isn't required if it's possible to infer the D-state - * from the _PRx control methods. (See 7.3.6.) - * We can infer that a given D-state has been achieved when all the dependencies - * are in the ON state. - */ -static ACPI_STATUS -acpi_pwr_infer_state(struct acpi_powerconsumer *pc) -{ - ACPI_HANDLE *res; - uint32_t on; - bool all_on = false; - - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - ACPI_SERIAL_ASSERT(powerres); - - /* It is important we go from the hottest to the coldest state. */ - for ( - pc->ac_state = ACPI_STATE_D0; - pc->ac_state <= ACPI_STATE_D3_HOT && !all_on; - pc->ac_state++ - ) { - MPASS(pc->ac_state <= sizeof(pc->ac_prx) / sizeof(*pc->ac_prx)); - - if (!pc->ac_prx[pc->ac_state].prx_has) - continue; - - all_on = true; - - for (size_t i = 0; i < pc->ac_prx[pc->ac_state].prx_count; i++) { - res = pc->ac_prx[pc->ac_state].prx_deps[i]; - /* If failure, better to assume D-state is hotter than colder. */ - if (ACPI_FAILURE(acpi_GetInteger(res, "_STA", &on))) - continue; - if (on == 0) { - all_on = false; - break; - } - } - } - - MPASS(pc->ac_state != ACPI_STATE_D0); - - /* - * If none of the power resources required for the shallower D-states are - * on, then we can assume it is unpowered (i.e. D3cold). A device is not - * required to support D3cold however; in that case, _PR3 is not explicitly - * provided. Those devices should default to D3hot instead. - * - * See comments of first row of table 7.1 in ACPI spec. - */ - if (!all_on) - pc->ac_state = pc->ac_prx[ACPI_STATE_D3_HOT].prx_has ? - ACPI_STATE_D3_COLD : ACPI_STATE_D3_HOT; - else - pc->ac_state--; - - return_ACPI_STATUS (AE_OK); -} - -static ACPI_STATUS -acpi_pwr_get_state_locked(ACPI_HANDLE consumer, int *state) -{ - struct acpi_powerconsumer *pc; - ACPI_HANDLE method_handle; - ACPI_STATUS status; - ACPI_BUFFER result; - ACPI_OBJECT *object = NULL; - - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - ACPI_SERIAL_ASSERT(powerres); - - if (consumer == NULL) - return_ACPI_STATUS (AE_NOT_FOUND); - - if ((pc = acpi_pwr_find_consumer(consumer)) == NULL) { - if (ACPI_FAILURE(status = acpi_pwr_register_consumer(consumer))) - goto out; - if ((pc = acpi_pwr_find_consumer(consumer)) == NULL) - panic("acpi added power consumer but can't find it"); - } - - status = AcpiGetHandle(consumer, "_PSC", &method_handle); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "no _PSC object - %s\n", - AcpiFormatException(status))); - status = acpi_pwr_infer_state(pc); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't infer D-state - %s\n", - AcpiFormatException(status))); - pc->ac_state = ACPI_STATE_UNKNOWN; - } - goto out; - } - - result.Pointer = NULL; - result.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiEvaluateObjectTyped(method_handle, NULL, NULL, &result, ACPI_TYPE_INTEGER); - if (ACPI_FAILURE(status) || result.Pointer == NULL) { - ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "failed to get state with _PSC - %s\n", - AcpiFormatException(status))); - pc->ac_state = ACPI_STATE_UNKNOWN; - goto out; - } - - object = (ACPI_OBJECT *)result.Pointer; - pc->ac_state = ACPI_STATE_D0 + object->Integer.Value; - status = AE_OK; - -out: - if (object != NULL) - AcpiOsFree(object); - *state = pc->ac_state; - return_ACPI_STATUS (status); -} - -/* - * Get a power consumer's D-state. - */ -ACPI_STATUS -acpi_pwr_get_state(ACPI_HANDLE consumer, int *state) -{ - ACPI_STATUS res; - - ACPI_SERIAL_BEGIN(powerres); - res = acpi_pwr_get_state_locked(consumer, state); - ACPI_SERIAL_END(powerres); - return (res); -} - -/* - * Set a power consumer to a particular D-state. + * Set a power consumer to a particular power state. */ ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state) @@ -533,7 +400,6 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state) ACPI_OBJECT *reslist_object; ACPI_STATUS status; char *method_name, *reslist_name = NULL; - int new_state; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -735,28 +601,8 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state) } } - /* - * Make sure the transition succeeded. If getting new state failed, - * just assume the new state is what we wanted. This was the behaviour - * before we were checking D-states. - */ - if (ACPI_FAILURE(acpi_pwr_get_state_locked(consumer, &new_state))) { - printf("%s: failed to get new D-state\n", __func__); - pc->ac_state = state; - } else { - if (new_state != state) - printf("%s: new power state %s is not the one requested %s\n", - __func__, acpi_d_state_to_str(new_state), - acpi_d_state_to_str(state)); - pc->ac_state = new_state; - } - - /* - * We consider the transition successful even if the state we got doesn't - * reflect what we set it to. This is because we weren't previously - * checking the new state at all, so there might exist buggy platforms on - * which suspend would otherwise succeed if we failed here. - */ + /* Transition was successful */ + pc->ac_state = state; status = AE_OK; out: diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 7495a010432b..6887f080311d 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -490,7 +490,6 @@ EVENTHANDLER_DECLARE(acpi_video_event, acpi_event_handler_t); /* Device power control. */ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable); -ACPI_STATUS acpi_pwr_get_state(ACPI_HANDLE consumer, int *state); ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state); acpi_pwr_for_sleep_t acpi_device_pwr_for_sleep; int acpi_set_powerstate(device_t child, int state); From nobody Wed Oct 1 09:30:20 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8mF1SfGz69Fvm; Wed, 01 Oct 2025 09:30: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8mD6R8yz3FcK; Wed, 01 Oct 2025 09:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DzlWZypKLGtT2TmDDK+RFCAERRcPb08GzuZoPLCNPQ4=; b=hRA8snD9KL2MFQiInOa8Ck2zBKNbzvsPewqkzSVJw4LbS0Dc6KXYQwxcWQJwl2g0wpt8gm wLxPzKk5awDNlJ37nSP1sJm9qydkPbchbm5PiAKuIZbhMhkQnHvH6Rx7rg3h7nitZg//Wx GVrx6Ih8n91OzVpVz0cOZELCx3jGSWM0J7UzQKX+XkV9fC+OKvUiS3IGq62Qy0rveS0TaN QBT7w/FmSEWHXrGNQ6vAi4jA07y4w1JGeSPVcXHwsmx28u4FcMbouF8skKIT7xeyQjmbgb 8HEA82PPR1pjSzRNQVxlfg96ay3K4s8UHt3iFnAn9bFRRiJNyBq7qqLkn2seYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DzlWZypKLGtT2TmDDK+RFCAERRcPb08GzuZoPLCNPQ4=; b=J7i6oUy4L9G+xDJc1h7WdDQsW2D55ssvx2lL5dezKw39lw/mH4DjmQ8+RhiUk28TN+lsrO JXLUQJF8nOHLR+M3N2SVXTBHSc3+5YSOILG1MQAF66+t68YoobrG48Qt1bjPPPLH+C4Dan +IT22wL40EolVghuV2WLuzeOKx3d+0vm9S0O9egXMJ0NbAHNOGnHMMFy3NagJ/ihbrXS4P SDspdU/oRuE2BSASp5BrPeCv08LS/jvaFZ8yZQ+jN7VOnwWWwcTbenlkCjXNBZiYB5h8jZ /U1IGJGDgIMc1+ZLQuAS+Jwip3a15QpBAkxi/wlmP3oOKHm/mTJjUBLMmI5e3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311020; a=rsa-sha256; cv=none; b=apasb25YmFlCWrnoBTK+72l+WgY29NWZhvbBORmD8TKHumRHAfJmeHfyXP38G+ZcfKb2Ih QEDnL0TsE+bhDCA0564f2CqPoFsIPBE7YywxI/XLYKKO4sxxXoUcKuntmVQpdoWQ1JyeJO edXCOapZIdJk5mH1yszNAOBkfbtcA3VrivvqSfwZKnBsWLVEkjj4O+zloKpqvttxix77uG wNRnrWMJqUwdk1ifONtYzZUdrAcWUSlPiRLTJRR50ghaIQgKZvyERcKHEZOLvfjE9lxj8E /bpEDO/0fw0+Rh9aCTRfmIzCZomqPv8oa1epCD9y8Rz5kFOzNnvxlHZ+M8PEuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8mD61Kyz1b2; Wed, 01 Oct 2025 09:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919UKb0006858; Wed, 1 Oct 2025 09:30:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919UKOx006855; Wed, 1 Oct 2025 09:30:20 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:30:20 GMT Message-Id: <202510010930.5919UKOx006855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Aymeric Wibo Subject: git: dc77c451f777 - stable/15 - Revert "acpi_powerres: Fix turning off power resources on first D-state switch" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: dc77c451f777cfe7d6c8da5b4f8c89ccd506bdfd Auto-Submitted: auto-generated The branch stable/15 has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=dc77c451f777cfe7d6c8da5b4f8c89ccd506bdfd commit dc77c451f777cfe7d6c8da5b4f8c89ccd506bdfd Author: Aymeric Wibo AuthorDate: 2025-10-01 09:13:56 +0000 Commit: Aymeric Wibo CommitDate: 2025-10-01 09:28:35 +0000 Revert "acpi_powerres: Fix turning off power resources on first D-state switch" This reverts commit a13f28d57ecfd136ce73493659c28a47fa1a4b9f. Reported by: phk Tested by: phk Sponsored by: The FreeBSD Foundation --- sys/dev/acpica/acpi_powerres.c | 110 ++--------------------------------------- 1 file changed, 5 insertions(+), 105 deletions(-) diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c index 0baa5c595470..29d1690f1bdd 100644 --- a/sys/dev/acpica/acpi_powerres.c +++ b/sys/dev/acpica/acpi_powerres.c @@ -76,13 +76,6 @@ struct acpi_powerconsumer { /* Device which is powered */ ACPI_HANDLE ac_consumer; int ac_state; - - struct { - bool prx_has; - size_t prx_count; - ACPI_HANDLE *prx_deps; - } ac_prx[ACPI_D_STATE_COUNT]; - TAILQ_ENTRY(acpi_powerconsumer) ac_link; TAILQ_HEAD(,acpi_powerreference) ac_references; }; @@ -103,7 +96,9 @@ static TAILQ_HEAD(acpi_powerconsumer_list, acpi_powerconsumer) ACPI_SERIAL_DECL(powerres, "ACPI power resources"); static ACPI_STATUS acpi_pwr_register_consumer(ACPI_HANDLE consumer); +#ifdef notyet static ACPI_STATUS acpi_pwr_deregister_consumer(ACPI_HANDLE consumer); +#endif /* notyet */ static ACPI_STATUS acpi_pwr_register_resource(ACPI_HANDLE res); #ifdef notyet static ACPI_STATUS acpi_pwr_deregister_resource(ACPI_HANDLE res); @@ -226,84 +221,6 @@ acpi_pwr_deregister_resource(ACPI_HANDLE res) } #endif /* notyet */ -/* - * Evaluate the _PRx (power resources each D-state depends on). This also - * populates the acpi_powerresources queue with the power resources discovered - * during this step. - * - * ACPI 7.3.8 - 7.3.11 guarantee that _PRx will return the same data each - * time they are evaluated. - * - * If this function fails, acpi_pwr_deregister_consumer() must be called on the - * power consumer to free already allocated memory. - */ -static ACPI_STATUS -acpi_pwr_get_power_resources(ACPI_HANDLE consumer, struct acpi_powerconsumer *pc) -{ - ACPI_INTEGER status; - ACPI_STRING reslist_name; - ACPI_HANDLE reslist_handle; - ACPI_STRING reslist_names[] = {"_PR0", "_PR1", "_PR2", "_PR3"}; - ACPI_BUFFER reslist; - ACPI_OBJECT *reslist_object; - ACPI_OBJECT *dep; - ACPI_HANDLE *res; - - ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - ACPI_SERIAL_ASSERT(powerres); - - MPASS(consumer != NULL); - - for (int state = ACPI_STATE_D0; state <= ACPI_STATE_D3_HOT; state++) { - pc->ac_prx[state].prx_has = false; - pc->ac_prx[state].prx_count = 0; - pc->ac_prx[state].prx_deps = NULL; - - reslist_name = reslist_names[state - ACPI_STATE_D0]; - if (ACPI_FAILURE(AcpiGetHandle(consumer, reslist_name, &reslist_handle))) - continue; - - reslist.Pointer = NULL; - reslist.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiEvaluateObjectTyped(reslist_handle, NULL, NULL, &reslist, - ACPI_TYPE_PACKAGE); - if (ACPI_FAILURE(status) || reslist.Pointer == NULL) - /* - * ACPI_ALLOCATE_BUFFER entails everything will be freed on error - * by AcpiEvaluateObjectTyped. - */ - continue; - - reslist_object = (ACPI_OBJECT *)reslist.Pointer; - pc->ac_prx[state].prx_has = true; - pc->ac_prx[state].prx_count = reslist_object->Package.Count; - - if (reslist_object->Package.Count == 0) { - AcpiOsFree(reslist_object); - continue; - } - - pc->ac_prx[state].prx_deps = mallocarray(pc->ac_prx[state].prx_count, - sizeof(*pc->ac_prx[state].prx_deps), M_ACPIPWR, M_NOWAIT); - if (pc->ac_prx[state].prx_deps == NULL) { - AcpiOsFree(reslist_object); - return_ACPI_STATUS (AE_NO_MEMORY); - } - - for (size_t i = 0; i < reslist_object->Package.Count; i++) { - dep = &reslist_object->Package.Elements[i]; - res = dep->Reference.Handle; - pc->ac_prx[state].prx_deps[i] = res; - - /* It's fine to attempt to register the same resource twice. */ - acpi_pwr_register_resource(res); - } - AcpiOsFree(reslist_object); - } - - return_ACPI_STATUS (AE_OK); -} - /* * Register a power consumer. * @@ -312,7 +229,6 @@ acpi_pwr_get_power_resources(ACPI_HANDLE consumer, struct acpi_powerconsumer *pc static ACPI_STATUS acpi_pwr_register_consumer(ACPI_HANDLE consumer) { - ACPI_INTEGER status; struct acpi_powerconsumer *pc; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -323,27 +239,12 @@ acpi_pwr_register_consumer(ACPI_HANDLE consumer) return_ACPI_STATUS (AE_OK); /* Allocate a new power consumer */ - if ((pc = malloc(sizeof(*pc), M_ACPIPWR, M_NOWAIT | M_ZERO)) == NULL) + if ((pc = malloc(sizeof(*pc), M_ACPIPWR, M_NOWAIT)) == NULL) return_ACPI_STATUS (AE_NO_MEMORY); TAILQ_INSERT_HEAD(&acpi_powerconsumers, pc, ac_link); TAILQ_INIT(&pc->ac_references); pc->ac_consumer = consumer; - /* - * Get all its power resource dependencies, if it has _PRx. We do this now - * as an opportunity to populate the acpi_powerresources queue. - * - * If this fails, immediately deregister it. - */ - status = acpi_pwr_get_power_resources(consumer, pc); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, - "failed to get power resources for %s\n", - acpi_name(consumer))); - acpi_pwr_deregister_consumer(consumer); - return_ACPI_STATUS (status); - } - /* XXX we should try to find its current state */ pc->ac_state = ACPI_STATE_UNKNOWN; @@ -353,6 +254,7 @@ acpi_pwr_register_consumer(ACPI_HANDLE consumer) return_ACPI_STATUS (AE_OK); } +#ifdef notyet /* * Deregister a power consumer. * @@ -377,9 +279,6 @@ acpi_pwr_deregister_consumer(ACPI_HANDLE consumer) /* Pull the consumer off the list and free it */ TAILQ_REMOVE(&acpi_powerconsumers, pc, ac_link); - for (size_t i = 0; i < sizeof(pc->ac_prx) / sizeof(*pc->ac_prx); i++) - if (pc->ac_prx[i].prx_deps != NULL) - free(pc->ac_prx[i].prx_deps, M_ACPIPWR); free(pc, M_ACPIPWR); ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "deregistered power consumer %s\n", @@ -387,6 +286,7 @@ acpi_pwr_deregister_consumer(ACPI_HANDLE consumer) return_ACPI_STATUS (AE_OK); } +#endif /* notyet */ /* * Set a power consumer to a particular power state. From nobody Wed Oct 1 09:38:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8xx0x1Nz69GXT; Wed, 01 Oct 2025 09:38: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8xx0DrMz3Gdg; Wed, 01 Oct 2025 09:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zOdN4pyZEhcmaLnxzhb2FDZ3grSrQJH+n7IJq8rgg6M=; b=XBybX0rVKJNSPzJpe3EnQruyYvWHWSoh7YCaYDKTQVrApGQwsN5i2tdxFzQ3GlO/S+OHX8 rAR+iyEv0XMld1QxEKHvodMgk1KW0ioRlYMaGGW2ZYqttZkfWfJM/0ot/S6i330jpnnUZ7 YbMH7wDO3R+hb1AXvZUrK9rj2RAxhmp9YIV7RO+FvSvY7T2dMo/vd/SGHGWS50V/sf0sOU SZuJGVA9Vp3L1BQ85Ew0jvgmymXnRStPJurXzVY+uE0/g3R7bJW5iJLYZqI4cZOl93yqAr GsGg8hdCoBiSjynhX1NMtKd0G4fQTIsXYdd9jg6mOatoiT+1tj5a2Wgj97xO8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zOdN4pyZEhcmaLnxzhb2FDZ3grSrQJH+n7IJq8rgg6M=; b=JtfOzxzAZ8QiBWUGRkgWfocGDOudavlTneyk23hRXwuYceG8KdZXZ9xjxHlPv+0v9vl449 Ok9ugX13D1xcW/F/R53xgBb8epuakvPi6L6i4x+6rAcpFkGXmZL0AfJ2fI40q7VylUtvbB xJIu4fJ9idun7AijC9desYge16CqNqK/VTQP40CEe1UVD4EWjxQfOXRUFY3baR7PN8Hggs 8FPqdsQk8zmMpwCRO3ROFxQ6hOkEfJqGHmOM5KobhZPaGxPpGwcT1bBGUBIEE9IftHWEaV 5mzi/AP4mFwW+VC3HWymBW0GHHccNNqC4TnMjJjjGmHVZZ0ONzcWIezpQ/2n1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311525; a=rsa-sha256; cv=none; b=GQ38qQhjgycEFDCWhwdijYq7+8yv7sCoK3qzIQj94cxAqKSd1zAkyf+ZJEG9vAve+ukzzv fdm84GRt12BcRpMn+BQpI4CgDi/uVvR3vEcN+R44vrQSZUZxnEKV6edd5f2UEbmyGjO8y9 5ClwGpc92/cIztMMd9k2eJKgbzfTl8p8dkGRKMxVOcDMt7gf3SKfPr/BKtllKXaQogGx9v /JROBqQpnBAWJu36trdFwyuupV4gjsLMNFXg5fDshkXeEYvV+wV5B+//YVcHDYmyvtXeO6 gL2m63w0SU8/cEK69rKJcSCI/ZLS6N/xCGAsd4xevEgeX0QC/lAGA5yKahRq2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8xw6cP9z2Lg; Wed, 01 Oct 2025 09:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919ciHo016292; Wed, 1 Oct 2025 09:38:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919ciQJ016290; Wed, 1 Oct 2025 09:38:44 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:44 GMT Message-Id: <202510010938.5919ciQJ016290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 2dc10f2a49af - stable/13 - ng_tty: don't increment m_data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2dc10f2a49afc688c103758a41d5fb8cab5fd1c2 Auto-Submitted: auto-generated The branch stable/13 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=2dc10f2a49afc688c103758a41d5fb8cab5fd1c2 commit 2dc10f2a49afc688c103758a41d5fb8cab5fd1c2 Author: Ahmad Khalifa AuthorDate: 2025-09-24 15:01:57 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:50:46 +0000 ng_tty: don't increment m_data Stop incrementing m_data so the callee can read the mbuf. MFC after: 3 days Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D52702 (cherry picked from commit 57d5a8feda3fd25a650eaab5998db13633d62d2d) --- sys/netgraph/ng_tty.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index 6f8667c664bb..c7d8a1b64eac 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -485,9 +485,7 @@ ngt_rint(struct tty *tp, char c, int flags) } /* Add char to mbuf */ - *mtod(m, u_char *) = c; - m->m_data++; - m->m_len++; + *(u_char *)mtodo(m, m->m_len++) = c; m->m_pkthdr.len++; /* Ship off mbuf if it's time */ From nobody Wed Oct 1 09:38:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8xy1ycLz69GV0; Wed, 01 Oct 2025 09:38: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8xy0zy9z3GlB; Wed, 01 Oct 2025 09:38:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p2f6c4TcOYRzLMIAYiqp93lIk0CIqfSmgK3mXuQGILs=; b=hcijZH0CZZE9xHMZlrBupndLuCUOD2tFWA+K4z1t0Zwy2NTVkeHjcRs5C1wNBKK+yUggyU ObG5qjrDrxLuLxvgY84AKMfP9z5Ec7CyMBPZHhW6gNHYULOaF4fQ7tskqHoP5OO6mVH4xz LTeozgv+iw6Z+our7Q+7ySuwKfwKNO71rnd+pBrhK+b+0mik/LsXsFrrvZ2yMzZcE5CAE3 9pX6fzIl5JpEwm9iYSyQW52sjf/65kzmi+TwklcIn/hSaS7LQuf0OmZpbBzT7D33g7Nrer JCt8fusdaXdgs033lJycOeB0Xiw/Na7dijg/Jy4d1walLdXjcSxr3GLdBkvJGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p2f6c4TcOYRzLMIAYiqp93lIk0CIqfSmgK3mXuQGILs=; b=r2sm9WTo2XLrZFcg9UtZGpyHkO5yqIrUIwqG5OpF7RzZVv48kaMA0NZU9D5B87jlpMC+e4 +x/7e1/WzVeigyU3RgJi4q0CBwnvMdzfNqgJ52kuvrbFkUHki6oQS9qtui9BOd09FHidbx ddom5uKIr0Xa+vJS4y5H4vC+ke1GL1QdHouk9qSCOv6RF3FlTOmFDNoOvwoTrRBxWcE0ph naW8rMjvwlpo1INR6WvUOblQ6VHmqxMgywjO7B/7l5E9WJn8WyXG9dfc0+/rHbc1qUzJVW iIsjCbJxo10hYWBQcAa8Uchc603qMelbDcH7pwi1duTfQ24CtavHfyO+v9548A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311526; a=rsa-sha256; cv=none; b=pq3/et4mU7YpLPeuYMQg55Xg3EXTOJe6kcTusIY65i42ruYWdhCzMsKaCtJE69929UsWsB /Fcw+Ixd6kKoOxcyYt0GBeZ15ZId6zY31UNlBHrxrQnPneuUWC3cfRXl4drFUrg1c/IZfp 1YOISfs7q+MEl+rwqaLCklog0yYK/HBQpMyUB03uX8AYYnwBEflzWBYWTeZymuPI83ImxV qUY5ON4PlqC1/nKyl+wFXCKjsvx58c+42JgjAwXkyR3t8LesIqOq/HSGQ+OT1rb6G2n6j8 52XYQ9FmEqxBW74Bwm2ci5GL+qAU14KO0V2C7ZJKPnH7fyWxTpENWlDQ6w11NQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8xy0Q36z1vh; Wed, 01 Oct 2025 09:38: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 5919cj96016333; Wed, 1 Oct 2025 09:38:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919cjud016330; Wed, 1 Oct 2025 09:38:45 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:45 GMT Message-Id: <202510010938.5919cjud016330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 51cac1f186f5 - stable/13 - ng_tty: copy to the correct mbuf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51cac1f186f549522aad8a0858ea1ff4413cb8fb Auto-Submitted: auto-generated The branch stable/13 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=51cac1f186f549522aad8a0858ea1ff4413cb8fb commit 51cac1f186f549522aad8a0858ea1ff4413cb8fb Author: Ahmad Khalifa AuthorDate: 2025-09-25 16:54:28 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:50:57 +0000 ng_tty: copy to the correct mbuf memcpy should copy to the current mbuf, otherwise we're copying to the first mbuf in the chain over and over. Reported by: kevans Reviewed by: glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52713 (cherry picked from commit e05521121f05a1b1e0d7c7b5fbe79f83fc303cd0) --- sys/netgraph/ng_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index c7d8a1b64eac..0e3230a66f66 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -427,7 +427,7 @@ ngt_rint_bypass(struct tty *tp, const void *buf, size_t len) for (mb = m; mb != NULL; mb = mb->m_next) { length = min(M_TRAILINGSPACE(mb), len - total); - memcpy(mtod(m, char *), (const char *)buf + total, length); + memcpy(mtod(mb, char *), (const char *)buf + total, length); mb->m_len = length; total += length; m->m_pkthdr.len += length; From nobody Wed Oct 1 09:38:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8xz3myLz69GcN; Wed, 01 Oct 2025 09:38: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8xz28Kzz3Gtc; Wed, 01 Oct 2025 09:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdlpQduOdxQwkJpeuS2ElbpW3kDdvK9XosvMI9JuIng=; b=RZC9rzEcly9ukIlHI2WW4NCZA4+SWEV79gX3C9dJAIRyE9gkz1jRWBxsUzvafcP9+ojXVL 13eJRngEJi+t1nvrRVS/2AovHEwwZRnEdffkDOMRkV0wv0A+E3yb2AEP9mV+72N6rdp8ny ajJcCmIoD0uuIvLt9pwekRPzz0WU1yVjfH6Xx1yJG2W/R//to2/OvK7RNsMtRKPUAcWodv 59iopj15Rz3wBIaf5U42ozRVwAAaVeu6N6XV4YqBnjrnKN/rrv1Jyjggx6jrlcFBfaxl9a PLZ41p+WG6pNSsD62TnHdZyyjsYLQBNlwB9bQLPu0viFGvK0wyUgfzEw4KDiQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdlpQduOdxQwkJpeuS2ElbpW3kDdvK9XosvMI9JuIng=; b=Hd24rS4inydRKaGM7tNFlHWn1UEeI4xio4DAGt9SYw2GmvFbLQ7z6VY3VGF6zJWtx3l0v8 xauWtrvr0COyak31fiSznjdHyQfr75rKHlsPFNFSFNMOlMgO2HVpz/D5WwYW4v6yn0RAxk ugQGKZm3sHXUnXCfIrJQOw/MY0hNAsaS0lSsbgvwBATGONbJr7ADIGhiMzN0H4DMLzjHl5 /8S5kITpMRJJFeXptxoH7Z5/D1805+4xgCKS+afEsXThdWSN9LKkoj8qC39oV31fFVjP48 3mHcoGYAKJGeH8HPYHzy9vxKI7K7nMR+ClnPOOl2TqXqWYxVPVmaefwfylEGUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311527; a=rsa-sha256; cv=none; b=Cyc5RckgYvJTti03wauclHydMlUYsmNLrZ07DPBotPrqoB2U7RvDT30yB/RM0iruMHvw82 NS8G/4vHeaX0Vjp0mghad5YKx/t+51gQgWK8/0Mex7E91XKJS1BuKcUEKzqVsWs2Z5NCIO Qxkq73qK8p+AHGOUQ+L/ewQ9riOqv1bGnMTry9kVzIufXcg1PcyC+3lOSbWzkXsFvjYpBM jO2NQV1xQnShHXyPRJ96LXu39DGe6p9IWo9m3emYUQLrbeSLvfXemgPhe9LW//xo/Uth2I 1pHvw4qPThbF3O6JArviM8bdZzftvT4+03I04qfINH2/TiYF/dwc3iTrmmORbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8xz1N9pz25N; Wed, 01 Oct 2025 09:38: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 5919cltd016366; Wed, 1 Oct 2025 09:38:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919clSW016363; Wed, 1 Oct 2025 09:38:47 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:47 GMT Message-Id: <202510010938.5919clSW016363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: d8ee81cb8a86 - stable/13 - gpioc: allocate priv->events with the correct size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d8ee81cb8a868d4b066a8a087fa7726b638484d8 Auto-Submitted: auto-generated The branch stable/13 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=d8ee81cb8a868d4b066a8a087fa7726b638484d8 commit d8ee81cb8a868d4b066a8a087fa7726b638484d8 Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:09:28 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:52:08 +0000 gpioc: allocate priv->events with the correct size MFC after: 1 day (cherry picked from commit fa26e445544eb88f05779258e2ab9c96384fe74d) --- sys/dev/gpio/gpioc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 916b37bc6f3d..1a5c483b0c3e 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -699,7 +699,7 @@ gpioc_open(struct cdev *dev, int oflags, int devtype, struct thread *td) * npins isn't a horrible fifo size for that either. */ priv->numevents = priv->sc->sc_npins * 2; - priv->events = malloc(priv->numevents * sizeof(struct gpio_event_detail), + priv->events = malloc(priv->numevents * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); return (0); @@ -909,7 +909,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, free(priv->events, M_GPIOC); priv->numevents = evcfg->gp_fifo_size; priv->events = malloc(priv->numevents * - sizeof(struct gpio_event_detail), M_GPIOC, + sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); priv->evidx_head = priv->evidx_tail = 0; } From nobody Wed Oct 1 09:38:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y10Lkzz69GV1; Wed, 01 Oct 2025 09:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y02ky0z3Grf; Wed, 01 Oct 2025 09:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ms8E/a05CP+rWUkP3G8NCtgNobCHFIc9mk5TjzP74Ek=; b=hrIx9RsfDm8y4oSWc9foIS4yEti0lzsMAxYQiLg1n4w4un1Md3BgnSRyztjZV3U1pDeHxo kY9wPo/D7a/jAcbYxCZVXVp2pKQHmAuk4gcd4ODXJnRoX0vOJvPI9ezgSOAZmj3hY7vA00 aE6RjlG8k6xjV+ly4c4oOWQzb6aW7JIwoEBLg0b/rFfQhrw3sqSoMVp3XFQWrxX2ESyL6N MQ87LNjAYH7P2PNQeHU7yIHVhD9ouP3jTQL3+LdzekZpemhSRaK0GthyCA/LyI1WX2ATYX pyaEertkgIzfvpS8f36jhX7sEtn3eb7cA40tGbcaoMiB0ZfhnYqpdpJRjwGN0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ms8E/a05CP+rWUkP3G8NCtgNobCHFIc9mk5TjzP74Ek=; b=CxSoxGDWGpW6Rqr317yCItFLX1mCXwOP19HMoVjXgnxdxQyEUMEucOojNu1xlxDxyyKW0X 8i4CEczJsKsBYa1Jhsmmxcg5UlRGWwgIsJgVZbtZysYHeJFKshNFnMiFsmWkLEj9dSlWaU qpdGzDeXhSjvrlM3iQtnWUO7TpWyIkNYrHjg2Zuc4DLnCsX/fgWdh+OAXkihVj8L2RRgHT bQ7TzwE30W3ti/aGNaf37+RaGunZp/GyyyI0pdylN1ZdIEpxchsZFyDp48jfjXlaY6kDzR 1aqgMy16ePw+oHRcxQQQgCtCCuxayj6Q/bVY93kDtAEzTDYnC4dFP56KpYD8EQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311528; a=rsa-sha256; cv=none; b=f+yYW5p7a35v0s+RX2NQzLq7wXfAeRYs9PaGh8BtrAdNmDPck2aN/fcWMzvYhu0UPjv2Qr 4OyMZPTB0jhZ5m3HfGNrhgKe2+d1BpJcxh5pK0tpPUW1ANkRmCIcprO/+V1qVXhw/yeS0x 4F14mvFKx53KuczUoQYgTodpwXtPaaWWObyLM8bT88nEen+HfZNVHGYKurVpgeFIN9O2sU PH8Qnz3dVDIgl+tllKxVDAr9gjHrLLqOx2wXIGoW4QHDETqwvJZwLjCleqstZyTW6Kg/rb Gk1TwFqLdjU3upDzYXgFQPnztmGC1q4XG5Tw+OmhxLefl3KFeqdztT2p9sEvyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y02K6Fz2Lh; Wed, 01 Oct 2025 09:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919cm5u016399; Wed, 1 Oct 2025 09:38:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919cmhW016396; Wed, 1 Oct 2025 09:38:48 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:48 GMT Message-Id: <202510010938.5919cmhW016396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 4472ecb362b0 - stable/13 - gpioc: fix race in ioctl(GPIOCONFIGEVENTS) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4472ecb362b068400f26abfce2db2a2b10a88d95 Auto-Submitted: auto-generated The branch stable/13 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=4472ecb362b068400f26abfce2db2a2b10a88d95 commit 4472ecb362b068400f26abfce2db2a2b10a88d95 Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:09:50 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:52:21 +0000 gpioc: fix race in ioctl(GPIOCONFIGEVENTS) A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the priv->pins list, making it no longer empty and opening the door for access to priv->events while we are reallocating it. Fix this by holding priv->mtx while handling GPIOCONFIGEVENTS. Reported by: Qiu-ji Chen PR: 289120 Reviewed by: mmel MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52783 (cherry picked from commit d000adfe41e6f2fe8f3dbe92d8fc2d34ae882086) --- sys/dev/gpio/gpioc.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 1a5c483b0c3e..536ebeb9ae39 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -783,6 +783,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, struct gpio_access_32 *a32; struct gpio_config_32 *c32; struct gpio_event_config *evcfg; + struct gpioc_pin_event *tmp; uint32_t caps, intrflags; bus = GPIO_GET_BUS(sc->sc_pdev); @@ -892,27 +893,35 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, res = devfs_get_cdevpriv((void **)&priv); if (res != 0) break; - /* If any pins have been configured, changes aren't allowed. */ - if (!SLIST_EMPTY(&priv->pins)) { - res = EINVAL; - break; - } if (evcfg->gp_report_type != GPIO_EVENT_REPORT_DETAIL && evcfg->gp_report_type != GPIO_EVENT_REPORT_SUMMARY) { res = EINVAL; break; } - priv->report_option = evcfg->gp_report_type; /* Reallocate the events buffer if the user wants it bigger. */ - if (priv->report_option == GPIO_EVENT_REPORT_DETAIL && + tmp = NULL; + if (evcfg->gp_report_type == GPIO_EVENT_REPORT_DETAIL && priv->numevents < evcfg->gp_fifo_size) { - free(priv->events, M_GPIOC); - priv->numevents = evcfg->gp_fifo_size; - priv->events = malloc(priv->numevents * + tmp = malloc(priv->numevents * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); + } + mtx_lock(&priv->mtx); + /* If any pins have been configured, changes aren't allowed. */ + if (!SLIST_EMPTY(&priv->pins)) { + mtx_unlock(&priv->mtx); + free(tmp, M_GPIOC); + res = EINVAL; + break; + } + if (tmp != NULL) { + free(priv->events, M_GPIOC); + priv->events = tmp; + priv->numevents = evcfg->gp_fifo_size; priv->evidx_head = priv->evidx_tail = 0; } + priv->report_option = evcfg->gp_report_type; + mtx_unlock(&priv->mtx); break; case FIONBIO: /* From nobody Wed Oct 1 09:38:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y15lWWz69GcW; Wed, 01 Oct 2025 09:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y13kLzz3Gjv; Wed, 01 Oct 2025 09:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o6J5ReTiBmiQzbi0AtitP3kV8ApJMI1MtUX4RJmiMgs=; b=Oy2salqw+IhB4RVihHD6iGcZcCME/7KieGtDg+9/blv5qO+7ObHRCXrJdiIJkmugXlB5IV Jffpz7+lE2mzdgmNgJYJ4uY51brMFhQ/SvDupPyy8j+TUl+a4sbKUG3jFeT6PYFvmVCcVs dy7Ek/lMNDRywoD/72Vb3fk/hXV+4rfh0Z5km05hm5bUQ9Hxbj9fpm4Z4yU8sFC5u3+OQ/ 65WKo363OwzFrsJTzE09Vnc7T37kOccTvOAF5EwQKbqpl6Zy3jmJsKrYICsAq/UMrJ8KcU FqZNWFONLuqY1TmltPLDI8eYfmdoh9kLhREibIG8gjBZQFCH3/H2BtlBS4GrvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o6J5ReTiBmiQzbi0AtitP3kV8ApJMI1MtUX4RJmiMgs=; b=Tp6R8Du6lkt8mB2EUSOfQjkwW8ZuHGKa+dX9QtZUJ7yyAQdsG0urziSpR/rW2yjvFi8dl6 PJ6U0dMvKY8cs2gLOw9ES17DcpF435EXKjl3AlY/5WFdU2GgKy/mkpVNBr1qpHIoH6WFoI CdyYvn7rVk3u7zHPnvJx5Tb0Y0jdKQtOSLt/5D7ACRHFQL4Ql5w6nZEwzl6ERSS+hWvLBQ VAso1LdkaVJAIW8vLLTyfO1O0JZyFvW1BN4N64oV+KuZCAnsS9hymkBz/3ddILY/iM0UP9 R5ODE70UMBB54GNt718zDTQF768Mywa8aWbPjh4Y8P5khFnC7e6O/D2en6qsgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311529; a=rsa-sha256; cv=none; b=W2sMIxFxYWjJaw7jE0Iyst5oCCVlqhTU871myd/cgxMvUZCcqI05xjjukQbksVBc6JoQ0x ExeRSyhm1LWKNP7tfSIcdejh8RvphxXWcw5YCmyhY1kM/6n6r373F7ugpFuhUbOwJ6ZYSZ 3lcySBczivpRQLzGPCZJTZCmpAUMqJj7KTmFsaH77i8LEGPR8kjrsOuow2FSeFccjRgh+W vItibXm3AADKL1owMY6LoaIuSfq2o4fY04abUhwf9TB8It0Qa/5vXRkcWKrcKZHabBU/3d WeTigDpuW9yaahnYSaVFIKxURhRusDkuNT9BS0TjhVEMwxA/HqH8j47rVEw9MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y13JkNz2D4; Wed, 01 Oct 2025 09:38:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919cnkM016432; Wed, 1 Oct 2025 09:38:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919cnVU016429; Wed, 1 Oct 2025 09:38:49 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:49 GMT Message-Id: <202510010938.5919cnVU016429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 1488828f451c - stable/13 - gpioc: allocate new fifo size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1488828f451c1793a23afc33e353292f3935b085 Auto-Submitted: auto-generated The branch stable/13 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=1488828f451c1793a23afc33e353292f3935b085 commit 1488828f451c1793a23afc33e353292f3935b085 Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:55:34 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:52:33 +0000 gpioc: allocate new fifo size This slipped through after I resolved some merge conflicts. Fixes: d000adfe MFC after: 1 day (cherry picked from commit 2679636b4412927242e46d3806fbb58e2702eddb) --- sys/dev/gpio/gpioc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 536ebeb9ae39..de40ac2247de 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -902,7 +902,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, tmp = NULL; if (evcfg->gp_report_type == GPIO_EVENT_REPORT_DETAIL && priv->numevents < evcfg->gp_fifo_size) { - tmp = malloc(priv->numevents * + tmp = malloc(evcfg->gp_fifo_size * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); } From nobody Wed Oct 1 09:38:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y272NZz69GcY; Wed, 01 Oct 2025 09:38: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y24nNMz3Gpg; Wed, 01 Oct 2025 09:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6wAofoBtxi1LQ3+n7q4PVZhOeLRETP6wQ+jmvPo9tAU=; b=nJKw6d0lxdjDEN+/AGMGzKG35eeNzxzfu21mBjK9EGTe3Q9WpMmcL+eXzFNtJwPH6kzQNW dAeLlQ9A1urRsppyStQi+UB637Ceyekw/ItxndSvEnhGBzHjTGipI/GT+F+a+H1owxOQz5 JgXHrLd/J8VRDhXFyLX0TbqRDLCJer4wNiYh3ZmpLbNNZCTm7nrreSYzrmoe+TwMZN+JhG 4SFf29CUvL77ohgmLtKR+ju0b/69Jr8fATLKhRcZvUjI92re4wAVAsUz++QJaCjarYHBAN ZOhm7Ut5+QQSiJMb2Glh2aVVfmqkezh/EMuTXXm4V+xz1BypwUGNrHpoqUzT4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6wAofoBtxi1LQ3+n7q4PVZhOeLRETP6wQ+jmvPo9tAU=; b=DfpwBZ/xK0MxspNfhy0jHJ5sBSPyJ8+dnlf4qZh2dmC7md3I3Gtubu1Lm7GtxaSEP7J6G1 nzKE3Mlz0MPjokWimup8goBE4ASd4g9CCrxg82/JjCq3WAbWbg3w1N2S8qvU+wD5NUEMly KwiyDDprafrynD53Nr8Es4dXujaBoZYzz/Ajx+1LHWFlWREQkDXAsnxf7UB2hyWGIwvElb zjMcSf8gRwPOPDC7hLXOXbyefeLW4UUo21Nf5ZdzLwazl9oKkCteMhgi9yksny7DerXbZM b/o3tPnKkbWYvfH2WfcP4Rkx/2nH6eJneJpwF1eaOpZXFgRyrEWs+j6NqGliFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311530; a=rsa-sha256; cv=none; b=igullq11K0mn7IG+2E9wyG5SDYkLaZGGdp3v4HFwrY5D5WR+yUWF4cJiGhhtBSQemaQZ0Z f2uRbDYaR0oxuPAAwKUG9lGyvW1RNf/w5I8v8zzBfVk6fpJ1Cw+WTuNGrSnug841I2nd09 InmZLf/pBUsgfBMykKT7U8PNMCwiPtx+6R1XZUtUL5UF+SJyPhHL0vLtrMIfI477U059Dt 9Jg6LvjY8X0MqAW/Wal58U2QbSJYosSKAKAuIHif+B5R74B/4IQ2qNqS89bs/P85P9jhfh 6APJwbsA3AeJf0w7S7eM+YhU3oWT5Icje02i8Z8LSrYSUBrIotkURcsA48XZNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y24KjJz2Gl; Wed, 01 Oct 2025 09:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919coIJ016482; Wed, 1 Oct 2025 09:38:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919coZf016479; Wed, 1 Oct 2025 09:38:50 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:50 GMT Message-Id: <202510010938.5919coZf016479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: e05342f3618f - stable/14 - ng_tty: don't increment m_data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e05342f3618f0e7b0e6c75a513212b389714d59a Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=e05342f3618f0e7b0e6c75a513212b389714d59a commit e05342f3618f0e7b0e6c75a513212b389714d59a Author: Ahmad Khalifa AuthorDate: 2025-09-24 15:01:57 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:34:47 +0000 ng_tty: don't increment m_data Stop incrementing m_data so the callee can read the mbuf. MFC after: 3 days Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D52702 (cherry picked from commit 57d5a8feda3fd25a650eaab5998db13633d62d2d) --- sys/netgraph/ng_tty.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index 6f8667c664bb..c7d8a1b64eac 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -485,9 +485,7 @@ ngt_rint(struct tty *tp, char c, int flags) } /* Add char to mbuf */ - *mtod(m, u_char *) = c; - m->m_data++; - m->m_len++; + *(u_char *)mtodo(m, m->m_len++) = c; m->m_pkthdr.len++; /* Ship off mbuf if it's time */ From nobody Wed Oct 1 09:38:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y372vmz69GRX; Wed, 01 Oct 2025 09:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y35ZFsz3GyF; Wed, 01 Oct 2025 09:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xB3qnmAyGc8r7zQL5IuoxFPFLvl2ke5hE67s/7Aw9fk=; b=F4qARksuvQxqR7WRWml3HGkcrKQwgZll8VLgipilFVcCrNyufT/zz1HeuFQj2sHMn6aBYT gLGYHQId+Vhbu9if0s1bas1UMponYgpvcDCI1+mn+B0RqACMGvrLp4f5QFT9H0kgCjcqat 0TxaalBIkH/PS6d7RHRf66icFVAiVasSmnDGynDiNCVMZlR69a41EDXqbVyap14Ix+kcA1 jEUWpyiiP169kCMGhThb79VN5+HWOV9gffyH4w3GYGy9HXBXsO9/7hTKhffjf5uLIri9YH PifOcBGDElY911H1De2KQ/zTduaqcuzv2+Rzrlg2ZDmyYy6GmEok2B1IuWSsOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xB3qnmAyGc8r7zQL5IuoxFPFLvl2ke5hE67s/7Aw9fk=; b=VDcvpFUnqhHqrJWjWj+kh+6BOxy/4XAmxf23sUAKYYJ/+a59FZ8yE3r7M4nuxASCbbBT2q Iw+tIFMRtGvQHoQaRYLH8KZnYZREWRPBEN3vxPkp5IvkIBrXLqf21ougy8uRXdEfWULt0D rJq/0wC1sD6MN3Fbf4vwDFISJjXP590j1pnQmyHYvR5Tp+5+yWLYu/IgNNQyg2zyOxV1HY lXpFm4W9Kr8q/w3uvkQRZkIRR2qnFV3ocb8Q9yDRJNUEVUlGNO90xSTGpOy+rypuK2zEkq LqjE6HFaZQhxWAx+D8Cc4TXxQ26MLQ6FGRkk5t6lYsl5xXN0F+frMFTzkcrmYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311531; a=rsa-sha256; cv=none; b=rBzWU5mcZ8T88vyNuHz1MWZYW+H41SEV5oCp+JeiSAqIQetJ1aJ6nFIQ0jBsdTw6A2oSbp UFYy04tNG57nfzhSoVfEVQE35piSO1LQayTOhKDDrTqQoa32s4yrNESO7h2oCiieRMi8G0 hwhvq09fOUmFvMb2JtCd6a7waIcaaU7JNFINiBjfbyiXA08o/swsCukOqvFPv97504RK8O JoDSDSw+sXZ19xNBP9FFiFh5rZZXN5x9YfceFK7nAGUQwSJnusXnYNuxgBgVpjGgxOwA0f WtPFpX7qNljbbiA0cvng9BynNImXIRph0ukCfZ5+bkkOqrZr1/XZPZ5JbNHnHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y352ttz2JG; Wed, 01 Oct 2025 09:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919cpUc016523; Wed, 1 Oct 2025 09:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919cpuX016519; Wed, 1 Oct 2025 09:38:51 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:51 GMT Message-Id: <202510010938.5919cpuX016519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: b6ad8caa24c2 - stable/14 - ng_tty: copy to the correct mbuf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b6ad8caa24c2c6e7e1c8a844c2fd283a2fcfef3e Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=b6ad8caa24c2c6e7e1c8a844c2fd283a2fcfef3e commit b6ad8caa24c2c6e7e1c8a844c2fd283a2fcfef3e Author: Ahmad Khalifa AuthorDate: 2025-09-25 16:54:28 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:35:01 +0000 ng_tty: copy to the correct mbuf memcpy should copy to the current mbuf, otherwise we're copying to the first mbuf in the chain over and over. Reported by: kevans Reviewed by: glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52713 (cherry picked from commit e05521121f05a1b1e0d7c7b5fbe79f83fc303cd0) --- sys/netgraph/ng_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index c7d8a1b64eac..0e3230a66f66 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -427,7 +427,7 @@ ngt_rint_bypass(struct tty *tp, const void *buf, size_t len) for (mb = m; mb != NULL; mb = mb->m_next) { length = min(M_TRAILINGSPACE(mb), len - total); - memcpy(mtod(m, char *), (const char *)buf + total, length); + memcpy(mtod(mb, char *), (const char *)buf + total, length); mb->m_len = length; total += length; m->m_pkthdr.len += length; From nobody Wed Oct 1 09:38:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y51gTxz69GV5; Wed, 01 Oct 2025 09:38: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y46chkz3Gvs; Wed, 01 Oct 2025 09:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7HhS/vfQ3AlIP9Dbjx8erDNCehAk15WAiqyiDjPuIyQ=; b=uSpSBlSkSiw5rv0juG3GNX5TnbOkWg1bw5XWgzFcUID3EU+LI9vjIl8XfT0zm795glu3H0 SEnP7DImVRLRIpWSVZZh5og7jHup5LlWrzCj6BgXiaX5a1BAuI1gtgKoaW2XFkGK8pK234 y2m1apPAmvWKpcpznMkfihEmY4whsgu2KyBgbofxUW4gumFc7JR20QT45QHDMULu4JMaL7 bVMXCor/FtTiz3d3siCr9Xr6WPjXQFx1zGj4Ha5w7tOCyQZ5tUlQ35zBelk5kuOjD5Mq9J PtjL9HYCOQKLWQKjs/mZj0KM89KEoRxe3XT5fe/dz3tqU0e9BFAoPOSVNDEklw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7HhS/vfQ3AlIP9Dbjx8erDNCehAk15WAiqyiDjPuIyQ=; b=owUFTU5qhUb6PRRBtdCyNaBnCLEnip2Vg7jklWWR3FCnTcDXGjWOK/e5KTpC1945vuzoAu mT8oWKW/Gs+bQngkWTrHBbhmTMztfD3KEieLJxhWvX0CjL+W4cqjGF6AZ1FCWDwiYYXGgj cSFZRVi6ruBVGPjGVfjmcaKQR+DhW0PupX3eOuFJSrePd2y0bDBkVIAj08kP7ctpeKjiZT K5pbZv0B+sVcrcM+6DuEEKIH49WK8urLeh7O7o+F0Byo5vALXceKP+5pFNG5X3nsk08sVq GBF8xA5Mo0LB5HZLtfA2cxB3oG3WemsOlJtOKt31qxWLh52X86eR/NQju4BuMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311532; a=rsa-sha256; cv=none; b=S9loZ6Wr11+wTgG/16f2Xziz7VNnlwP4gMaOfCTF1X3dINvPSS7YR5fR9G9E5pIalu9V/u 1yEIgb7ksL7QkebMsyi2x2FAi5Zl+37SkxeuEVn1aFTN6Ohiaj7ReZdct/vQaS/dl1weqT rlEbDhKLYEPwCcZ7/WXJRqfNFvucDO5Rl2NcAI8VFSsm7WIo4O2Nt5NL7ntYr3o3Yt55gV c42iiRVMRmT6VpvwxtK3x+ophHNZxWJjztC7zr1ez0ZHg3T4NRDnpS1dHUY0IXuox/EhSg cck7SUB0aDVbYDH+hNbaJc0qYUAxRydl01tVVGcEpMFh+UIKLXnm+GrMK189lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y463WQz2P2; Wed, 01 Oct 2025 09:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919cq5p016558; Wed, 1 Oct 2025 09:38:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919cqW7016555; Wed, 1 Oct 2025 09:38:52 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:52 GMT Message-Id: <202510010938.5919cqW7016555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 555c30611c26 - stable/14 - rk_gpio: Fix register read/write on rk3568 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 555c30611c26a485e8fe17e75affd0f3c9f71319 Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=555c30611c26a485e8fe17e75affd0f3c9f71319 commit 555c30611c26a485e8fe17e75affd0f3c9f71319 Author: Evgenii Ivanov AuthorDate: 2025-09-25 17:15:01 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 08:35:18 +0000 rk_gpio: Fix register read/write on rk3568 Not all registers have a write mask with high/low register on rk3568. Reviewed by: vexeduxr MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D52512 (cherry picked from commit 34ec8c9ccaa473d2d0c177a92c041bb8fdb083db) --- sys/arm64/rockchip/rk_gpio.c | 99 ++++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/sys/arm64/rockchip/rk_gpio.c b/sys/arm64/rockchip/rk_gpio.c index 5a96ea2d0cb4..c20488612e10 100644 --- a/sys/arm64/rockchip/rk_gpio.c +++ b/sys/arm64/rockchip/rk_gpio.c @@ -91,6 +91,11 @@ struct rk_pin_irqsrc { uint32_t mode; }; +struct rk_gpio_reg { + uint8_t single; + uint8_t offset; +}; + struct rk_gpio_softc { device_t sc_dev; device_t sc_busdev; @@ -104,7 +109,7 @@ struct rk_gpio_softc { uint32_t swporta_ddr; uint32_t version; struct pin_cached pin_cached[RK_GPIO_MAX_PINS]; - uint8_t regs[RK_GPIO_REGNUM]; + struct rk_gpio_reg regs[RK_GPIO_REGNUM]; void *ihandle; struct rk_pin_irqsrc isrcs[RK_GPIO_MAX_PINS]; }; @@ -139,14 +144,15 @@ static int rk_gpio_detach(device_t dev); static int rk_gpio_read_bit(struct rk_gpio_softc *sc, int reg, int bit) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; uint32_t value; - if (sc->version == RK_GPIO_TYPE_V1) { - value = RK_GPIO_READ(sc, offset); + if (rk_reg->single) { + value = RK_GPIO_READ(sc, rk_reg->offset); value >>= bit; } else { - value = RK_GPIO_READ(sc, bit > 15 ? offset + 4 : offset); + value = RK_GPIO_READ(sc, bit > 15 ? + rk_reg->offset + 4 : rk_reg->offset); value >>= (bit % 16); } return (value & 1); @@ -155,50 +161,53 @@ rk_gpio_read_bit(struct rk_gpio_softc *sc, int reg, int bit) static void rk_gpio_write_bit(struct rk_gpio_softc *sc, int reg, int bit, int data) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; uint32_t value; - if (sc->version == RK_GPIO_TYPE_V1) { - value = RK_GPIO_READ(sc, offset); + if (rk_reg->single) { + value = RK_GPIO_READ(sc, rk_reg->offset); if (data) value |= (1 << bit); else value &= ~(1 << bit); - RK_GPIO_WRITE(sc, offset, value); + RK_GPIO_WRITE(sc, rk_reg->offset, value); } else { if (data) value = (1 << (bit % 16)); else value = 0; value |= (1 << ((bit % 16) + 16)); - RK_GPIO_WRITE(sc, bit > 15 ? offset + 4 : offset, value); + RK_GPIO_WRITE(sc, bit > 15 ? + rk_reg->offset + 4 : rk_reg->offset, value); } } static uint32_t rk_gpio_read_4(struct rk_gpio_softc *sc, int reg) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; uint32_t value; - if (sc->version == RK_GPIO_TYPE_V1) - value = RK_GPIO_READ(sc, offset); + if (rk_reg->single) + value = RK_GPIO_READ(sc, rk_reg->offset); else - value = (RK_GPIO_READ(sc, offset) & 0xffff) | - (RK_GPIO_READ(sc, offset + 4) << 16); + value = (RK_GPIO_READ(sc, rk_reg->offset) & 0xffff) | + (RK_GPIO_READ(sc, rk_reg->offset + 4) << 16); return (value); } static void rk_gpio_write_4(struct rk_gpio_softc *sc, int reg, uint32_t value) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; - if (sc->version == RK_GPIO_TYPE_V1) - RK_GPIO_WRITE(sc, offset, value); + if (rk_reg->single) + RK_GPIO_WRITE(sc, rk_reg->offset, value); else { - RK_GPIO_WRITE(sc, offset, (value & 0xffff) | 0xffff0000); - RK_GPIO_WRITE(sc, offset + 4, (value >> 16) | 0xffff0000); + RK_GPIO_WRITE(sc, rk_reg->offset, + (value & 0xffff) | 0xffff0000); + RK_GPIO_WRITE(sc, rk_reg->offset + 4, + (value >> 16) | 0xffff0000); } } @@ -314,31 +323,31 @@ rk_gpio_attach(device_t dev) switch (sc->version) { case RK_GPIO_TYPE_V1: - sc->regs[RK_GPIO_SWPORTA_DR] = 0x00; - sc->regs[RK_GPIO_SWPORTA_DDR] = 0x04; - sc->regs[RK_GPIO_INTEN] = 0x30; - sc->regs[RK_GPIO_INTMASK] = 0x34; - sc->regs[RK_GPIO_INTTYPE_LEVEL] = 0x38; - sc->regs[RK_GPIO_INT_POLARITY] = 0x3c; - sc->regs[RK_GPIO_INT_STATUS] = 0x40; - sc->regs[RK_GPIO_INT_RAWSTATUS] = 0x44; - sc->regs[RK_GPIO_DEBOUNCE] = 0x48; - sc->regs[RK_GPIO_PORTA_EOI] = 0x4c; - sc->regs[RK_GPIO_EXT_PORTA] = 0x50; + sc->regs[RK_GPIO_SWPORTA_DR] = (struct rk_gpio_reg){ 1, 0x00 }; + sc->regs[RK_GPIO_SWPORTA_DDR] = (struct rk_gpio_reg){ 1, 0x04 }; + sc->regs[RK_GPIO_INTEN] = (struct rk_gpio_reg){ 1, 0x30 }; + sc->regs[RK_GPIO_INTMASK] = (struct rk_gpio_reg){ 1, 0x34 }; + sc->regs[RK_GPIO_INTTYPE_LEVEL] = (struct rk_gpio_reg){ 1, 0x38 }; + sc->regs[RK_GPIO_INT_POLARITY] = (struct rk_gpio_reg){ 1, 0x3c }; + sc->regs[RK_GPIO_INT_STATUS] = (struct rk_gpio_reg){ 1, 0x40 }; + sc->regs[RK_GPIO_INT_RAWSTATUS] = (struct rk_gpio_reg){ 1, 0x44 }; + sc->regs[RK_GPIO_DEBOUNCE] = (struct rk_gpio_reg){ 1, 0x48 }; + sc->regs[RK_GPIO_PORTA_EOI] = (struct rk_gpio_reg){ 1, 0x4c }; + sc->regs[RK_GPIO_EXT_PORTA] = (struct rk_gpio_reg){ 1, 0x50 }; break; case RK_GPIO_TYPE_V2: - sc->regs[RK_GPIO_SWPORTA_DR] = 0x00; - sc->regs[RK_GPIO_SWPORTA_DDR] = 0x08; - sc->regs[RK_GPIO_INTEN] = 0x10; - sc->regs[RK_GPIO_INTMASK] = 0x18; - sc->regs[RK_GPIO_INTTYPE_LEVEL] = 0x20; - sc->regs[RK_GPIO_INTTYPE_BOTH] = 0x30; - sc->regs[RK_GPIO_INT_POLARITY] = 0x28; - sc->regs[RK_GPIO_INT_STATUS] = 0x50; - sc->regs[RK_GPIO_INT_RAWSTATUS] = 0x58; - sc->regs[RK_GPIO_DEBOUNCE] = 0x38; - sc->regs[RK_GPIO_PORTA_EOI] = 0x60; - sc->regs[RK_GPIO_EXT_PORTA] = 0x70; + sc->regs[RK_GPIO_SWPORTA_DR] = (struct rk_gpio_reg){ 0, 0x00 }; + sc->regs[RK_GPIO_SWPORTA_DDR] = (struct rk_gpio_reg){ 0, 0x08 }; + sc->regs[RK_GPIO_INTEN] = (struct rk_gpio_reg){ 0, 0x10 }; + sc->regs[RK_GPIO_INTMASK] = (struct rk_gpio_reg){ 0, 0x18 }; + sc->regs[RK_GPIO_INTTYPE_LEVEL] = (struct rk_gpio_reg){ 0, 0x20 }; + sc->regs[RK_GPIO_INTTYPE_BOTH] = (struct rk_gpio_reg){ 0, 0x30 }; + sc->regs[RK_GPIO_INT_POLARITY] = (struct rk_gpio_reg){ 0, 0x28 }; + sc->regs[RK_GPIO_INT_STATUS] = (struct rk_gpio_reg){ 1, 0x50 }; + sc->regs[RK_GPIO_INT_RAWSTATUS] = (struct rk_gpio_reg){ 1, 0x58 }; + sc->regs[RK_GPIO_DEBOUNCE] = (struct rk_gpio_reg){ 0, 0x38 }; + sc->regs[RK_GPIO_PORTA_EOI] = (struct rk_gpio_reg){ 0, 0x60 }; + sc->regs[RK_GPIO_EXT_PORTA] = (struct rk_gpio_reg){ 1, 0x70 }; break; default: device_printf(dev, "Unknown gpio version %08x\n", sc->version); @@ -394,7 +403,7 @@ rk_gpio_detach(device_t dev) mtx_destroy(&sc->sc_mtx); clk_disable(sc->clk); - return(0); + return (0); } static device_t @@ -471,7 +480,7 @@ rk_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) { if (pin >= RK_GPIO_MAX_PINS) - return EINVAL; + return (EINVAL); *caps = RK_GPIO_DEFAULT_CAPS; return (0); From nobody Wed Oct 1 09:38:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y62RnWz69GV9; Wed, 01 Oct 2025 09:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y60Qhmz3Gmc; Wed, 01 Oct 2025 09:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BuoGXsF9Md6At9wWxqy4qKRwinDnLu79fjcM2/GNZ0Q=; b=Mwh0OVs54iBCmxq0OceVnhzi0wniUb/s5bN6KCGL0uy2+4Tbw4dzCFdIgp9qPqRJN/axKI y2avaQHqOAnWcYNX7PKAhBIx25NGPRQ9wJihLGa5XmvOLT/c/8tifwPIXGkt+9p1byM1AM n504CSdZTr1BF7ovOPbEL9HzOGvFtyDKzlzKKQ/YGXDfOdJHCZqHk5+WpZSwOeXpxmK89+ EvtdjDKGeq7MmloxVNZYCvUZ/7uo61D6lQI9+a+D4a6wyaQYkGobMt/Cth35HCR7XBqUIf AiO4NxxB3ePo2XnkxAmVJ4OtWRsednGrcL0ZiLWPDmW74NpbS/127YnP8PJZYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BuoGXsF9Md6At9wWxqy4qKRwinDnLu79fjcM2/GNZ0Q=; b=J7IgQyMCdEUlxjawA3YnA32TMoPg5WKzAl2emXchF43LWgblmLJ129LX5QD4PvgtGUzzKQ bwlBdbAlU5RcCASWkuoNLN/QH0CIbdrt5LMD5zk2I5X5ZI/8Z2MLoq3HmgBjoey+vaFcBL CHsEAB1sL/gQYA0zOeF9uSKnNMMIp6ab8p8DTn4hjKoWbXbZz9dVVinHVCiJTSdDIRvy+y iZVZhg5GqI4brCj+XkNyTul15i0P/kyxW1S9+hbVg/qQlUOZCRWNrQsw2HhIGdGl/6ypVr PHxDn2UhMK7C0Jvcgs1h7av6BwCH8tJacNT6+VRJs6V899vR/3E/45JovaDVDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311534; a=rsa-sha256; cv=none; b=sEkYNuA9unIXDs9KIbd11c8TFURxFX7uqrM8sDXquys2STMhpOihTpqtZ7DUZdBCXsNV3E CQ4yuMoADZv2GXG8fE9jwsKLNa1VMERHdso+mm9q4UpEQzV5+GRJyuHvJ7mV7eWgohUtAE IDhHUaRjFsAe098AsClWm6/rhSL2dkVGGlSSYV9YTr+xAGH0gmf66rnGLExwtcC6X1yprL YB6mgYoaT3Sb55wXZqVUUN+YNF7ijwKwE5h+k0qwCka9d08Iceoa2x5wRfZ2D7e+C/2rsG qRwZyLfAykmFiJljLmSE/tWUsPFNbkg8Meh3cYcQsS4Lhrt5KOrG3MRIyijOUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y6014qz2Gm; Wed, 01 Oct 2025 09:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919crTF016593; Wed, 1 Oct 2025 09:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919crgl016590; Wed, 1 Oct 2025 09:38:53 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:53 GMT Message-Id: <202510010938.5919crgl016590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 39139fec932e - stable/14 - gpioc: allocate priv->events with the correct size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 39139fec932edc313e891b0a49db61ad2c64b1fe Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=39139fec932edc313e891b0a49db61ad2c64b1fe commit 39139fec932edc313e891b0a49db61ad2c64b1fe Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:09:28 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:08:55 +0000 gpioc: allocate priv->events with the correct size MFC after: 1 day (cherry picked from commit fa26e445544eb88f05779258e2ab9c96384fe74d) --- sys/dev/gpio/gpioc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 067a43617f11..a3595c849a21 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -699,7 +699,7 @@ gpioc_open(struct cdev *dev, int oflags, int devtype, struct thread *td) * npins isn't a horrible fifo size for that either. */ priv->numevents = priv->sc->sc_npins * 2; - priv->events = malloc(priv->numevents * sizeof(struct gpio_event_detail), + priv->events = malloc(priv->numevents * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); return (0); @@ -909,7 +909,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, free(priv->events, M_GPIOC); priv->numevents = evcfg->gp_fifo_size; priv->events = malloc(priv->numevents * - sizeof(struct gpio_event_detail), M_GPIOC, + sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); priv->evidx_head = priv->evidx_tail = 0; } From nobody Wed Oct 1 09:38:55 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y73NQsz69GP2; Wed, 01 Oct 2025 09:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y71xRjz3H4H; Wed, 01 Oct 2025 09:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5y1mroI84lrRxg+/RGgxqrCgay8qHAHwqMfEA4NoPx4=; b=i+twswxvtvmo1VAbwMV4oxViWhTc7nrMLqYZm4ZfN4+LlMHl6bAYqrgT46eSCOI6EdG9Ag MTNyqvOQs2deND0j5B1r8nunClurD/F7fbWlytGgSuEpLbhvzEKFWlfptzF9xVMv/nH2Tq PjfmkFBiRC/rWNyN2rbN+EzIj8GL7O9IAaA0piPD6rpJzdUSKj0UZqexKF9bcVyD7+r4ht UMMVoU/kRxU2lpSbUuhOj+g4BZd3o8Pbrip5C+ALZlp6B7gwu/gUi58bcYehxfRhJhYRSt 5PrOnAaMaQb2orrPNC8Cq12ZpCnm/5GzHicv/nMeB/1lE9TBxnwOvt9RYRHDNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5y1mroI84lrRxg+/RGgxqrCgay8qHAHwqMfEA4NoPx4=; b=poAlHb3GjAiuD1ZTW+7ip15W5pW+I8LdF1SUaePoKsgux9z3JN94EoZOM9TNkLFumgVAAO LlFtmDLwUlx8dd8hDWpr6zBzi4GIUtqUqwjpGqMYs+4uhIrvCxgXzOarI+jxRoj8jKtiyl dqas7odmehgoA0pZ8tZ3rGgdFGL8MejAhKpG99KXPCJgyNPjl452jJI/KrnyrRqqCkjB9B mpdiH/XSe77Y99hSoVsngOau97gSBSMdmPsPZVKyuSAlW8X61F3Ryi3pqmxcctRtj4weXc Hx84yPfXDPHobvNlmqPNLlVQSPV9d1SFj38e5+dEBVMQG9tnsux1VcxmWGe3rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311535; a=rsa-sha256; cv=none; b=fjblzQerzqi1t4WZGWYk+gxckiP7l4Eapx6Kw62pu6nnuEJFBj50WwRZ2EmzWVYNJbZC0D 21VthsaoJHafjsFxydNp0JVeDr5/Njx4WU9+5J+JSvp0lrjNgFLdqEUbT3YqJtbh8VE7jd MprzXPWFazvWhD6hDIMiQVwCunfvnDtGtVRCTucQOvFxBj2Tc7l9FNoa5NZs4Y9kuFDNpU cFAeDWoY1fxbKYM6u2QanzurcSD3Ur8oEqpM91fKf4o2ViCY/BZBjVyQr0cyRBAwMe/06B Au4dPs0sz6FMs2QOxZVzJmky7z4tiUJvgjr/D5csxbxYrPzlApR+ESajtpfcEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y71192z2JH; Wed, 01 Oct 2025 09:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919ctRY016627; Wed, 1 Oct 2025 09:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919ct0L016624; Wed, 1 Oct 2025 09:38:55 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:55 GMT Message-Id: <202510010938.5919ct0L016624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 6163ced966b4 - stable/14 - gpioc: fix race in ioctl(GPIOCONFIGEVENTS) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6163ced966b4e37a987e514aa2d2a61781c98fa5 Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=6163ced966b4e37a987e514aa2d2a61781c98fa5 commit 6163ced966b4e37a987e514aa2d2a61781c98fa5 Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:09:50 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:08:55 +0000 gpioc: fix race in ioctl(GPIOCONFIGEVENTS) A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the priv->pins list, making it no longer empty and opening the door for access to priv->events while we are reallocating it. Fix this by holding priv->mtx while handling GPIOCONFIGEVENTS. Reported by: Qiu-ji Chen PR: 289120 Reviewed by: mmel MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52783 (cherry picked from commit d000adfe41e6f2fe8f3dbe92d8fc2d34ae882086) --- sys/dev/gpio/gpioc.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index a3595c849a21..45757854b938 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -783,6 +783,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, struct gpio_access_32 *a32; struct gpio_config_32 *c32; struct gpio_event_config *evcfg; + struct gpioc_pin_event *tmp; uint32_t caps, intrflags; bus = GPIO_GET_BUS(sc->sc_pdev); @@ -892,27 +893,35 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, res = devfs_get_cdevpriv((void **)&priv); if (res != 0) break; - /* If any pins have been configured, changes aren't allowed. */ - if (!SLIST_EMPTY(&priv->pins)) { - res = EINVAL; - break; - } if (evcfg->gp_report_type != GPIO_EVENT_REPORT_DETAIL && evcfg->gp_report_type != GPIO_EVENT_REPORT_SUMMARY) { res = EINVAL; break; } - priv->report_option = evcfg->gp_report_type; /* Reallocate the events buffer if the user wants it bigger. */ - if (priv->report_option == GPIO_EVENT_REPORT_DETAIL && + tmp = NULL; + if (evcfg->gp_report_type == GPIO_EVENT_REPORT_DETAIL && priv->numevents < evcfg->gp_fifo_size) { - free(priv->events, M_GPIOC); - priv->numevents = evcfg->gp_fifo_size; - priv->events = malloc(priv->numevents * + tmp = malloc(priv->numevents * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); + } + mtx_lock(&priv->mtx); + /* If any pins have been configured, changes aren't allowed. */ + if (!SLIST_EMPTY(&priv->pins)) { + mtx_unlock(&priv->mtx); + free(tmp, M_GPIOC); + res = EINVAL; + break; + } + if (tmp != NULL) { + free(priv->events, M_GPIOC); + priv->events = tmp; + priv->numevents = evcfg->gp_fifo_size; priv->evidx_head = priv->evidx_tail = 0; } + priv->report_option = evcfg->gp_report_type; + mtx_unlock(&priv->mtx); break; case FIONBIO: /* From nobody Wed Oct 1 09:38:56 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y863kZz69Gg3; Wed, 01 Oct 2025 09:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y82S0Hz3H2b; Wed, 01 Oct 2025 09:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJVUGOH/QEm6Pvw24YyaJ7Gzke1f8gCtCHq9kr0ZTkI=; b=HlpTD/XQLvsdVurkdX3WJmv5TV7A+y35gsip0LBG4ri+AaWa514ZVzEnJn/eMX2E8ZIkrC qmGXYvRL8OSzkTsoOcPfQiwqR5DF85QrfRQPE+me3eWbuQNO/Zlh1COay3hzg0SVrSQPU0 NUSs+MITqYyki/04K8x1UfgoilXgpi9vgrRbNZ64K/lLowoB3FpKH1AXC5jLKNujISQMD5 3GW3xmiIW4IJkhBu4jCgn60NbwKFPh9k4BSzbh0x+5A1YuTiB+wMgK3Tg264JsWIwgtrQO yeLVQSdOyPBXq6A88H5wCU4e9X0+p2Wc2s0Slf+XHA6590MgndtgjhI7ysUTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJVUGOH/QEm6Pvw24YyaJ7Gzke1f8gCtCHq9kr0ZTkI=; b=dP3A+0tC1XFClfRobttRtg0uchNbgIakmV5T+jiLCLIvTgo724t3qewVSw1Sib3B3jSFJ9 VhYUMW4T1tIcLo9+OVd6bSLiLPgLqMunoqpUf9LMXo98gGEzjsWI30/xy4qgOYwBgPm8TZ osZp/H1ozgMcNJpCPce9T4MJ4PcPF2VbL1ET17VUi4P7VzNcFHETYkXF8cvSrOrxLirZQL rKZZJ7R0mcfuKb6sgat1qgz7XB7mdqetw6pnEoxrF6LoHDR0Z1+u3Htjxiyp38QKZUsmQB cMej1iWfbGyzRTsrLHL8m8L335eiALvZqqDNrycQKE2ECJO6xc0ZbYILJ9NFqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311536; a=rsa-sha256; cv=none; b=GenALe/D28Tad5eT3/wBf4yO3A1p3sc2tU12qNCay5y+QpS2OOQa4FptZqAtD+4axBQ8Bm +a8261/doVWDz4t/rlA3NPp8jqxU6eJWGOoGkw79MUzyD/F2MfvBUknyKWQ+NxO9rTNrOg v9bDVvk7qgj9jfxvt1iTol8JjlOTktxKJRCv+ee5B3oKPC9fmWpNWqGKHB9ljLF3d5btgm ng2IaK+s66CCXfOfQs2dH6a6oe7gT1Gf/I4iVkG2/Lw79WhYIcqo7bpUhq+wCS00tqJTsa wgvz6o/x+9oTHWYmHGgsTpTrk3uS5djLX0LDcXH2yt7kB0IXGpERoMMwIu9JJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y81y1jz25P; Wed, 01 Oct 2025 09:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5919cuqU016662; Wed, 1 Oct 2025 09:38:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919cudc016659; Wed, 1 Oct 2025 09:38:56 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:56 GMT Message-Id: <202510010938.5919cudc016659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 80ef1216d773 - stable/14 - gpioc: allocate new fifo size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 80ef1216d773b09a6905dbb7cfdeac9844e2a084 Auto-Submitted: auto-generated The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=80ef1216d773b09a6905dbb7cfdeac9844e2a084 commit 80ef1216d773b09a6905dbb7cfdeac9844e2a084 Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:55:34 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:08:55 +0000 gpioc: allocate new fifo size This slipped through after I resolved some merge conflicts. Fixes: d000adfe MFC after: 1 day (cherry picked from commit 2679636b4412927242e46d3806fbb58e2702eddb) --- sys/dev/gpio/gpioc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 45757854b938..6618258a1386 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -902,7 +902,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, tmp = NULL; if (evcfg->gp_report_type == GPIO_EVENT_REPORT_DETAIL && priv->numevents < evcfg->gp_fifo_size) { - tmp = malloc(priv->numevents * + tmp = malloc(evcfg->gp_fifo_size * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); } From nobody Wed Oct 1 09:38:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8y96NyLz69GZk; Wed, 01 Oct 2025 09:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8y93qs3z3HBp; Wed, 01 Oct 2025 09:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lGOrBsHh0lbld078J9neJhkf6tTfXEPbbXsXic7m/Nk=; b=QwlGa+eQuf/jhtXkz2Z0MeRxxv/IQPSpMk+lNlQ5k+snw7Jr/tAR0MUP8onWOxKslpZzth fhChGXbvgL8OPNza0adsZ6XAX+TBlGudMzTFOx94YZFX4G80SJ7LGahSTAAAwcQUk7KT4z WND+FhGsZSPevxkS565tgSJ7XoGX0Hm6eTvzgKO+ghX//9oZ+hCd93MKPEsYAHdsRSNylx lomXT150RQ1dI88vrGKcAF07Eno7F5JP+XA20CYH9tbw4J673hpzCDPbmwNMZjoXoXm0aW w2EIVZsnFtD8tmJ/Si2DLva3oLH+saPF3ZtLAp0my0c2qdHMWMs47Ia9XTLpNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lGOrBsHh0lbld078J9neJhkf6tTfXEPbbXsXic7m/Nk=; b=y16HT3ZyvkD4L/zvwQvAsbLgKuEo11M7oy1gYlytFZmo4ApqCAhiB1Gd3YLrXfh50sSM2S Uhiz8dcw0Q6izvH3FYW2QsiU35eDaIcJ14VoLoa3YyYBUYaQBeTbe3URsAKe6rYgmAxbbV VFkTqrgsNMietZmDsD3kcE4L887Jwqn/U/6r3+m1Zd55LFdsGLegFky+n21hMIeWuS5+MT DYWuQpP9yloBU92Yj6dwEmAOghMr2enCLs1NGdMZaHv1K5c8Xbu3WhTPHupvxX19lHvZdH OogNEg6USGvIHXJlKSNO4+VBOeOwyxeg/9wDD4OjIbLA3e+fSRcc6XyZuaONpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311537; a=rsa-sha256; cv=none; b=agfVGvxN7ufwhDnwvW8fsEN9wnFG/3qOD7ddS3z8Yd/YH7LGhzvAtk9QS6BFMIfxVwes3v znQZbu0p5Dd/AMTQOhyEkRRVeuLz1phVluGrx4qwmH5H9Y6mVss7jIv/sD0Vw1Gyq5wWDs mgjWF33j6SV0mRjlW0Cf5fdHCA043cTXEmEclPGYVGZ3n+U4pK4c4VSO7jTgcTtz6n5A9/ mzsoGnaIUVxhDbPMw07Hwq9ExWf7l/zqFTBJrZBID/wKTf1x6i/ECVe+gy2DiIbBSoJJ5X ZcPAPC/VplRzPM/nhCybi0jO1I/sp2z+AGrtuKIgzkEypU25PBBnQyJAKt25vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8y932szz2JJ; Wed, 01 Oct 2025 09:38: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 5919cvOn016713; Wed, 1 Oct 2025 09:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919cv8a016710; Wed, 1 Oct 2025 09:38:57 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:57 GMT Message-Id: <202510010938.5919cv8a016710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: e73cc0abe140 - stable/15 - ng_tty: don't increment m_data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e73cc0abe1401ff12efffa09d96d3a212608f08a Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=e73cc0abe1401ff12efffa09d96d3a212608f08a commit e73cc0abe1401ff12efffa09d96d3a212608f08a Author: Ahmad Khalifa AuthorDate: 2025-09-24 15:01:57 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:35 +0000 ng_tty: don't increment m_data Stop incrementing m_data so the callee can read the mbuf. MFC after: 3 days Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D52702 (cherry picked from commit 57d5a8feda3fd25a650eaab5998db13633d62d2d) --- sys/netgraph/ng_tty.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index 6f8667c664bb..c7d8a1b64eac 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -485,9 +485,7 @@ ngt_rint(struct tty *tp, char c, int flags) } /* Add char to mbuf */ - *mtod(m, u_char *) = c; - m->m_data++; - m->m_len++; + *(u_char *)mtodo(m, m->m_len++) = c; m->m_pkthdr.len++; /* Ship off mbuf if it's time */ From nobody Wed Oct 1 09:38:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8yC2LpGz69GVN; Wed, 01 Oct 2025 09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yB5bpZz3H69; Wed, 01 Oct 2025 09: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=1759311538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mC11aOtrStP5tUqbJoE2sTuKcBNmqntuO3RFOmMkJKg=; b=LMdzP/lXdwoNf+wRIuKRIAQJsCl3lMAa+nhLnkcCxIlZBfNoBWbuKpO3MjSEuP+yJiXOuM +19GXg+NnecfAzWFGZsmTb1uLMB3MetD/7mdsApwLIy7Uh0tGw2b27pS8pKFu1/g/HjSmn 2WHE66rWWwydOWYjQojLJ62Ja/r+iBDN2YeNEagvGpdF4qDegqD6SpAvwijoyKsEqnyxv3 30D+LoZdbEEZ2elAgsGzETI5N6EcTYiexrUIoTrAqMEM0P5RJffvwlXIADchWNBy211gaM jpwNXUn5iIL1u1UBZgWugR/6JGvFRrFTiAOkwD9luDjAGP9sTKqmMGxySBt8uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mC11aOtrStP5tUqbJoE2sTuKcBNmqntuO3RFOmMkJKg=; b=QxEkZ0ptlpfwXl6qJtE7FnpYxuUxdGemqeOYrGlzzSioTrNjii5SG7gulxBVke42mbDnX3 7V3MnSDcdI94C8YtInlZvA3laACuenYbILIUoBv5l7WRwEy7cm8VqCaiH3XZmkFa/oqy1v 45OlwVRDi9sVJYp6d3Z7ov4tTnfBi+kODe1yPGR4BBfV4vyBpZFSAYn+CpDMSx6ZFMJ/ZJ WcIad6wTopETPd5vLJ6o/wdSP2cXpODpV7DcSHgnsVxdPSeRvW5lPBjndPscu08vbYhDnh HrXNK+AuWvVUldDD4xJEb77nJysLfWZ72Gj6HDJKmiDvfra+3J4CJAxRXS39+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311538; a=rsa-sha256; cv=none; b=ITqNXrgGYVTKdLyJtcRv/Nzwy+ra3fokK1O/hhEsiAzBR7GviwaqLd91Zco7pHcULP4BQd oFkopsN4FzOfSAAVsafuVGWP/9cxf/rxJL1FnrbvzQ/0RShf0si4SjvTk4umOSReFoqXVZ fs5N3vyqulBA3mWKRFu1O9iGQ/j2zZsok4ZwOUWy4X0vCFalPdIejYIDuQ7FY6ZhOekSQe hotsYnJy4+DzvtrHSAQIPPMSUYhCMH6h8h6iCoRco5y8aH2hc1giCDPgvKB1kdQ7zQOIGa 96B9EVNkhor6wy4ia6daXvODynsIWeFMsKpNCfsTLO8Vlkbvz3k985ZvpAOlyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8yB3yCvz2Gn; Wed, 01 Oct 2025 09: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 5919cwDx016749; Wed, 1 Oct 2025 09: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 5919cwYr016746; Wed, 1 Oct 2025 09:38:58 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:58 GMT Message-Id: <202510010938.5919cwYr016746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 2ae71a5e9ffb - stable/15 - ng_tty: copy to the correct mbuf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2ae71a5e9ffbca2b4e72c90c9bdd9e2c0b857f92 Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=2ae71a5e9ffbca2b4e72c90c9bdd9e2c0b857f92 commit 2ae71a5e9ffbca2b4e72c90c9bdd9e2c0b857f92 Author: Ahmad Khalifa AuthorDate: 2025-09-25 16:54:28 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:35 +0000 ng_tty: copy to the correct mbuf memcpy should copy to the current mbuf, otherwise we're copying to the first mbuf in the chain over and over. Reported by: kevans Reviewed by: glebius MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52713 (cherry picked from commit e05521121f05a1b1e0d7c7b5fbe79f83fc303cd0) --- sys/netgraph/ng_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index c7d8a1b64eac..0e3230a66f66 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -427,7 +427,7 @@ ngt_rint_bypass(struct tty *tp, const void *buf, size_t len) for (mb = m; mb != NULL; mb = mb->m_next) { length = min(M_TRAILINGSPACE(mb), len - total); - memcpy(mtod(m, char *), (const char *)buf + total, length); + memcpy(mtod(mb, char *), (const char *)buf + total, length); mb->m_len = length; total += length; m->m_pkthdr.len += length; From nobody Wed Oct 1 09:38:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8yD0BKsz69Gcq; Wed, 01 Oct 2025 09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yC5fjYz3H6N; Wed, 01 Oct 2025 09: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=1759311539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qtQ3souYF+Ok3RFl48t4/jrs+1WNLbF8sWajiTbRokI=; b=DQYNBwbwBRq2KDMFJuV0ttIWibIDdX4Gn9KZ5zV8wndhvjklE4dqCMSBgcrTxBy72ZrRxe Pn5fIAMrTSnSJUsIzWL3mlst/ZZXWOR+x3dwnAHsVsgUgcXlznN2jaLVjabfQM8xAIFO/+ hOPizmDGWdr/Wr0tNEvXRVAwc1qGqpRUUslB+QrgwHIYkjeifSqoLBDI7QFPGJ+et7idpp BFRqYKvUnWKnBJ5/EtmFrfiWbERtMvc5I66Jh49QY8AKi75LFGF9Kl+r1QyLkTiMGCH1+J WwlqsEvmfxc3EiUXHBC0MzeSh9VVU9z2ltr32+iF4jLV0F+87LkYKZHBMp3DfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qtQ3souYF+Ok3RFl48t4/jrs+1WNLbF8sWajiTbRokI=; b=Tbs2sFFCzOJeRgeHfr1rQzOdfgqLppIqCBPNd229rjRPPTsGLaylEhZ8jUk6TW/rbsfJhB QLBLRJeKaFxgFzFqcm+emdH2dhQNAmyYMmlVGMj6ldARxoULCC4kE919Hn4f+rsPmRA32o exS+416lqyYKV8rq6YTSHMIl2ozAwjmoc/52yRhHpc8rOLABn6dmfsyrrAD10S5HdNnRzL VHBDiGQt7H5U7fKEM+8HdljJtpMKd9sj1XQohmbW+kW/NamuSHbFtfCPtD9tIUBt8up3ko 9/LKG3+FMNCUP5qC9xccpUMdCAwC34Ag5bbBdmQYOHokm3/uT3u9xQ0Y/Khktw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311539; a=rsa-sha256; cv=none; b=sZ/EzK6ce54Yx2Gl0nIJx5ZLL5opn1YzR9cWGq8WTLTDdZnRE7We0FGuA1Q45+pSNN75RC mabOu/JdCWzlRo0qW+3BgdRJIetCdVV40vKPY/daX1EqZV7vXJqz7oeWILNFVB+hGZySnm YEWYeb9f1UaJEc5m3+pQGpB6whIzskEAe2Do4v8iDkp0cUfojWYn8vRBF04JmYdk676tyn dMZ2XkuVMaY1BksXuc9a2OldtRwLYCpGuckmkFjRnB6t8JdS3XWDSLWga1oZilkGMI4NMM DVt3w8hwl5GR092Wc9xEMVvMNI10AuR+QzIRczr9SLKA3LD39mgLC18VYysWTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8yC4y2dz2Gp; Wed, 01 Oct 2025 09: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 5919cxIL016788; Wed, 1 Oct 2025 09: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 5919cxw4016785; Wed, 1 Oct 2025 09:38:59 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:38:59 GMT Message-Id: <202510010938.5919cxw4016785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 9fd527140ae8 - stable/15 - rk_gpio: Fix register read/write on rk3568 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9fd527140ae8b6b44b9a1a992e6e424a70895c38 Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=9fd527140ae8b6b44b9a1a992e6e424a70895c38 commit 9fd527140ae8b6b44b9a1a992e6e424a70895c38 Author: Evgenii Ivanov AuthorDate: 2025-09-25 17:15:01 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:35 +0000 rk_gpio: Fix register read/write on rk3568 Not all registers have a write mask with high/low register on rk3568. Reviewed by: vexeduxr MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D52512 (cherry picked from commit 34ec8c9ccaa473d2d0c177a92c041bb8fdb083db) --- sys/arm64/rockchip/rk_gpio.c | 99 ++++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/sys/arm64/rockchip/rk_gpio.c b/sys/arm64/rockchip/rk_gpio.c index 61614f532634..7358239a7c35 100644 --- a/sys/arm64/rockchip/rk_gpio.c +++ b/sys/arm64/rockchip/rk_gpio.c @@ -90,6 +90,11 @@ struct rk_pin_irqsrc { uint32_t mode; }; +struct rk_gpio_reg { + uint8_t single; + uint8_t offset; +}; + struct rk_gpio_softc { device_t sc_dev; device_t sc_busdev; @@ -103,7 +108,7 @@ struct rk_gpio_softc { uint32_t swporta_ddr; uint32_t version; struct pin_cached pin_cached[RK_GPIO_MAX_PINS]; - uint8_t regs[RK_GPIO_REGNUM]; + struct rk_gpio_reg regs[RK_GPIO_REGNUM]; void *ihandle; struct rk_pin_irqsrc isrcs[RK_GPIO_MAX_PINS]; }; @@ -138,14 +143,15 @@ static int rk_gpio_detach(device_t dev); static int rk_gpio_read_bit(struct rk_gpio_softc *sc, int reg, int bit) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; uint32_t value; - if (sc->version == RK_GPIO_TYPE_V1) { - value = RK_GPIO_READ(sc, offset); + if (rk_reg->single) { + value = RK_GPIO_READ(sc, rk_reg->offset); value >>= bit; } else { - value = RK_GPIO_READ(sc, bit > 15 ? offset + 4 : offset); + value = RK_GPIO_READ(sc, bit > 15 ? + rk_reg->offset + 4 : rk_reg->offset); value >>= (bit % 16); } return (value & 1); @@ -154,50 +160,53 @@ rk_gpio_read_bit(struct rk_gpio_softc *sc, int reg, int bit) static void rk_gpio_write_bit(struct rk_gpio_softc *sc, int reg, int bit, int data) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; uint32_t value; - if (sc->version == RK_GPIO_TYPE_V1) { - value = RK_GPIO_READ(sc, offset); + if (rk_reg->single) { + value = RK_GPIO_READ(sc, rk_reg->offset); if (data) value |= (1 << bit); else value &= ~(1 << bit); - RK_GPIO_WRITE(sc, offset, value); + RK_GPIO_WRITE(sc, rk_reg->offset, value); } else { if (data) value = (1 << (bit % 16)); else value = 0; value |= (1 << ((bit % 16) + 16)); - RK_GPIO_WRITE(sc, bit > 15 ? offset + 4 : offset, value); + RK_GPIO_WRITE(sc, bit > 15 ? + rk_reg->offset + 4 : rk_reg->offset, value); } } static uint32_t rk_gpio_read_4(struct rk_gpio_softc *sc, int reg) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; uint32_t value; - if (sc->version == RK_GPIO_TYPE_V1) - value = RK_GPIO_READ(sc, offset); + if (rk_reg->single) + value = RK_GPIO_READ(sc, rk_reg->offset); else - value = (RK_GPIO_READ(sc, offset) & 0xffff) | - (RK_GPIO_READ(sc, offset + 4) << 16); + value = (RK_GPIO_READ(sc, rk_reg->offset) & 0xffff) | + (RK_GPIO_READ(sc, rk_reg->offset + 4) << 16); return (value); } static void rk_gpio_write_4(struct rk_gpio_softc *sc, int reg, uint32_t value) { - int offset = sc->regs[reg]; + struct rk_gpio_reg *rk_reg = &sc->regs[reg]; - if (sc->version == RK_GPIO_TYPE_V1) - RK_GPIO_WRITE(sc, offset, value); + if (rk_reg->single) + RK_GPIO_WRITE(sc, rk_reg->offset, value); else { - RK_GPIO_WRITE(sc, offset, (value & 0xffff) | 0xffff0000); - RK_GPIO_WRITE(sc, offset + 4, (value >> 16) | 0xffff0000); + RK_GPIO_WRITE(sc, rk_reg->offset, + (value & 0xffff) | 0xffff0000); + RK_GPIO_WRITE(sc, rk_reg->offset + 4, + (value >> 16) | 0xffff0000); } } @@ -313,31 +322,31 @@ rk_gpio_attach(device_t dev) switch (sc->version) { case RK_GPIO_TYPE_V1: - sc->regs[RK_GPIO_SWPORTA_DR] = 0x00; - sc->regs[RK_GPIO_SWPORTA_DDR] = 0x04; - sc->regs[RK_GPIO_INTEN] = 0x30; - sc->regs[RK_GPIO_INTMASK] = 0x34; - sc->regs[RK_GPIO_INTTYPE_LEVEL] = 0x38; - sc->regs[RK_GPIO_INT_POLARITY] = 0x3c; - sc->regs[RK_GPIO_INT_STATUS] = 0x40; - sc->regs[RK_GPIO_INT_RAWSTATUS] = 0x44; - sc->regs[RK_GPIO_DEBOUNCE] = 0x48; - sc->regs[RK_GPIO_PORTA_EOI] = 0x4c; - sc->regs[RK_GPIO_EXT_PORTA] = 0x50; + sc->regs[RK_GPIO_SWPORTA_DR] = (struct rk_gpio_reg){ 1, 0x00 }; + sc->regs[RK_GPIO_SWPORTA_DDR] = (struct rk_gpio_reg){ 1, 0x04 }; + sc->regs[RK_GPIO_INTEN] = (struct rk_gpio_reg){ 1, 0x30 }; + sc->regs[RK_GPIO_INTMASK] = (struct rk_gpio_reg){ 1, 0x34 }; + sc->regs[RK_GPIO_INTTYPE_LEVEL] = (struct rk_gpio_reg){ 1, 0x38 }; + sc->regs[RK_GPIO_INT_POLARITY] = (struct rk_gpio_reg){ 1, 0x3c }; + sc->regs[RK_GPIO_INT_STATUS] = (struct rk_gpio_reg){ 1, 0x40 }; + sc->regs[RK_GPIO_INT_RAWSTATUS] = (struct rk_gpio_reg){ 1, 0x44 }; + sc->regs[RK_GPIO_DEBOUNCE] = (struct rk_gpio_reg){ 1, 0x48 }; + sc->regs[RK_GPIO_PORTA_EOI] = (struct rk_gpio_reg){ 1, 0x4c }; + sc->regs[RK_GPIO_EXT_PORTA] = (struct rk_gpio_reg){ 1, 0x50 }; break; case RK_GPIO_TYPE_V2: - sc->regs[RK_GPIO_SWPORTA_DR] = 0x00; - sc->regs[RK_GPIO_SWPORTA_DDR] = 0x08; - sc->regs[RK_GPIO_INTEN] = 0x10; - sc->regs[RK_GPIO_INTMASK] = 0x18; - sc->regs[RK_GPIO_INTTYPE_LEVEL] = 0x20; - sc->regs[RK_GPIO_INTTYPE_BOTH] = 0x30; - sc->regs[RK_GPIO_INT_POLARITY] = 0x28; - sc->regs[RK_GPIO_INT_STATUS] = 0x50; - sc->regs[RK_GPIO_INT_RAWSTATUS] = 0x58; - sc->regs[RK_GPIO_DEBOUNCE] = 0x38; - sc->regs[RK_GPIO_PORTA_EOI] = 0x60; - sc->regs[RK_GPIO_EXT_PORTA] = 0x70; + sc->regs[RK_GPIO_SWPORTA_DR] = (struct rk_gpio_reg){ 0, 0x00 }; + sc->regs[RK_GPIO_SWPORTA_DDR] = (struct rk_gpio_reg){ 0, 0x08 }; + sc->regs[RK_GPIO_INTEN] = (struct rk_gpio_reg){ 0, 0x10 }; + sc->regs[RK_GPIO_INTMASK] = (struct rk_gpio_reg){ 0, 0x18 }; + sc->regs[RK_GPIO_INTTYPE_LEVEL] = (struct rk_gpio_reg){ 0, 0x20 }; + sc->regs[RK_GPIO_INTTYPE_BOTH] = (struct rk_gpio_reg){ 0, 0x30 }; + sc->regs[RK_GPIO_INT_POLARITY] = (struct rk_gpio_reg){ 0, 0x28 }; + sc->regs[RK_GPIO_INT_STATUS] = (struct rk_gpio_reg){ 1, 0x50 }; + sc->regs[RK_GPIO_INT_RAWSTATUS] = (struct rk_gpio_reg){ 1, 0x58 }; + sc->regs[RK_GPIO_DEBOUNCE] = (struct rk_gpio_reg){ 0, 0x38 }; + sc->regs[RK_GPIO_PORTA_EOI] = (struct rk_gpio_reg){ 0, 0x60 }; + sc->regs[RK_GPIO_EXT_PORTA] = (struct rk_gpio_reg){ 1, 0x70 }; break; default: device_printf(dev, "Unknown gpio version %08x\n", sc->version); @@ -394,7 +403,7 @@ rk_gpio_detach(device_t dev) mtx_destroy(&sc->sc_mtx); clk_disable(sc->clk); - return(0); + return (0); } static device_t @@ -471,7 +480,7 @@ rk_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) { if (pin >= RK_GPIO_MAX_PINS) - return EINVAL; + return (EINVAL); *caps = RK_GPIO_DEFAULT_CAPS; return (0); From nobody Wed Oct 1 09:39:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8yF13Z9z69GRc; Wed, 01 Oct 2025 09:39: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yD5yFFz3HFw; Wed, 01 Oct 2025 09: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=1759311540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5fFrEDv3McEBrYviM1wQAjQLeSx7726Rs7Y5na+M6/A=; b=Ugne8TmgXYblFlF0iqZJQEGXb8N9SISr59z8IhS0yXbR4HOEP5JyM9orJsyw8a3YjgmrDa aiiHiwSCMe04d70Ib09N9dNxUAtnPWPLKCgJluiXAAE/O/WxURm5NWTTt5FsvsUO0P54tH 0bOTgFAQGkFDSgujJtS7BWjdB+DW7a7tSzEisSVUoceguX5XX0X6RFPO1cjLSa56gzUSff YFmZ0eDvXrgCrFqwS+svMN/sfylNI2mJElHRkpc22Rt8UO4ZYFTjuSKYrSyiMEJnBsk87u G+EKnHsSDJ6am5ihv4deB7NY6IU3npGBfmOYONZqRQTPtG5fEKhU5wn8db4tNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5fFrEDv3McEBrYviM1wQAjQLeSx7726Rs7Y5na+M6/A=; b=CgQdq6+PADSADoqYsgSi/xVQdHmxw+P8fX9aCz1XCLP7K1LRoeWEO0XlIcFrToqrtu+3bq pT9AyUCV8N22Ci/foxKnZXekO/vYX62cnXQiLQGrc6mr4adDT323cqkz/U/OR3M3hrx8AD MWS0jMkZqiE0uDoA7t9qDM9Sn3Wb5BIIkxggHYuDidQ7CG7VNG4i10pB9q1/m3LtqKkVy0 Xyxma1EpLkwrC79oeYCRpgHaK3cQ0dV5BgzHO7PuVGynYa+lhGV/7ZjVL6CsVFOA3l8EVH svUVjbDx9VBY9esxOdtAXDAv2qq5k/LyneHqdSc/iQJ1AcJ6psapTCHaAcrMXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311540; a=rsa-sha256; cv=none; b=sdomxwmnJ8qa+/kvsYdrWj7Uzd5QsBVqX7sPkZ+11i+3QFrJ+hm2vg+GyRVmQY2V6jykGT tK1qmPdikzWRYwSi8/FNyOPRropwD40DZM2uDZSE6gecqYR9u7n8N2ogZ/36Et6Y/6EhKK XlxMlRwsokwjTyn9FiGLgXarZQDtRZ7RAHf4GzaRJaptdJ6t+X3pagYiC0LFLjhQyDze9t YHofllwL4xePtpjkVh7Ymv4wKai5Wvi84qMhBJG1TtjK9UVNXl/lFD1CywWqNiLJG1euPA cCgj/w8WiA3z7+s5Bhs6BcrX/hgwXZnSxJMwGZjPdySi28aH9GA3JYPxLANmmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8yD5YRtz2Gq; Wed, 01 Oct 2025 09: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 5919d0mI016828; Wed, 1 Oct 2025 09: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 5919d0Bc016825; Wed, 1 Oct 2025 09:39:00 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:39:00 GMT Message-Id: <202510010939.5919d0Bc016825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: cddbc26251d6 - stable/15 - rk_gpio: Enable gpio allocation via fdt List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cddbc26251d618b1229114ffc62c85bc3b39a25e Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=cddbc26251d618b1229114ffc62c85bc3b39a25e commit cddbc26251d618b1229114ffc62c85bc3b39a25e Author: Evgenii Ivanov AuthorDate: 2025-09-25 17:15:08 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:36 +0000 rk_gpio: Enable gpio allocation via fdt The code is based on bcm2835_gpio.c. This enables allocating gpio interrupts via interrupts property in fdt. Reviewed by: vexeduxr MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D52513 (cherry picked from commit ace98a8fb8fe18d47ccbb55619a9ffd4ac10f98c) --- sys/arm64/rockchip/rk_gpio.c | 98 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 80 insertions(+), 18 deletions(-) diff --git a/sys/arm64/rockchip/rk_gpio.c b/sys/arm64/rockchip/rk_gpio.c index 7358239a7c35..145d9769f35f 100644 --- a/sys/arm64/rockchip/rk_gpio.c +++ b/sys/arm64/rockchip/rk_gpio.c @@ -663,46 +663,108 @@ rk_gpio_get_node(device_t bus, device_t dev) } static int -rk_pic_map_intr(device_t dev, struct intr_map_data *data, - struct intr_irqsrc **isrcp) +rk_gpio_pic_map_fdt(struct rk_gpio_softc *sc, + struct intr_map_data_fdt *daf, + u_int *irqp, uint32_t *modep) { - struct rk_gpio_softc *sc = device_get_softc(dev); - struct intr_map_data_gpio *gdata; uint32_t irq; + uint32_t mode; - if (data->type != INTR_MAP_DATA_GPIO) { - device_printf(dev, "Wrong type\n"); - return (ENOTSUP); - } - gdata = (struct intr_map_data_gpio *)data; - irq = gdata->gpio_pin_num; + if (daf->ncells != 2) + return (EINVAL); + + irq = daf->cells[0]; + if (irq >= RK_GPIO_MAX_PINS) + return (EINVAL); + + /* Only reasonable modes are supported. */ + if (daf->cells[1] == 1) + mode = GPIO_INTR_EDGE_RISING; + else if (daf->cells[1] == 2) + mode = GPIO_INTR_EDGE_FALLING; + else if (daf->cells[1] == 3) + mode = GPIO_INTR_EDGE_BOTH; + else if (daf->cells[1] == 4) + mode = GPIO_INTR_LEVEL_HIGH; + else if (daf->cells[1] == 8) + mode = GPIO_INTR_LEVEL_LOW; + else + return (EINVAL); + + *irqp = irq; + if (modep != NULL) + *modep = mode; + return (0); +} + +static int +rk_gpio_pic_map_gpio(struct rk_gpio_softc *sc, + struct intr_map_data_gpio *dag, + u_int *irqp, uint32_t *modep) +{ + uint32_t irq; + irq = dag->gpio_pin_num; if (irq >= RK_GPIO_MAX_PINS) { - device_printf(dev, "Invalid interrupt %u\n", irq); + device_printf(sc->sc_dev, "Invalid interrupt %u\n", + irq); return (EINVAL); } - *isrcp = RK_GPIO_ISRC(sc, irq); + + *irqp = irq; + if (modep != NULL) + *modep = dag->gpio_intr_mode; return (0); } +static int +rk_gpio_pic_map(struct rk_gpio_softc *sc, struct intr_map_data *data, + u_int *irqp, uint32_t *modep) +{ + switch (data->type) { + case INTR_MAP_DATA_FDT: + return (rk_gpio_pic_map_fdt(sc, + (struct intr_map_data_fdt *)data, irqp, modep)); + case INTR_MAP_DATA_GPIO: + return (rk_gpio_pic_map_gpio(sc, + (struct intr_map_data_gpio *)data, irqp, modep)); + default: + device_printf(sc->sc_dev, "Wrong type\n"); + return (ENOTSUP); + } +} + +static int +rk_pic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + int error; + struct rk_gpio_softc *sc = device_get_softc(dev); + uint32_t irq; + + error = rk_gpio_pic_map(sc, data, &irq, NULL); + if (error == 0) + *isrcp = RK_GPIO_ISRC(sc, irq); + return (error); +} + static int rk_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct rk_gpio_softc *sc = device_get_softc(dev); struct rk_pin_irqsrc *rkisrc = (struct rk_pin_irqsrc *)isrc; - struct intr_map_data_gpio *gdata; uint32_t mode; - uint8_t pin; + uint32_t pin; if (!data) { device_printf(dev, "No map data\n"); return (ENOTSUP); } - gdata = (struct intr_map_data_gpio *)data; - mode = gdata->gpio_intr_mode; - pin = gdata->gpio_pin_num; - if (rkisrc->irq != gdata->gpio_pin_num) { + if (rk_gpio_pic_map(sc, data, &pin, &mode) != 0) + return (EINVAL); + + if (rkisrc->irq != pin) { device_printf(dev, "Interrupts don't match\n"); return (EINVAL); } From nobody Wed Oct 1 09:39:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8yH16h1z69GM6; Wed, 01 Oct 2025 09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yG0d3gz3H9B; Wed, 01 Oct 2025 09: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=1759311542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAJzDM1SMoB8yjW4rwTj3GIq2k38HDiet+nGws7H708=; b=oY80kO2QIsLtQ2ypU9Xv8lYuoOT7lFlHYlTBVvC8qgtz6A7mR3kacpDx1hgNRG8+OI3jIL ASAI6UXqe8/mR4a68TwUPEMPh0tcvXsqi+ncqvJnKRQ6T08goZbumJfwK/OUZqNR5DJvts 16U6qPNIvOYTI5OYrLjbFVbpEFGh3ax/0voHIgalhQFkv7XtUqM7GH99OUKgYrNh3+rFx+ pucxhHr+Zdq7xUcPuZBSFbjlkKjV6HKFPwlRMsdKXvr1AqJDpNQBg7LBTTLzqVXQKbLPVV Pynaq27yS8EtN+iO6VsaA7P/7a2wfqKFA2JJ9ggjIC2YQ6OF+sGXTgsxsyiHkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WAJzDM1SMoB8yjW4rwTj3GIq2k38HDiet+nGws7H708=; b=R2DgqoJa9+e4VLI/wf/1SuY3FFmQJQwkuikJrBvNZN03hkzyx6yO04Sr1oqht+HKauQK+6 LgAa6ZIQWPkPrVLYXNBGea7Bb5GW4nXdPM/rmrD7/5e5XzeEe//swNWCtOb44+JcqeN4SZ n15Tz7KdIQuNpGNGQtodLK/+U3FPwxzPNXHZL/UoP4q1HTcBWHlo4mO6ARUcvlZm0cgpaZ vnnw900W43ZKCmTWPGhGyIVDDZWy8XxcwU97D2GG+lrMtB/SHpuO7VYUjbAqWBCeoa9dVL ehOHD9xrvbAKnApVU7Q+ZaacbwycRBv8GZrK0kTmg7trZCEtQ2QxuCkaOFE+fQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311542; a=rsa-sha256; cv=none; b=iDwJxLbyZX3w9zNxJNQaN0JMravcCsZXzyvZ0shYKvgF8DyL6qL0+lZMH2aDSs1ij4dPTl HumebGw1y6AOHcP+X0lbxBalfj8mlvhwYyFH5SglPVCRGrBWPsEWAV/CHhyv9fDUb7PbKC oBXhxvJbD0HU4e3t6p7ndvXbpVZC6ihD97dARnNAWbDB1Qh9fUpq21B56dDeRVIGEwl/dZ +BaI6dLI67C956kvXtMV7r3xKXUhCc0RAYnC7XZ5w7tluLbkxYW20ZiU+eozjLSQkJrQw+ DIJZosAWTd5YXDRJqUNecMQrBmHOYsv090FOy2YnAPdh4kR5DDNNo58Z6MUdUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8yF6xKsz2D5; Wed, 01 Oct 2025 09: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 5919d1Vd016862; Wed, 1 Oct 2025 09: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 5919d1aZ016859; Wed, 1 Oct 2025 09:39:01 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:39:01 GMT Message-Id: <202510010939.5919d1aZ016859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 7432a95653de - stable/15 - gpio: implement bus_setup_intr and bus_teardown_intr List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7432a95653de9702dcb5c2e2804b9a7f28077bce Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=7432a95653de9702dcb5c2e2804b9a7f28077bce commit 7432a95653de9702dcb5c2e2804b9a7f28077bce Author: Ahmad Khalifa AuthorDate: 2025-09-30 04:19:37 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:36 +0000 gpio: implement bus_setup_intr and bus_teardown_intr Implement bus_setup_intr and bus_teardown_intr as bus_generic_setup_intr and bus_generic_teardown_intr respectively for GPIO drivers that support interrupts. This allows children to setup interrupts. Reported by: Evgenii Ivanov Reviewed by: imp MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52197 (cherry picked from commit f1a372ed88b11c1e096523c0b6cf62902c1db37c) --- sys/arm/allwinner/aw_gpio.c | 4 ++++ sys/arm/broadcom/bcm2835/bcm2835_gpio.c | 4 ++++ sys/arm/freescale/imx/imx_gpio.c | 4 ++++ sys/arm/mv/mvebu_gpio.c | 4 ++++ sys/arm/nvidia/tegra_gpio.c | 4 ++++ sys/arm/ti/ti_gpio.c | 4 ++++ sys/arm64/rockchip/rk_gpio.c | 4 ++++ sys/dev/gpio/pl061.c | 3 +-- 8 files changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/arm/allwinner/aw_gpio.c b/sys/arm/allwinner/aw_gpio.c index f1b6f0bc9193..c90d61f7b45e 100644 --- a/sys/arm/allwinner/aw_gpio.c +++ b/sys/arm/allwinner/aw_gpio.c @@ -1531,6 +1531,10 @@ static device_method_t aw_gpio_methods[] = { DEVMETHOD(device_attach, aw_gpio_attach), DEVMETHOD(device_detach, aw_gpio_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, aw_gpio_pic_disable_intr), DEVMETHOD(pic_enable_intr, aw_gpio_pic_enable_intr), diff --git a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c index 93ee5d7c8bd3..ff5c4043dd86 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_gpio.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_gpio.c @@ -1321,6 +1321,10 @@ static device_method_t bcm_gpio_methods[] = { DEVMETHOD(device_attach, bcm_gpio_attach), DEVMETHOD(device_detach, bcm_gpio_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* GPIO protocol */ DEVMETHOD(gpio_get_bus, bcm_gpio_get_bus), DEVMETHOD(gpio_pin_max, bcm_gpio_pin_max), diff --git a/sys/arm/freescale/imx/imx_gpio.c b/sys/arm/freescale/imx/imx_gpio.c index 3b19ef1b5e67..60b8d79ab27e 100644 --- a/sys/arm/freescale/imx/imx_gpio.c +++ b/sys/arm/freescale/imx/imx_gpio.c @@ -918,6 +918,10 @@ static device_method_t imx51_gpio_methods[] = { DEVMETHOD(device_detach, imx51_gpio_detach), #ifdef INTRNG + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, gpio_pic_disable_intr), DEVMETHOD(pic_enable_intr, gpio_pic_enable_intr), diff --git a/sys/arm/mv/mvebu_gpio.c b/sys/arm/mv/mvebu_gpio.c index 4cc9b7030a65..c27d5a204052 100644 --- a/sys/arm/mv/mvebu_gpio.c +++ b/sys/arm/mv/mvebu_gpio.c @@ -839,6 +839,10 @@ static device_method_t mvebu_gpio_methods[] = { DEVMETHOD(device_attach, mvebu_gpio_attach), DEVMETHOD(device_detach, mvebu_gpio_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, mvebu_gpio_pic_disable_intr), DEVMETHOD(pic_enable_intr, mvebu_gpio_pic_enable_intr), diff --git a/sys/arm/nvidia/tegra_gpio.c b/sys/arm/nvidia/tegra_gpio.c index aa34537352be..ce24fccd3a40 100644 --- a/sys/arm/nvidia/tegra_gpio.c +++ b/sys/arm/nvidia/tegra_gpio.c @@ -853,6 +853,10 @@ static device_method_t tegra_gpio_methods[] = { DEVMETHOD(device_attach, tegra_gpio_attach), DEVMETHOD(device_detach, tegra_gpio_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, tegra_gpio_pic_disable_intr), DEVMETHOD(pic_enable_intr, tegra_gpio_pic_enable_intr), diff --git a/sys/arm/ti/ti_gpio.c b/sys/arm/ti/ti_gpio.c index 01b9597a4418..b7e9909b8548 100644 --- a/sys/arm/ti/ti_gpio.c +++ b/sys/arm/ti/ti_gpio.c @@ -1048,6 +1048,10 @@ static device_method_t ti_gpio_methods[] = { DEVMETHOD(device_attach, ti_gpio_attach), DEVMETHOD(device_detach, ti_gpio_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* GPIO protocol */ DEVMETHOD(gpio_get_bus, ti_gpio_get_bus), DEVMETHOD(gpio_pin_max, ti_gpio_pin_max), diff --git a/sys/arm64/rockchip/rk_gpio.c b/sys/arm64/rockchip/rk_gpio.c index 145d9769f35f..8da37d516802 100644 --- a/sys/arm64/rockchip/rk_gpio.c +++ b/sys/arm64/rockchip/rk_gpio.c @@ -851,6 +851,10 @@ static device_method_t rk_gpio_methods[] = { DEVMETHOD(device_attach, rk_gpio_attach), DEVMETHOD(device_detach, rk_gpio_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* GPIO protocol */ DEVMETHOD(gpio_get_bus, rk_gpio_get_bus), DEVMETHOD(gpio_pin_max, rk_gpio_pin_max), diff --git a/sys/dev/gpio/pl061.c b/sys/dev/gpio/pl061.c index 32109e5982bc..9996b0253c7d 100644 --- a/sys/dev/gpio/pl061.c +++ b/sys/dev/gpio/pl061.c @@ -558,8 +558,7 @@ static device_method_t pl061_methods[] = { /* Bus interface */ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* GPIO protocol */ DEVMETHOD(gpio_get_bus, pl061_get_bus), From nobody Wed Oct 1 09:39:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8yH6TZmz69GY1; Wed, 01 Oct 2025 09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yH1B3kz3HD4; Wed, 01 Oct 2025 09: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=1759311543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tmryGI/0VXNLEwaG0vsyOavIFyCazOea1YwrBuhwYSw=; b=c5oLf+mqSd2cV5qorfFvDk54HFktys0Lt35hmGgew3/1PTwpyPy5/BGbspTMLZgmyDr+rw Z/kq3pDfT5pO/nKzPr6T9rOZMublFLsAGMLSyUx4uVpS9FUu+Y1hjpFLEZ3bt4nQq3Z7Sc jn+rEvE7E70ZiY8fBuMTnctR9cvdVDhka4nJKA8TCBQ2n0oEgkeqsmhRDqQ7J1f9S17ume TDP6WXuMDV5ME5bJua+2On38kJ4KUMaZV3v96zH0HW2pj+krTexP1BsH5IJmTa+FbQYMMc kkjxrc8JHybjKc0l/XqrXXQQ7TIJpF8hzAtLhT0kjMVZQKD3yPHODrZHH9fjJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tmryGI/0VXNLEwaG0vsyOavIFyCazOea1YwrBuhwYSw=; b=yIj/Z9spK/S9g9YWLfUeFEVJ0uI+D29Mg2Y4Z2n2G50qKoSOWPVuRI1tFYGqtZ5klwQX2P J4zovuzt4QYivHminnq6ZBM3zQAQqrZoxhYUYY0M3lECVtlVQN+xA4Y0RGA6Wu4P+sLHSN RUmD04ualO93nx/wLWhonjS6ItUxDFRwsvSeuwDFmjKvdaPRPfCGfueTTKnPHFQ0L3ZRSr gJs+l8+y1zUdjrQoZE9NRxW5FlV/R1u4RZSPluWPbX41fup4JvOr6yccJ5Z1qVGDtbsNdt 1WRKUKfclBXOdJQvO9sJz6uzu7qOYF6jhrNcOz/3bcMEkZe4yX6Zml6HUb3h0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311543; a=rsa-sha256; cv=none; b=cQUNi1Lfg9ZHNH0qZKlHMe4OMTTW7fKBqkd4tX9Nam5lOHjhS8kzQTO7IEwxn0D9cMQhzA nz9ks2hWsQKd3to18E550EQZxGKhpyK56WaL6H+EXbWAuLmkheIWGuawiv2SPtQlaz4zG0 E5d7en1SppX0XqvZFsAuMea7FlxUaRfY/SmkurtwDh0l6sYBSfMnVBr2WLEkvqOJvl1jVY h/M53AUYQEc9940Ehm8PHVMmajMEGvjk4/Ip0oRKBnXXXMQ7LOLwB8B8QsG3DgL+1CWIXs ERREP2znhIEBRQbEIInP7AIh8HFQko+iQBfCvUweP7MbKIOBLC0ysVnouTtFgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8yH0l8xz1vj; Wed, 01 Oct 2025 09: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 5919d3AY016900; Wed, 1 Oct 2025 09: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 5919d2F4016897; Wed, 1 Oct 2025 09:39:02 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:39:02 GMT Message-Id: <202510010939.5919d2F4016897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 0f92b4049931 - stable/15 - gpioc: allocate priv->events with the correct size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0f92b40499318adaad3c178b4033b0cb680075ce Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=0f92b40499318adaad3c178b4033b0cb680075ce commit 0f92b40499318adaad3c178b4033b0cb680075ce Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:09:28 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:36 +0000 gpioc: allocate priv->events with the correct size MFC after: 1 day (cherry picked from commit fa26e445544eb88f05779258e2ab9c96384fe74d) --- sys/dev/gpio/gpioc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 5a60f939dc78..b56fe6b4c37f 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -704,7 +704,7 @@ gpioc_open(struct cdev *dev, int oflags, int devtype, struct thread *td) * npins isn't a horrible fifo size for that either. */ priv->numevents = priv->sc->sc_npins * 2; - priv->events = malloc(priv->numevents * sizeof(struct gpio_event_detail), + priv->events = malloc(priv->numevents * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); priv->evidx_head = priv->evidx_tail = 0; @@ -925,7 +925,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, free(priv->events, M_GPIOC); priv->numevents = evcfg->gp_fifo_size; priv->events = malloc(priv->numevents * - sizeof(struct gpio_event_detail), M_GPIOC, + sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); priv->evidx_head = priv->evidx_tail = 0; } From nobody Wed Oct 1 09:39:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8yL1D6Sz69Ggl; Wed, 01 Oct 2025 09:39: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yK3BX6z3H75; Wed, 01 Oct 2025 09:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A96TV5cbPIErNHNRB5xM4vmU+lP9kL4et54r6ADmXfU=; b=SDVwvPQRbVKz6oBYsgF89fkNayZZOfBHPmDhp8KCwA8lfSGBlbIOsWScOIpM5S7+XMM8ra he2dMd5fpoSNPX8kmwa6oCBQeAaoMiKhnqqKQBRhZVMxuSbGq3b0a01u5+i7syHfXXhm46 g+SHjIA5h34ouQ6ssEoLFwIK3IOaGas1xsb1XKJ46EKVhsslmjVdBQ42PGO41AVvUG1D8W Ehm6NSgmLYA7mQpBCKWgkIivxW0kxkzhWzUKyhAZikZnOA6ckcRpIQK+HXG/n+YNfZ+IN8 V/oG5FReB8APLJGrcj2mS6m+wxBdqOBJKnF844y3KEVrEwG6oN2vlBzqhTPG+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A96TV5cbPIErNHNRB5xM4vmU+lP9kL4et54r6ADmXfU=; b=Dt4bHwXpPz9845Mofh9Iq15XyRLu7vHIVKgl1QpQFG3nkssEqK8hLVuKkzZ9fgMX/1PKrW 211ylzgne1Ygm+XdcBkS4l9Xt+8FHKbSz3NXA7mMwLKmSrABgLGsDotuYfE6hsU+MKe4RW xeKkAWag8nKgIU0F9jfN7HkU9rhXAk0A2+sKHlWt+VSyQ2Y6aSsy+iwls9zMl+HapDR63x Zy3u1hSyWH5yJy67RClhqvk38Nclc/cGwKL13bGhHjip653Zoeg14aNfHxQl1ouUknEy6L LPebYsKwGgr+nMtNF2m3vcYNx23gz0fSaqqLAr9bUXkerMRIFDts3CcJcxqS4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311545; a=rsa-sha256; cv=none; b=N6NtiKGdmCxYRorfuaWvF+U7m8rnwdYBCDAb+GNjS5KqJBMM1J61WzXjLh1kJppi0Z6+RR 3yGaXWW+EV1Hor4Az5l8C3gpftMiV0dvyCT+X7mndob6ytwdocZnWTqnRhq6ybtm1bG2XH mR7rFWgpQq1eL70VbAnulBwc8j+bJ0Lhdt/fJT+TJHuzzoimbLLDzJ0eOR2maaFdtmK37y URCkjNWub994/8RUAouNgU9LqWykaBXm7scTpvTfztXgaqoNCO1ipQcuzTisrjchjNHyEE Y4mKiVnB9bjxyjMQfGluKGJvIyZgJ5aWaJ7/aN8N+KL3L5Ys3qAOSHjR9unTEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8yK2hXCz2Gs; Wed, 01 Oct 2025 09:39: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 5919d5xt016970; Wed, 1 Oct 2025 09:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919d5x7016967; Wed, 1 Oct 2025 09:39:05 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:39:05 GMT Message-Id: <202510010939.5919d5x7016967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 3c4b41a93af0 - stable/15 - gpioc: allocate new fifo size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3c4b41a93af0694c6d7e5bf8e38af1626a878579 Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=3c4b41a93af0694c6d7e5bf8e38af1626a878579 commit 3c4b41a93af0694c6d7e5bf8e38af1626a878579 Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:55:34 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:36 +0000 gpioc: allocate new fifo size This slipped through after I resolved some merge conflicts. Fixes: d000adfe MFC after: 1 day (cherry picked from commit 2679636b4412927242e46d3806fbb58e2702eddb) --- sys/dev/gpio/gpioc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 9b297bcb1a77..6c6f79227166 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -918,7 +918,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, tmp = NULL; if (evcfg->gp_report_type == GPIO_EVENT_REPORT_DETAIL && priv->numevents < evcfg->gp_fifo_size) { - tmp = malloc(priv->numevents * + tmp = malloc(evcfg->gp_fifo_size * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); } From nobody Wed Oct 1 09:39:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cc8yK3kbBz69GMF; Wed, 01 Oct 2025 09:39: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cc8yJ39s1z3H9r; Wed, 01 Oct 2025 09:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BP5dQiek5ybFLat0KJK4oICGg6G589zFcUD+YpOeWO8=; b=iKZcpTz0cRdVI/K4mYew/L/d+GvTEfIMkQ04tjCHlTy2lu8+G2B90p8yZnCnsT4N2MVTL1 t6TCkNjvh2mStgxfpX8vfKGnL8Yxoc1g63xpsMp+wQQKAx0mC1gNtJrKUL5wlzVb/DXrU0 g3vVytfHVXJRgt7hC7YrzbfaFqpbxnJ6ZXk7kblnpzMXVZLjA1D2oAreMc3ynje6O2MWw2 pp6u+6scZlY8pXja/aGznzzL+1Ri5B2H2QF3NfLcvRgIt4wjfR6lAvQgoaPRYx7VxOU17l Wovv0MQTzmfKE9BHnWHVKlrHc6zekJ8G1VKNGCw94ycLQA8GkK9IfWF7j0Id0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759311544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BP5dQiek5ybFLat0KJK4oICGg6G589zFcUD+YpOeWO8=; b=NrYJOvfZl+xp47FAC5QltQfKtwpNwa/8kVFGdchxSmBWHLagEv7mhSuJ3YO8denfA5m9tS yQfqY9NUrqwJ10AcOXGa9yggC3G7r0ecy2hQt6iAloIFWExk1ireUlhi9S4xI6luW/8lRb mltPKfnUEYj9YIywvQoBUGTMu2WJuH1L2PmLsT/is4sHqwNBMti6AL9IeEFgZciFNASubQ eKqTG8TOWT5S1JlcoYcnkC4DgsVW6hNXZ3cbwUtpC0adGjggrZjlwQkgfDYNbEbU/rlHuW 6faDZQhokS3/TNSBtlOkKYarKGpDx0iS+LWLeKnnxekLScwb0NAjTFBgtS09Fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759311544; a=rsa-sha256; cv=none; b=PsNry+VXec5xvcciKQWOuEUlhl6NgC+KLBGtddKbce5Zt7hELT5DdjbaKRqe00g9Uy9WVx 2fR9BELj4tNwPBQ8CjL69lCOJpV7ILRKRmvtzchM6Zk/MIYy0GnSt0kx3Fb4yjrGYbR/fR 2NAYdpDiZUmWKjNSjf/xOOxFK7spUNKM6QNULt+o0KobTOHDjTtNh4bAlw1uz2sKtPVpfx oCQLjddqcO9SFezzOguNSI767NH0oU3olOS6WIcQ/T/uEPrrjQcFil5kJk2tY7V4d0CoeR vO5vBlAvpfogchxD9fY7nAUq9Q4/e1ndwvyMmg9GU24+cC4qPYTLs30XNOK2xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cc8yJ1VZNz2Gr; Wed, 01 Oct 2025 09:39: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 5919d49F016937; Wed, 1 Oct 2025 09:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5919d4IX016934; Wed, 1 Oct 2025 09:39:04 GMT (envelope-from git) Date: Wed, 1 Oct 2025 09:39:04 GMT Message-Id: <202510010939.5919d4IX016934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ahmad Khalifa Subject: git: 8fef0ee89497 - stable/15 - gpioc: fix race in ioctl(GPIOCONFIGEVENTS) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8fef0ee894979cde55a5d2b7571ff71c393fda7d Auto-Submitted: auto-generated The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=8fef0ee894979cde55a5d2b7571ff71c393fda7d commit 8fef0ee894979cde55a5d2b7571ff71c393fda7d Author: Ahmad Khalifa AuthorDate: 2025-09-30 11:09:50 +0000 Commit: Ahmad Khalifa CommitDate: 2025-10-01 09:37:36 +0000 gpioc: fix race in ioctl(GPIOCONFIGEVENTS) A race can occur in gpioc_ioctl when it is called with GPIOCONFIGEVENTS closely followed by GPIOSETCONFIG. GPIOSETCONFIG can alter the priv->pins list, making it no longer empty and opening the door for access to priv->events while we are reallocating it. Fix this by holding priv->mtx while handling GPIOCONFIGEVENTS. Reported by: Qiu-ji Chen PR: 289120 Reviewed by: mmel MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D52783 (cherry picked from commit d000adfe41e6f2fe8f3dbe92d8fc2d34ae882086) --- sys/dev/gpio/gpioc.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index b56fe6b4c37f..9b297bcb1a77 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -793,6 +793,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, struct gpio_access_32 *a32; struct gpio_config_32 *c32; struct gpio_event_config *evcfg; + struct gpioc_pin_event *tmp; uint32_t caps, intrflags; switch (cmd) { @@ -908,27 +909,35 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag, res = devfs_get_cdevpriv((void **)&priv); if (res != 0) break; - /* If any pins have been configured, changes aren't allowed. */ - if (!SLIST_EMPTY(&priv->pins)) { - res = EINVAL; - break; - } if (evcfg->gp_report_type != GPIO_EVENT_REPORT_DETAIL && evcfg->gp_report_type != GPIO_EVENT_REPORT_SUMMARY) { res = EINVAL; break; } - priv->report_option = evcfg->gp_report_type; /* Reallocate the events buffer if the user wants it bigger. */ - if (priv->report_option == GPIO_EVENT_REPORT_DETAIL && + tmp = NULL; + if (evcfg->gp_report_type == GPIO_EVENT_REPORT_DETAIL && priv->numevents < evcfg->gp_fifo_size) { - free(priv->events, M_GPIOC); - priv->numevents = evcfg->gp_fifo_size; - priv->events = malloc(priv->numevents * + tmp = malloc(priv->numevents * sizeof(struct gpioc_pin_event), M_GPIOC, M_WAITOK | M_ZERO); + } + mtx_lock(&priv->mtx); + /* If any pins have been configured, changes aren't allowed. */ + if (!SLIST_EMPTY(&priv->pins)) { + mtx_unlock(&priv->mtx); + free(tmp, M_GPIOC); + res = EINVAL; + break; + } + if (tmp != NULL) { + free(priv->events, M_GPIOC); + priv->events = tmp; + priv->numevents = evcfg->gp_fifo_size; priv->evidx_head = priv->evidx_tail = 0; } + priv->report_option = evcfg->gp_report_type; + mtx_unlock(&priv->mtx); break; case FIONBIO: /* From nobody Wed Oct 1 12:36:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtX530mz69Xtb; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtX3Ptrz3m11; Wed, 01 Oct 2025 12:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DDhhQ1nBzU4kZ1LKmrx1M1KItT5jpTUdRF64sFjZZL8=; b=dCBpVudWp5JKAjxDprDw8NUYGfbp8iH+12UMKjtPdDTMIgMNPRW/VPtSyFxkzwmtyDZcvK ghBZyxHo0JE4AvZjUy713leirxSu0mPfhnWaudrl0lQGfhD6ZiR3akTiKZ8MtvZHDmu6yM 3Yqw9H025RgOFInYeHPP0LkVuKNTPcxc0AXk2Z+xF9sxUUQQNdqQ1L2CMHZ4aSmoi0KXy1 ys4+nzsFlrviOmI1oA5yxabonBm9qwU68ES0E9rG//2EECjxTVuSitU9yREXFhTSed+tMM BUsGPiUcjJEokVHy0SDxJuBKsniYYTsWpW2QOUD6/AQQUGDDB7mV16TxZptvPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DDhhQ1nBzU4kZ1LKmrx1M1KItT5jpTUdRF64sFjZZL8=; b=P7DZUfZOCSGvEP7guDuUKGFNGQ6uPP1MkwOKnVoWoP0JQOnSl1sF3VSroCuCnHKiAWoqnx LPL1CTeXqTCyXHIUiVGsbnaZVcdSWWWlZuJw4e9RRlkaAwY3TsLV3aTqv38+92EHZqFd+a ugPaUkMQrfuss+z+OZP8nsRferBdBurAouwVQmsdNZhZv3tr+3I+ZQXtPqBtwF6ux4aJw8 iS162N6TM4ivjp0Sj8SryvHaelcUEaxynYtOooKFvK9QLwkpm/yvVAHwtsxzN/Jd0lFqC7 Lfmos97JX7HAsr+87RkwfxyY9OusrjGl0gap0X0Zp8t7/eO+vkG7faqaP6ITpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322164; a=rsa-sha256; cv=none; b=mIHrKPvItuiC7OUV0ynrvdtxID2aEUcT3B2dcTgAmQ6JwjWeDxjhsXMG+CZPtr5/8rWiHq 3tDIlIn5DRaTIyTBXrhb1X97TJF4J0VbW17zJFyR4P2XuLRm37ksWzoAo6LVLzYpHL2F8u xeJR2JYwIWUZwFbotNMI44DkHiqn9+6HHjAo0udq0eBB6he0VRY9B/LH33G8URy9olyq+O 3VwdPwh9F4KbrWCJ4yFaSEnE5//22XzeDbPdfRIpGgrsBQaCCqLLkcIR5iirXa30E+QPYI vzwfJuba1qt+gaKIr4yxvmYFj/8kAM94FnYFRLXON8nnI9xArDLkZIHtLNU+Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtX31Dlz6t5; Wed, 01 Oct 2025 12:36: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 591Ca4dV057393; Wed, 1 Oct 2025 12:36:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591Ca4u2057390; Wed, 1 Oct 2025 12:36:04 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:04 GMT Message-Id: <202510011236.591Ca4u2057390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: fc4881dd9aac - stable/15 - packages: Remove inetd from the minimal set List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fc4881dd9aacca5a83491940b8fed46a9d59a3f1 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=fc4881dd9aacca5a83491940b8fed46a9d59a3f1 commit fc4881dd9aacca5a83491940b8fed46a9d59a3f1 Author: Lexi Winter AuthorDate: 2025-09-25 17:36:30 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:24:47 +0000 packages: Remove inetd from the minimal set Although inetd is widely used, none of the base daemons which require or support inetd (e.g. fingerd, tftpd, sshd) are in the minimal set, and it's fairly uncommon to enable inetd's built-in servers nowadays. MFC after: 6 hours Reviewed by: manu, bapt, emaste Differential Revision: https://reviews.freebsd.org/D52715 (cherry picked from commit 791fc275dbc37ccb3cd4d33a087b69e399019572) --- release/packages/ucl/inetd-all.ucl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/release/packages/ucl/inetd-all.ucl b/release/packages/ucl/inetd-all.ucl index 75c4ca7cf6da..bf70f8a7458d 100644 --- a/release/packages/ucl/inetd-all.ucl +++ b/release/packages/ucl/inetd-all.ucl @@ -23,7 +23,3 @@ The inetd(8) server listens for incoming network connections and spawns a process to handle the connection based on its configuration file. Some built-in servers for basic services are also provided. EOD - -annotations { - set = "minimal,minimal-jail" -} From nobody Wed Oct 1 12:36:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtY4MSCz69Y0M; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtY3wG5z3lxr; Wed, 01 Oct 2025 12:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nh4XMEZEIRIE3BlYVniduMTml/pzbxFETOGLI4e/SGw=; b=ltZO8AzIxCKNoMQKEcLpvqu1F1WQ/kVnQ+sd+1HPZSAbES0NQImnFE7IswmlAC1y66EGdk 01Bb7JSfvoAGHldjhsDtNj8SecPDtee0Ja7SADT2czTUCt1Q2/nDeuoNxLkpMUBYl+ddOb FyDbAQkhOOOyAEfJvPO7/kelGl4PpvLVSw3AWweBBAcoxapVc88lztV3pUipsmdK9yNSqf Rd+5j9WeX0XOTT2kO1ZYP2/60aaapbEvDeM161ZrXXMs4KEr+ru1uy5xxRJ1r4fE9TrBWB TBJbCJxIPLY7IcTZTu/m4cqPvndV/R8xNUTz4eY3L41TsRet8/nPKuU6zaVF8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nh4XMEZEIRIE3BlYVniduMTml/pzbxFETOGLI4e/SGw=; b=UE9d61cK11cWUmDLLuek2QZ2+p+15PEhHry5vv9ifcRYbCjDJ8vDJKpbuh2xChOPLtCUCK fl4JLZdaQqjD30gcYPniGf9CiE86CFQCrK3GZ3ZB8N266a2UUpmqXiIJrbSCAEaA+R/ts1 M9rQJwc9Ql80DKITmRnMqhMkJb0o7RUlJeH21tP4CJs3Pev9c+CyKQADxjFVuXb1r2Iq/Q 4VNBO9V0vRe2mt1iORbS+YS8nJipv0tiTnbmfRNRQZNh3eaGJwQKGifzQpPTl/BnpnPLhN R9QzZFVPM9SqrWo1ejDT1dlaBs5zfVoZ2eJOWi+Us9F65B4t5y29ZW3vZU418Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322165; a=rsa-sha256; cv=none; b=jkDwqXU/31YqFgsD/T4PVPX3clQ5NJNiDbU1V7X8iMaQ7hq9BDXQ0vuyNmSSQ0WHQ/mdNU 2cYajQOfy3GGg+v1fIbTs1KewM1chM5kpNiVMMe/G+1Fsh3B+FXGNTfA/6va9EdQQmh/G7 Lik+E5+ABw1A5QhV553XPi4x/xcPlU0u67M4AbUVnCxsw1oyXp+aX4HR9TMmOPf1h2JaHV PaNnlPz7ku/Brhpe4gCg0eom8L+hKUuzxZR4UZDWg0STyQRnuX1tIoVT5irUuABVBTLmG2 XjlQu5Ycz7Vru1yM3Yi7jURLzNMxxoMEycEa+4YeDxzBCt0TPm27tWWhPxCG/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtY3Tw8z6yk; Wed, 01 Oct 2025 12:36: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 591Ca5K1057426; Wed, 1 Oct 2025 12:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591Ca5E7057423; Wed, 1 Oct 2025 12:36:05 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:05 GMT Message-Id: <202510011236.591Ca5E7057423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 32e75ec5851e - stable/15 - packages: Add a base-jail set List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 32e75ec5851ea065798d7a2a22b83537a7473153 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=32e75ec5851ea065798d7a2a22b83537a7473153 commit 32e75ec5851ea065798d7a2a22b83537a7473153 Author: Lexi Winter AuthorDate: 2025-09-25 17:31:38 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:25:15 +0000 packages: Add a base-jail set This is base, but without packages which are not generally useful in jails. The following packages are excluded: * Support for hardware not present in a jail: acpi, apm, bluetooth, ccdconfig, console-tools, cxgbe-tools, efi-tools, fd, hostapd, mlx-tools, nvme-tools, wpa * Kernel facilities that don't work in a jail: dtrace, dwatch, ggate, hast, iscsi, libcuse, smbutils All library packages are included in base-jail, even if they might not work, because the user may have executables linked with them. While here, remove the set-minimal dependency from set-devel, since this will cause unnecessary packages to be installed in jails. This means users will need to install set-devel in addition to their base set (minimal or base), which bsdinstall already handles correctly. Add a license to all the set UCL files, so people can redistribute them. MFC after: 6 hours Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D52719 (cherry picked from commit 31d00ac6c9ec342312ca4075d2e6dc0a68b5263d) --- release/packages/sets/base-dbg.ucl | 18 +++++++++++++ release/packages/sets/base-jail-dbg.ucl | 34 ++++++++++++++++++++++++ release/packages/sets/base-jail.ucl | 37 +++++++++++++++++++++++++++ release/packages/sets/base.ucl | 18 +++++++++++++ release/packages/sets/devel-dbg.ucl | 25 +++++++++++++----- release/packages/sets/devel.ucl | 25 +++++++++++++----- release/packages/sets/kernels-dbg.ucl | 18 +++++++++++++ release/packages/sets/kernels.ucl | 18 +++++++++++++ release/packages/sets/lib32-dbg.ucl | 18 +++++++++++++ release/packages/sets/lib32.ucl | 18 +++++++++++++ release/packages/sets/minimal-dbg.ucl | 18 +++++++++++++ release/packages/sets/minimal-jail-dbg.ucl | 18 +++++++++++++ release/packages/sets/minimal-jail.ucl | 18 +++++++++++++ release/packages/sets/minimal.ucl | 18 +++++++++++++ release/packages/sets/src.ucl | 18 +++++++++++++ release/packages/sets/tests.ucl | 18 +++++++++++++ release/packages/ucl/acct-all.ucl | 4 +++ release/packages/ucl/atf-all.ucl | 4 +++ release/packages/ucl/audit-all.ucl | 4 +++ release/packages/ucl/autofs-all.ucl | 4 +++ release/packages/ucl/bhyve-all.ucl | 4 +++ release/packages/ucl/blocklist-all.ucl | 4 +++ release/packages/ucl/bsdconfig-all.ucl | 4 +++ release/packages/ucl/bsdinstall-all.ucl | 4 +++ release/packages/ucl/bsnmp-all.ucl | 4 +++ release/packages/ucl/csh-all.ucl | 4 +++ release/packages/ucl/dma-all.ucl | 4 +++ release/packages/ucl/ee-all.ucl | 4 +++ release/packages/ucl/examples-all.ucl | 4 +++ release/packages/ucl/ftp-all.ucl | 4 +++ release/packages/ucl/games-all.ucl | 4 +++ release/packages/ucl/gssd-all.ucl | 4 +++ release/packages/ucl/inetd-all.ucl | 4 +++ release/packages/ucl/ipf-all.ucl | 4 +++ release/packages/ucl/ipfw-all.ucl | 4 +++ release/packages/ucl/jail-all.ucl | 4 +++ release/packages/ucl/kerberos-all.ucl | 4 +++ release/packages/ucl/kerberos-kdc-all.ucl | 4 +++ release/packages/ucl/kyua-all.ucl | 4 +++ release/packages/ucl/lib9p-all.ucl | 4 +++ release/packages/ucl/libarchive-all.ucl | 4 +++ release/packages/ucl/libbegemot-all.ucl | 4 +++ release/packages/ucl/libblocksruntime-all.ucl | 4 +++ release/packages/ucl/libbsdstat-all.ucl | 4 +++ release/packages/ucl/libbsm-all.ucl | 4 +++ release/packages/ucl/libcasper-all.ucl | 4 +++ release/packages/ucl/libcompat-all.ucl | 4 +++ release/packages/ucl/libcompiler_rt-all.ucl | 4 +++ release/packages/ucl/libcuse-all.ucl | 4 +++ release/packages/ucl/libdwarf-all.ucl | 4 +++ release/packages/ucl/libevent1-all.ucl | 4 +++ release/packages/ucl/libexecinfo-all.ucl | 4 +++ release/packages/ucl/libipt-all.ucl | 4 +++ release/packages/ucl/libldns-all.ucl | 4 +++ release/packages/ucl/liblzma-all.ucl | 4 +++ release/packages/ucl/libmagic-all.ucl | 4 +++ release/packages/ucl/libmilter-all.ucl | 4 +++ release/packages/ucl/libpathconv-all.ucl | 4 +++ release/packages/ucl/librpcsec_gss-all.ucl | 4 +++ release/packages/ucl/librss-all.ucl | 4 +++ release/packages/ucl/libsdp-all.ucl | 4 +++ release/packages/ucl/libsqlite3-all.ucl | 4 +++ release/packages/ucl/libstdbuf-all.ucl | 4 +++ release/packages/ucl/libstdthreads-all.ucl | 4 +++ release/packages/ucl/libthread_db-all.ucl | 4 +++ release/packages/ucl/libucl-all.ucl | 4 +++ release/packages/ucl/libvgl-all.ucl | 4 +++ release/packages/ucl/libvmmapi-all.ucl | 4 +++ release/packages/ucl/liby-all.ucl | 4 +++ release/packages/ucl/libyaml-all.ucl | 4 +++ release/packages/ucl/lp-all.ucl | 4 +++ release/packages/ucl/natd-all.ucl | 4 +++ release/packages/ucl/netmap-all.ucl | 4 +++ release/packages/ucl/nfs-all.ucl | 4 +++ release/packages/ucl/ntp-all.ucl | 4 +++ release/packages/ucl/openssl-all.ucl | 4 +++ release/packages/ucl/pf-all.ucl | 4 +++ release/packages/ucl/pmc-all.ucl | 4 +++ release/packages/ucl/quotacheck-all.ucl | 4 +++ release/packages/ucl/rcmds-all.ucl | 4 +++ release/packages/ucl/rdma-all.ucl | 4 +++ release/packages/ucl/rip-all.ucl | 4 +++ release/packages/ucl/sendmail-all.ucl | 4 +++ release/packages/ucl/ssh-all.ucl | 4 +++ release/packages/ucl/tcpd-all.ucl | 4 +++ release/packages/ucl/telnet-all.ucl | 4 +++ release/packages/ucl/unbound-all.ucl | 4 +++ release/packages/ucl/yp-all.ucl | 4 +++ 88 files changed, 611 insertions(+), 14 deletions(-) diff --git a/release/packages/sets/base-dbg.ucl b/release/packages/sets/base-dbg.ucl index c34e8b575834..d9eeb2c49677 100644 --- a/release/packages/sets/base-dbg.ucl +++ b/release/packages/sets/base-dbg.ucl @@ -1,3 +1,21 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Base system debug symbols (metapackage)" desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Base jail system debug symbols (metapackage)" + +desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Base jail system (metapackage)" + +vital = true + +desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Base system (metapackage)" vital = true diff --git a/release/packages/sets/devel-dbg.ucl b/release/packages/sets/devel-dbg.ucl index c3fcd9806272..f454bd1d634d 100644 --- a/release/packages/sets/devel-dbg.ucl +++ b/release/packages/sets/devel-dbg.ucl @@ -1,13 +1,24 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Development tools debugging symbols (metapackage)" desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Development tools (metapackage)" vital = true @@ -6,10 +24,3 @@ desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Base system kernels debugging symbols (metapackage)" desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Base system kernels (metapackage)" desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "32-bit compatibility library debugging symbols (metapackage)" desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "32-bit compatibility libraries (metapackage)" vital = true diff --git a/release/packages/sets/minimal-dbg.ucl b/release/packages/sets/minimal-dbg.ucl index 606394001696..aa2034c90548 100644 --- a/release/packages/sets/minimal-dbg.ucl +++ b/release/packages/sets/minimal-dbg.ucl @@ -1,3 +1,21 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Basic multi-user system debugging symbols (metapackage)" desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Basic multi-user jail debugging symbols (metapackage)" desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Basic multi-user jail system (metapackage)" vital = true diff --git a/release/packages/sets/minimal.ucl b/release/packages/sets/minimal.ucl index f2338f4c2e3b..37e7df8e7e68 100644 --- a/release/packages/sets/minimal.ucl +++ b/release/packages/sets/minimal.ucl @@ -1,3 +1,21 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "Basic multi-user system (metapackage)" vital = true diff --git a/release/packages/sets/src.ucl b/release/packages/sets/src.ucl index 7ab94eb420df..997335a19768 100644 --- a/release/packages/sets/src.ucl +++ b/release/packages/sets/src.ucl @@ -1,3 +1,21 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "System source code" vital = yes diff --git a/release/packages/sets/tests.ucl b/release/packages/sets/tests.ucl index 07b463fb7d69..3829dae11b3e 100644 --- a/release/packages/sets/tests.ucl +++ b/release/packages/sets/tests.ucl @@ -1,3 +1,21 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + comment = "System test suite" vital = yes diff --git a/release/packages/ucl/acct-all.ucl b/release/packages/ucl/acct-all.ucl index a96e3cc08471..f4c7119af798 100644 --- a/release/packages/ucl/acct-all.ucl +++ b/release/packages/ucl/acct-all.ucl @@ -29,3 +29,7 @@ lastcomm(1) command to view this information. However, system accounting is not intended as a security auditing mechanism; use the OpenBSM auditing system provided in the $PKG_NAME_PREFIX-audit package for that. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/atf-all.ucl b/release/packages/ucl/atf-all.ucl index 4d4bf8b6b69b..3014163c95bd 100644 --- a/release/packages/ucl/atf-all.ucl +++ b/release/packages/ucl/atf-all.ucl @@ -33,3 +33,7 @@ test programs in a variety of languages. These libraries all offer similar functionality and any test program written with them exposes a consistent user interface. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/audit-all.ucl b/release/packages/ucl/audit-all.ucl index c7c437d24476..43074b3bf299 100644 --- a/release/packages/ucl/audit-all.ucl +++ b/release/packages/ucl/audit-all.ucl @@ -42,3 +42,7 @@ system. This packages provides the auditing daemon auditd(8) and various utilities used to manage the auditing system and work with audit data. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/autofs-all.ucl b/release/packages/ucl/autofs-all.ucl index a51292e78faf..63261b9ce8d1 100644 --- a/release/packages/ucl/autofs-all.ucl +++ b/release/packages/ucl/autofs-all.ucl @@ -27,3 +27,7 @@ or to provide automated access to NFS servers via the /net mountpoint. This package provides the automountd(8) daemon which is responsible for managing this, as well as the management utility automount(8). EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/bhyve-all.ucl b/release/packages/ucl/bhyve-all.ucl index ac250b0f2ad4..c4e450a47934 100644 --- a/release/packages/ucl/bhyve-all.ucl +++ b/release/packages/ucl/bhyve-all.ucl @@ -40,3 +40,7 @@ loader. An example script is also provided in /usr/share/examples/bhyve/vmrun.sh which can be used to run simple virtual machines. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/blocklist-all.ucl b/release/packages/ucl/blocklist-all.ucl index 6acc6c548103..6e94b3822cf0 100644 --- a/release/packages/ucl/blocklist-all.ucl +++ b/release/packages/ucl/blocklist-all.ucl @@ -26,3 +26,7 @@ system packet filter. blacklistd(8) relies on each network daemon to report access attempts, so only daemons which have had blacklist support added will work. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/bsdconfig-all.ucl b/release/packages/ucl/bsdconfig-all.ucl index ba34e5b96fe9..944dc0a259da 100644 --- a/release/packages/ucl/bsdconfig-all.ucl +++ b/release/packages/ucl/bsdconfig-all.ucl @@ -25,3 +25,7 @@ configuration, including services, networking and disks. This package also provides sysrc(8), a command-line utility for managing the rc.conf(5) configuration. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/bsdinstall-all.ucl b/release/packages/ucl/bsdinstall-all.ucl index cfa303bc2ba4..2e01cbcb51ca 100644 --- a/release/packages/ucl/bsdinstall-all.ucl +++ b/release/packages/ucl/bsdinstall-all.ucl @@ -35,3 +35,7 @@ bsdinstall is used for installation of new systems, both for system setup from installation media, e.g., CD-ROMs, and for use on live systems to prepare VM images and jails. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/bsnmp-all.ucl b/release/packages/ucl/bsnmp-all.ucl index 683b6ff51a53..88a777b3181d 100644 --- a/release/packages/ucl/bsnmp-all.ucl +++ b/release/packages/ucl/bsnmp-all.ucl @@ -40,3 +40,7 @@ Protocol). It is intended to serve only the absolute basic MIBs and implement all other MIBs through loadable modules. In this way the bsnmpd can be used in unexpected ways. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/csh-all.ucl b/release/packages/ucl/csh-all.ucl index a158b5cd4fcb..787c43bdb82b 100644 --- a/release/packages/ucl/csh-all.ucl +++ b/release/packages/ucl/csh-all.ucl @@ -38,3 +38,7 @@ interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control, and a C-like syntax. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/dma-all.ucl b/release/packages/ucl/dma-all.ucl index 9abc83e8ee60..7b52c48a6def 100644 --- a/release/packages/ucl/dma-all.ucl +++ b/release/packages/ucl/dma-all.ucl @@ -46,3 +46,7 @@ systems, nor act as a mail exchanger for other hosts. If an SMTP server is required, or when more advanced mail routing is needed, consider using the $PKG_NAME_PREFIX-sendmail package instead. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/ee-all.ucl b/release/packages/ucl/ee-all.ucl index 2caa658c40f3..fbad921e7ef8 100644 --- a/release/packages/ucl/ee-all.ucl +++ b/release/packages/ucl/ee-all.ucl @@ -23,3 +23,7 @@ The Easy Editor, ee(1), is a simple, user-friendly text editor. It provides a full-screen editing interface similar to vi(1), but is easier to learn for new users. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/examples-all.ucl b/release/packages/ucl/examples-all.ucl index fe7ce1c461b4..027c65427924 100644 --- a/release/packages/ucl/examples-all.ucl +++ b/release/packages/ucl/examples-all.ucl @@ -24,3 +24,7 @@ The examples are provided as self-contained C source code. Some useful graphics data related to the "Beastie" mascot are also provided. EOD + +annotations { + set = "base,base-jail" +} diff --git a/release/packages/ucl/ftp-all.ucl b/release/packages/ucl/ftp-all.ucl index a8eac7b57946..285bf72529b5 100644 --- a/release/packages/ucl/ftp-all.ucl +++ b/release/packages/ucl/ftp-all.ucl @@ -22,3 +22,7 @@ desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: e1632b827b1a - stable/15 - freebsd-base.7: New manpage describing pkgbase List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e1632b827b1ac3e023917dddddb3a9add0a36b12 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=e1632b827b1ac3e023917dddddb3a9add0a36b12 commit e1632b827b1ac3e023917dddddb3a9add0a36b12 Author: Lexi Winter AuthorDate: 2025-09-25 17:41:00 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:25:25 +0000 freebsd-base.7: New manpage describing pkgbase This covers the basic structure of pkgbase, how packages are distributed, how package sets work, and provides a few example of actually using pkgbase. MFC after: 6 hours Approved by: re (cperciva) Reviewed by: ziaee, cperciva Differential Revision: https://reviews.freebsd.org/D52644 (cherry picked from commit 72bf56e273cb914e3b00f98e35e7270efd4edddb) --- share/man/man7/Makefile | 2 + share/man/man7/freebsd-base.7 | 189 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index ef8a5a555a07..6a426cc29b15 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -23,6 +23,7 @@ MAN= arch.7 \ named_attribute.7 \ operator.7 \ orders.7 \ + freebsd-base.7 \ ports.7 \ release.7 \ sdoc.7 \ @@ -38,6 +39,7 @@ MAN= arch.7 \ MLINKS= intro.7 miscellaneous.7 MLINKS+= growfs.7 growfs_fstab.7 +MLINKS+= freebsd-base.7 pkgbase.7 MLINKS+= security.7 securelevel.7 MLINKS+= c.7 c78.7 MLINKS+= c.7 c89.7 diff --git a/share/man/man7/freebsd-base.7 b/share/man/man7/freebsd-base.7 new file mode 100644 index 000000000000..f84cc7239a1d --- /dev/null +++ b/share/man/man7/freebsd-base.7 @@ -0,0 +1,189 @@ +.\" SPDX-License-Identifier: ISC +.\" +.\" Copyright (c) 2025 Lexi Winter. +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd September 25, 2025 +.Dt FREEBSD-BASE 7 +.Os +.Sh NAME +.\" .Nm pkgbase +.Nm freebsd-base +.Nd base system packages +.Sh DESCRIPTION +The +.Fx +base system may be installed as a set of +.Xr pkg 8 +packages, which supersedes the traditional method of installing using +.Xr tar 1 +archives. +.Pp +All base packages have names beginning with the string +.Dq "FreeBSD-" , +and have an origin beginning with +.Dq base/ . +In the default system configuration, the repository containing these +packages is called +.Dq FreeBSD-base , +but any name may be used. +The repository name can be used with +.Xr pkg 8 +to restrict package operations to the base system packages. +.Pp +Packages for all supported +.Fx +releases as well as active +.Dq STABLE +and +.Dq CURRENT +.\" re@ will provide their own repository before release, at which +.\" point this text will need updating. +branches are hosted on the Internet at +.Lk https://pkg.freebsd.org . +These packages are updated when new errata or security updates are +released (for supported release versions), or twice daily for +development branches. +.Pp +Alternatively, packages may be built from the system source tree +according to the instructions in +.Xr build 7 , +allowing the system to be updated from source code using packages. +.Sh PACKAGE ORGANISATION +To allow customisation of the installed system, each package is split +into several subpackages which contain different components of the +package. +For the package +.Sy FreeBSD-foo , +the following subpackages may be available: +.Bl -column "FreeBSD-foo-dev-lib32" "Description" +.It Sy "Package name" Ta Sy "Description" +.It FreeBSD-foo Ta Base files for the package (typically executables) +.It FreeBSD-foo-lib Ta Native runtime libraries +.It FreeBSD-foo-lib32 Ta 32-bit compatibility runtime libraries +.It FreeBSD-foo-dev Ta Development files (headers and static libraries) +.It FreeBSD-foo-dev-lib32 Ta 32-bit development files +.It FreeBSD-foo-dbg Ta Debugging symbols +.It FreeBSD-foo-man Ta Manual pages. +Manual pages are only packaged separately if the +.Sy WITH_MANSPLITPKG +.Xr src.conf 5 +option was enabled when building the system, which is not the default. +.El +.Pp +The exact set of available subpackages differs for each individual +package. For example, some packages may not provide any development +files, in which case the +.Sy -dev +subpackage is not present. +.Sh PACKAGE SETS +Package sets are meta-packages which do not contain any files +themselves, but depend on a selection of other packages, such that each +package set allows the complete set of packages for a supported workload +to be installed. +.Pp +Package sets are provided as packages named +.Sy FreeBSD-set- . +The following package sets are available in the base system: +.Bl -tag -width "minimal-jail" +.It minimal +The minimal set of packages required to bring up a multi-user +.Fx +system. +This includes the core system, along with packages required for +hardware support (such as +.Xr devmatch 8 +and downloadable firmware), and basic networking, including DHCP and +IEEE Std 802.11\(tm wireless networks. +.It minimal-jail +The equivalent of +.Sy minimal +for systems running in a +.Xr jail 8 +environment. +This set excludes hardware support not typically required for jails. +.It devel +Development tools, including C/C++ compilers, the link loader, and +other tools such as +.Xr ar 1 +and +.Xr nm 1 . +This set also includes native development files (headers and static +libraries) for all packages. +.It lib32 +32-compatibility libraries, for running 32-bit applications on a +64-bit host system. +This set includes both runtime libraries and development files. +.It base +The complete base system, excluding tests, the system source code, +and debugging symbols. +.It base-jail +The equivalent of +.Sy base +for systems running in a +.Xr jail 8 +environment. +This set excludes system functionality which typically does not work +or is not useful in a jail. +.It src +The system source tree for the userland and kernel, installed in +.Pa /usr/src . +.It tests +The system test suite, installed in +.Pa /usr/tests . +.It kernels +All available system kernels. +.El +.Sh EXAMPLES +Install the +.Xr vi 1 +text editor on the running system: +.Bd -literal -offset indent +pkg install FreeBSD-vi +.Ed +.Pp +Install a new +.Xr jail 8 +system using the +.Sy minimal-jail +package set: +.Bd -literal -offset indent +pkg -r /jails/myjail install FreeBSD-set-minimal-jail +.Ed +.Pp +Install C/C++ compilers on the running system: +.Bd -literal -offset indent +pkg install FreeBSD-set-devel +.Ed +.Pp +Apply available updates to the running system: +.Bd -literal -offset indent +pkg update -r FreeBSD-base +.Ed +.Pp +Install the development toolchain for FreeBSD/powerpc64le in an +alternate root (for example, to support cross-compiling software +for a different target than the host system): +.Bd -literal -offset indent +pkg -r /ppcdev -oABI=FreeBSD:16:powerpc64le \e + install -r FreeBSD-set-devel +.Ed +.Sh SEE ALSO +.Xr build 7 , +.Xr pkg 8 , +.Xr src.conf 5 +.Sh HISTORY +Support for installing the base system as packages was introduced in +.Fx 15.0 . +Earlier releases supported a subset of this functionality. From nobody Wed Oct 1 12:36:07 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtb6V3Dz69Xlc; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtb5lmPz3m6F; Wed, 01 Oct 2025 12:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3gGiggKo1wAZsiPQRrQva0fkqDYZvei96ywHGBE+8w=; b=pAM5B6NWSirz2DTaGp4guvqXzEyHHLs2WOsdbxxRvSf4P9yIevpjrq9N5jS6M0XnP5PrzD 1jg7SBTH1knOtgLN9SRnU254WuKvH6+ikp7UW7l7bXfAEqAqY9q9qr5N7BXb+DNn+HLAqY r0F0DBD47XDBh02NO2/T8WOjoNEii7Q8K7xi1xityD9CKX2RP3AoKMeTmNuh0RVeamtJhN cI5uoL7+AfJIqnDCYpbk7kFWNmZ1Jpbgbt4rGFXDdzdrUN4IkHbrUiYQ+SOBPROTvpIp0w yql/vpOx71DtpGfn4UKh7dwZNnh3CheCc/U9CuTUMoQpR01jq2+eWjT+hxYnGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3gGiggKo1wAZsiPQRrQva0fkqDYZvei96ywHGBE+8w=; b=pSCGOCOtx4Nf7rZJbbUco1LKSmtpoC+fcft7p4MJopIiUjIqsjS8XkXlQ3amJ/hyVpgSvX qjKS+pzp5liY6OSzrVD3mjhKOY0dkve0pktP41tts1T2wLfcL7rnmAyQ52Vm3BmPXCFJGP FK3CwX1ZoDTiaM99dznuGoY2sBqMZaTkziIjTw1Ya9XS1W+KNpSd0jQDIcGFwS6elQJVVt NfOnk/2pqo4bskvNUWEiLnO62D6K/WVBMg5Izxvm2Rn3JxKWZmWIHOBZxXzYONQewFmeEg SgBKbEvy4lyCZ8I0NevuA0fHxo6ywf6JRWE3GXffdCmYHvpdREFuJAXLYpcTXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322167; a=rsa-sha256; cv=none; b=a9UfXJwaazOZSH7DXYKVaCbLXWsM2CmBwbF3W/pu7ltJqAWf6lt8+Msws87tsRHrRl+JD1 6CszYez5QzgR2VGJVpnAfX4Sss7VTlD0vufp0mqvjOYMfSJyUxsEbBIVX7l4eiv/6YjF2Z LlZcX8YbQRHdIMJQdKtYY1c3SvEcFslz9TeBo0Iz/cCeFa4btBjxeiMHjbp4UGpKJV443S RYdWUs4bFuge8iZqO19ZMeSJjael3s2ep5/bjrb2VWS08tMYg7qJ8WVKqvnVNpt+Rz7O2P qQ4BPWRSm07g6wY7RiehV9mwFXNJijJOrdUVJbmlMHVCI6PqRo45Kj53ehmyeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtb5GFwz79n; Wed, 01 Oct 2025 12:36: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 591Ca7In057492; Wed, 1 Oct 2025 12:36:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591Ca76u057489; Wed, 1 Oct 2025 12:36:07 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:07 GMT Message-Id: <202510011236.591Ca76u057489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 478a4535a028 - stable/15 - packages: Add efi-tools to set-minimal List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 478a4535a028dbae46de6d8c9181d81cebfb1867 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=478a4535a028dbae46de6d8c9181d81cebfb1867 commit 478a4535a028dbae46de6d8c9181d81cebfb1867 Author: Lexi Winter AuthorDate: 2025-09-28 01:46:42 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:26:10 +0000 packages: Add efi-tools to set-minimal This is required to manage the firmware on amd64 and aarch64 systems. MFC after: 3 days Reviewed by: imp, emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52742 (cherry picked from commit fc726c4ec4636d44e9c964092dba6df07cac8b20) --- release/packages/ucl/efi-tools-all.ucl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release/packages/ucl/efi-tools-all.ucl b/release/packages/ucl/efi-tools-all.ucl index 52c966d7cda1..d6dc71dc616c 100644 --- a/release/packages/ucl/efi-tools-all.ucl +++ b/release/packages/ucl/efi-tools-all.ucl @@ -35,3 +35,7 @@ the UEFI firmware from a running system: * efitable(8) can dump UEFI tables. EOD + +annotations { + set = minimal +} From nobody Wed Oct 1 12:36:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtd4ctpz69Xtk; Wed, 01 Oct 2025 12:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtc6bWSz3m1X; Wed, 01 Oct 2025 12:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HDuGcBWzhQvIY5fX0EBjjEsPfiStiGxps/ZzN/6UGIM=; b=lzgLWniAfQoN+PSr+74oT2NtH0xA0UDCdh0mBTQ+HTjCdVDtFLY5dQuxeyHIRE/afwZLPh FhCWvcuDrm/KsHF6WPmqMbOzQA5tFfEVzjy2K/MsqzKZTQ9zRW4ys9ApmjTlGemwXK3Vgq gipnBq5cGJs0Z6v1SKKqj4uIOLY8FtsdpAvJ5ibiv9k9tvKvyvS1SiGkQvswaDwIxfU+qa R6FOwkI4SDkS49wsNuKXkVCjkaqE261ftb3uAHs5a1RgMoA3CchVnJfz5MwjEdK6+6AkV5 3zbAXYN8Q2gcjX95OCnX1yRlEI4V1I3urwuSAwYAzQk2Ah/ZPHQnshloAx4DAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HDuGcBWzhQvIY5fX0EBjjEsPfiStiGxps/ZzN/6UGIM=; b=uS8Ey/P/Qc0jTL47taWxMPl/5cVRxvBUXza5MO746ToD93lxElPaWDab7X+L8eAbuUat5Y i3JD5WFTIyZ4dfSOmRT+DVV9ERr8lrtxmk3uogzh4CSc996y5v/fi2OvX8b5c9SxRpERvV jEiW4r3qq0oRg08pS52d2qaowrV6BCHD6sppEQ7OWfNxYqII6oNfOrf3vDRw65SbzcE2TP nFyTkdUoRfQ3MxHLjid6f7ZAUtdiUCcc/LlRYmyWo69cDtPUXDvi7e4O5QvkPwRcN1wGj1 lefO/Qktz53grFYf5TztsVGnTKrJK6jI6xognGetKa3fjIjEZxYGdsWKOHLaWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322168; a=rsa-sha256; cv=none; b=G4jPSJ4H5THKW0C9lj1U6MBTfA7QaENhnvum9q3Px/zV6j50PfV7opw2AX87bfojra4E4Q oK1eMP8hxBj2Trp1uQdFFLyY5V7kl4q2j2GiBA54/ql6lW2kFhqWqwEn6vbfQtBCg3bjhE MzKQ93WSE/mxO8TO5IYsQ99+/qmlX/HyZBMnsN11GZR8wdBlo0YL7xFhuAzh/JvciJyOrb IYidxaWt9aQMNIcfYNkGbBWw1pBqKN2VPc+FtQXcgyNOkjfWRA92tA1MaadUW6nXmW93// sHQQWmJ9kpWNCbcX0lptkw96fnGO0DugY4m5yfUTAkT25mq1UtTW+Kdi4DXniQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtc5yc5z769; Wed, 01 Oct 2025 12:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 591Ca8Ob057534; Wed, 1 Oct 2025 12:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591Ca8RO057531; Wed, 1 Oct 2025 12:36:08 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:08 GMT Message-Id: <202510011236.591Ca8RO057531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 4b220047f169 - stable/15 - packages: Add kernel-man to minimal-jail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4b220047f1695ce44419a9a8f7ed6063d28d119b Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=4b220047f1695ce44419a9a8f7ed6063d28d119b commit 4b220047f1695ce44419a9a8f7ed6063d28d119b Author: Lexi Winter AuthorDate: 2025-09-28 01:49:08 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:26:21 +0000 packages: Add kernel-man to minimal-jail These manpages are broadly applicable to all systems, even jails, since they describe kernel facilities which are available in jails. MFC after: 3 days Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52743 (cherry picked from commit 29a4fe3dbd8493d0066c5424bfe0e890d4703f34) --- release/packages/ucl/kernel-man.ucl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/packages/ucl/kernel-man.ucl b/release/packages/ucl/kernel-man.ucl index 90257693b97b..4f56bd12cd92 100644 --- a/release/packages/ucl/kernel-man.ucl +++ b/release/packages/ucl/kernel-man.ucl @@ -24,5 +24,5 @@ developer manual pages (section 9). EOD annotations { - set = "minimal" + set = "minimal,minimal-jail" } From nobody Wed Oct 1 12:36:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtf1yscz69Y0T; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtf0Cxrz3m4d; Wed, 01 Oct 2025 12:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GaUOoWi6IWU8t+R48y+mPN3RJTwe0Of2BouJJCWmVX0=; b=lKCmhB5Zr39ZjtoQHi4JvCLHC4pOb7IC7hEQqjjjI0pnn0337jPgFHEa6iQF2xunWWrFgV Yq/eLsC+FBlPQQBbB63K711enL1toZc4uTryx/rTKlAugUo0kq30LtpwOCm5vHYeLlXnFs Q1eBj+UPiHwEQrIfwbutlFu7rqJhpZXpi9HaFRjUwHwFIBi7SP6xj5KboY6+sMeHc/Ijbs 4w/82YBUL3/ewZPRRBsY00/YUTIhbr8VIACsN3x6cJHZmrPE2Pzw3EY2WG2ICHcfrkaQHE JgOBaEjcCiINp0IHefLGIX+0VzjF6E2nyIMKxdjIGBos/GQbi1i8LC4wvJ+zjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GaUOoWi6IWU8t+R48y+mPN3RJTwe0Of2BouJJCWmVX0=; b=AGxPg+4epiCiahI3EOA5E4KmMvJxy64kcOTvaT9SDMirwlaF3LV8UiXZ4dfGYjhRXV+Zbu XIRmF2XVYKz0dLjZfIiesoKqFCN2VmKSUyHUatiC7A+G/ev0ssgLLxpW7XKVzQ7/f0eWU8 um3pmQmMchJWFQymJkmMUGKGdrN1SpY0PSQjpz+i+3P2yWnw2b+dA8TSVHabzY5pV4g1LC FgvgiECc7xxg9ix9mz23uAosYnx+RKVol1SfBKbUuQklFjEC4Gp74A9xuBXn3TRKmjJx7v YMo1dbnkBFxADabjehHEfQFiqTTav5CegoNtF/S1FCGc2Qw1hHCySu2vb2NTzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322170; a=rsa-sha256; cv=none; b=XoedSEmxnoDYbl7ikHTb3PJPixF52gcotlC+Sn0ZmzsQLxjfA4R0A16IgzbczO35+awR3/ vRIzO2N3iCwO0Q4eCTgmiHJPnvVHf2MbOq7t9WZbWQi0ewO7BL8rzCdbobN3fzLeDdyBgC SpWERR9ub1mfeg169h7pVljwYx+/Aspy++7ccCF1qXbmzDA7LODZJ+n1+ZRmw3hw4uBjL/ vh7PQHw8oHxn77h2PzJFr6CzfPLOedc+KfQNJbO8WhLW6R+ibGpDKEQzoXImRo7+Wg0I2K oErQ/WkI1MRaTNmobPrlfJA+eNQw2HqB2dzcfizPUyJg0MmitH1wtadVts8dYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtd6f06z6t7; Wed, 01 Oct 2025 12:36: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 591Ca96F057566; Wed, 1 Oct 2025 12:36:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591Ca9sd057563; Wed, 1 Oct 2025 12:36:09 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:09 GMT Message-Id: <202510011236.591Ca9sd057563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 7082b85f03f7 - stable/15 - packages: Add an "optional" set List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7082b85f03f7ac0b057a3db1ba1988dcd2432852 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=7082b85f03f7ac0b057a3db1ba1988dcd2432852 commit 7082b85f03f7ac0b057a3db1ba1988dcd2432852 Author: Lexi Winter AuthorDate: 2025-09-29 20:33:38 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:26:43 +0000 packages: Add an "optional" set This is everything in "base" but without compilers. This means we have sets to support four basic workloads: - "minimal" for a small installation where the user intends to add other packages by hand. - "optional" for a complete installation on a production system which does not need to compile software. - "devel", which can be added to either minimal or optional when compilers are required. - "base" for a complete installation, including compilers, for users who don't want to interact with pkgbase and just want the complete system installed like it was before. This is probably the last set want to add; any further metapackages would be better treated as "task" packages intended to target one specific workload. MFC after: 3 days Reviewed by: cperciva, bapt Differential Revision: https://reviews.freebsd.org/D52777 (cherry picked from commit eaecc9551ae4d342fee921fb4c0a1eeb6bf68b86) --- release/packages/sets/base-jail.ucl | 6 ++++- release/packages/sets/base.ucl | 10 +++++++- release/packages/sets/optional-dbg.ucl | 31 ++++++++++++++++++++++++ release/packages/sets/optional-jail-dbg.ucl | 31 ++++++++++++++++++++++++ release/packages/sets/optional-jail.ucl | 34 +++++++++++++++++++++++++++ release/packages/sets/optional.ucl | 33 ++++++++++++++++++++++++++ release/packages/ucl/acct-all.ucl | 2 +- release/packages/ucl/acpi-all.ucl | 4 ++++ release/packages/ucl/apm-all.ucl | 4 ++++ release/packages/ucl/atf-all.ucl | 2 +- release/packages/ucl/audit-all.ucl | 2 +- release/packages/ucl/autofs-all.ucl | 2 +- release/packages/ucl/bhyve-all.ucl | 2 +- release/packages/ucl/blocklist-all.ucl | 2 +- release/packages/ucl/bluetooth-all.ucl | 4 ++++ release/packages/ucl/bsdconfig-all.ucl | 2 +- release/packages/ucl/bsdinstall-all.ucl | 2 +- release/packages/ucl/bsnmp-all.ucl | 2 +- release/packages/ucl/ccdconfig-all.ucl | 4 ++++ release/packages/ucl/console-tools-all.ucl | 4 ++++ release/packages/ucl/csh-all.ucl | 2 +- release/packages/ucl/ctl-all.ucl | 4 ++++ release/packages/ucl/cxgbe-tools-all.ucl | 4 ++++ release/packages/ucl/dma-all.ucl | 2 +- release/packages/ucl/dtrace-all.ucl | 4 ++++ release/packages/ucl/dwatch-all.ucl | 4 ++++ release/packages/ucl/ee-all.ucl | 2 +- release/packages/ucl/examples-all.ucl | 2 +- release/packages/ucl/fd-all.ucl | 4 ++++ release/packages/ucl/ftp-all.ucl | 2 +- release/packages/ucl/games-all.ucl | 2 +- release/packages/ucl/ggate-all.ucl | 4 ++++ release/packages/ucl/gssd-all.ucl | 2 +- release/packages/ucl/hast-all.ucl | 4 ++++ release/packages/ucl/hostapd-all.ucl | 4 ++++ release/packages/ucl/inetd-all.ucl | 2 +- release/packages/ucl/ipf-all.ucl | 2 +- release/packages/ucl/ipfw-all.ucl | 2 +- release/packages/ucl/iscsi-all.ucl | 4 ++++ release/packages/ucl/jail-all.ucl | 2 +- release/packages/ucl/kerberos-all.ucl | 2 +- release/packages/ucl/kerberos-kdc-all.ucl | 2 +- release/packages/ucl/kyua-all.ucl | 2 +- release/packages/ucl/lib9p-all.ucl | 2 +- release/packages/ucl/libarchive-all.ucl | 2 +- release/packages/ucl/libbegemot-all.ucl | 2 +- release/packages/ucl/libblocksruntime-all.ucl | 2 +- release/packages/ucl/libbsdstat-all.ucl | 2 +- release/packages/ucl/libbsm-all.ucl | 2 +- release/packages/ucl/libcasper-all.ucl | 2 +- release/packages/ucl/libcompat-all.ucl | 2 +- release/packages/ucl/libcompiler_rt-all.ucl | 2 +- release/packages/ucl/libcuse-all.ucl | 2 +- release/packages/ucl/libdwarf-all.ucl | 2 +- release/packages/ucl/libevent1-all.ucl | 2 +- release/packages/ucl/libexecinfo-all.ucl | 2 +- release/packages/ucl/libipt-all.ucl | 2 +- release/packages/ucl/libldns-all.ucl | 2 +- release/packages/ucl/liblzma-all.ucl | 2 +- release/packages/ucl/libmagic-all.ucl | 2 +- release/packages/ucl/libmilter-all.ucl | 2 +- release/packages/ucl/libpathconv-all.ucl | 2 +- release/packages/ucl/librpcsec_gss-all.ucl | 2 +- release/packages/ucl/librss-all.ucl | 2 +- release/packages/ucl/libsdp-all.ucl | 2 +- release/packages/ucl/libsqlite3-all.ucl | 2 +- release/packages/ucl/libstdbuf-all.ucl | 2 +- release/packages/ucl/libstdthreads-all.ucl | 2 +- release/packages/ucl/libthread_db-all.ucl | 2 +- release/packages/ucl/libucl-all.ucl | 2 +- release/packages/ucl/libvgl-all.ucl | 2 +- release/packages/ucl/libvmmapi-all.ucl | 2 +- release/packages/ucl/liby-all.ucl | 2 +- release/packages/ucl/libyaml-all.ucl | 2 +- release/packages/ucl/lp-all.ucl | 2 +- release/packages/ucl/mlx-tools-all.ucl | 4 ++++ release/packages/ucl/natd-all.ucl | 2 +- release/packages/ucl/netmap-all.ucl | 2 +- release/packages/ucl/nfs-all.ucl | 2 +- release/packages/ucl/ntp-all.ucl | 2 +- release/packages/ucl/nvme-tools-all.ucl | 4 ++++ release/packages/ucl/openssl-all.ucl | 2 +- release/packages/ucl/pf-all.ucl | 2 +- release/packages/ucl/pmc-all.ucl | 2 +- release/packages/ucl/quotacheck-all.ucl | 2 +- release/packages/ucl/rcmds-all.ucl | 2 +- release/packages/ucl/rdma-all.ucl | 2 +- release/packages/ucl/rip-all.ucl | 2 +- release/packages/ucl/sendmail-all.ucl | 2 +- release/packages/ucl/smbutils-all.ucl | 4 ++++ release/packages/ucl/ssh-all.ucl | 2 +- release/packages/ucl/syscons-data-all.ucl | 4 ++++ release/packages/ucl/tcpd-all.ucl | 2 +- release/packages/ucl/telnet-all.ucl | 2 +- release/packages/ucl/unbound-all.ucl | 2 +- release/packages/ucl/yp-all.ucl | 2 +- usr.sbin/bsdinstall/scripts/pkgbase.in | 3 ++- 97 files changed, 289 insertions(+), 75 deletions(-) diff --git a/release/packages/sets/base-jail.ucl b/release/packages/sets/base-jail.ucl index e6c52349d3cb..d1dc17bc9860 100644 --- a/release/packages/sets/base-jail.ucl +++ b/release/packages/sets/base-jail.ucl @@ -16,7 +16,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -comment = "Base jail system (metapackage)" +comment = "Base system for jails (metapackage)" vital = true @@ -30,6 +30,10 @@ deps { version = "${VERSION}" origin = "base" }, + "set-optional-jail" { + version = "${VERSION}" + origin = "base" + }, "set-devel" { version = "${VERSION}" origin = "base" diff --git a/release/packages/sets/base.ucl b/release/packages/sets/base.ucl index 7b86450ae5b2..823e2342fab8 100644 --- a/release/packages/sets/base.ucl +++ b/release/packages/sets/base.ucl @@ -21,7 +21,11 @@ comment = "Base system (metapackage)" vital = true desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Optional software debug symbols (metapackage)" + +desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Optional software debug symbols for jails (metapackage)" + +desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Optional base system software for jails (metapackage)" + +vital = true + +desc = < + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Optional base system software (metapackage)" + +vital = true + +desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 3ded79804e5c - stable/15 - create-sets.sh: Always build the base sets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3ded79804e5c057827b8a820a2a5716d30a16416 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=3ded79804e5c057827b8a820a2a5716d30a16416 commit 3ded79804e5c057827b8a820a2a5716d30a16416 Author: Lexi Winter AuthorDate: 2025-09-30 04:25:38 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:26:53 +0000 create-sets.sh: Always build the base sets Since all packages were moved to the optional set, no packages are directly in the base sets, which means nothing caused the base sets to be built. Add the base sets to create-sets.sh so they're always built. Fixes: eaecc9551ae4 ("packages: Add an "optional" set") MFC after: 1 day (cherry picked from commit a087b4aec38c37d47b888aa8411948250cdd4bc0) --- release/packages/create-sets.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release/packages/create-sets.sh b/release/packages/create-sets.sh index 8c564ecfeb92..09567657c161 100755 --- a/release/packages/create-sets.sh +++ b/release/packages/create-sets.sh @@ -17,6 +17,10 @@ repodir="$1"; shift # generate-set-ucl.lua. UCL_VARS="$@" +# Nothing is explicitly added to set-base, so it wouldn't get built unless +# we list it here. +SETS="base base-dbg base-jail base-jail-dbg" + for pkg in "$repodir"/*.pkg; do # If the package name doesn't containing a '-', then it's # probably data.pkg or packagesite.pkg, which are not real From nobody Wed Oct 1 12:36:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtj0nPMz69Y0V; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDth269Kz3m5C; Wed, 01 Oct 2025 12:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PXWQ0H82sWDMt6lGSzBvpV2sXiNkLGJhbRYpCOrk0WY=; b=v8RK2auRB1KJQSnCukfmk9zJP7i3fxeA8qibkjmqsG/CRB9BbUBN3+Uxy+ywXCQCoIbYsR KiLf21VtdSikrEmDGnfOitdnqKnJdIOYXS2858c2fVc5G6p8sam/e+gGWHVAiwsjJ9bJ+i zkNyAAitytAyNo3BofPqzyR+Pkmydi/hLQUmcFyEtZsvjxAsiryMA97EusO7tU+XuiCT+I qZUZ71YqZVS6MU2jL2j5oWEIunjVzFrgf3Wb9fRFzt5XIcfvdr3sftWF42vcPR8NY2qFa5 3TzKJcKeiSsRqyw6WK7UVw7VaQce6D1UWzldFBZzDzaOL4PKHHy/3gaiMKrhOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PXWQ0H82sWDMt6lGSzBvpV2sXiNkLGJhbRYpCOrk0WY=; b=L5E77PMRyoUc0/bkqAp0L+SKVtluF7QHmkTOcWtl6DmiXIJDpKEGwelN2Yslb8t3xzWPQK 0oez5QCwxNOP38IJNdBmqqWQnp/kNJOPLJts3Z+h26QesU5HFxkqd9hKYusJ2kJ1UR1GTe JrCFrdaDxxhof/2Kv/1VkIPtga6sKIlS5c/zkwTV99ZWEpEhUbB7nbQ6qwAUihxl2sQXim IFwrQ/UlOPOz5cU49vL0kbcdlSVOYSrCKQBhV79GzQ8VwUhgxkiJ+R8VW7EwUs5RAmo/dH CU953n8D87hSygePr8XvjnxFyozqnK+CqcyNCO00Pf358+yraM+hhL8wbH4R7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322172; a=rsa-sha256; cv=none; b=ia6bnsJaMQXBTQbzrCGJpAok6nDvMQxiJRTecikqKG2iKSFYvyXwKzMle0Cs8E+DYfPrFW my5PtZuz3D9T4Z6tE7xWHmLZhtmXnWYZfh42Vip+GCLVnnSBpGWWECnqRfMOG7l9zm82uA iVz9kLI12wIBvr5K99uAGQgAbj+bR58tVnGwT0ztsk6tcadUbsXtkoKxaL9aS9Fe7CZmvM 7m7YQyV9j0Mrr3XnWZfKt+Lx2qRaq/cwKo7W/JvHrCOMhcNH1XbCyuD4hI9sSUZTqy1FIN CSqe3W6m04OmKKMdVyk46tGwvaVbVpq+xO0QJvmz2DdgbegayVx5L0Qd5/PMjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDth1MMwz6fM; Wed, 01 Oct 2025 12:36: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 591CaCF1057632; Wed, 1 Oct 2025 12:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591CaCWb057627; Wed, 1 Oct 2025 12:36:12 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:12 GMT Message-Id: <202510011236.591CaCWb057627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 259bb93b80c0 - stable/15 - Remove ftpd(8) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 259bb93b80c0881a2b089e2836d92334477f09ef Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=259bb93b80c0881a2b089e2836d92334477f09ef commit 259bb93b80c0881a2b089e2836d92334477f09ef Author: Lexi Winter AuthorDate: 2025-09-29 20:26:26 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:28:40 +0000 Remove ftpd(8) This was previously deprecated and is slated for removal in 15.0. Users who still need ftpd(8) can install the ftp/freebsd-ftpd port. Retain the ftp(d) PAM services since other FTP daemons use them. Update /etc/inetd.conf to point to /usr/local. Add ftpd to ObsoleteFiles, but do not list configuration files since users may want to preserve these to use with the freebsd-ftpd port. There is still some language in the manual referring to ftpd(8) which is relevant to the port, which has been retained but updated to reference the port. MFC after: 3 days Relnotes: yes Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D52739 (cherry picked from commit 614c8750ce116865953916b8b5bab2467ee94187) --- ObsoleteFiles.inc | 6 + UPDATING | 5 + contrib/tnftp/src/ftp.1 | 5 +- lib/libutil/login.conf.5 | 4 +- libexec/Makefile | 4 - libexec/ftpd/Makefile | 39 - libexec/ftpd/Makefile.depend | 21 - libexec/ftpd/Makefile.depend.options | 5 - libexec/ftpd/blacklist.c | 55 - libexec/ftpd/blacklist_client.h | 53 - libexec/ftpd/config.h | 280 -- libexec/ftpd/extern.h | 110 - libexec/ftpd/ftpchroot.5 | 118 - libexec/ftpd/ftpcmd.y | 1806 ------------- libexec/ftpd/ftpd.8 | 589 ----- libexec/ftpd/ftpd.c | 3448 ------------------------- libexec/ftpd/ftpusers | 28 - libexec/ftpd/logwtmp.c | 70 - libexec/ftpd/pathnames.h | 39 - libexec/ftpd/popen.c | 193 -- libexec/rc/rc.conf | 3 - libexec/rc/rc.d/Makefile | 6 - libexec/rc/rc.d/ftpd | 22 - release/tools/oci-image-notoolchain.conf | 1 - share/examples/etc/README.examples | 1 - share/man/man5/rc.conf.5 | 24 +- share/man/man5/src.conf.5 | 16 +- share/man/man7/hier.7 | 8 +- share/man/man7/security.7 | 1 - share/man/man8/intro.8 | 2 - tools/build/mk/OptionalObsoleteFiles.inc | 7 - tools/build/options/WITHOUT_BLACKLIST_SUPPORT | 3 +- tools/build/options/WITHOUT_FTP | 4 +- tools/build/options/WITHOUT_PAM_SUPPORT | 7 +- usr.sbin/inetd/inetd.8 | 4 +- usr.sbin/inetd/inetd.conf | 4 +- usr.sbin/newsyslog/newsyslog.conf.d/Makefile | 7 - usr.sbin/syslogd/Makefile | 6 - 38 files changed, 32 insertions(+), 6972 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d3b1a0239e3f..a63b78d357c6 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20250929: Remove ftpd(8) +OLD_FILES+=etc/rc.d/ftpd +OLD_FILES+=usr/libexec/ftpd +OLD_FILES+=usr/share/man/man5/ftpchroot.5.gz +OLD_FILES+=usr/share/man/man8/ftpd.8.gz + # 20250917: Remove a miscapitalized manual OLD_FILES+=usr/share/man/man9/vnet.9.gz OLD_FILES+=usr/share/man/man9/vimage.9.gz diff --git a/UPDATING b/UPDATING index 01c10700e1e3..6ee866092f47 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20251001: + The deprecated ftpd(8) has been removed. Users who still need ftpd + can install the ftp/freebsd-ftpd port. pkgbase users should remove + the orphaned FreeBSD-ftpd package. + 20250929: Both drm-kmod and nividia-drm ports had to be updated to either no longer conflict on LinuxKPI vs. native PCI changes and/or to keep diff --git a/contrib/tnftp/src/ftp.1 b/contrib/tnftp/src/ftp.1 index 34a88c23520b..e9f09ddca8cc 100644 --- a/contrib/tnftp/src/ftp.1 +++ b/contrib/tnftp/src/ftp.1 @@ -58,7 +58,7 @@ .\" .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 .\" -.Dd May 10, 2008 +.Dd September 25, 2025 .Dt FTP 1 .Os .Sh NAME @@ -2325,8 +2325,7 @@ for an example of how to make this automatic. .Sh SEE ALSO .Xr getservbyname 3 , .Xr editrc 5 , -.Xr services 5 , -.Xr ftpd 8 +.Xr services 5 .Sh STANDARDS .Nm attempts to be compliant with: diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 27f37fb5fc30..942f3ecd2661 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -17,7 +17,7 @@ .\" 5. Modifications may be freely made to this file providing the above .\" conditions are met. .\" -.Dd June 28, 2023 +.Dd September 25, 2025 .Dt LOGIN.CONF 5 .Os .Sh NAME @@ -496,7 +496,7 @@ lists. .Xr pam 3 , .Xr passwd 5 , .Xr ttys 5 , -.Xr ftpd 8 , +.Xr ftpd 8 Pq Pa ports/ftp/freebsd-ftpd , .Xr pam_passwdqc 8 .Sh HISTORY The file diff --git a/libexec/Makefile b/libexec/Makefile index 55e586434087..7ce78321f08e 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -54,10 +54,6 @@ SUBDIR+= fingerd _phttpget= phttpget .endif -.if ${MK_FTP} != "no" -SUBDIR+= ftpd -.endif - .if ${MK_MAIL} != "no" _comsat= comsat .endif diff --git a/libexec/ftpd/Makefile b/libexec/ftpd/Makefile deleted file mode 100644 index a040fa57f7d7..000000000000 --- a/libexec/ftpd/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -.include - -PACKAGE= ftpd - -CONFS= ftpusers -PROG= ftpd -MAN= ftpd.8 ftpchroot.5 -SRCS= ftpd.c ftpcmd.y logwtmp.c popen.c - -CFLAGS+=-DSETPROCTITLE -DLOGIN_CAP -DVIRTUAL_HOSTING -CFLAGS+=-I${.CURDIR} -YFLAGS= -WARNS?= 2 -WFORMAT=0 - -LIBADD= crypt md util - -.PATH: ${SRCTOP}/bin/ls -SRCS+= ls.c cmp.c print.c util.c -CFLAGS+=-Dmain=ls_main -I${SRCTOP}/bin/ls -LIBADD+= m - -.if ${MK_BLACKLIST_SUPPORT} != "no" -CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blocklist/include -SRCS+= blacklist.c -LIBADD+= blacklist -LDFLAGS+=-L${LIBBLACKLISTDIR} -.endif - -.if ${MK_INET6_SUPPORT} != "no" -CFLAGS+=-DINET6 -.endif - -.if ${MK_PAM_SUPPORT} != "no" -CFLAGS+=-DUSE_PAM -LIBADD+= pam -.endif - -.include diff --git a/libexec/ftpd/Makefile.depend b/libexec/ftpd/Makefile.depend deleted file mode 100644 index b6e94a3cf93c..000000000000 --- a/libexec/ftpd/Makefile.depend +++ /dev/null @@ -1,21 +0,0 @@ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - include/arpa \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libcrypt \ - lib/libmd \ - lib/libutil \ - lib/msun \ - usr.bin/yacc.host \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/libexec/ftpd/Makefile.depend.options b/libexec/ftpd/Makefile.depend.options deleted file mode 100644 index 5f186bb031f2..000000000000 --- a/libexec/ftpd/Makefile.depend.options +++ /dev/null @@ -1,5 +0,0 @@ -# This file is not autogenerated - take care! - -DIRDEPS_OPTIONS= BLACKLIST_SUPPORT PAM_SUPPORT - -.include diff --git a/libexec/ftpd/blacklist.c b/libexec/ftpd/blacklist.c deleted file mode 100644 index 0a45f9369074..000000000000 --- a/libexec/ftpd/blacklist.c +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * Copyright (c) 2016 The FreeBSD Foundation - * - * This software was developed by Kurt Lidl under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. */ - - -#include -#include -#include -#include - -#include -#include "blacklist_client.h" - -static struct blacklist *blstate; -extern int use_blacklist; - -void -blacklist_init(void) -{ - - if (use_blacklist) - blstate = blacklist_open(); -} - -void -blacklist_notify(int action, int fd, const char *msg) -{ - - if (blstate == NULL) - return; - (void)blacklist_r(blstate, action, fd, msg); -} diff --git a/libexec/ftpd/blacklist_client.h b/libexec/ftpd/blacklist_client.h deleted file mode 100644 index 0b6805dc218e..000000000000 --- a/libexec/ftpd/blacklist_client.h +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright (c) 2016 The FreeBSD Foundation - * - * This software was developed by Kurt Lidl under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. */ - - -#ifndef BLACKLIST_CLIENT_H -#define BLACKLIST_CLIENT_H - -#ifndef BLACKLIST_API_ENUM -enum { - BLACKLIST_AUTH_OK = 0, - BLACKLIST_AUTH_FAIL -}; -#endif - -#ifdef USE_BLACKLIST -void blacklist_init(void); -void blacklist_notify(int, int, const char *); - -#define BLACKLIST_INIT() blacklist_init() -#define BLACKLIST_NOTIFY(x, y, z) blacklist_notify(x, y, z) - -#else - -#define BLACKLIST_INIT() -#define BLACKLIST_NOTIFY(x, y, z) - -#endif - -#endif /* BLACKLIST_CLIENT_H */ diff --git a/libexec/ftpd/config.h b/libexec/ftpd/config.h deleted file mode 100644 index c5ca1f01e10e..000000000000 --- a/libexec/ftpd/config.h +++ /dev/null @@ -1,280 +0,0 @@ - - -/* config.h. Generated automatically by configure. */ -/* config.h.in. Generated automatically from configure.in by autoheader. */ -/* $Id: config.h.in,v 1.15 2001/04/28 07:11:46 lukem Exp $ */ - - -/* Define if the closedir function returns void instead of int. */ -/* #undef CLOSEDIR_VOID */ - -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* Define if your C compiler doesn't accept -c and -o together. */ -/* #undef NO_MINUS_C_MINUS_O */ - -/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */ -/* #undef F77_NO_MINUS_C_MINUS_O */ - -/* Define to `long' if doesn't define. */ -/* #undef off_t */ - -/* Define to the type of arg1 for select(). */ -/* #undef SELECT_TYPE_ARG1 */ - -/* Define to the type of args 2, 3 and 4 for select(). */ -/* #undef SELECT_TYPE_ARG234 */ - -/* Define to the type of arg5 for select(). */ -/* #undef SELECT_TYPE_ARG5 */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define if the closedir function returns void instead of int. */ -/* #undef VOID_CLOSEDIR */ - -/* The number of bytes in a off_t. */ -#define SIZEOF_OFF_T 0 - -/* Define if you have the err function. */ -#define HAVE_ERR 1 - -/* Define if you have the fgetln function. */ -#define HAVE_FGETLN 1 - -/* Define if you have the flock function. */ -#define HAVE_FLOCK 1 - -/* Define if you have the fparseln function. */ -#define HAVE_FPARSELN 1 - -/* Define if you have the fts_open function. */ -#define HAVE_FTS_OPEN 1 - -/* Define if you have the getaddrinfo function. */ -#define HAVE_GETADDRINFO 1 - -/* Define if you have the getgrouplist function. */ -#define HAVE_GETGROUPLIST 1 - -/* Define if you have the getnameinfo function. */ -#define HAVE_GETNAMEINFO 1 - -/* Define if you have the getspnam function. */ -/* #undef HAVE_GETSPNAM */ - -/* Define if you have the getusershell function. */ -#define HAVE_GETUSERSHELL 1 - -/* Define if you have the inet_net_pton function. */ -#define HAVE_INET_NET_PTON 1 - -/* Define if you have the inet_ntop function. */ -#define HAVE_INET_NTOP 1 - -/* Define if you have the inet_pton function. */ -#define HAVE_INET_PTON 1 - -/* Define if you have the lockf function. */ -#define HAVE_LOCKF 1 - -/* Define if you have the mkstemp function. */ -#define HAVE_MKSTEMP 1 - -/* Define if you have the setlogin function. */ -#define HAVE_SETLOGIN 1 - -/* Define if you have the setproctitle function. */ -#define HAVE_SETPROCTITLE 1 - -/* Define if you have the sl_init function. */ -#define HAVE_SL_INIT 1 - -/* Define if you have the snprintf function. */ -#define HAVE_SNPRINTF 1 - -/* Define if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the strlcat function. */ -#define HAVE_STRLCAT 1 - -/* Define if you have the strlcpy function. */ -#define HAVE_STRLCPY 1 - -/* Define if you have the strmode function. */ -#define HAVE_STRMODE 1 - -/* Define if you have the strsep function. */ -#define HAVE_STRSEP 1 - -/* Define if you have the strtoll function. */ -#define HAVE_STRTOLL 1 - -/* Define if you have the user_from_uid function. */ -#define HAVE_USER_FROM_UID 1 - -/* Define if you have the usleep function. */ -#define HAVE_USLEEP 1 - -/* Define if you have the vfork function. */ -#define HAVE_VFORK 1 - -/* Define if you have the vsyslog function. */ -#define HAVE_VSYSLOG 1 - -/* Define if you have the header file. */ -#define HAVE_ARPA_NAMESER_H 1 - -/* Define if you have the header file. */ -#define HAVE_DIRENT_H 1 - -/* Define if you have the header file. */ -#define HAVE_ERR_H 1 - -/* Define if you have the header file. */ -#define HAVE_FTS_H 1 - -/* Define if you have the header file. */ -#define HAVE_LIBUTIL_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_NDIR_H */ - -/* Define if you have the header file. */ -#define HAVE_PATHS_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_DIR_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_SYSMACROS_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_UTIL_H */ - -/* Define if you have the crypt library (-lcrypt). */ -#define HAVE_LIBCRYPT 1 - -/* Define if you have the nsl library (-lnsl). */ -/* #undef HAVE_LIBNSL */ - -/* Define if you have the skey library (-lskey). */ -/* #undef HAVE_LIBSKEY */ - -/* Define if you have the socket library (-lsocket). */ -/* #undef HAVE_LIBSOCKET */ - -/* Define if you have the util library (-lutil). */ -#define HAVE_LIBUTIL 1 - -/* Define if your compiler supports `long long' */ -#define HAVE_LONG_LONG 1 - -/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */ -#define HAVE_PRINTF_QD 1 - -/* Define if in_port_t exists */ -#define HAVE_IN_PORT_T 1 - -/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */ -#define HAVE_SOCKADDR_SA_LEN 1 - -/* Define if socklen_t exists */ -#define HAVE_SOCKLEN_T 1 - -/* Define if AF_INET6 exists in */ -#define HAVE_AF_INET6 1 - -/* Define if `struct sockaddr_in6' exists in */ -#define HAVE_SOCKADDR_IN6 1 - -/* Define if `struct addrinfo' exists in */ -#define HAVE_ADDRINFO 1 - -/* - * Define if contains AI_NUMERICHOST et al. - * Systems which only implement RFC2133 will need this. - */ -#define HAVE_RFC2553_NETDB 1 - -/* Define if `struct direct' has a d_namlen element */ -#define HAVE_D_NAMLEN 1 - -/* Define if struct passwd.pw_expire exists. */ -#define HAVE_PW_EXPIRE 1 - -/* Define if GLOB_BRACE, gl_path and gl_match exist in */ -#define HAVE_WORKING_GLOB 1 - -/* Define if crypt() is declared in */ -#define HAVE_CRYPT_D 1 - -/* Define if fclose() is declared in */ -#define HAVE_FCLOSE_D 1 - -/* Define if optarg is declared in or */ -#define HAVE_OPTARG_D 1 - -/* Define if optind is declared in or */ -#define HAVE_OPTIND_D 1 - -/* Define if optreset exists */ -#define HAVE_OPTRESET 1 - -/* Define if pclose() is declared in */ -#define HAVE_PCLOSE_D 1 - -/* Define if getusershell() is declared in */ -#define HAVE_GETUSERSHELL_D 1 - -/* Define if `long long' is supported and sizeof(off_t) >= 8 */ -#define HAVE_QUAD_SUPPORT 1 - -/* Define if not using in-built /bin/ls code */ -/* #undef NO_INTERNAL_LS */ - -/* Define if using S/Key */ -/* #undef SKEY */ - -/* - * Define this if compiling with SOCKS (the firewall traversal library). - * Also, you must define connect, getsockname, bind, accept, listen, and - * select to their R-versions. - */ -/* #undef SOCKS */ -/* #undef SOCKS4 */ -/* #undef SOCKS5 */ -/* #undef connect */ -/* #undef getsockname */ -/* #undef bind */ -/* #undef accept */ -/* #undef listen */ -/* #undef select */ -/* #undef dup */ -/* #undef dup2 */ -/* #undef fclose */ -/* #undef gethostbyname */ -/* #undef getpeername */ -/* #undef read */ -/* #undef recv */ -/* #undef recvfrom */ -/* #undef rresvport */ -/* #undef send */ -/* #undef sendto */ -/* #undef shutdown */ -/* #undef write */ - -/* Define if you have the header file. */ -#define HAVE_FTP_NAMES 1 diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h deleted file mode 100644 index 047e8573dd09..000000000000 --- a/libexec/ftpd/extern.h +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include - -void blkfree(char **); -char **copyblk(char **); -void cwd(char *); -void delete(char *); -void dologout(int); -void fatalerror(char *); -void ftpd_logwtmp(char *, char *, struct sockaddr *addr); -int ftpd_pclose(FILE *); -FILE *ftpd_popen(char *, char *); -int get_line(char *, int, FILE *); -void lreply(int, const char *, ...) __printflike(2, 3); -void makedir(char *); -void nack(char *); -void pass(char *); -void passive(void); -void long_passive(char *, int); -void perror_reply(int, char *); -void pwd(void); -void removedir(char *); -void renamecmd(char *, char *); -char *renamefrom(char *); -void reply(int, const char *, ...) __printflike(2, 3); -void retrieve(char *, char *); -void send_file_list(char *); -void statcmd(void); -void statfilecmd(char *); -void store(char *, char *, int); -void upper(char *); -void user(char *); -void yyerror(char *); -int yyparse(void); -int ls_main(int, char **); - -extern int assumeutf8; -extern char cbuf[]; -extern union sockunion data_dest; -extern int epsvall; -extern int form; -extern int ftpdebug; -extern int guest; -extern union sockunion his_addr; -extern char *homedir; -extern int hostinfo; -extern char *hostname; -extern int maxtimeout; -extern int logged_in; -extern int logging; -extern int noepsv; -extern int noguestretr; -extern int noretr; -extern int paranoid; -extern struct passwd *pw; -extern int pdata; -extern char proctitle[]; -extern int readonly; -extern off_t restart_point; -extern int timeout; -extern char tmpline[]; -extern int type; -extern char *typenames[]; /* defined in included from ftpd.c */ -extern int usedefault; - -struct sockaddr_in; -struct sockaddr_in6; -union sockunion { - struct sockinet { - u_char si_len; - u_char si_family; - u_short si_port; - } su_si; - struct sockaddr_in su_sin; - struct sockaddr_in6 su_sin6; -}; -#define su_len su_si.si_len -#define su_family su_si.si_family -#define su_port su_si.si_port diff --git a/libexec/ftpd/ftpchroot.5 b/libexec/ftpd/ftpchroot.5 deleted file mode 100644 index cb2f15f719ad..000000000000 --- a/libexec/ftpd/ftpchroot.5 +++ /dev/null @@ -1,118 +0,0 @@ -.\" Copyright (c) 2003 FreeBSD Project -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd January 26, 2003 -.Dt FTPCHROOT 5 -.Os -.Sh NAME -.Nm ftpchroot -.Nd "list users and groups subject to FTP access restrictions" -.Sh DESCRIPTION -The file -.Nm -is read by -.Xr ftpd 8 -at the beginning of an FTP session, after having authenticated the user. -Each line in -.Nm -corresponds to a user or group. -If a line in -.Nm -matches the current user or a group he is a member of, -access restrictions will be applied to this -session by changing its root directory with -.Xr chroot 2 -to that specified on the line or to the user's login directory. -.Pp -The order of records in -.Nm -is important because the first match will be used. -Fields on each line are separated by tabs or spaces. -.Pp -The first field specifies a user or group name. -If it is prefixed by an -.Dq at -sign, -.Ql @ , -it specifies a group name; -the line will match each user who is a member of this group. -As a special case, a single -.Ql @ -in this field will match any user. -A username is specified otherwise. -.Pp -The optional second field describes the directory for the user -or each member of the group to be locked up in using -.Xr chroot 2 . -Be it omitted, the user's login directory will be used. -If it is not an absolute pathname, then it will be relative -to the user's login directory. -If it contains the -.Pa /./ -separator, -.Xr ftpd 8 -will treat its left-hand side as the name of the directory to do -.Xr chroot 2 -to, and its right-hand side to change the current directory to afterwards. -.Sh FILES -.Bl -tag -width ".Pa /etc/ftpchroot" -compact -.It Pa /etc/ftpchroot -.El -.Sh EXAMPLES -These lines in -.Nm -will lock up the user -.Dq Li webuser -and each member of the group -.Dq Li hostee -in their respective login directories: -.Bd -literal -offset indent -webuser -@hostee -.Ed -.Pp -And this line will tell -.Xr ftpd 8 -to lock up the user -.Dq Li joe -in -.Pa /var/spool/ftp -and then to change the current directory to -.Pa /joe , -which is relative to the session's new root: -.Pp -.Dl "joe /var/spool/ftp/./joe" -.Pp -And finally the following line will lock up every user connecting -through FTP in his respective -.Pa ~/public_html , -thus lowering possible impact on the system -from intrinsic insecurity of FTP: -.Pp -.Dl "@ public_html" -.Sh SEE ALSO -.Xr chroot 2 , -.Xr group 5 , -.Xr passwd 5 , -.Xr ftpd 8 diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y deleted file mode 100644 index c090130d8137..000000000000 --- a/libexec/ftpd/ftpcmd.y +++ /dev/null @@ -1,1806 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1985, 1988, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * Grammar for FTP commands. - * See RFC 959. - */ - -%{ - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "extern.h" -#include "pathnames.h" - -#define yylex ftpcmd_yylex - -off_t restart_point; - -static int cmd_type; -static int cmd_form; -static int cmd_bytesz; -static int state; -char cbuf[512]; -char *fromname = NULL; - -%} - -%union { - struct { - off_t o; - int i; - } u; - char *s; -} - *** 6492 LINES SKIPPED *** From nobody Wed Oct 1 12:36:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtj55Mfz69Xx6; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtj2hnjz3mL3; Wed, 01 Oct 2025 12:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gCTwKI5TldqAkDvNoWI38agJyOOFrAloCh2rjcg+A80=; b=yPlGcvhriwAHul4CCi/kn5x5cZ8FkwzbzcvzqYb41lu5TlkYqMTYuioLn6j4vzI2cZd8gP bXpXuTjUfNVOcw/6/VmZeqO3wU5yG32kPhNBgYvnC2VrrhzzJ5SA7dJXPLp8eFVGDuyNyb o6F2CyeDGXzyNQRyTMAaDK8N7ayIo+1oH6/Icv8921PGJrl+G+OElQUbOkssA3cJdITQbE 1kOZ5VGFHfJgZTyFRi3I1gySdyBkLeyIBUhtN09bg3CGHldfos2EipRm73urek70Jf+egO 8mNTNfIGxxyYQNZVtICSVoiANU36m4O+5GjtLRsCrTIY7+DX5fZzXQ9Xsl9ztg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gCTwKI5TldqAkDvNoWI38agJyOOFrAloCh2rjcg+A80=; b=g9UWPaLiut4ML0+DslIo4ERxNQEGKzMhIkkQbLi+Gvz/P1yePfcVVuaDRE+hlimKJ+xVP0 /JNHUUy4SfORflwHalJ2qD2g6NwWVHhLBxhnctTgSrFXvFNN69dqjocCs02CPCRh5Stnjx zX32fPlr/w0+DVGOK/yp72qgjmWf0u0HHtfP5lDR7jHMkVpVBPLiz4cr6giUjv5QIPzoqf W6mRWwVGP/bfhHqWbf63CH3sJanGOL8FnDNYQCUssVIcuBPENwL10+x3fH6u1q18WFMG+S AFwugYvIZqt657zMMC6zUddCCkHjFjaslw4tI6d2bglJbSk7/ipoEFzmazEIpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322173; a=rsa-sha256; cv=none; b=yrgBgPqyccJOpXHmnvzW4SRRuUGRGhsYyNV6EQ8XbFcDO29bQOuSiWPaDFKXbEg5+O+1st dpwQwSQQTfseGsqNqhZSbsSSeyTBahR7s6iXjdYxciXoWJAHx9QbFFH8hllKGVHFxtSTuv N+HlO18AkS1ZOGEb4hZ7hLekrcVf6gNFA+eb229UmUdIN3DM1RPl2vhPcBud6jxgOjRL2b YCGU/zexEWBwKbIvK+naQ1ftCKkc1EAg5xxhjfQO+rmAkQzo2wROBwov3cs6lLuY8oJLu0 Vx871RyrxQnXQLgkbG4Tk7/okwdFSwE+PViyzqL09Z5vfB5fCaE5nQbeNpLk/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtj2CvNz79p; Wed, 01 Oct 2025 12:36: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 591CaDk7057664; Wed, 1 Oct 2025 12:36:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591CaDXl057661; Wed, 1 Oct 2025 12:36:13 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:13 GMT Message-Id: <202510011236.591CaDXl057661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: b4b91207ab6f - stable/15 - sh: Remove /.profile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b4b91207ab6f38db33f853b2d6b3f1bb806f94f1 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=b4b91207ab6f38db33f853b2d6b3f1bb806f94f1 commit b4b91207ab6f38db33f853b2d6b3f1bb806f94f1 Author: Lexi Winter AuthorDate: 2025-09-30 06:02:06 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:35:10 +0000 sh: Remove /.profile root's home directory was moved to /root many years ago, so there's no reason to keep this old link. This brings sh in line with csh, where /.cshrc was removed in dcb65c5a94d4. Relnotes: yes Approved by: re (cperciva) MFC after: 1 day PR: 289097 Reviewed by: cperciva, jilles, bapt, emaste Differential Revision: https://reviews.freebsd.org/D52161 (cherry picked from commit d31e342bcc8e22d7eb25c21a711cd4b8a54db6c0) bin/sh: Fix the build Removing was unintentional; put it back. Fixes: d31e342bcc8e ("sh: Remove /.profile") MFC after: 1 day (cherry picked from commit bb0955ee4db8870bb013cf7d208ad9b2fc27b619) --- bin/sh/Makefile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bin/sh/Makefile b/bin/sh/Makefile index 916bb88b57fa..2b1eca8e4b31 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -69,11 +69,4 @@ token.h: mktokens HAS_TESTS= SUBDIR.${MK_TESTS}+= tests -beforeinstallconfig: - rm -f ${DESTDIR}/.profile - -LINKMODE=${CONFMODE} -afterinstallconfig: - ${INSTALL_LINK} ${TAG_ARGS:D${TAG_ARGS},config} ${DESTDIR}/root/.profile ${DESTDIR}/.profile - .include From nobody Wed Oct 1 12:36:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtk5XzDz69XWH; Wed, 01 Oct 2025 12:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtk3WJxz3mLJ; Wed, 01 Oct 2025 12:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21/wSVUfd3TrEjdqvglxZHpyRWUTW6wKLPeBpXZYfMQ=; b=Y/cLDQ6yTlJiu3y45ZI4qFK85UJFJ8dTwebddlYnyr5SfqT25pEmpYO0ox2PEM6juh7gX0 mtZyTkmaMEQJgz9fyZNcvTKdNRI6olDYegavqIUr7LfAVN0FYD5EbamzlVe365JqbDNdTe u2bEyK9G1stFQXFf0eSCMZAmPWrtQquadrA/9xnIHNmK4x96beLdh3rWrbfc9HmznzPDts cAgZ2LehsHmp3BgbZmsl9w7m1Qwc19ex0B16jE1ndP9i869r5nKV6RmJFKgeKVV5jMYFkl IiS8ulhTNKMvJaa6WCR7fHPYPZv4NLjA7BdCHtPZfFYinigSo81Akx4KuGVMuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21/wSVUfd3TrEjdqvglxZHpyRWUTW6wKLPeBpXZYfMQ=; b=ZlDNTS+8HOpQxaPt5EpzvDnlT+CEQwtOxLDtSGdi3wlBYSpnP0UwjjDa2iiHAv+U8tDVzk XcENYQUpE3qsUniiG41cERc/qTA56IkPD1yKcFeQukr++LWcCTjaBQqcFaYwKK85hr/FuW KoU91TOcfyPxcCojJ7HhSfxWxVhZzsami7/oRfhpjg+yuZIWedM+diXfJ9JqH7TS6stiaz zmqNjitjiUYFz4chOIwdJDyPxy5n+E7GaTf2naqXfDb4acK8AtqzIdFj3m9hh/yv9PzO1W 5/sP+yX60of2+dF0woBf7+I2UocEzr+v6B0vewEu7ZuDOUas0tAyr9uZsqujog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322174; a=rsa-sha256; cv=none; b=EBlzBxZEkTvO0i+C4/1+v4149lM2qcCbBFEmKq9CBYQ/LCd4zW86RhiHmK3xTr3A5wsbiC EQJ8n0SAY0qXEDEz2cwuM8E/Hvy7w1iousWRmiUw5IQPMjIJGGabwNCidO9l9Yukfz5drY KBnj1+m403QjEUDRud6YV0h54Vd1/e92UQMCifTs5I96IxUIUHigj9YwK0yeYNyaCT1nqy du3j6z5TE2W0dDLT2QiHTuiDeL3RXMLDiiUSGKPtAZ4BYE9KNDBbzWRuZV1sdWcsIzvjr9 rzh8WEK3JKTTLg4s9F8NHepYwpTmKBlKG0BlADigBzlgyfGK76sEigNNTm80Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtk2xFDz79q; Wed, 01 Oct 2025 12:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 591CaE98057698; Wed, 1 Oct 2025 12:36:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591CaEN5057695; Wed, 1 Oct 2025 12:36:14 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:14 GMT Message-Id: <202510011236.591CaEN5057695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 693aa6bea296 - stable/15 - bsdinstall: Only offer to enable services which are installed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 693aa6bea29662da5e461486201ec1bf347af8a5 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=693aa6bea29662da5e461486201ec1bf347af8a5 commit 693aa6bea29662da5e461486201ec1bf347af8a5 Author: Lexi Winter AuthorDate: 2025-09-30 06:02:51 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:35:23 +0000 bsdinstall: Only offer to enable services which are installed With pkgbase, users may decide to install a minimal set of packages that's missing some daemons. Check which services are installed, and only include the ones which are present in the dialogue. MFC after: 1 day Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D52646 (cherry picked from commit 2507698b630db3d88b0aab12c348873f827255a2) --- usr.sbin/bsdinstall/scripts/services | 49 ++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/services b/usr.sbin/bsdinstall/scripts/services index 93282effbb3f..110b6f321ed1 100755 --- a/usr.sbin/bsdinstall/scripts/services +++ b/usr.sbin/bsdinstall/scripts/services @@ -40,21 +40,44 @@ fi echo -n > $BSDINSTALL_TMPETC/rc.conf.services +DAEMON_OPTIONS="" + +if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/sshd" ]; then + DAEMON_OPTIONS="$DAEMON_OPTIONS \ + sshd \"Secure shell daemon\" ${sshd_enable:-off}" +fi + +if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/ntpd" ]; then + DAEMON_OPTIONS="$DAEMON_OPTIONS \ + ntpd \"Synchronize system and network time\" ${ntpd_enable:-off} \ + ntpd_sync_on_start \"Sync time on ntpd startup, even if offset is high\" \ + ${ntpd_sync_on_start:-off}" +fi + +if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/local_unbound" ]; then + DAEMON_OPTIONS="$DAEMON_OPTIONS \ + local_unbound \"Local caching validating resolver\" \ + ${local_unbound_enable:-off}" +fi + +if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/powerd" ]; then + DAEMON_OPTIONS="$DAEMON_OPTIONS \ + powerd \"Adjust CPU frequency dynamically if supported\" \ + ${powerd_enable:-off}" +fi + +if [ -x "${BSDINSTALL_CHROOT}/etc/rc.d/moused" ]; then + DAEMON_OPTIONS="$DAEMON_OPTIONS \ + moused \"PS/2 mouse pointer on console\" ${moused_enable:-off}" +fi + exec 5>&1 -DAEMONS=$( bsddialog --backtitle "$OSNAME Installer" \ - --title "System Configuration" --no-cancel --separate-output \ - --checklist "Choose the services you would like to be started at boot:" \ +DAEMONS=$(eval bsddialog --backtitle \"$OSNAME Installer\" \ + --title \"System Configuration\" --no-cancel --separate-output \ + --checklist \"Choose the services you would like to be started at boot:\" \ 0 0 0 \ - local_unbound "Local caching validating resolver" \ - ${local_unbound_enable:-off} \ - sshd "Secure shell daemon" ${sshd_enable:-off} \ - moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ - ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ - ntpd_sync_on_start "Sync time on ntpd startup, even if offset is high" \ - ${ntpd_sync_on_start:-off} \ - powerd "Adjust CPU frequency dynamically if supported" \ - ${powerd_enable:-off} \ - dumpdev "Enable kernel crash dumps to /var/crash" ${dumpdev:-on} \ + $DAEMON_OPTIONS \ + dumpdev \"Enable kernel crash dumps to /var/crash\" ${dumpdev:-on} \ 2>&1 1>&5 ) retval=$? exec 5>&- From nobody Wed Oct 1 12:36:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtm0nbNz69Y0d; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtl5Kbgz3mJJ; Wed, 01 Oct 2025 12:36:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NlEagqmt0m42jzkcYz/9RyQiHtJyDiuF2qV0eecxjY=; b=SK+UszILLSaxr/awS+ytkt+N3JXXP9j5us0KQiM+bfPhYWfHNC04/pfpqt5jWCkDruA5w0 3L4rvw0Giu5BS+qFZjdZM9tn73fnN8wrv99X6oixp5fsgcxAFB/irIMQgIYWF1tC9mZmta zoCCePH8+7HprsT7e2ymKMuJWx2QypGvmWapieMMDFVYfrs3jrnDxN/J7r3fu5YI+v9kjy +uvrnxfvo9ZxZz0n2YDDk0wYbjE2G8dpBvWYvxp+OyZhnwukhAr+mYxGKd95O0xPv5EUDC VgTgqSzAM/zhU4UEha9JsAooVBSaQ5ZKurbF5ruFOJN6xcjwbwvYn6r6+zLhEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7NlEagqmt0m42jzkcYz/9RyQiHtJyDiuF2qV0eecxjY=; b=gCMDqQAEVL3p3pVKe9HjR7AmSJ5HHogtedo8P3tAnx52oBnN+vinKLTv4BofpbhI0qM+A2 LT2TEcPQ9Bjj2DRvMfmyXQ1KHoiC/lPRXGKa1xIhXwJTwzzq6HIDxoCNWzEurOec2eAbQi dLN7pjUiB3YxYxi7nHq4N0nidC9ea8b/n9ekFdqEHtZ4cuL03pcaEjSMOlGWM4aZeaBTn5 BVJS1+hVEmEH40ezlrRTxV2/ICVrWQ0Fv9afjZaD04+8a2xVy9rLhhvWUc3IucU+34AKSc w/fBZvj4EKHr2MAI8Mbsz0I8IiljjJQNt1L+jln/SMIYxkYo2czXNr1PQGaruA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322175; a=rsa-sha256; cv=none; b=pCuIljuX5TnqPhrQCXOFIneVdclt7MBWceSf2bL9GNEygt5l3sHjL+TeCkX49YUvB2R4oh 0wt+7Plbh9FsyDWS2S7p0R8XqJXmEmf6eEq6Q9Mwc0nFF8vFVermtMDq7ZBbEuXrGtcnw+ cACa/fpwLJG/l/VH0/ZK5YIju6LLkQZ5wECkyEYXHJcWquovEL2Xq1zFjQMbjMT3oFYp2a tATvCHT5jTkQeBFl+ubQzvkk+k1BDctlnkrP2cux5N77np8GzY6PBt5K2eyEK2dpW5dVlu r8RLimtlFOnYrjRZx6utdXE6hWIa3S1DpdgaMkbDRhlBYaHLGwlrsQr6XFYQEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtl3r5Tz7D2; Wed, 01 Oct 2025 12:36: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 591CaFb4057734; Wed, 1 Oct 2025 12:36:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591CaFIf057731; Wed, 1 Oct 2025 12:36:15 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:15 GMT Message-Id: <202510011236.591CaFIf057731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 1757898edd55 - stable/15 - liby: Move to toolchain package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1757898edd55b32c9f337e26901480943ec07c95 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=1757898edd55b32c9f337e26901480943ec07c95 commit 1757898edd55b32c9f337e26901480943ec07c95 Author: Lexi Winter AuthorDate: 2025-09-30 08:10:32 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:35:57 +0000 liby: Move to toolchain package We don't need an entire package for this trivial library. Move it to toolchain, which in practice means it's installed in toolchain-dev as it only contains a static library. MFC after: 1 day Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52793 (cherry picked from commit b0f25a38d7217b04dcdf7f2272ecf5f2f314d314) --- lib/liby/Makefile | 2 +- release/packages/ucl/liby-all.ucl | 28 ---------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/lib/liby/Makefile b/lib/liby/Makefile index 93f72ee440f8..ace8f8457d22 100644 --- a/lib/liby/Makefile +++ b/lib/liby/Makefile @@ -1,4 +1,4 @@ -PACKAGE=lib${LIB} +PACKAGE=toolchain LIB= y SRCS= main.c yyerror.c NO_PIC= diff --git a/release/packages/ucl/liby-all.ucl b/release/packages/ucl/liby-all.ucl deleted file mode 100644 index 313058e08710..000000000000 --- a/release/packages/ucl/liby-all.ucl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SPDX-License-Identifier: ISC - * - * Copyright (c) 2025 Lexi Winter - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -comment = "YACC runtime library" - -desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: b2249ee627aa - stable/15 - libstdthreads: Move to the runtime package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b2249ee627aa45221a68a988a6f2da9ac719668b Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=b2249ee627aa45221a68a988a6f2da9ac719668b commit b2249ee627aa45221a68a988a6f2da9ac719668b Author: Lexi Winter AuthorDate: 2025-09-30 08:11:14 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:36:07 +0000 libstdthreads: Move to the runtime package This library is required for C11 conformance, and is tiny (11kB), so instead of creating a bunch of packages for it, put it in runtime. Although this is a core C library and might be expected to live in clibs, kib objected to this on the basis that almost nothing actually uses libstdthreads and putting it in clibs would be wasteful. MFC after: 1 day Reviewed by: kib Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52792 (cherry picked from commit 11709058bf680f5738c6656597f2ff9e662c9400) --- lib/libstdthreads/Makefile | 2 +- release/packages/ucl/libstdthreads-all.ucl | 28 ---------------------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/lib/libstdthreads/Makefile b/lib/libstdthreads/Makefile index 49d024052420..dcdac58efc12 100644 --- a/lib/libstdthreads/Makefile +++ b/lib/libstdthreads/Makefile @@ -1,4 +1,4 @@ -PACKAGE=lib${LIB} +PACKAGE=runtime LIB= stdthreads SHLIB_MAJOR= 0 diff --git a/release/packages/ucl/libstdthreads-all.ucl b/release/packages/ucl/libstdthreads-all.ucl deleted file mode 100644 index 493a1cce1a46..000000000000 --- a/release/packages/ucl/libstdthreads-all.ucl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SPDX-License-Identifier: ISC - * - * Copyright (c) 2025 Lexi Winter - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -comment = "C11 threading library" - -desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: b580906afa66 - stable/15 - packages: Rename liblzma package to xz List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b580906afa6611cdc8a22132ce05d9910dabaf48 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=b580906afa6611cdc8a22132ce05d9910dabaf48 commit b580906afa6611cdc8a22132ce05d9910dabaf48 Author: Lexi Winter AuthorDate: 2025-09-30 08:11:55 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:36:15 +0000 packages: Rename liblzma package to xz Rename liblzma to xz, and use LIB_PACKAGE to create an xz-lib package for runtime libraries. MFC after: 1 day Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52791 (cherry picked from commit 9124ace751eb9c856c50c3698cf93ede45a9897d) --- lib/liblzma/Makefile | 4 +++- release/packages/ucl/{liblzma-all.ucl => xz-all.ucl} | 7 ++++--- usr.bin/lzmainfo/Makefile | 2 ++ usr.bin/xz/Makefile | 2 ++ usr.bin/xzdec/Makefile | 2 ++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/liblzma/Makefile b/lib/liblzma/Makefile index 27e0521f5884..9c6ece74ffd0 100644 --- a/lib/liblzma/Makefile +++ b/lib/liblzma/Makefile @@ -1,4 +1,6 @@ -PACKAGE=lib${LIB} +PACKAGE= xz +LIB_PACKAGE= + LIB= lzma LZMADIR= ${SRCTOP}/contrib/xz/src/liblzma diff --git a/release/packages/ucl/liblzma-all.ucl b/release/packages/ucl/xz-all.ucl similarity index 78% rename from release/packages/ucl/liblzma-all.ucl rename to release/packages/ucl/xz-all.ucl index d5698d48332a..16da8b76f0ac 100644 --- a/release/packages/ucl/liblzma-all.ucl +++ b/release/packages/ucl/xz-all.ucl @@ -16,11 +16,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -comment = "XZ LZMA library" +comment = "LZMA2 data compression" desc = < +PACKAGE=xz + PROG= xz LINKS= ${BINDIR}/xz ${BINDIR}/unxz diff --git a/usr.bin/xzdec/Makefile b/usr.bin/xzdec/Makefile index 7c43b2e03d78..6bf3dc07a408 100644 --- a/usr.bin/xzdec/Makefile +++ b/usr.bin/xzdec/Makefile @@ -1,3 +1,5 @@ +PACKAGE=xz + PROG= xzdec LINKS= ${BINDIR}/xzdec ${BINDIR}/lzdec From nobody Wed Oct 1 12:36:18 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtq2C6Pz69Xv1; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtq0nmGz3mP5; Wed, 01 Oct 2025 12:36:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V1305J3RNlxm/75EGROygRafWv9qkydex2R7jfyzn88=; b=gtNOQdGnqQKzA0Srir5qCDig1GrSNXskmTlePCjUGuhoDK9xBSm1+PlGeXLg8dAukIToC3 7dGkUABgRpayD8wWBWkjAuXRN85wEHEn5YC13EshsvSEg96wFoX0joAYIXkuKvDS7MTeoA DE9GT9SJ06Nn5pv5PDy4/Ai38TU2HwNx4GRzT3ZfDf3jEb6YUawtLUE+0kFwPmv1Dp+1o9 QwmH0fv4+eHN9Sg8m3y9ErXRsgbHM/CxPznlnW9HAIMtKGkrHJKabM1z3+SCsjkp6Hc99C v2T1Rgv+eT9MmIiufHaxTosuQ+UUeEpaRDC0kcspqFBt04fGBZcH7snr6qgc0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V1305J3RNlxm/75EGROygRafWv9qkydex2R7jfyzn88=; b=n7tDamP0g5Rg0F7jM6lGOn/VAIc4UlbZJ7945OJZzCGZWYJsucolw+gdBEEfc0VExk84oc ThYFHZBtvAe3JbGnVMy8iRq6F8IM2BKIk+hZ8FdSH06WVovw7Y2V3Om0IIB9eWqMZnFa0F e1uHAAjnhyrddZhVhYRSp3ioks8UVmKpFvQOmzjbseNeOX6494hGGv1p7Hvj9Lgejr53AZ tJdC5up0+B3iVZb2yCBMktWqYtP6W384uaN/o0rcFJVlujwIRp/jgkPrZ920nFJ1RC2iqq DE7xFxG1oXr5C9dY+qzvBq45sQwZr7rUI+O/v+EiHX3T5d4879RuORjSH0vJjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322179; a=rsa-sha256; cv=none; b=BlEt0qzNBkhUl7vGqEuYCnQeLh7XopK8EkdsBlcfUJ8Elb7ORS53ZDcQDCxcD/xx/b+LcH bdAgdHBEwd94IQjfg0h9N1g6j0eEI6CjrNfNRMrdMjdXeqQp+6YeVtQ5IPU5w2O0Aat6o3 5RhRRyy7BWKJiw2p59ZM1Isk24PS87IEvxKqOUgD+ziXRgzN2/ZSax3JnLhxpFAS1bRH5m vBGGRd/vilD/Ecx0HXHSEZ0HM/pNjxe9eRVzLGZk12yRT6/G0zhRiL8NGnFGdV6wQPNzw2 2gp7KmM6JvLc4ts+vKwUbprqBKedtP1UUcYmpiKedhiTjJ9Ns7HN4Hfd0MdT4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtp6mrmz7D3; Wed, 01 Oct 2025 12:36: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 591CaIAV057830; Wed, 1 Oct 2025 12:36:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591CaI8R057827; Wed, 1 Oct 2025 12:36:18 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:18 GMT Message-Id: <202510011236.591CaI8R057827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 4305db21bb2f - stable/15 - libsdp: Move to bluetooth-lib package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4305db21bb2f664b770b10b01cd241b751b35ca9 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=4305db21bb2f664b770b10b01cd241b751b35ca9 commit 4305db21bb2f664b770b10b01cd241b751b35ca9 Author: Lexi Winter AuthorDate: 2025-09-30 08:12:28 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:36:25 +0000 libsdp: Move to bluetooth-lib package Instead of creating a separate libsdp package, use LIB_PACKAGE to ship this in bluetooth-lib. MFC after: 1 day Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52790 (cherry picked from commit 41ee4321cc528b1f72d6a674fafdd5337be83f95) --- lib/libsdp/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libsdp/Makefile b/lib/libsdp/Makefile index f0153e756dfd..8177c9bdbd1a 100644 --- a/lib/libsdp/Makefile +++ b/lib/libsdp/Makefile @@ -1,6 +1,7 @@ # $Id: Makefile,v 1.2 2003/09/07 20:34:19 max Exp $ -PACKAGE=lib${LIB} +PACKAGE= bluetooth +LIB_PACKAGE= LIB= sdp MAN= sdp.3 From nobody Wed Oct 1 12:36:19 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccDtr4Mzcz69Y0s; Wed, 01 Oct 2025 12:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccDtr10VGz3mX6; Wed, 01 Oct 2025 12:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXGiUzkJPp6RVg7ne+YdfSX2kd/BnSA+Iem68JTcOUA=; b=LTC3XUOv5M8+3KgRedyDqvNrMed7Fau3JpRSRmjbKNn4E7XJ0e4k6etAzhK8SIbkQDxryN i9JgJKOiRDgHzpBL7Zr8U/b/yoAtj8aB8pAMpx079C2mh97bMvyEVZ6RlDrGYHMQus5Lgp t5Wkdb3t3Eh4q/XmVrZtNHNBpzB7ZoLP3IJTg9vgDrUB4wxEYQI5ifIgk1nfZB2zjdtA5f qr/1B+I6OgGmgxKgrSDuDVldSNpl2j+BwietcHea6lszlh5/UyngRDWLQhOqsthJQGgU8i XBkmOtOaESDVLiUvyfGX8MZg1T1SRTcn5+1WruPNR9RixDPaGaGnF/jXxUg4OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759322180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TXGiUzkJPp6RVg7ne+YdfSX2kd/BnSA+Iem68JTcOUA=; b=MxhuYbFVXrAZv+tVnBvaSp6e7m8jX2kizF1YaDXIRsekqbfAiEkP/V7sQn1NeT99We3/Ye eNzHOlhx0hWRor2J9Ns2JBRHTcptFyzVZfRw+I226vzNCwfLzOTUk335VHxPUZunP4DK31 Sm367ZqhJR87oCsBMP1ai7y76IxYKXKbBqtmrBR9Xc8A7gSr38wIc0WWQKz11VSKNTb2NR SNXLk8OPH0O7rFCXLzQ56k4u+A8my/n6LKrpVA8KQLlZ4yDn2oQuJ7ZWu7jX5w55c3OrCR toMs/bGqtiJhcTs58A42RnczW99awHrMO8wNkSX9cwVOe9QvQxfg+VM+KbMCLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759322180; a=rsa-sha256; cv=none; b=d72v/kMiMGSgpJ224Gg8srkd0Dk20CBTWNTPZu9KWJ04G5aByPEIXH8Yt1dSJc6DytDE4G /fFXXWsDVNxQvOdYIBRV+78yab1jsraKl6ggKhfusfL/sRDL2WBTGBHP9V0RATHR9m2Ile Rd3S5TkT31fD1wvy6X0RFVe6DCGjw4Fors/ElHTikSszJZq9pndIE56VyDr4moEOfx8Kn4 VPMqtCWt4lC+ZqAuxcKDnJ7LzjZhrIYOthpAdUiAur7fFPaftENrgQ6mNWSLlg6nm6UzzZ 73I66/Paac7sUwQ5Y4BPVkiyGLQvkQDOOxCZhxE+XADx8Exmxhdq8vvnW2y9+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccDtr0YmCz6fN; Wed, 01 Oct 2025 12:36: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 591CaJ3n057863; Wed, 1 Oct 2025 12:36:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591CaJDq057860; Wed, 1 Oct 2025 12:36:19 GMT (envelope-from git) Date: Wed, 1 Oct 2025 12:36:19 GMT Message-Id: <202510011236.591CaJDq057860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 9655d4f5e100 - stable/15 - libbsm: Rename package to audit-lib List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9655d4f5e10098ad741d171f3433dbb721da5410 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=9655d4f5e10098ad741d171f3433dbb721da5410 commit 9655d4f5e10098ad741d171f3433dbb721da5410 Author: Lexi Winter AuthorDate: 2025-09-30 08:13:03 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:36:37 +0000 libbsm: Rename package to audit-lib This is part of audit, so use the new LIB_PACKAGE feature to name the package audit-lib, rather than libbsm. MFC after: 1 day Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52789 (cherry picked from commit a053f948ade60e8a63ebdaa676bf95c5ce38af07) --- include/Makefile | 4 ++-- lib/libbsm/Makefile | 9 ++++----- release/packages/ucl/libbsm-all.ucl | 40 ------------------------------------- 3 files changed, 6 insertions(+), 47 deletions(-) diff --git a/include/Makefile b/include/Makefile index 07890362d7a6..661b2ee131ca 100644 --- a/include/Makefile +++ b/include/Makefile @@ -94,14 +94,14 @@ BSM= audit.h \ audit_fcntl.h \ audit_kevents.h \ audit_socket_type.h -BSMPACKAGE= libbsm +BSMPACKAGE= audit BSMDIR= ${INCLUDEDIR}/bsm .PATH: ${SRCTOP}/sys/security SECAUDIT= audit/audit.h \ audit/audit_ioctl.h \ audit/audit_private.h -SECAUDITPACKAGE= libbsm +SECAUDITPACKAGE= audit SECAUDITDIR= ${INCLUDEDIR}/security/audit .PATH: ${SRCTOP}/sys/cam diff --git a/lib/libbsm/Makefile b/lib/libbsm/Makefile index 67802eef62ac..4413a5dd79f7 100644 --- a/lib/libbsm/Makefile +++ b/lib/libbsm/Makefile @@ -1,9 +1,8 @@ -# -# +PACKAGE= audit +LIB_PACKAGE= -PACKAGE= lib${LIB} -OPENBSMDIR= ${SRCTOP}/contrib/openbsm -_LIBBSMDIR= ${OPENBSMDIR}/libbsm +OPENBSMDIR= ${SRCTOP}/contrib/openbsm +_LIBBSMDIR= ${OPENBSMDIR}/libbsm LIB= bsm SHLIB_MAJOR= 3 diff --git a/release/packages/ucl/libbsm-all.ucl b/release/packages/ucl/libbsm-all.ucl deleted file mode 100644 index 02022b91f83a..000000000000 --- a/release/packages/ucl/libbsm-all.ucl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2005-2007 Robert N. M. Watson - * Copyright (c) 2008-2009 Apple Inc. - * 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. - */ - -comment = "Basic Security Module (BSM) audit library" - -desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 0e17e8009374 - stable/15 - libstdbuf: Move to the utilities package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0e17e8009374328569f9c17e86781b46af1fb735 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=0e17e8009374328569f9c17e86781b46af1fb735 commit 0e17e8009374328569f9c17e86781b46af1fb735 Author: Lexi Winter AuthorDate: 2025-09-30 08:13:34 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:36:49 +0000 libstdbuf: Move to the utilities package This is a niche tool which is only useful in a small number of specific situations. It's very small (8kB), and the executable component /usr/bin/stdbuf is already in -utilities, so move the shlib to -utilities as well. MFC after: 1 day Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52788 (cherry picked from commit 4c8bbf5897b7e8e580f8ecb1d9d93f5d6d6c7f24) --- lib/libstdbuf/Makefile | 1 - release/packages/ucl/libstdbuf-all.ucl | 39 ---------------------------------- 2 files changed, 40 deletions(-) diff --git a/lib/libstdbuf/Makefile b/lib/libstdbuf/Makefile index 102c6745c593..9e289e0018fc 100644 --- a/lib/libstdbuf/Makefile +++ b/lib/libstdbuf/Makefile @@ -1,6 +1,5 @@ .include -PACKAGE=lib${LIB} LIB= stdbuf SRCS= stdbuf.c SHLIB_MAJOR= 1 diff --git a/release/packages/ucl/libstdbuf-all.ucl b/release/packages/ucl/libstdbuf-all.ucl deleted file mode 100644 index d3e4a6a62478..000000000000 --- a/release/packages/ucl/libstdbuf-all.ucl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2012 Jeremie Le Hen - * 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 and documentation 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. - */ - -comment = "Preloaded library to change standard streams initial buffering" - -desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 50dc8aa3759b - stable/15 - packages: Move ctf-tools to ctf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 50dc8aa3759b2d70da998373d19c7a34eefd5f46 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=50dc8aa3759b2d70da998373d19c7a34eefd5f46 commit 50dc8aa3759b2d70da998373d19c7a34eefd5f46 Author: Lexi Winter AuthorDate: 2025-09-30 08:29:37 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:36:58 +0000 packages: Move ctf-tools to ctf Remove the ctf-tools package. Add a new package which contains the previous contents of ctf-tools along with libctf. This removes CDDL-licensed code from the utilities package. Set LIB_PACKAGE for libctf so that DTrace runtime doesn't need to install the tools. MFC after: 1 day Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52776 (cherry picked from commit 24e4dcf4ba5e9dedcf89efd358ea3e1fe5867020) --- cddl/lib/libctf/Makefile | 2 ++ cddl/usr.bin/ctfconvert/Makefile | 2 +- cddl/usr.bin/ctfdump/Makefile | 2 +- cddl/usr.bin/ctfmerge/Makefile | 2 +- release/packages/ucl/{ctf-tools-all.ucl => ctf-all.ucl} | 5 +++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cddl/lib/libctf/Makefile b/cddl/lib/libctf/Makefile index 10854482cd21..1c605182bc1d 100644 --- a/cddl/lib/libctf/Makefile +++ b/cddl/lib/libctf/Makefile @@ -2,6 +2,8 @@ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libctf/common .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/ctf +PACKAGE= ctf +LIB_PACKAGE= LIB= ctf SRCS= ctf_create.c \ ctf_decl.c \ diff --git a/cddl/usr.bin/ctfconvert/Makefile b/cddl/usr.bin/ctfconvert/Makefile index cd9f850f480c..df53c46b7246 100644 --- a/cddl/usr.bin/ctfconvert/Makefile +++ b/cddl/usr.bin/ctfconvert/Makefile @@ -3,7 +3,7 @@ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt -PACKAGE= ctf-tools +PACKAGE= ctf PROG= ctfconvert SRCS= alist.c \ ctf.c \ diff --git a/cddl/usr.bin/ctfdump/Makefile b/cddl/usr.bin/ctfdump/Makefile index 23ded7458bed..357598583ae7 100644 --- a/cddl/usr.bin/ctfdump/Makefile +++ b/cddl/usr.bin/ctfdump/Makefile @@ -1,7 +1,7 @@ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/dump -PACKAGE= ctf-tools +PACKAGE= ctf PROG= ctfdump SRCS= dump.c \ symbol.c \ diff --git a/cddl/usr.bin/ctfmerge/Makefile b/cddl/usr.bin/ctfmerge/Makefile index 4cd9511f911c..81bccc047a25 100644 --- a/cddl/usr.bin/ctfmerge/Makefile +++ b/cddl/usr.bin/ctfmerge/Makefile @@ -1,7 +1,7 @@ .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/common .PATH: ${SRCTOP}/cddl/contrib/opensolaris/tools/ctf/cvt -PACKAGE= ctf-tools +PACKAGE= ctf PROG= ctfmerge SRCS= alist.c \ barrier.c \ diff --git a/release/packages/ucl/ctf-tools-all.ucl b/release/packages/ucl/ctf-all.ucl similarity index 88% rename from release/packages/ucl/ctf-tools-all.ucl rename to release/packages/ucl/ctf-all.ucl index df2955dafab5..941990908373 100644 --- a/release/packages/ucl/ctf-tools-all.ucl +++ b/release/packages/ucl/ctf-all.ucl @@ -21,7 +21,7 @@ * text is licensed under the CDDL. */ -comment = "Compact C Type Format (CTF) utilities" +comment = "Compact C Type Format (CTF)" desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 1bd747746013 - stable/15 - package: Use correct license for clang List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1bd7477460130a91c035d257fa2e86224f38870d Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=1bd7477460130a91c035d257fa2e86224f38870d commit 1bd7477460130a91c035d257fa2e86224f38870d Author: Lexi Winter AuthorDate: 2025-09-30 08:31:17 +0000 Commit: Lexi Winter CommitDate: 2025-10-01 10:37:08 +0000 package: Use correct license for clang LLVM was relicensed under Apache 2.0 with LLVM exception a while ago. MFC after: 1 day Reviewed by: bapt, imp (previous version) Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D51769 (cherry picked from commit 3cbd1f81688855a91f826ee4e04618ceace101ca) --- release/packages/ucl/clang-all.ucl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/packages/ucl/clang-all.ucl b/release/packages/ucl/clang-all.ucl index e0372940ed42..86cac409fa9e 100644 --- a/release/packages/ucl/clang-all.ucl +++ b/release/packages/ucl/clang-all.ucl @@ -25,7 +25,7 @@ This package provides the clang(1) frontend as well as related utilities for working with object files. EOD -licenses = [ NCSA ] +licenses = [ "Apache-2.0 WITH LLVM-exception" ] annotations { set = devel From nobody Wed Oct 1 15:52:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKDj6Nb7z69r4V; Wed, 01 Oct 2025 15:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKDj5s0sz3NF9; Wed, 01 Oct 2025 15:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759333925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3uTo0WSA6c9Ur51U9HI+Fkn1TKO4BjIF/WVBfHdUnXw=; b=C8+b2+dWQRd2inXq/7Wlz5u0TounQTM2EYqYUuLuaXC15mxgCalN4SRFGyZcWj067/qJo6 0cIAhn8lIOzGjJT69FgCWcxaeRB/W1tY0MwP+MwujeeP0tONytAMJSAuFVyTWOFxAMWI0J AIcReyKNewjZseliXmgsU4SDUIB3YGzvNy7+liPQGDcn8Wd/HbH4VndFhrtfukhJRADnEc 63ens1VcMTRIGG7T8H+AEIh0pXzC8uCTPZ44NS5ga4VB+bhnxSJePDrYhSxlCiwi7VXSwN Ze8d/uQYelj12XT7+zM07gOkpPTR1ko0L1v3yOJuDgCISevDXu4SIvjqwGpzcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759333925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3uTo0WSA6c9Ur51U9HI+Fkn1TKO4BjIF/WVBfHdUnXw=; b=LKcYzBOwDsZ3zbVf9Mg2oLpoT+sSbryLJ3gT3Hdwa16ybo6ZIfB1iecWgduawmpfQfxALU BUmkfM6LrE0GQzmSNGHUi3hnmMO/elfwrXOe4RxS/8xvHFXMJHBnwSXoBdSkCP3Tyzd5lY 8LESNl8C1AfWUwbOU55feV+YTSfaYi910R2fqbmF0I333ioHldXlliDQvP/KGQRccObUdo jsXMGyd84VeeZsoBl4bwlPzOT2C4FbHnEmGDxUkfHxUkMdAb8Uc7gqpzPZ2HIJZSGrybPC 6oPcthIVVbNvYm1iy6R4otz9xOy7x5MmwY4tp9ZsJl0jR2O/4SM0p8oNjswBvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759333925; a=rsa-sha256; cv=none; b=x2+HbnM3doHmSa8oexXv/Md7FFt9YjljKkA37YC8B/pf/CxTtLWN2Q8sXl3Rl+LeDFLJcV Snup7NoxxODy8VlluycolLFu+ZyTLPwqiCFjGRXpF348CRgm4HgA3LJNoEpfSHrM3h2bUh FpnUCt9XSW+mNV2oQi38tmhBj/I6rq1gmctF2Nnn48D1hSrZI2xMlOZAjsYuPwdilu2NWU P1A28ns6AGwNTEUA9mcst8qvHDWFgAFS2nYhf+pjSrla44cEQra04+P+lL13Mp93porDlT q4q7IZj7BHcxGXjXmRdEVqDN9CI3jdrwSC6FPXg+7w3p6Zql57VnTlIBmLEtQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKDj5LRpzCH4; Wed, 01 Oct 2025 15:52: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 591Fq5oh034984; Wed, 1 Oct 2025 15:52:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591Fq5ui034981; Wed, 1 Oct 2025 15:52:05 GMT (envelope-from git) Date: Wed, 1 Oct 2025 15:52:05 GMT Message-Id: <202510011552.591Fq5ui034981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 2b58ab6ce53d - stable/15 - sysctl.9: Fix grammar in *TUN descriptions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2b58ab6ce53d20e1c8e67bb2517a42bad73cba33 Auto-Submitted: auto-generated The branch stable/15 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b58ab6ce53d20e1c8e67bb2517a42bad73cba33 commit 2b58ab6ce53d20e1c8e67bb2517a42bad73cba33 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-09-28 08:05:47 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-10-01 15:51:50 +0000 sysctl.9: Fix grammar in *TUN descriptions Reported by: bcr Reviewed by: bcr MFC after: 3 days Event: EuroBSDCon 2025 Fixes: 5eb1caa8c845 Updated SYSCTL manual pages Differential Revision: https://reviews.freebsd.org/D52768 (cherry picked from commit f34e1c76adc5efd9b603cf6b2d5827f7db8c2ed8) --- share/man/man9/sysctl.9 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man9/sysctl.9 b/share/man/man9/sysctl.9 index 92c8532c8ed2..31031e64f713 100644 --- a/share/man/man9/sysctl.9 +++ b/share/man/man9/sysctl.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 1, 2020 +.Dd September 28, 2025 .Dt SYSCTL 9 .Os .Sh NAME @@ -863,14 +863,14 @@ flags to be set indicating the read and write disposition of the sysctl: .It Dv CTLFLAG_RD This is a read-only sysctl. .It Dv CTLFLAG_RDTUN -This is a read-only sysctl and tunable which is tried fetched once +This is a read-only sysctl and tunable which is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_WR This is a writable sysctl. .It Dv CTLFLAG_RW This sysctl is readable and writable. .It Dv CTLFLAG_RWTUN -This is a readable and writeable sysctl and tunable which is tried +This is a readable and writeable sysctl and tunable which is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_NOFETCH @@ -907,7 +907,7 @@ This sysctl can be written to by processes in When iterating the sysctl name space, do not list this sysctl. .It Dv CTLFLAG_TUN Advisory flag that a system tunable also exists for this variable. -The initial sysctl value is tried fetched once from the system +The initial sysctl value is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_DYN Dynamically created OIDs automatically get this flag set. From nobody Wed Oct 1 15:52:26 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKF713xHz69r4W; Wed, 01 Oct 2025 15:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKF675kBz3NNF; Wed, 01 Oct 2025 15:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759333947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0etwPfaimIU7H3h19Q5KGRY5R8MmhGX0+uo+2AJHOY=; b=K1ILZTHTUSUnkERo3BTgiQVaMTMscndk3sEbcUWXf5y8VkpMKTV6V4UEAJJL8Jp4Roiygx ZeK6XRfK46v1QDW5KTYBhkbM0vELuWpBMVL48rlN6Fle1cqDi3743GrdA0R3PC+uMqvbt5 zFy5cZtJ3UpxuJnh597jqaFDWduYXbQfczPx67kjwqjx+FNeGJUYFGcTHBRlvP7sxl96zo 7ozhOYoowOFBXc7zeGwy4DW1YOQB7KMbIZTMVcXjTiEtuTmdqPiA+c6cAt4pcn2FqqdKNW OFxjN6Fq9Sqpl9mjU9sb+KYRhAKwSU8Ez7bMMnV7vjzRu3PVDtlzwVebP4FhIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759333947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0etwPfaimIU7H3h19Q5KGRY5R8MmhGX0+uo+2AJHOY=; b=e77qE2MDVZoCsXpPF5vW38b7kdkKZBgCSdOkqRuVr8FxrzLbKXdBtOpOQueHbzqdAhlw4c 4f+3XHwAM2e/XV970d7AeI3flIoWoPbEniUQxM6MuvHYR84pw6L081h/SUQcTGlTCDAr+y 1CNuHvh7JUDSRqFbqayTBms+DLzytlI4qaGvefXegq9dJneYmYvOGPLMjOylcdI5bZbboV JE7KYl4Qt9gSBmH4Q9EKxE6CZOYpObPGGaKPGVqoK9+rMWY8gs/4YHIFR6ZqpBBuW04Zyu hBsXL3xvm/7JO87jlF7Ma7DIz/OrmMt+k/voCpmP/CSAawE2OyF86HOihAECqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759333947; a=rsa-sha256; cv=none; b=AJhOJFuU58VgsPJ8Kg2FVoDfu2MHhpTIZOXS3/xcEj1vMlJAwTDlPhY2QzwQm73HXxhlXS UXnky0td4W8KPFkqJ5a7wmBBwV6pwd3QVelw+rZXbl2GhbDHhl8/AKj4oV2oeFzLrZOyUI Kp+q5E71BN7RYlpLlwfDYfCxU1LDnbu0Sd9Gfv2BYvwglFi57oDpxjMylDzLkYb3j+wKiu WcDgV6g9eL0rLkPw+XpFbnpuDZkYMDZaZvaST2sJDZsqapp2kwM2h+5IguSCLMOCb8Gy5P ogriJw68J0D8mv9PZKu2ygA8S4Jj2y3WsFBdirKZIyasquY9m0XTWXvQLxGJTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKF66hcnzD7p; Wed, 01 Oct 2025 15:52: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 591FqQZw035206; Wed, 1 Oct 2025 15:52:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591FqQdT035203; Wed, 1 Oct 2025 15:52:26 GMT (envelope-from git) Date: Wed, 1 Oct 2025 15:52:26 GMT Message-Id: <202510011552.591FqQdT035203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 453baca8fb7e - stable/14 - sysctl.9: Fix grammar in *TUN descriptions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 453baca8fb7e2ca2847117bfd25ca4b84ac97cff Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=453baca8fb7e2ca2847117bfd25ca4b84ac97cff commit 453baca8fb7e2ca2847117bfd25ca4b84ac97cff Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-09-28 08:05:47 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-10-01 15:52:21 +0000 sysctl.9: Fix grammar in *TUN descriptions Reported by: bcr Reviewed by: bcr MFC after: 3 days Event: EuroBSDCon 2025 Fixes: 5eb1caa8c845 Updated SYSCTL manual pages Differential Revision: https://reviews.freebsd.org/D52768 (cherry picked from commit f34e1c76adc5efd9b603cf6b2d5827f7db8c2ed8) --- share/man/man9/sysctl.9 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man9/sysctl.9 b/share/man/man9/sysctl.9 index 44f042b1d789..5e2269418136 100644 --- a/share/man/man9/sysctl.9 +++ b/share/man/man9/sysctl.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 1, 2020 +.Dd September 28, 2025 .Dt SYSCTL 9 .Os .Sh NAME @@ -863,14 +863,14 @@ flags to be set indicating the read and write disposition of the sysctl: .It Dv CTLFLAG_RD This is a read-only sysctl. .It Dv CTLFLAG_RDTUN -This is a read-only sysctl and tunable which is tried fetched once +This is a read-only sysctl and tunable which is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_WR This is a writable sysctl. .It Dv CTLFLAG_RW This sysctl is readable and writable. .It Dv CTLFLAG_RWTUN -This is a readable and writeable sysctl and tunable which is tried +This is a readable and writeable sysctl and tunable which is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_NOFETCH @@ -907,7 +907,7 @@ This sysctl can be written to by processes in When iterating the sysctl name space, do not list this sysctl. .It Dv CTLFLAG_TUN Advisory flag that a system tunable also exists for this variable. -The initial sysctl value is tried fetched once from the system +The initial sysctl value is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_DYN Dynamically created OIDs automatically get this flag set. From nobody Wed Oct 1 15:52:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKFT1RvCz69rNX; Wed, 01 Oct 2025 15:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKFT0hfwz3Nnl; Wed, 01 Oct 2025 15:52:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759333965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wq/cycMUyvCev/UcdiNsXMG9+Sv/vsU1o+L34GNy4VQ=; b=JLzcLiB0kRzzhdv/HSi7CbuAucKGSj2Cbm14dafOCW51VGQ2pxXIGxoL7+3iwu3VikBR53 Zauo6KbwaMiimsNIqYnpIWZUY2sRXksC8U41B0Qx1IjxHubrILdt1Pq5JL7Fnebsl4a85R XpEmhQ7waIXtOZogjGD/QnPW/B2X5Ky11y1DTwD/zVc2Pj+4BNqSz/6zG63XkLn2mGOzw4 qRLjy8kBV0HohI87v6qsRogDKw7s1nX+VM+CQyQlncy+S8TnckPQ0Pc8hR6dZBnAYYZC4v uV1r6RkQ8YtdHUWUk+oTVSQp7ZAhIvOLDhi4MLyUYL6g1L5mzk8UF+Wqew30WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759333965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wq/cycMUyvCev/UcdiNsXMG9+Sv/vsU1o+L34GNy4VQ=; b=RrUEmHwW5OnLeg4fKcSpizkRgBdrmJxWO9TXPGSVfNO/34jarNLbdj3wBZCTLPlGGP2Pee S/uCjFgQ/gMOoPdVsU8EGDDUqUliKJPUag/U8AUN2nt1cCgG8NTu+H+SZodesV2YFam1d2 YqlpbTsrA7xun1jd0r0f3+mjf5To8HzIRulmI5cgrSEg3Kz2LtdMLzZ5SPuSdC+ZFEHTfS WeWpnKBNoCEq7/UhkFfTFo9apZmMJQFtfx3CocTEpBDJ0yigjFwu6uek/XK3JZUZdkcFf/ 0mrhsLnXsoawO2LGvX3zl6iev+f1ApVeSvHAMDsjya5qS+13virx67Q5qfjBqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759333965; a=rsa-sha256; cv=none; b=x+BYorjMZ9wqhqoIUYbp/HQiF6jtCdg75FA8Nsk7aIotYD8lY6pOg9c/Pmhom1cbR2CbwW IyjT6Snwpe1JN4x+2xtXTT+NjhybEMx/gGlzrpqHcd4vAaX0eknEtoH/qUEYTWsacWCfJg h4KiRNrZ0FHfpRDu3n5UgNF6Vsew4Bs1aCuJctqRcenWA+UNJj61DLgNU6kzgGQyJg7ESF ivYN8jO31a5o8A/BlY5BfISksdUCYWAoEYteF3mQx1Mktu9ZEF8AIAksdJBPdEjAsp5Aa7 nJMVitE5wjEZOsQe7YaK1v2povQJpCxTpPzvZWjyWkFfhpAHG4OHvFpVFM65sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKFT0JKyzDF6; Wed, 01 Oct 2025 15:52: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 591FqiKI035416; Wed, 1 Oct 2025 15:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591FqiBf035413; Wed, 1 Oct 2025 15:52:44 GMT (envelope-from git) Date: Wed, 1 Oct 2025 15:52:44 GMT Message-Id: <202510011552.591FqiBf035413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: d7d94b0ab8b1 - stable/13 - sysctl.9: Fix grammar in *TUN descriptions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7d94b0ab8b1a77eca276be5b090171d57f95632 Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=d7d94b0ab8b1a77eca276be5b090171d57f95632 commit d7d94b0ab8b1a77eca276be5b090171d57f95632 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-09-28 08:05:47 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-10-01 15:52:31 +0000 sysctl.9: Fix grammar in *TUN descriptions Reported by: bcr Reviewed by: bcr MFC after: 3 days Event: EuroBSDCon 2025 Fixes: 5eb1caa8c845 Updated SYSCTL manual pages Differential Revision: https://reviews.freebsd.org/D52768 (cherry picked from commit f34e1c76adc5efd9b603cf6b2d5827f7db8c2ed8) --- share/man/man9/sysctl.9 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man9/sysctl.9 b/share/man/man9/sysctl.9 index d6c03623e417..4f334c7bb113 100644 --- a/share/man/man9/sysctl.9 +++ b/share/man/man9/sysctl.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 1, 2020 +.Dd September 28, 2025 .Dt SYSCTL 9 .Os .Sh NAME @@ -855,14 +855,14 @@ flags to be set indicating the read and write disposition of the sysctl: .It Dv CTLFLAG_RD This is a read-only sysctl. .It Dv CTLFLAG_RDTUN -This is a read-only sysctl and tunable which is tried fetched once +This is a read-only sysctl and tunable which is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_WR This is a writable sysctl. .It Dv CTLFLAG_RW This sysctl is readable and writable. .It Dv CTLFLAG_RWTUN -This is a readable and writeable sysctl and tunable which is tried +This is a readable and writeable sysctl and tunable which is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_NOFETCH @@ -899,7 +899,7 @@ This sysctl can be written to by processes in When iterating the sysctl name space, do not list this sysctl. .It Dv CTLFLAG_TUN Advisory flag that a system tunable also exists for this variable. -The initial sysctl value is tried fetched once from the system +The initial sysctl value is fetched once from the system environment early during module load or system boot. .It Dv CTLFLAG_DYN Dynamically created OIDs automatically get this flag set. From nobody Wed Oct 1 16:10:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKfM6P7qz69spM; Wed, 01 Oct 2025 16:10: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKfM3xMMz3PmN; Wed, 01 Oct 2025 16:10:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LK/e2BVnmV2Rfn7kfQ67FNKKtxFwFAbejqhP0cHqrr4=; b=DyOb4sIFVC+ojoT+/h7gtu/uszo7jD2tSvgk7QC37eUD4hYMiYRDRZAbzyPMtzt4ZBsRfJ YlDx0HDT8nJJM7PgEu782RHe1qv6tgeCiitRjSM949FMSGyJlQ+0CRzuAsWXtnyKG3O/8M L2zXbVQ+12gs0/Y02cBFMCAN2nmzWwcR8E9jc0E/ckzaDpmiAIjLOFG7+2nOem/d5ScmRa 5vpqw2c9nmrTabjmzVcjIn5BgV166SwNYcWRtUBjtMJSIKU29NSN1K89U9p/iD9+GkTFOf cU+EXJRpFolowdaWlJ/YyZh8LIj54SACBrttw/4xljV6jJJOskawknXOhP9gaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LK/e2BVnmV2Rfn7kfQ67FNKKtxFwFAbejqhP0cHqrr4=; b=HDbV6OJR3DOiXRG9+5Zf7edoWI3lykpK7+livaBJHiSNHk4WioUbmcC8VUUcgA1hEO4hHU BxmQmZPfRF5gP+VNYh42qEBzmsUrlGk8fU0/CIVADoFmdjlN7eEdTwasmznaMuJwMYAGkI phLuFVq0+RE4S5MJOigQHx0bzkU5bREwhLKS6OeubGiqj0TYr42yN3EoBxlRLJccNuqZaG 4oMEXWvULITwO14HHvkYemT+4wkDLtN69dWgcFU7mOTMcyIxsIwnkQ1C3MdEJxIh2W5u8x VaKCDVQvH4HvbH60Qd3iLWiaF2vFhRDXl4cw9OACuo6S/hHDpr3BMqCwAcKGlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759335051; a=rsa-sha256; cv=none; b=Ve+B9Kr0T+OaIMbHEP4ddCariwwCOCdTv0TVlkSd8XZ0yp7x+UHoF9+w6W0dyKoVUBfy41 JLP04iifXW6g+ZmpcJwUyQBH5venKHWct4DkypxS0eMPbHOv36nuHiCXZC0j3CccKlEcFx PtjKYLneB3U7ewKEa2amQwonoivo5kH21tltVE0clip8dKLpsKz+vtycSxR9KmqbzuBNb5 yEqLU3t6eCvTgIQPcm7Jh5z2j6eOk/ypR30BGit34XIibp+26G7PLNqeNH6a+5VWFNnJUy PsGH7KxFrXfw589foSTgTUq9rOSSsNuNwHP0kb0T2maGrNhO/EM9yx7eKxhGMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKfM3W4dzDJd; Wed, 01 Oct 2025 16:10: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 591GAp9o066085; Wed, 1 Oct 2025 16:10:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GApiK066082; Wed, 1 Oct 2025 16:10:51 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:10:51 GMT Message-Id: <202510011610.591GApiK066082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: e345fb2e91bc - stable/15 - pf: Add pfsync protocol for FreeBSD 15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: e345fb2e91bc6a2aae52c28f303efa0fcef9ad03 Auto-Submitted: auto-generated The branch stable/15 has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=e345fb2e91bc6a2aae52c28f303efa0fcef9ad03 commit e345fb2e91bc6a2aae52c28f303efa0fcef9ad03 Author: Kajetan Staszkiewicz AuthorDate: 2025-08-22 10:44:20 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-10-01 15:59:44 +0000 pf: Add pfsync protocol for FreeBSD 15 A new version of pfsync packet is introduced: 1500. This version solves the issues with data alignment introduced in version 1400 and adds syncing of information needed to sync states created by rules with af-to (original interface, af and proto separate for wire and stack keys), of rt_af needed for prefer-ipv6-nexthop, and of tag names. Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D52176 (cherry picked from commit 99475087d63b4602a0213645bc17d82c3946e2fd) --- contrib/tcpdump/print-pfsync.c | 14 +- share/man/man4/pfsync.4 | 2 + sys/net/if_pfsync.h | 7 +- sys/net/pfvar.h | 62 +++++- sys/netpfil/pf/if_pfsync.c | 219 +++++++++++++++---- sys/netpfil/pf/pf_ioctl.c | 204 ++++++++++++++---- tests/sys/netpfil/pf/pfsync.sh | 466 ++++++++++++++++++++++++++++++++++++++++- usr.bin/netstat/if.c | 12 +- 8 files changed, 883 insertions(+), 103 deletions(-) diff --git a/contrib/tcpdump/print-pfsync.c b/contrib/tcpdump/print-pfsync.c index e4f11930816c..e7885c4a9e00 100644 --- a/contrib/tcpdump/print-pfsync.c +++ b/contrib/tcpdump/print-pfsync.c @@ -102,6 +102,7 @@ struct pfsync_actions { static void pfsync_print_clr(netdissect_options *, const void *); static void pfsync_print_state_1301(netdissect_options *, const void *); static void pfsync_print_state_1400(netdissect_options *, const void *); +static void pfsync_print_state_1500(netdissect_options *, const void *); static void pfsync_print_ins_ack(netdissect_options *, const void *); static void pfsync_print_upd_c(netdissect_options *, const void *); static void pfsync_print_upd_req(netdissect_options *, const void *); @@ -131,6 +132,8 @@ struct pfsync_actions actions[] = { { "eof", 0, NULL }, { "insert", sizeof(struct pfsync_state_1400), pfsync_print_state_1400 }, { "update", sizeof(struct pfsync_state_1400), pfsync_print_state_1400 }, + { "insert", sizeof(struct pfsync_state_1500), pfsync_print_state_1500 }, + { "update", sizeof(struct pfsync_state_1500), pfsync_print_state_1500 }, }; static void @@ -228,12 +231,21 @@ pfsync_print_state_1301(netdissect_options *ndo, const void *bp) static void pfsync_print_state_1400(netdissect_options *ndo, const void *bp) { - struct pfsync_state_1301 *st = (struct pfsync_state_1301 *)bp; + struct pfsync_state_1400 *st = (struct pfsync_state_1400 *)bp; fn_print_char(ndo, '\n'); print_state(ndo, (union pfsync_state_union *)st, PFSYNC_MSG_VERSION_1400); } +static void +pfsync_print_state_1500(netdissect_options *ndo, const void *bp) +{ + struct pfsync_state_1500 *st = (struct pfsync_state_1500 *)bp; + + fn_print_char(ndo, '\n'); + print_state(ndo, (union pfsync_state_union *)st, PFSYNC_MSG_VERSION_1500); +} + static void pfsync_print_ins_ack(netdissect_options *ndo, const void *bp) { diff --git a/share/man/man4/pfsync.4 b/share/man/man4/pfsync.4 index cc9c350ea875..c12bad74831f 100644 --- a/share/man/man4/pfsync.4 +++ b/share/man/man4/pfsync.4 @@ -162,6 +162,8 @@ FreeBSD releases 13.2 and older. Compatibility with FreeBSD 13.1 has been verified. .It Cm 1400 FreeBSD release 14.0. +.It Cm 1500 +FreeBSD release 15.0. .El .Sh SYSCTL VARIABLES The following variables can be entered at the diff --git a/sys/net/if_pfsync.h b/sys/net/if_pfsync.h index e99df0b85ccf..7b3177e1137d 100644 --- a/sys/net/if_pfsync.h +++ b/sys/net/if_pfsync.h @@ -62,9 +62,10 @@ enum pfsync_msg_versions { PFSYNC_MSG_VERSION_UNSPECIFIED = 0, PFSYNC_MSG_VERSION_1301 = 1301, PFSYNC_MSG_VERSION_1400 = 1400, + PFSYNC_MSG_VERSION_1500 = 1500, }; -#define PFSYNC_MSG_VERSION_DEFAULT PFSYNC_MSG_VERSION_1400 +#define PFSYNC_MSG_VERSION_DEFAULT PFSYNC_MSG_VERSION_1500 #define PFSYNC_ACT_CLR 0 /* clear all states */ #define PFSYNC_ACT_INS_1301 1 /* insert state */ @@ -81,7 +82,9 @@ enum pfsync_msg_versions { #define PFSYNC_ACT_EOF 12 /* end of frame */ #define PFSYNC_ACT_INS_1400 13 /* insert state */ #define PFSYNC_ACT_UPD_1400 14 /* update state */ -#define PFSYNC_ACT_MAX 15 +#define PFSYNC_ACT_INS_1500 15 /* insert state */ +#define PFSYNC_ACT_UPD_1500 16 /* update state */ +#define PFSYNC_ACT_MAX 17 /* * A pfsync frame is built from a header followed by several sections which diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index f73420494000..8c0e9b057a4f 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -452,6 +452,16 @@ VNET_DECLARE(struct rmlock, pf_rules_lock); #define PF_RULES_RASSERT() rm_assert(&V_pf_rules_lock, RA_RLOCKED) #define PF_RULES_WASSERT() rm_assert(&V_pf_rules_lock, RA_WLOCKED) +VNET_DECLARE(struct rmlock, pf_tags_lock); +#define V_pf_tags_lock VNET(pf_tags_lock) + +#define PF_TAGS_RLOCK_TRACKER struct rm_priotracker _pf_tags_tracker +#define PF_TAGS_RLOCK() rm_rlock(&V_pf_tags_lock, &_pf_tags_tracker) +#define PF_TAGS_RUNLOCK() rm_runlock(&V_pf_tags_lock, &_pf_tags_tracker) +#define PF_TAGS_WLOCK() rm_wlock(&V_pf_tags_lock) +#define PF_TAGS_WUNLOCK() rm_wunlock(&V_pf_tags_lock) +#define PF_TAGS_WASSERT() rm_assert(&V_pf_tags_lock, RA_WLOCKED) + extern struct mtx_padalign pf_table_stats_lock; #define PF_TABLE_STATS_LOCK() mtx_lock(&pf_table_stats_lock) #define PF_TABLE_STATS_UNLOCK() mtx_unlock(&pf_table_stats_lock) @@ -1209,11 +1219,11 @@ struct pfsync_state_1301 { u_int8_t state_flags; u_int8_t timeout; u_int8_t sync_flags; - u_int8_t updates; + u_int8_t updates; /* unused */ } __packed; struct pfsync_state_1400 { - /* The beginning of the struct is compatible with previous versions */ + /* The beginning of the struct is compatible with pfsync_state_1301 */ u_int64_t id; char ifname[IFNAMSIZ]; struct pfsync_state_key key[2]; @@ -1236,7 +1246,7 @@ struct pfsync_state_1400 { u_int8_t __spare; u_int8_t timeout; u_int8_t sync_flags; - u_int8_t updates; + u_int8_t updates; /* unused */ /* The rest is not */ u_int16_t qid; u_int16_t pqid; @@ -1249,12 +1259,54 @@ struct pfsync_state_1400 { u_int8_t set_prio[2]; u_int8_t rt; char rt_ifname[IFNAMSIZ]; +} __packed; +struct pfsync_state_1500 { + /* The beginning of the struct is compatible with pfsync_state_1301 */ + u_int64_t id; + char ifname[IFNAMSIZ]; + struct pfsync_state_key key[2]; + struct pf_state_peer_export src; + struct pf_state_peer_export dst; + struct pf_addr rt_addr; + u_int32_t rule; + u_int32_t anchor; + u_int32_t nat_rule; + u_int32_t creation; + u_int32_t expire; + u_int32_t packets[2][2]; + u_int32_t bytes[2][2]; + u_int32_t creatorid; + /* The rest is not, use the opportunity to fix alignment */ + char tagname[PF_TAG_NAME_SIZE]; + char rt_ifname[IFNAMSIZ]; + char orig_ifname[IFNAMSIZ]; + int32_t rtableid; + u_int16_t state_flags; + u_int16_t qid; + u_int16_t pqid; + u_int16_t dnpipe; + u_int16_t dnrpipe; + u_int16_t max_mss; + sa_family_t wire_af; + sa_family_t stack_af; + sa_family_t rt_af; + u_int8_t wire_proto; + u_int8_t stack_proto; + u_int8_t log; + u_int8_t timeout; + u_int8_t direction; + u_int8_t rt; + u_int8_t min_ttl; + u_int8_t set_tos; + u_int8_t set_prio[2]; + u_int8_t spare[3]; /* Improve struct alignment */ } __packed; union pfsync_state_union { struct pfsync_state_1301 pfs_1301; struct pfsync_state_1400 pfs_1400; + struct pfsync_state_1500 pfs_1500; } __packed; #ifdef _KERNEL @@ -2462,6 +2514,10 @@ int pf_translate(struct pf_pdesc *, struct pf_addr *, u_int16_t, struct pf_addr *, u_int16_t, u_int16_t, int); int pf_translate_af(struct pf_pdesc *); bool pf_init_threshold(struct pf_kthreshold *, uint32_t, uint32_t); +uint16_t pf_tagname2tag(const char *); +#ifdef ALTQ +uint16_t pf_qname2qid(const char *, bool); +#endif /* ALTQ */ void pfr_initialize(void); void pfr_cleanup(void); diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 7b9405ee1f8d..66bc99df2afa 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -153,6 +153,8 @@ static int (*pfsync_acts[])(struct mbuf *, int, int, int, int) = { pfsync_in_eof, /* PFSYNC_ACT_EOF */ pfsync_in_ins, /* PFSYNC_ACT_INS_1400 */ pfsync_in_upd, /* PFSYNC_ACT_UPD_1400 */ + pfsync_in_ins, /* PFSYNC_ACT_INS_1500 */ + pfsync_in_upd, /* PFSYNC_ACT_UPD_1500 */ }; struct pfsync_q { @@ -165,9 +167,11 @@ struct pfsync_q { enum pfsync_q_id { PFSYNC_Q_INS_1301, PFSYNC_Q_INS_1400, + PFSYNC_Q_INS_1500, PFSYNC_Q_IACK, PFSYNC_Q_UPD_1301, PFSYNC_Q_UPD_1400, + PFSYNC_Q_UPD_1500, PFSYNC_Q_UPD_C, PFSYNC_Q_DEL_C, PFSYNC_Q_COUNT, @@ -176,6 +180,7 @@ enum pfsync_q_id { /* Functions for building messages for given queue */ static void pfsync_out_state_1301(struct pf_kstate *, void *); static void pfsync_out_state_1400(struct pf_kstate *, void *); +static void pfsync_out_state_1500(struct pf_kstate *, void *); static void pfsync_out_iack(struct pf_kstate *, void *); static void pfsync_out_upd_c(struct pf_kstate *, void *); static void pfsync_out_del_c(struct pf_kstate *, void *); @@ -184,9 +189,11 @@ static void pfsync_out_del_c(struct pf_kstate *, void *); static struct pfsync_q pfsync_qs[] = { { pfsync_out_state_1301, sizeof(struct pfsync_state_1301), PFSYNC_ACT_INS_1301 }, { pfsync_out_state_1400, sizeof(struct pfsync_state_1400), PFSYNC_ACT_INS_1400 }, + { pfsync_out_state_1500, sizeof(struct pfsync_state_1500), PFSYNC_ACT_INS_1500 }, { pfsync_out_iack, sizeof(struct pfsync_ins_ack), PFSYNC_ACT_INS_ACK }, { pfsync_out_state_1301, sizeof(struct pfsync_state_1301), PFSYNC_ACT_UPD_1301 }, { pfsync_out_state_1400, sizeof(struct pfsync_state_1400), PFSYNC_ACT_UPD_1400 }, + { pfsync_out_state_1500, sizeof(struct pfsync_state_1500), PFSYNC_ACT_UPD_1500 }, { pfsync_out_upd_c, sizeof(struct pfsync_upd_c), PFSYNC_ACT_UPD_C }, { pfsync_out_del_c, sizeof(struct pfsync_del_c), PFSYNC_ACT_DEL_C } }; @@ -195,9 +202,11 @@ static struct pfsync_q pfsync_qs[] = { static u_int8_t pfsync_qid_sstate[] = { PFSYNC_S_INS, /* PFSYNC_Q_INS_1301 */ PFSYNC_S_INS, /* PFSYNC_Q_INS_1400 */ + PFSYNC_S_INS, /* PFSYNC_Q_INS_1500 */ PFSYNC_S_IACK, /* PFSYNC_Q_IACK */ PFSYNC_S_UPD, /* PFSYNC_Q_UPD_1301 */ PFSYNC_S_UPD, /* PFSYNC_Q_UPD_1400 */ + PFSYNC_S_UPD, /* PFSYNC_Q_UPD_1500 */ PFSYNC_S_UPD_C, /* PFSYNC_Q_UPD_C */ PFSYNC_S_DEL_C, /* PFSYNC_Q_DEL_C */ }; @@ -525,13 +534,15 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) struct pf_kstate *st = NULL; struct pf_state_key *skw = NULL, *sks = NULL; struct pf_krule *r = NULL; - struct pfi_kkif *kif; + struct pfi_kkif *kif, *orig_kif; struct pfi_kkif *rt_kif = NULL; struct pf_kpooladdr *rpool_first; int error; + int n = 0; sa_family_t rt_af = 0; uint8_t rt = 0; - int n = 0; + sa_family_t wire_af, stack_af; + u_int8_t wire_proto, stack_proto; PF_RULES_RASSERT(); @@ -542,7 +553,11 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) return (EINVAL); } - if ((kif = pfi_kkif_find(sp->pfs_1301.ifname)) == NULL) { + /* + * Check interfaces early on. Do it before allocating memory etc. + * Because there is a high chance there will be a lot more such states. + */ + if ((kif = orig_kif = pfi_kkif_find(sp->pfs_1301.ifname)) == NULL) { if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: unknown interface: %s\n", __func__, sp->pfs_1301.ifname); @@ -551,6 +566,30 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) return (0); /* skip this state */ } + /* + * States created with floating interface policy can be synchronized to + * hosts with different interfaces, because they are bound to V_pfi_all. + * But s->orig_kif still points to a real interface. Don't abort + * importing the state if orig_kif does not exists on the importing host + * but the state is not interface-bound. + */ + if (msg_version == PFSYNC_MSG_VERSION_1500) { + orig_kif = pfi_kkif_find(sp->pfs_1500.orig_ifname); + if (orig_kif == NULL) { + if (kif == V_pfi_all) { + orig_kif = kif; + } else { + if (V_pf_status.debug >= PF_DEBUG_MISC) + printf("%s: unknown original interface:" + " %s\n", __func__, + sp->pfs_1500.orig_ifname); + if (flags & PFSYNC_SI_IOCTL) + return (EINVAL); + return (0); /* skip this state */ + } + } + } + /* * If the ruleset checksums match or the state is coming from the ioctl, * it's safe to associate the state with the rule of that number. @@ -565,10 +604,6 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) } else r = &V_pf_default_rule; - /* - * Check routing interface early on. Do it before allocating memory etc. - * because there is a high chance there will be a lot more such states. - */ switch (msg_version) { case PFSYNC_MSG_VERSION_1301: /* @@ -619,10 +654,12 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) "because of different ruleset", __func__); return ((flags & PFSYNC_SI_IOCTL) ? EINVAL : 0); } + wire_af = stack_af = sp->pfs_1301.af; + wire_proto = stack_proto = sp->pfs_1301.proto; break; case PFSYNC_MSG_VERSION_1400: /* - * On FreeBSD 14 and above we're not taking any chances. + * On FreeBSD 14 we're not taking any chances. * We use the information synced to us. */ if (sp->pfs_1400.rt) { @@ -641,6 +678,29 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) */ rt_af = sp->pfs_1400.af; } + wire_af = stack_af = sp->pfs_1400.af; + wire_proto = stack_proto = sp->pfs_1400.proto; + break; + case PFSYNC_MSG_VERSION_1500: + /* + * On FreeBSD 15 and above we're not taking any chances. + * We use the information synced to us. + */ + if (sp->pfs_1500.rt) { + rt_kif = pfi_kkif_find(sp->pfs_1500.rt_ifname); + if (rt_kif == NULL) { + DPFPRINTF(PF_DEBUG_MISC, + "%s: unknown route interface: %s", + __func__, sp->pfs_1500.rt_ifname); + return ((flags & PFSYNC_SI_IOCTL) ? EINVAL : 0); + } + rt = sp->pfs_1500.rt; + rt_af = sp->pfs_1500.rt_af; + } + wire_af = sp->pfs_1500.wire_af; + stack_af = sp->pfs_1500.stack_af; + wire_proto = sp->pfs_1500.wire_proto; + stack_proto = sp->pfs_1500.stack_proto; break; } @@ -667,8 +727,9 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) ks = &sp->pfs_1301.key[PF_SK_STACK]; #endif - if (PF_ANEQ(&kw->addr[0], &ks->addr[0], sp->pfs_1301.af) || - PF_ANEQ(&kw->addr[1], &ks->addr[1], sp->pfs_1301.af) || + if (wire_af != stack_af || + PF_ANEQ(&kw->addr[0], &ks->addr[0], wire_af) || + PF_ANEQ(&kw->addr[1], &ks->addr[1], wire_af) || kw->port[0] != ks->port[0] || kw->port[1] != ks->port[1]) { sks = uma_zalloc(V_pf_state_key_z, M_NOWAIT); @@ -687,36 +748,19 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) skw->addr[1] = kw->addr[1]; skw->port[0] = kw->port[0]; skw->port[1] = kw->port[1]; - skw->proto = sp->pfs_1301.proto; - skw->af = sp->pfs_1301.af; + skw->proto = wire_proto; + skw->af = wire_af; if (sks != skw) { sks->addr[0] = ks->addr[0]; sks->addr[1] = ks->addr[1]; sks->port[0] = ks->port[0]; sks->port[1] = ks->port[1]; - sks->proto = sp->pfs_1301.proto; - sks->af = sp->pfs_1301.af; + sks->proto = stack_proto; + sks->af = stack_af; } /* copy to state */ - bcopy(&sp->pfs_1301.rt_addr, &st->act.rt_addr, sizeof(st->act.rt_addr)); st->creation = (time_uptime - ntohl(sp->pfs_1301.creation)) * 1000; - st->expire = pf_get_uptime(); - if (sp->pfs_1301.expire) { - uint32_t timeout; - - timeout = r->timeout[sp->pfs_1301.timeout]; - if (!timeout) - timeout = V_pf_default_rule.timeout[sp->pfs_1301.timeout]; - - /* sp->expire may have been adaptively scaled by export. */ - st->expire -= (timeout - ntohl(sp->pfs_1301.expire)) * 1000; - } - - st->direction = sp->pfs_1301.direction; - st->act.log = sp->pfs_1301.log; - st->timeout = sp->pfs_1301.timeout; - st->act.rt = rt; st->act.rt_kif = rt_kif; st->act.rt_af = rt_af; @@ -724,6 +768,12 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) switch (msg_version) { case PFSYNC_MSG_VERSION_1301: st->state_flags = sp->pfs_1301.state_flags; + st->direction = sp->pfs_1301.direction; + st->act.log = sp->pfs_1301.log; + st->timeout = sp->pfs_1301.timeout; + if (rt) + bcopy(&sp->pfs_1301.rt_addr, &st->act.rt_addr, + sizeof(st->act.rt_addr)); /* * In FreeBSD 13 pfsync lacks many attributes. Copy them * from the rule if possible. If rule can't be matched @@ -762,6 +812,9 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) break; case PFSYNC_MSG_VERSION_1400: st->state_flags = ntohs(sp->pfs_1400.state_flags); + st->direction = sp->pfs_1400.direction; + st->act.log = sp->pfs_1400.log; + st->timeout = sp->pfs_1400.timeout; st->act.qid = ntohs(sp->pfs_1400.qid); st->act.pqid = ntohs(sp->pfs_1400.pqid); st->act.dnpipe = ntohs(sp->pfs_1400.dnpipe); @@ -772,12 +825,47 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) st->act.max_mss = ntohs(sp->pfs_1400.max_mss); st->act.set_prio[0] = sp->pfs_1400.set_prio[0]; st->act.set_prio[1] = sp->pfs_1400.set_prio[1]; + if (rt) + bcopy(&sp->pfs_1400.rt_addr, &st->act.rt_addr, + sizeof(st->act.rt_addr)); + break; + case PFSYNC_MSG_VERSION_1500: + st->state_flags = ntohs(sp->pfs_1500.state_flags); + st->direction = sp->pfs_1500.direction; + st->act.log = sp->pfs_1500.log; + st->timeout = sp->pfs_1500.timeout; + st->act.qid = ntohs(sp->pfs_1500.qid); + st->act.pqid = ntohs(sp->pfs_1500.pqid); + st->act.dnpipe = ntohs(sp->pfs_1500.dnpipe); + st->act.dnrpipe = ntohs(sp->pfs_1500.dnrpipe); + st->act.rtableid = ntohl(sp->pfs_1500.rtableid); + st->act.min_ttl = sp->pfs_1500.min_ttl; + st->act.set_tos = sp->pfs_1500.set_tos; + st->act.max_mss = ntohs(sp->pfs_1500.max_mss); + st->act.set_prio[0] = sp->pfs_1500.set_prio[0]; + st->act.set_prio[1] = sp->pfs_1500.set_prio[1]; + if (rt) + bcopy(&sp->pfs_1500.rt_addr, &st->act.rt_addr, + sizeof(st->act.rt_addr)); + if (sp->pfs_1500.tagname[0] != 0) + st->tag = pf_tagname2tag(sp->pfs_1500.tagname); break; default: panic("%s: Unsupported pfsync_msg_version %d", __func__, msg_version); } + st->expire = pf_get_uptime(); + if (sp->pfs_1301.expire) { + uint32_t timeout; + timeout = r->timeout[st->timeout]; + if (!timeout) + timeout = V_pf_default_rule.timeout[st->timeout]; + + /* sp->expire may have been adaptively scaled by export. */ + st->expire -= (timeout - ntohl(sp->pfs_1301.expire)) * 1000; + } + if (! (st->act.rtableid == -1 || (st->act.rtableid >= 0 && st->act.rtableid < rt_numfibs))) goto cleanup; @@ -797,7 +885,7 @@ pfsync_state_import(union pfsync_state_union *sp, int flags, int msg_version) if (!(flags & PFSYNC_SI_IOCTL)) st->state_flags |= PFSTATE_NOSYNC; - if ((error = pf_state_insert(kif, kif, skw, sks, st)) != 0) + if ((error = pf_state_insert(kif, orig_kif, skw, sks, st)) != 0) goto cleanup_state; /* XXX when we have nat_rule/anchors, use STATE_INC_COUNTERS */ @@ -1089,23 +1177,29 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) struct mbuf *mp; union pfsync_state_union *sa, *sp; int i, offp, total_len, msg_version, msg_len; + u_int8_t timeout, direction; + sa_family_t af; switch (action) { case PFSYNC_ACT_INS_1301: msg_len = sizeof(struct pfsync_state_1301); - total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1301; break; case PFSYNC_ACT_INS_1400: msg_len = sizeof(struct pfsync_state_1400); - total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1400; break; + case PFSYNC_ACT_INS_1500: + msg_len = sizeof(struct pfsync_state_1500); + msg_version = PFSYNC_MSG_VERSION_1500; + break; default: V_pfsyncstats.pfsyncs_badver++; return (-1); } + total_len = msg_len * count; + mp = m_pulldown(m, offset, total_len, &offp); if (mp == NULL) { V_pfsyncstats.pfsyncs_badlen++; @@ -1116,13 +1210,26 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) for (i = 0; i < count; i++) { sp = (union pfsync_state_union *)((char *)sa + msg_len * i); + switch (msg_version) { + case PFSYNC_MSG_VERSION_1301: + case PFSYNC_MSG_VERSION_1400: + af = sp->pfs_1301.af; + timeout = sp->pfs_1301.timeout; + direction = sp->pfs_1301.direction; + break; + case PFSYNC_MSG_VERSION_1500: + af = sp->pfs_1500.wire_af; + timeout = sp->pfs_1500.timeout; + direction = sp->pfs_1500.direction; + break; + } + /* Check for invalid values. */ - if (sp->pfs_1301.timeout >= PFTM_MAX || + if (timeout >= PFTM_MAX || sp->pfs_1301.src.state > PF_TCPS_PROXY_DST || sp->pfs_1301.dst.state > PF_TCPS_PROXY_DST || - sp->pfs_1301.direction > PF_OUT || - (sp->pfs_1301.af != AF_INET && - sp->pfs_1301.af != AF_INET6)) { + direction > PF_OUT || + (af != AF_INET && af != AF_INET6)) { if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: invalid value\n", __func__); V_pfsyncstats.pfsyncs_badval++; @@ -1215,23 +1322,28 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) struct pf_kstate *st; struct mbuf *mp; int sync, offp, i, total_len, msg_len, msg_version; + u_int8_t timeout; switch (action) { case PFSYNC_ACT_UPD_1301: msg_len = sizeof(struct pfsync_state_1301); - total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1301; break; case PFSYNC_ACT_UPD_1400: msg_len = sizeof(struct pfsync_state_1400); - total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1400; break; + case PFSYNC_ACT_UPD_1500: + msg_len = sizeof(struct pfsync_state_1500); + msg_version = PFSYNC_MSG_VERSION_1500; + break; default: V_pfsyncstats.pfsyncs_badact++; return (-1); } + total_len = msg_len * count; + mp = m_pulldown(m, offset, total_len, &offp); if (mp == NULL) { V_pfsyncstats.pfsyncs_badlen++; @@ -1242,8 +1354,18 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) for (i = 0; i < count; i++) { sp = (union pfsync_state_union *)((char *)sa + msg_len * i); + switch (msg_version) { + case PFSYNC_MSG_VERSION_1301: + case PFSYNC_MSG_VERSION_1400: + timeout = sp->pfs_1301.timeout; + break; + case PFSYNC_MSG_VERSION_1500: + timeout = sp->pfs_1500.timeout; + break; + } + /* check for invalid values */ - if (sp->pfs_1301.timeout >= PFTM_MAX || + if (timeout >= PFTM_MAX || sp->pfs_1301.src.state > PF_TCPS_PROXY_DST || sp->pfs_1301.dst.state > PF_TCPS_PROXY_DST) { if (V_pf_status.debug >= PF_DEBUG_MISC) { @@ -1288,7 +1410,7 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) pfsync_alloc_scrub_memory(&sp->pfs_1301.dst, &st->dst); pf_state_peer_ntoh(&sp->pfs_1301.dst, &st->dst); st->expire = pf_get_uptime(); - st->timeout = sp->pfs_1301.timeout; + st->timeout = timeout; } st->pfsync_time = time_uptime; @@ -1788,6 +1910,14 @@ pfsync_out_state_1400(struct pf_kstate *st, void *buf) pfsync_state_export(sp, st, PFSYNC_MSG_VERSION_1400); } +static void +pfsync_out_state_1500(struct pf_kstate *st, void *buf) +{ + union pfsync_state_union *sp = buf; + + pfsync_state_export(sp, st, PFSYNC_MSG_VERSION_1500); +} + static void pfsync_out_iack(struct pf_kstate *st, void *buf) { @@ -2455,6 +2585,8 @@ pfsync_sstate_to_qid(u_int8_t sync_state) return PFSYNC_Q_INS_1301; case PFSYNC_MSG_VERSION_1400: return PFSYNC_Q_INS_1400; + case PFSYNC_MSG_VERSION_1500: + return PFSYNC_Q_INS_1500; } break; case PFSYNC_S_IACK: @@ -2465,6 +2597,8 @@ pfsync_sstate_to_qid(u_int8_t sync_state) return PFSYNC_Q_UPD_1301; case PFSYNC_MSG_VERSION_1400: return PFSYNC_Q_UPD_1400; + case PFSYNC_MSG_VERSION_1500: + return PFSYNC_Q_UPD_1500; } break; case PFSYNC_S_UPD_C: @@ -3021,6 +3155,7 @@ pfsync_kstatus_to_softc(struct pfsync_kstatus *status, struct pfsync_softc *sc) break; case PFSYNC_MSG_VERSION_1301: case PFSYNC_MSG_VERSION_1400: + case PFSYNC_MSG_VERSION_1500: sc->sc_version = status->version; break; default: diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index c7aa3e1822e7..d7bb62977afb 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -116,7 +116,6 @@ static int pf_rollback_altq(u_int32_t); static int pf_commit_altq(u_int32_t); static int pf_enable_altq(struct pf_altq *); static int pf_disable_altq(struct pf_altq *); -static uint16_t pf_qname2qid(const char *); static void pf_qid_unref(uint16_t); #endif /* ALTQ */ static int pf_begin_rules(u_int32_t *, int, const char *); @@ -214,8 +213,7 @@ static void pf_init_tagset(struct pf_tagset *, unsigned int *, static void pf_cleanup_tagset(struct pf_tagset *); static uint16_t tagname2hashindex(const struct pf_tagset *, const char *); static uint16_t tag2hashindex(const struct pf_tagset *, uint16_t); -static u_int16_t tagname2tag(struct pf_tagset *, const char *); -static u_int16_t pf_tagname2tag(const char *); +static u_int16_t tagname2tag(struct pf_tagset *, const char *, bool); static void tag_unref(struct pf_tagset *, u_int16_t); struct cdev *pf_dev; @@ -286,6 +284,7 @@ int pf_end_threads; struct proc *pf_purge_proc; VNET_DEFINE(struct rmlock, pf_rules_lock); +VNET_DEFINE(struct rmlock, pf_tags_lock); VNET_DEFINE_STATIC(struct sx, pf_ioctl_lock); #define V_pf_ioctl_lock VNET(pf_ioctl_lock) struct sx pf_end_lock; @@ -685,19 +684,50 @@ tag2hashindex(const struct pf_tagset *ts, uint16_t tag) } static u_int16_t -tagname2tag(struct pf_tagset *ts, const char *tagname) +tagname2tag(struct pf_tagset *ts, const char *tagname, bool add_new) { struct pf_tagname *tag; u_int32_t index; u_int16_t new_tagid; - PF_RULES_WASSERT(); + PF_TAGS_RLOCK_TRACKER; + + PF_TAGS_RLOCK(); index = tagname2hashindex(ts, tagname); TAILQ_FOREACH(tag, &ts->namehash[index], namehash_entries) if (strcmp(tagname, tag->name) == 0) { tag->ref++; - return (tag->tag); + new_tagid = tag->tag; + PF_TAGS_RUNLOCK(); + return (new_tagid); + } + + /* + * When used for pfsync with queues we must not create new entries. + * Pf tags can be created just fine by this function, but queues + * require additional configuration. If they are missing on the target + * system we just ignore them + */ + if (add_new == false) { + printf("%s: Not creating a new tag\n", __func__); + PF_TAGS_RUNLOCK(); + return (0); + } + + /* + * If a new entry must be created do it under a write lock. + * But first search again, somebody could have created the tag + * between unlocking the read lock and locking the write lock. + */ + PF_TAGS_RUNLOCK(); + PF_TAGS_WLOCK(); + TAILQ_FOREACH(tag, &ts->namehash[index], namehash_entries) + if (strcmp(tagname, tag->name) == 0) { + tag->ref++; + new_tagid = tag->tag; + PF_TAGS_WUNLOCK(); + return (new_tagid); } /* @@ -714,16 +744,20 @@ tagname2tag(struct pf_tagset *ts, const char *tagname) * to rounding of the number of bits in the vector up to a multiple * of the vector word size at declaration/allocation time. */ - if ((new_tagid == 0) || (new_tagid > TAGID_MAX)) + if ((new_tagid == 0) || (new_tagid > TAGID_MAX)) { + PF_TAGS_WUNLOCK(); return (0); + } /* Mark the tag as in use. Bits are 0-based for BIT_CLR() */ BIT_CLR(TAGID_MAX, new_tagid - 1, &ts->avail); /* allocate and fill new struct pf_tagname */ tag = uma_zalloc(V_pf_tag_z, M_NOWAIT); - if (tag == NULL) + if (tag == NULL) { + PF_TAGS_WUNLOCK(); return (0); + } strlcpy(tag->name, tagname, sizeof(tag->name)); tag->tag = new_tagid; tag->ref = 1; @@ -735,7 +769,29 @@ tagname2tag(struct pf_tagset *ts, const char *tagname) index = tag2hashindex(ts, new_tagid); TAILQ_INSERT_TAIL(&ts->taghash[index], tag, taghash_entries); - return (tag->tag); + PF_TAGS_WUNLOCK(); + return (new_tagid); +} + +static char * +tag2tagname(struct pf_tagset *ts, u_int16_t tag) +{ + struct pf_tagname *t; + uint16_t index; + + PF_TAGS_RLOCK_TRACKER; + + PF_TAGS_RLOCK(); + + index = tag2hashindex(ts, tag); + TAILQ_FOREACH(t, &ts->taghash[index], taghash_entries) + if (tag == t->tag) { + PF_TAGS_RUNLOCK(); + return (t->name); + } + + PF_TAGS_RUNLOCK(); + return (NULL); } static void @@ -744,7 +800,7 @@ tag_unref(struct pf_tagset *ts, u_int16_t tag) struct pf_tagname *t; uint16_t index; - PF_RULES_WASSERT(); + PF_TAGS_WLOCK(); index = tag2hashindex(ts, tag); TAILQ_FOREACH(t, &ts->taghash[index], taghash_entries) @@ -761,12 +817,20 @@ tag_unref(struct pf_tagset *ts, u_int16_t tag) } break; } + + PF_TAGS_WUNLOCK(); } -static uint16_t +uint16_t pf_tagname2tag(const char *tagname) { - return (tagname2tag(&V_pf_tags, tagname)); + return (tagname2tag(&V_pf_tags, tagname, true)); +} + +static const char * +pf_tag2tagname(uint16_t tag) +{ + return (tag2tagname(&V_pf_tags, tag)); } static int @@ -897,10 +961,16 @@ pf_commit_eth(uint32_t ticket, const char *anchor) } #ifdef ALTQ -static uint16_t -pf_qname2qid(const char *qname) +uint16_t +pf_qname2qid(const char *qname, bool add_new) +{ + return (tagname2tag(&V_pf_qids, qname, add_new)); +} + +static const char * +pf_qid2qname(uint16_t qid) { - return (tagname2tag(&V_pf_qids, qname)); + return (tag2tagname(&V_pf_qids, qid)); } static void @@ -1149,7 +1219,7 @@ pf_altq_ifnet_event(struct ifnet *ifp, int remove) } bcopy(a1, a2, sizeof(struct pf_altq)); - if ((a2->qid = pf_qname2qid(a2->qname)) == 0) { + if ((a2->qid = pf_qname2qid(a2->qname, true)) == 0) { error = EBUSY; free(a2, M_PFALTQ); break; @@ -1604,7 +1674,7 @@ pf_export_kaltq(struct pf_altq *q, struct pfioc_altq_v1 *pa, size_t ioc_size) #define ASSIGN_OPT(x) exported_q->pq_u.hfsc_opts.x = q->pq_u.hfsc_opts.x #define ASSIGN_OPT_SATU32(x) exported_q->pq_u.hfsc_opts.x = \ SATU32(q->pq_u.hfsc_opts.x) - + ASSIGN_OPT_SATU32(rtsc_m1); ASSIGN_OPT(rtsc_d); ASSIGN_OPT_SATU32(rtsc_m2); @@ -1618,7 +1688,7 @@ pf_export_kaltq(struct pf_altq *q, struct pfioc_altq_v1 *pa, size_t ioc_size) ASSIGN_OPT_SATU32(ulsc_m2); ASSIGN_OPT(flags); - + #undef ASSIGN_OPT #undef ASSIGN_OPT_SATU32 } else @@ -1726,7 +1796,7 @@ pf_import_kaltq(struct pfioc_altq_v1 *pa, struct pf_altq *q, size_t ioc_size) ASSIGN_OPT(ulsc_m2); ASSIGN_OPT(flags); - + #undef ASSIGN_OPT } else COPY(pq_u); @@ -1758,7 +1828,7 @@ pf_import_kaltq(struct pfioc_altq_v1 *pa, struct pf_altq *q, size_t ioc_size) ASSIGN(qid); break; } - default: + default: panic("%s: unhandled struct pfioc_altq version", __func__); break; } @@ -2189,11 +2259,11 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket, #ifdef ALTQ /* set queue IDs */ if (rule->qname[0] != 0) { - if ((rule->qid = pf_qname2qid(rule->qname)) == 0) + if ((rule->qid = pf_qname2qid(rule->qname, true)) == 0) ERROUT(EBUSY); else if (rule->pqname[0] != 0) { if ((rule->pqid = - pf_qname2qid(rule->pqname)) == 0) + pf_qname2qid(rule->pqname, true)) == 0) ERROUT(EBUSY); } else rule->pqid = rule->qid; @@ -3310,7 +3380,7 @@ DIOCGETETHRULE_error: #ifdef ALTQ /* set queue IDs */ if (rule->qname[0] != 0) { - if ((rule->qid = pf_qname2qid(rule->qname)) == 0) + if ((rule->qid = pf_qname2qid(rule->qname, true)) == 0) error = EBUSY; else rule->qid = rule->qid; @@ -3861,11 +3931,11 @@ DIOCGETRULENV_error: /* set queue IDs */ if (newrule->qname[0] != 0) { if ((newrule->qid = - pf_qname2qid(newrule->qname)) == 0) + pf_qname2qid(newrule->qname, true)) == 0) error = EBUSY; else if (newrule->pqname[0] != 0) { if ((newrule->pqid = - pf_qname2qid(newrule->pqname)) == 0) + pf_qname2qid(newrule->pqname, true)) == 0) error = EBUSY; } else newrule->pqid = newrule->qid; @@ -4396,7 +4466,7 @@ DIOCGETSTATESV2_full: * copy the necessary fields */ if (altq->qname[0] != 0) { - if ((altq->qid = pf_qname2qid(altq->qname)) == 0) { + if ((altq->qid = pf_qname2qid(altq->qname, true)) == 0) { PF_RULES_WUNLOCK(); error = EBUSY; free(altq, M_PFALTQ); @@ -5719,6 +5789,7 @@ fail: void pfsync_state_export(union pfsync_state_union *sp, struct pf_kstate *st, int msg_version) { + const char *tagname; bzero(sp, sizeof(union pfsync_state_union)); *** 682 LINES SKIPPED *** From nobody Wed Oct 1 16:10:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKfN5N7Rz69sPj; Wed, 01 Oct 2025 16:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKfN4bpLz3Pw7; Wed, 01 Oct 2025 16:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yKjQSd280hYRW0kf+E+cnp8uBGEN90wNKe7VwzuujdY=; b=gnGw90rdOxM3v/ULbyqd8NkOpi/mFvE8SC9GBbINpLzvclR9nD93ywrrfctHglTCBlfW+N xq4PIqeL0PcpYw1EUoRa4e0MLBxXMkSuBchHVUle6ka0EcxZgGVQ/RYU770HckEvpYbQ5N 3hymXkBSllpDUi9C5V3WX8zqFoLjRbwEdkk9QpA9gkCfXBPLR0kxt0zuhaNMaPaFpRpq5l KH7i3hpjSrIChCQaNkIUZLIVMkLQsrLpjALR6ZFB/vsD+6NZZrA7f7X24x09Qruv9eGiqL sGYvrSR/wTy/XGQyb4Ly4dQSE5wqiZhSlZDzxJ6UH4ldvbhu59Y+2mT7jVLaIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yKjQSd280hYRW0kf+E+cnp8uBGEN90wNKe7VwzuujdY=; b=Kre7NXOl2ooRtLNMQ/kRQIpteUFYRflo7d48YawfMiOe0QeQ3K8DjOMpTLd5szf66bNG5S wB6/3K4LImnQhH38piUA5qrrvb47giJGTV9BQY7H5YXsz6wVFmSnKeYA5Y/NeRUr78t7zI 85z07UjRLJCig9g/YP2c90dbA1Mqa+ExCj41sBvbEaTvXeqjk3e9mAZX/0VK4Nr4nqZ6uu 5TCLJ1P2+pt4YK+AugNc6u7BxjJMl4333N3iNsdz/44zG+5Ai1yoW7krKF+CZIsWF4ICrQ HmGuGUmg8Cx9qq7TFyFo8VZWqKXHlAiwRMO+uzSnJHnXgLScIfylCyLyJOuXjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759335052; a=rsa-sha256; cv=none; b=Bu+MX/0K2gD5UX4ORvfstTghzYv5liXBYhkKR1kVRDzfmzkH/qJir7KItuvGbgR4o8B+jy n3j4xT0r27Yr2flKybNsDnVwFXZaSTe7lgYujx5qz/TjNksTEV/ADh74/8lYD9e9F4dNiA pLI47UkdUkn3ng7Hh0oFYcnkC467onBPFNNcyCaubilnaLS2cqw1df/Cezr+cJ1dQtH1sf kfvFS81e6IvyBZtaoLMtygpJL7B8oeQzMleilX6OhA5xNKOXbnlvDkYl9pzAWuLZHuoN/H PHJjGdKdbv55KcKUg94N0nEdRGQ+6S1Cm/FJWf6TlZnatEVQfCXpRdIZ0g53jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKfN44yszDTv; Wed, 01 Oct 2025 16:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 591GAqco066121; Wed, 1 Oct 2025 16:10:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GAqVI066118; Wed, 1 Oct 2025 16:10:52 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:10:52 GMT Message-Id: <202510011610.591GAqVI066118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: f12dba5d1746 - stable/15 - pf: Fix interface binding for af-to with route-to List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: f12dba5d17466d591f7adbeca5e9eec06ef06d66 Auto-Submitted: auto-generated The branch stable/15 has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=f12dba5d17466d591f7adbeca5e9eec06ef06d66 commit f12dba5d17466d591f7adbeca5e9eec06ef06d66 Author: Kajetan Staszkiewicz AuthorDate: 2025-09-07 10:48:15 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-10-01 15:59:45 +0000 pf: Fix interface binding for af-to with route-to States created by inbound af-to rules bypass outbound filtering and span both the inbound and outbound interfaces. When the first packet for such rule creates a state, this state has st->orig_kif set the original inbound interface and kif set to V_pfi_all. When the outbound interface is eventually known st->kif is updated to that interface. When not using route-to, the outbound route and its interface are determined for the new address family and st->kif is set to that interface. However when using route-to, ifp is explicitely given and the code for updating st->kif is not run for the first packet. When the returning packet matches the state, the code is run but updates st->kif to the original inbound interface, which is now the outbound interface. The state ends up with st->kif == st->orig_kif and won't forward any more returning packets. There is another block of code performing such update, but only for reply-to. Perform the update of st->kif in a single place no matter if ifp was explicitely given or found by routing lookup. For checks using pings check if really all pings have been replied to, because a single reply is enough to have ping exit with a successful exit code. Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D52445 (cherry picked from commit 42441d342071767f32cfe507466135dc79052a56) --- sys/netpfil/pf/pf.c | 64 +++++++++++++++++---------------------- tests/sys/netpfil/pf/nat64.sh | 6 +++- tests/sys/netpfil/pf/src_track.sh | 6 ++-- 3 files changed, 36 insertions(+), 40 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 3a047ea44c47..3311260aa157 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9163,26 +9163,8 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, } else { dst->sin.sin_addr = ip->ip_dst; } - - /* - * Bind to the correct interface if we're - * if-bound. We don't know which interface - * that will be until here, so we've inserted - * the state on V_pf_all. Fix that now. - */ - if (s->kif == V_pfi_all && ifp != NULL && - r->rule_flag & PFRULE_IFBOUND) - s->kif = ifp->if_pf_kif; } } - - if (r->rule_flag & PFRULE_IFBOUND && - pd->act.rt == PF_REPLYTO && - s->kif == V_pfi_all) { - s->kif = pd->act.rt_kif; - s->orig_kif = oifp->if_pf_kif; - } - PF_STATE_UNLOCK(s); } @@ -9197,6 +9179,20 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, goto bad; } + /* + * Bind to the correct interface if we're if-bound. We don't know which + * interface that will be until here, so we've inserted the state + * on V_pf_all. Fix that now. + */ + if (s != NULL && s->kif == V_pfi_all && r->rule_flag & PFRULE_IFBOUND) { + /* Verify that we're here because of BOUND_IFACE */ + MPASS(r->rt == PF_REPLYTO || (pd->af != pd->naf && s->direction == PF_IN)); + s->kif = ifp->if_pf_kif; + if (pd->act.rt == PF_REPLYTO) { + s->orig_kif = oifp->if_pf_kif; + } + } + if (r->rt == PF_DUPTO) skip_test = true; @@ -9477,26 +9473,8 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, sizeof(dst.sin6_addr)); else dst.sin6_addr = ip6->ip6_dst; - - /* - * Bind to the correct interface if we're - * if-bound. We don't know which interface - * that will be until here, so we've inserted - * the state on V_pf_all. Fix that now. - */ - if (s->kif == V_pfi_all && ifp != NULL && - r->rule_flag & PFRULE_IFBOUND) - s->kif = ifp->if_pf_kif; } } - - if (r->rule_flag & PFRULE_IFBOUND && - pd->act.rt == PF_REPLYTO && - s->kif == V_pfi_all) { - s->kif = pd->act.rt_kif; - s->orig_kif = oifp->if_pf_kif; - } - PF_STATE_UNLOCK(s); } @@ -9518,6 +9496,20 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, goto bad; } + /* + * Bind to the correct interface if we're if-bound. We don't know which + * interface that will be until here, so we've inserted the state + * on V_pf_all. Fix that now. + */ + if (s != NULL && s->kif == V_pfi_all && r->rule_flag & PFRULE_IFBOUND) { + /* Verify that we're here because of BOUND_IFACE */ + MPASS(r->rt == PF_REPLYTO || (pd->af != pd->naf && s->direction == PF_IN)); + s->kif = ifp->if_pf_kif; + if (pd->act.rt == PF_REPLYTO) { + s->orig_kif = oifp->if_pf_kif; + } + } + if (r->rt == PF_DUPTO) skip_test = true; diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 4438ad6abb85..d930e2ee5763 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -1039,13 +1039,14 @@ route_to_body() "pass in on ${epair}b route-to (${epair_link}a 192.0.2.2) inet6 from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" atf_check -s exit:0 -o ignore \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ ping6 -c 3 64:ff9b::192.0.2.2 states=$(mktemp) || exit 1 jexec rtr pfctl -qvvss | normalize_pfctl_s > $states for state_regexp in \ - "${epair}b ipv6-icmp 192.0.2.1:.* \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:8 \(64:ff9b::c000:202\[[0-9]+\]\).*4:2 pkts.*route-to: 192.0.2.2@${epair_link}a" \ + "${epair_link}a ipv6-icmp 192.0.2.1:.* \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:8 \(64:ff9b::c000:202\[[0-9]+\]\).*6:6 pkts.*route-to: 192.0.2.2@${epair_link}a origif: ${epair}b" \ ; do grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" done @@ -1094,6 +1095,7 @@ reply_to_body() "pass in on ${epair}b reply-to (${epair}b 2001:db8::2) inet6 from any to 64:ff9b::/96 af-to inet from 192.0.2.1" atf_check -s exit:0 -o ignore \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ ping6 -c 3 64:ff9b::192.0.2.2 } @@ -1155,8 +1157,10 @@ v6_gateway_body() "pass in on ${epair_lan}b inet6 from any to 64:ff9b::/96 af-to inet from (${epair_wan_one}a)" atf_check -s exit:0 -o ignore \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ ping6 -c 3 64:ff9b::192.0.2.2 atf_check -s exit:0 -o ignore \ + -o match:'3 packets transmitted, 3 packets received, 0.0% packet loss' \ ping6 -c 3 64:ff9b::198.51.100.1 } diff --git a/tests/sys/netpfil/pf/src_track.sh b/tests/sys/netpfil/pf/src_track.sh index e12d0464ee8c..d86b4ce6c466 100755 --- a/tests/sys/netpfil/pf/src_track.sh +++ b/tests/sys/netpfil/pf/src_track.sh @@ -565,9 +565,9 @@ mixed_af_body() # FIXME: Sticky-address is broken for af-to pools! # The SN is created but apparently not used, as seen in states. for state_regexp in \ - "${epair_tester}b tcp 203.0.113.0:4201 \(2001:db8:44::1\[4201\]\) -> 192.0.2.100:9 \(64:ff9b::c000:264\[9\]\) .* route-to: 2001:db8:4202::2@${epair_server2}a" \ - "${epair_tester}b tcp 203.0.113.1:4202 \(2001:db8:44::1\[4202\]\) -> 192.0.2.100:9 \(64:ff9b::c000:264\[9\]\) .* route-to: 2001:db8:4202::2@${epair_server2}a" \ - "${epair_tester}b tcp 203.0.113.2:4203 \(2001:db8:44::2\[4203\]\) -> 192.0.2.100:9 \(64:ff9b::c000:264\[9\]\) .* route-to: 198.51.100.18@${epair_server1}a" \ + "${epair_server2}a tcp 203.0.113.0:4201 \(2001:db8:44::1\[4201\]\) -> 192.0.2.100:9 \(64:ff9b::c000:264\[9\]\) .* route-to: 2001:db8:4202::2@${epair_server2}a origif: ${epair_tester}b" \ + "${epair_server2}a tcp 203.0.113.1:4202 \(2001:db8:44::1\[4202\]\) -> 192.0.2.100:9 \(64:ff9b::c000:264\[9\]\) .* route-to: 2001:db8:4202::2@${epair_server2}a origif: ${epair_tester}b" \ + "${epair_server1}a tcp 203.0.113.2:4203 \(2001:db8:44::2\[4203\]\) -> 192.0.2.100:9 \(64:ff9b::c000:264\[9\]\) .* route-to: 198.51.100.18@${epair_server1}a origif: ${epair_tester}b" \ ; do grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" done From nobody Wed Oct 1 16:10:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKfQ0rymz69spP; Wed, 01 Oct 2025 16:10: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKfP5cwMz3Px0; Wed, 01 Oct 2025 16:10:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IjYih5ixU8kgrM5sGzVKRh3nWC3tXPf+mW+XbE2NDWk=; b=fUSIG5C+9NYfTwa7q4z4bAEW+sVkaie0qaqCAKmL3GFbJd5On7M97ueTarnZVW4IoNxsQF DNqCTwK7d1TouzDv9xJXKTg08pJMymKc45ZUc3pohZmro1MJx1bsE4sR0QJy/+zYBZCjM+ 2poja3v3u0C5crqjAEBaAVGZDROajUbsElI+tY9azR/gJ0POmG7HzliDrJT5u26wfoYESE ZCAGVVH86nrPQH3QMQcDGODd/ShRjce38AePvYCIkg85UFO3TAbDRN31XJDm07uHNlhzK0 7aCc/Y3VHXpOTe/Jvg6U69l/Ji2c4wK6LeRAIQlTBHTBdSYZ9PRQY6cXrZJ6SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IjYih5ixU8kgrM5sGzVKRh3nWC3tXPf+mW+XbE2NDWk=; b=GuObSFJgpSlU5Wu4QR4ZpMJLoZtU370GCk1IRrWlOITAoQkZP65uSS5BhdcJFKMHdYgYcW eAjh5905bchNfNUtsLwHW+p5vf7Fu9o6GGQaYRMKb2KKGnQKi4wL7+xhq6t0t2ouklJXf7 k+eYFmnV1VlOtzlqdQNB+iObZliJG0JA4VzRsyiMVlLwwbEYKcQak/xzhykKyCGqub3fn8 a6Ck0VWftgUP9VMjr2KwyiMebok0ErFdCGIVdEmlRjysbzy+HECmFsXT5nVdJkHbfWDiPM cT20OpCjFdh1YIYtrA6vV7UKmIaJt7EztFokadoymaosIlg1M1+gM0oFUDYmGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759335053; a=rsa-sha256; cv=none; b=ul1qNXA0DmVgJWOfVl0129fAedmmAvw+8uG5kRqQ9HMUsRCbjo73MWBpN/GTOW8HPTWUbF v3oJ3rCGcQArkTkeoYZdG5wyPlT4kxnhJhOObAZLVyFuLZKenqPAXL2DmemJV5oxF/p5ld wHMCTyJkdjrNmupTsj+etKP9AI84adiSmYdX2rwww0VCDijLiE5larUI+BnVX3YCW5I8HA F/yok1ELbGFGQC+6Icw7X5E4LHG9DzLpO+Kvfbq9zIGrLN8fFYQfyDnZSwwXk5dqWefN6J 03wYj5P4Wi0/ZecFllWGRlWB8LHprMtGqoDfFmeUdVaBmQIe3W9zz2Cq874GnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKfP53w4zDTw; Wed, 01 Oct 2025 16:10: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 591GArWc066163; Wed, 1 Oct 2025 16:10:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GArrW066160; Wed, 1 Oct 2025 16:10:53 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:10:53 GMT Message-Id: <202510011610.591GArrW066160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 048b8123ee87 - stable/15 - pf: Always skip outbound filtering for inbound af-to rules List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 048b8123ee87154b220d73ea6543423164f25fdb Auto-Submitted: auto-generated The branch stable/15 has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=048b8123ee87154b220d73ea6543423164f25fdb commit 048b8123ee87154b220d73ea6543423164f25fdb Author: Kajetan Staszkiewicz AuthorDate: 2025-09-07 13:59:00 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-10-01 16:00:20 +0000 pf: Always skip outbound filtering for inbound af-to rules The af-to rules on inbound direction create a single state spanning both the inbound and the outbound interface. Calling pf_test() for the outbound direction in pf_route() makes the packet pass through state search, match the existing state, never evaluate the ruleset, and increase state counters. Check that the state comes from an af-to rule in inbound direction, and if yes, skip outbound testing. Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D52446 (cherry picked from commit 938ae26ffda81fd42c235eaa3223dae51331e4eb) --- sys/netpfil/pf/pf.c | 4 ++-- tests/sys/netpfil/pf/nat64.sh | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 3311260aa157..c90ed1ff7769 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9193,7 +9193,7 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, } } - if (r->rt == PF_DUPTO) + if (r->rt == PF_DUPTO || (pd->af != pd->naf && s->direction == PF_IN)) skip_test = true; if (pd->dir == PF_IN && !skip_test) { @@ -9510,7 +9510,7 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, } } - if (r->rt == PF_DUPTO) + if (r->rt == PF_DUPTO || (pd->af != pd->naf && s->direction == PF_IN)) skip_test = true; if (pd->dir == PF_IN && !skip_test) { diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index d930e2ee5763..d873d34a51d5 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -214,11 +214,11 @@ tcp_in_if_bound_body() fi # Interfaces of the state are reversed when doing inbound NAT64! - # FIXME: Packets counters seem wrong! + # FIXME: Packets from both directions are counted only on the inbound direction! states=$(mktemp) || exit 1 jexec rtr pfctl -qvvss | normalize_pfctl_s > $states for state_regexp in \ - "${epair_link}a tcp 192.0.2.1:[0-9]+ \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:1234 \(64:ff9b::c000:202\[1234\]\) .* 9:9 pkts.* rule 3 .* origif: ${epair}b" \ + "${epair_link}a tcp 192.0.2.1:[0-9]+ \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:1234 \(64:ff9b::c000:202\[1234\]\) .* 9:0 pkts.* rule 3 .* origif: ${epair}b" \ ; do grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" done @@ -296,11 +296,11 @@ tcp_in_floating_body() fi # Interfaces of the state are reversed when doing inbound NAT64! - # FIXME: Packets counters seem wrong! + # FIXME: Packets from both directions are counted only on the inbound direction! states=$(mktemp) || exit 1 jexec rtr pfctl -qvvss | normalize_pfctl_s > $states for state_regexp in \ - "all tcp 192.0.2.1:[0-9]+ \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:1234 \(64:ff9b::c000:202\[1234\]\).* 9:9 pkts.* rule 3 .* origif: ${epair}b" \ + "all tcp 192.0.2.1:[0-9]+ \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:1234 \(64:ff9b::c000:202\[1234\]\).* 9:0 pkts.* rule 3 .* origif: ${epair}b" \ ; do grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" done @@ -1045,8 +1045,10 @@ route_to_body() states=$(mktemp) || exit 1 jexec rtr pfctl -qvvss | normalize_pfctl_s > $states + # Interfaces of the state are reversed when doing inbound NAT64! + # FIXME: Packets from both directions are counted only on the inbound direction! for state_regexp in \ - "${epair_link}a ipv6-icmp 192.0.2.1:.* \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:8 \(64:ff9b::c000:202\[[0-9]+\]\).*6:6 pkts.*route-to: 192.0.2.2@${epair_link}a origif: ${epair}b" \ + "${epair_link}a ipv6-icmp 192.0.2.1:.* \(2001:db8::2\[[0-9]+\]\) -> 192.0.2.2:8 \(64:ff9b::c000:202\[[0-9]+\]\).* 6:0 pkts.*route-to: 192.0.2.2@${epair_link}a origif: ${epair}b" \ ; do grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" done From nobody Wed Oct 1 16:10:54 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKfR3xv8z69sjs; Wed, 01 Oct 2025 16:10: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKfR00YHz3Q0s; Wed, 01 Oct 2025 16:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Ffvo4Gtg8K+cRK3nhERs2mcCA/cGuJcVlwbs6ISRsA=; b=vECdHXMFiushOPK4oUzIJFnfa6cHRLiWx9NgmjihCm+oSl1+DCSFTyOgKkVxey4fem6Hxn E0JTDY9WPTRr1rv/ApgxGdE0tDyGSRk+fLN5F5cZVYuocYJ9Vo58gxwXSAj/NvP8407w4o jJq/+9Opgit8M3756MLc3o8iNesQaLi3u4gVoFpcDFgngb7HSJxedMra9J8Gf+2AogtEUK K3gOhMWjFZtWfw8+oSe+2HfO9QfISIwbbRSp79DOSbFt+btSSSd9Wv322ie+9cVXwKCOj/ ClhJDStZ6KPjrdpqEw7DGsEsCNpbr9YYIO7uY3rmiCKTU7Vn3tQH5qiXUbvaag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Ffvo4Gtg8K+cRK3nhERs2mcCA/cGuJcVlwbs6ISRsA=; b=CiN8AlWqFoRSLpupap5zdDzHJyXSeAGCF0q3dUg50CldWPNM9vFy+uDTbdbe51mgX3wG0B Xn9NhI5KM1DAAro9zyhO8H1oGsEi5tvNW2qhzG64Wf19beSyuv4QG5he50/jI/DCF11v7k ewIQBaAuIXYW8pe94ShRnz7u/qryyK38yuitbRh7TahHhK2VEH/TGQv6v1dyWfsywdkv8n jrOsnvkcQxorXO6nREwocc4bdyqoop2tSvruE6JVpKIA7Oqm3kCeXMG/uY/Zdg9EbKHDv6 dP15QVPp/tWSTUE3e85Es4GcE7k0rikNNIn5WuP0qmAayxvBPlEEJ78CR/zcoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759335055; a=rsa-sha256; cv=none; b=IiuNBqd1O4JE3vILKXey6MUxE6CXGaIoNxqYl84SMtNcomL6A8JRqUiwN1YPlQc9aMpQE4 fQQU+bJYeOAp9JqKAY2TePEGzh3d/F+HQ7YuLSXDQNBIvukbePnN06NACVkw2LMhSMAjJn i9Kg7AowcOol3auoIUtU/H05aCf95OtnG8/AxcRpCDs8iC6ikSFUbw69o/yurEk1v2avXs QhKZpTstllQ341vNJJBBJ7ov/auegZOkJuiiq0Kr/j5ruZhOmuBu0RNSrFz3uloS+sxOJu NoE4zMDwuSjSZ1+cfaHjL4pocDySdiBvHqM68/9bNzM+1GA8QaTSotHcH90AEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKfQ5zQGzDJf; Wed, 01 Oct 2025 16:10: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 591GAsWZ066197; Wed, 1 Oct 2025 16:10:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GAs5V066194; Wed, 1 Oct 2025 16:10:54 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:10:54 GMT Message-Id: <202510011610.591GAs5V066194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: 013708fd3167 - stable/15 - pf: Fix rule and state counters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 013708fd31677fc70893d461fe2ba03a77500126 Auto-Submitted: auto-generated The branch stable/15 has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=013708fd31677fc70893d461fe2ba03a77500126 commit 013708fd31677fc70893d461fe2ba03a77500126 Author: Kajetan Staszkiewicz AuthorDate: 2025-09-03 18:27:11 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-10-01 16:00:31 +0000 pf: Fix rule and state counters Increasing counters on "match" rules causes the 1st packet making a connection to be double-counted, but only for rule counters, not rules' tables, because those are not increased at all during rule parsing. Remove "match" rule counter handling during rule parsing, do it only in pf_counters_inc(). NAT can be performed either by "nat" rules in the NAT ruleset or by "match" rules. Rules before the NAT rule, and the NAT rule itself match on pre-NAT addresses, and later rules match on post-NAT addresses. When increasing counters go over rules in the same order as a packet would and use source and destination addresses for updating table counters from appropriate state key, taking into consideration on which rule NAT happens. Use AF from state key, so that table counters can be properly updated for af-to rules. Synchronize match rule updating behaviour to that of OpenBSD: if rules match, but state is not created, don't update counters. Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D52447 (cherry picked from commit 6353f5d9a5c6f194bb014b8785a57f5314e8c652) --- sys/net/pfvar.h | 7 +- sys/netpfil/pf/pf.c | 339 +++++++++------- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/counters.sh | 817 +++++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/pf/nat64.sh | 26 +- tests/sys/netpfil/pf/utils.subr | 3 + 6 files changed, 1039 insertions(+), 154 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 8c0e9b057a4f..7e030910e0ec 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1165,7 +1165,6 @@ struct pf_test_ctx { int rewrite; u_short reason; struct pf_src_node *sns[PF_SN_MAX]; - struct pf_krule_slist rules; struct pf_krule *nr; struct pf_krule *tr; struct pf_krule **rm; @@ -2722,8 +2721,10 @@ int pf_osfp_match(struct pf_osfp_enlist *, pf_osfp_t); #ifdef _KERNEL void pf_print_host(struct pf_addr *, u_int16_t, sa_family_t); -enum pf_test_status pf_step_into_anchor(struct pf_test_ctx *, struct pf_krule *); -enum pf_test_status pf_match_rule(struct pf_test_ctx *, struct pf_kruleset *); +enum pf_test_status pf_step_into_anchor(struct pf_test_ctx *, struct pf_krule *, + struct pf_krule_slist *match_rules); +enum pf_test_status pf_match_rule(struct pf_test_ctx *, struct pf_kruleset *, + struct pf_krule_slist *); void pf_step_into_keth_anchor(struct pf_keth_anchor_stackframe *, int *, struct pf_keth_ruleset **, struct pf_keth_rule **, struct pf_keth_rule **, diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index c90ed1ff7769..66096133acd4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -344,10 +344,12 @@ static int pf_test_eth_rule(int, struct pfi_kkif *, struct mbuf **); static int pf_test_rule(struct pf_krule **, struct pf_kstate **, struct pf_pdesc *, struct pf_krule **, - struct pf_kruleset **, u_short *, struct inpcb *); + struct pf_kruleset **, u_short *, struct inpcb *, + struct pf_krule_slist *); static int pf_create_state(struct pf_krule *, struct pf_test_ctx *, - struct pf_kstate **, u_int16_t, u_int16_t); + struct pf_kstate **, u_int16_t, u_int16_t, + struct pf_krule_slist *match_rules); static int pf_state_key_addr_setup(struct pf_pdesc *, struct pf_state_key_cmp *, int); static int pf_tcp_track_full(struct pf_kstate *, @@ -393,7 +395,7 @@ static bool pf_src_connlimit(struct pf_kstate *); static int pf_match_rcvif(struct mbuf *, struct pf_krule *); static void pf_counters_inc(int, struct pf_pdesc *, struct pf_kstate *, struct pf_krule *, - struct pf_krule *); + struct pf_krule *, struct pf_krule_slist *); static void pf_log_matches(struct pf_pdesc *, struct pf_krule *, struct pf_krule *, struct pf_kruleset *, struct pf_krule_slist *); @@ -489,26 +491,30 @@ BOUND_IFACE(struct pf_kstate *st, struct pf_pdesc *pd) counter_u64_add(s->anchor->states_cur, 1); \ counter_u64_add(s->anchor->states_tot, 1); \ } \ - if (s->nat_rule != NULL) { \ - counter_u64_add(s->nat_rule->states_cur, 1);\ - counter_u64_add(s->nat_rule->states_tot, 1);\ + if (s->nat_rule != NULL && s->nat_rule != s->rule) { \ + counter_u64_add(s->nat_rule->states_cur, 1); \ + counter_u64_add(s->nat_rule->states_tot, 1); \ } \ SLIST_FOREACH(mrm, &s->match_rules, entry) { \ - counter_u64_add(mrm->r->states_cur, 1); \ - counter_u64_add(mrm->r->states_tot, 1); \ + if (s->nat_rule != mrm->r) { \ + counter_u64_add(mrm->r->states_cur, 1); \ + counter_u64_add(mrm->r->states_tot, 1); \ + } \ } \ } while (0) #define STATE_DEC_COUNTERS(s) \ do { \ struct pf_krule_item *mrm; \ - if (s->nat_rule != NULL) \ - counter_u64_add(s->nat_rule->states_cur, -1);\ - if (s->anchor != NULL) \ - counter_u64_add(s->anchor->states_cur, -1); \ counter_u64_add(s->rule->states_cur, -1); \ + if (s->anchor != NULL) \ + counter_u64_add(s->anchor->states_cur, -1); \ + if (s->nat_rule != NULL && s->nat_rule != s->rule) \ + counter_u64_add(s->nat_rule->states_cur, -1); \ SLIST_FOREACH(mrm, &s->match_rules, entry) \ - counter_u64_add(mrm->r->states_cur, -1); \ + if (s->nat_rule != mrm->r) { \ + counter_u64_add(mrm->r->states_cur, -1);\ + } \ } while (0) MALLOC_DEFINE(M_PFHASH, "pf_hash", "pf(4) hash header structures"); @@ -2869,20 +2875,24 @@ pf_alloc_state(int flags) return (uma_zalloc(V_pf_state_z, flags | M_ZERO)); } +static __inline void +pf_free_match_rules(struct pf_krule_slist *match_rules) { + struct pf_krule_item *ri; + + while ((ri = SLIST_FIRST(match_rules))) { + SLIST_REMOVE_HEAD(match_rules, entry); + free(ri, M_PF_RULE_ITEM); + } +} + void pf_free_state(struct pf_kstate *cur) { - struct pf_krule_item *ri; - KASSERT(cur->refs == 0, ("%s: %p has refs", __func__, cur)); KASSERT(cur->timeout == PFTM_UNLINKED, ("%s: timeout %u", __func__, cur->timeout)); - while ((ri = SLIST_FIRST(&cur->match_rules))) { - SLIST_REMOVE_HEAD(&cur->match_rules, entry); - free(ri, M_PF_RULE_ITEM); - } - + pf_free_match_rules(&(cur->match_rules)); pf_normalize_tcp_cleanup(cur); uma_zfree(V_pf_state_z, cur); pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_REMOVALS], 1); @@ -4733,7 +4743,8 @@ pf_tag_packet(struct pf_pdesc *pd, int tag) } while (0) enum pf_test_status -pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r) +pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r, + struct pf_krule_slist *match_rules) { enum pf_test_status rv; @@ -4751,7 +4762,7 @@ pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r) struct pf_kanchor *child; rv = PF_TEST_OK; RB_FOREACH(child, pf_kanchor_node, &r->anchor->children) { - rv = pf_match_rule(ctx, &child->ruleset); + rv = pf_match_rule(ctx, &child->ruleset, match_rules); if ((rv == PF_TEST_QUICK) || (rv == PF_TEST_FAIL)) { /* * we either hit a rule with quick action @@ -4762,7 +4773,7 @@ pf_step_into_anchor(struct pf_test_ctx *ctx, struct pf_krule *r) } } } else { - rv = pf_match_rule(ctx, &r->anchor->ruleset); + rv = pf_match_rule(ctx, &r->anchor->ruleset, match_rules); /* * Unless errors occured, stop iff any rule matched * within quick anchors. @@ -5611,9 +5622,10 @@ pf_rule_apply_nat(struct pf_test_ctx *ctx, struct pf_krule *r) } enum pf_test_status -pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) +pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset, + struct pf_krule_slist *match_rules) { - struct pf_krule_item *ri; + struct pf_krule_item *ri, *rt; struct pf_krule *r; struct pf_krule *save_a; struct pf_kruleset *save_aruleset; @@ -5752,11 +5764,14 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) return (PF_TEST_FAIL); } ri->r = r; - SLIST_INSERT_HEAD(&ctx->rules, ri, entry); - pf_counter_u64_critical_enter(); - pf_counter_u64_add_protected(&r->packets[pd->dir == PF_OUT], 1); - pf_counter_u64_add_protected(&r->bytes[pd->dir == PF_OUT], pd->tot_len); - pf_counter_u64_critical_exit(); + + if (SLIST_EMPTY(match_rules)) { + SLIST_INSERT_HEAD(match_rules, ri, entry); + } else { + SLIST_INSERT_AFTER(rt, ri, entry); + } + rt = ri; + pf_rule_to_actions(r, &pd->act); if (r->log) PFLOG_PACKET(r->action, PFRES_MATCH, r, @@ -5780,7 +5795,7 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) ctx->arsm = ctx->aruleset; } if (pd->act.log & PF_LOG_MATCHES) - pf_log_matches(pd, r, ctx->a, ruleset, &ctx->rules); + pf_log_matches(pd, r, ctx->a, ruleset, match_rules); if (r->quick) { ctx->test_status = PF_TEST_QUICK; break; @@ -5797,7 +5812,7 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) * Note: we don't need to restore if we are not going * to continue with ruleset evaluation. */ - if (pf_step_into_anchor(ctx, r) != PF_TEST_OK) { + if (pf_step_into_anchor(ctx, r, match_rules) != PF_TEST_OK) { break; } ctx->a = save_a; @@ -5812,11 +5827,11 @@ pf_match_rule(struct pf_test_ctx *ctx, struct pf_kruleset *ruleset) static int pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pf_pdesc *pd, struct pf_krule **am, - struct pf_kruleset **rsm, u_short *reason, struct inpcb *inp) + struct pf_kruleset **rsm, u_short *reason, struct inpcb *inp, + struct pf_krule_slist *match_rules) { struct pf_krule *r = NULL; struct pf_kruleset *ruleset = NULL; - struct pf_krule_item *ri; struct pf_test_ctx ctx; u_short transerror; int action = PF_PASS; @@ -5833,7 +5848,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, ctx.rsm = rsm; ctx.th = &pd->hdr.tcp; ctx.reason = *reason; - SLIST_INIT(&ctx.rules); pf_addrcpy(&pd->nsaddr, pd->src, pd->af); pf_addrcpy(&pd->ndaddr, pd->dst, pd->af); @@ -5926,7 +5940,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, } ruleset = &pf_main_ruleset; - rv = pf_match_rule(&ctx, ruleset); + rv = pf_match_rule(&ctx, ruleset, match_rules); if (rv == PF_TEST_FAIL) { /* * Reason has been set in pf_match_rule() already. @@ -5962,7 +5976,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, PFLOG_PACKET(r->action, ctx.reason, r, ctx.a, ruleset, pd, 1, NULL); } if (pd->act.log & PF_LOG_MATCHES) - pf_log_matches(pd, r, ctx.a, ruleset, &ctx.rules); + pf_log_matches(pd, r, ctx.a, ruleset, match_rules); if (pd->virtual_proto != PF_VPROTO_FRAGMENT && (r->action == PF_DROP) && ((r->rule_flag & PFRULE_RETURNRST) || @@ -6007,7 +6021,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, (pd->flags & PFDESC_TCP_NORM)))) { bool nat64; - action = pf_create_state(r, &ctx, sm, bproto_sum, bip_sum); + action = pf_create_state(r, &ctx, sm, bproto_sum, bip_sum, + match_rules); ctx.sk = ctx.nk = NULL; if (action != PF_PASS) { pf_udp_mapping_release(ctx.udp_mapping); @@ -6053,11 +6068,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, action = PF_AFRT; } } else { - while ((ri = SLIST_FIRST(&ctx.rules))) { - SLIST_REMOVE_HEAD(&ctx.rules, entry); - free(ri, M_PF_RULE_ITEM); - } - uma_zfree(V_pf_state_key_z, ctx.sk); uma_zfree(V_pf_state_key_z, ctx.nk); ctx.sk = ctx.nk = NULL; @@ -6085,11 +6095,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, return (action); cleanup: - while ((ri = SLIST_FIRST(&ctx.rules))) { - SLIST_REMOVE_HEAD(&ctx.rules, entry); - free(ri, M_PF_RULE_ITEM); - } - uma_zfree(V_pf_state_key_z, ctx.sk); uma_zfree(V_pf_state_key_z, ctx.nk); pf_udp_mapping_release(ctx.udp_mapping); @@ -6100,7 +6105,8 @@ cleanup: static int pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, - struct pf_kstate **sm, u_int16_t bproto_sum, u_int16_t bip_sum) + struct pf_kstate **sm, u_int16_t bproto_sum, u_int16_t bip_sum, + struct pf_krule_slist *match_rules) { struct pf_pdesc *pd = ctx->pd; struct pf_kstate *s = NULL; @@ -6114,7 +6120,6 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, struct tcphdr *th = &pd->hdr.tcp; u_int16_t mss = V_tcp_mssdflt; u_short sn_reason; - struct pf_krule_item *ri; /* check maximums */ if (r->max_states && @@ -6166,7 +6171,7 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, s->rule = r; s->nat_rule = ctx->nr; s->anchor = ctx->a; - memcpy(&s->match_rules, &ctx->rules, sizeof(s->match_rules)); + s->match_rules = *match_rules; memcpy(&s->act, &pd->act, sizeof(struct pf_rule_actions)); if (pd->act.allow_opts) @@ -6330,11 +6335,6 @@ pf_create_state(struct pf_krule *r, struct pf_test_ctx *ctx, return (PF_PASS); csfailed: - while ((ri = SLIST_FIRST(&ctx->rules))) { - SLIST_REMOVE_HEAD(&ctx->rules, entry); - free(ri, M_PF_RULE_ITEM); - } - uma_zfree(V_pf_state_key_z, ctx->sk); uma_zfree(V_pf_state_key_z, ctx->nk); @@ -7484,6 +7484,7 @@ static void pf_sctp_multihome_delayed(struct pf_pdesc *pd, struct pfi_kkif *kif, struct pf_kstate *s, int action) { + struct pf_krule_slist match_rules; struct pf_sctp_multihome_job *j, *tmp; struct pf_sctp_source *i; int ret; @@ -7531,8 +7532,14 @@ again: if (s->rule->rule_flag & PFRULE_ALLOW_RELATED) { j->pd.related_rule = s->rule; } + SLIST_INIT(&match_rules); ret = pf_test_rule(&r, &sm, - &j->pd, &ra, &rs, &reason, NULL); + &j->pd, &ra, &rs, &reason, NULL, &match_rules); + /* + * Nothing to do about match rules, the processed + * packet has already increased the counters. + */ + pf_free_match_rules(&match_rules); PF_RULES_RUNLOCK(); SDT_PROBE4(pf, sctp, multihome, test, kif, r, j->pd.m, ret); if (ret != PF_DROP && sm != NULL) { @@ -10630,108 +10637,149 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, return (0); } +static __inline void +pf_rule_counters_inc(struct pf_pdesc *pd, struct pf_krule *r, int dir_out, + int op_pass, sa_family_t af, struct pf_addr *src_host, + struct pf_addr *dst_host) +{ + pf_counter_u64_add_protected(&(r->packets[dir_out]), 1); + pf_counter_u64_add_protected(&(r->bytes[dir_out]), pd->tot_len); + pf_update_timestamp(r); + + if (r->src.addr.type == PF_ADDR_TABLE) + pfr_update_stats(r->src.addr.p.tbl, src_host, af, + pd->tot_len, dir_out, op_pass, r->src.neg); + if (r->dst.addr.type == PF_ADDR_TABLE) + pfr_update_stats(r->dst.addr.p.tbl, dst_host, af, + pd->tot_len, dir_out, op_pass, r->dst.neg); +} + static void -pf_counters_inc(int action, struct pf_pdesc *pd, - struct pf_kstate *s, struct pf_krule *r, struct pf_krule *a) +pf_counters_inc(int action, struct pf_pdesc *pd, struct pf_kstate *s, + struct pf_krule *r, struct pf_krule *a, struct pf_krule_slist *match_rules) { - struct pf_krule *tr; - int dir = pd->dir; - int dirndx; + struct pf_krule_slist *mr = match_rules; + struct pf_krule_item *ri; + struct pf_krule *nr = NULL; + struct pf_addr *src_host = pd->src; + struct pf_addr *dst_host = pd->dst; + struct pf_state_key *key; + int dir_out = (pd->dir == PF_OUT); + int op_pass = (r->action == PF_PASS); + sa_family_t af = pd->af; + int s_dir_in, s_dir_out, s_dir_rev; pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected( - &pd->kif->pfik_bytes[pd->af == AF_INET6][dir == PF_OUT][action != PF_PASS], + &pd->kif->pfik_bytes[pd->af == AF_INET6][dir_out][action != PF_PASS], pd->tot_len); pf_counter_u64_add_protected( - &pd->kif->pfik_packets[pd->af == AF_INET6][dir == PF_OUT][action != PF_PASS], + &pd->kif->pfik_packets[pd->af == AF_INET6][dir_out][action != PF_PASS], 1); - if (action == PF_PASS || action == PF_AFRT || r->action == PF_DROP) { - dirndx = (dir == PF_OUT); - pf_counter_u64_add_protected(&r->packets[dirndx], 1); - pf_counter_u64_add_protected(&r->bytes[dirndx], pd->tot_len); - pf_update_timestamp(r); + /* If the rule has failed to apply, don't increase its counters */ + if (!(action == PF_PASS || action == PF_AFRT || r->action == PF_DROP)) { + pf_counter_u64_critical_exit(); + return; + } - if (a != NULL) { - pf_counter_u64_add_protected(&a->packets[dirndx], 1); - pf_counter_u64_add_protected(&a->bytes[dirndx], pd->tot_len); + if (s != NULL) { + PF_STATE_LOCK_ASSERT(s); + mr = &(s->match_rules); + + /* + * For af-to on the inbound direction we can determine + * the direction only by checking direction of AF translation, + * since the state is always "in" and so is packet's direction. + */ + if (pd->af != pd->naf && s->direction == PF_IN) { + dir_out = (pd->naf == s->rule->naf); + s_dir_in = 1; + s_dir_out = 0; + s_dir_rev = (pd->naf != s->rule->naf); + } + else { + dir_out = (pd->dir == PF_OUT); + s_dir_in = (s->direction == PF_IN); + s_dir_out = (s->direction == PF_OUT); + s_dir_rev = (pd->dir != s->direction); } - if (s != NULL) { - struct pf_krule_item *ri; - if (s->nat_rule != NULL) { - pf_counter_u64_add_protected(&s->nat_rule->packets[dirndx], + s->packets[s_dir_rev]++; + s->bytes[s_dir_rev] += pd->tot_len; + + /* + * Source nodes are accessed unlocked here. But since we are + * operating with stateful tracking and the state is locked, + * those SNs could not have been freed. + */ + for (pf_sn_types_t sn_type=0; sn_typesns[sn_type] != NULL) { + counter_u64_add( + s->sns[sn_type]->packets[dir_out], 1); - pf_counter_u64_add_protected(&s->nat_rule->bytes[dirndx], + counter_u64_add( + s->sns[sn_type]->bytes[dir_out], pd->tot_len); } - /* - * Source nodes are accessed unlocked here. - * But since we are operating with stateful tracking - * and the state is locked, those SNs could not have - * been freed. - */ - for (pf_sn_types_t sn_type=0; sn_typesns[sn_type] != NULL) { - counter_u64_add( - s->sns[sn_type]->packets[dirndx], - 1); - counter_u64_add( - s->sns[sn_type]->bytes[dirndx], - pd->tot_len); - } - } - dirndx = (dir == s->direction) ? 0 : 1; - s->packets[dirndx]++; - s->bytes[dirndx] += pd->tot_len; - - SLIST_FOREACH(ri, &s->match_rules, entry) { - pf_counter_u64_add_protected(&ri->r->packets[dirndx], 1); - pf_counter_u64_add_protected(&ri->r->bytes[dirndx], pd->tot_len); + } - if (ri->r->src.addr.type == PF_ADDR_TABLE) - pfr_update_stats(ri->r->src.addr.p.tbl, - (s == NULL) ? pd->src : - &s->key[(s->direction == PF_IN)]-> - addr[(s->direction == PF_OUT)], - pd->af, pd->tot_len, dir == PF_OUT, - r->action == PF_PASS, ri->r->src.neg); - if (ri->r->dst.addr.type == PF_ADDR_TABLE) - pfr_update_stats(ri->r->dst.addr.p.tbl, - (s == NULL) ? pd->dst : - &s->key[(s->direction == PF_IN)]-> - addr[(s->direction == PF_IN)], - pd->af, pd->tot_len, dir == PF_OUT, - r->action == PF_PASS, ri->r->dst.neg); + /* Start with pre-NAT addresses */ + key = s->key[(s->direction == PF_OUT)]; + src_host = &(key->addr[s_dir_out]); + dst_host = &(key->addr[s_dir_in]); + af = key->af; + if (s->nat_rule) { + /* Old-style NAT rules */ + if (s->nat_rule->action == PF_NAT || + s->nat_rule->action == PF_RDR || + s->nat_rule->action == PF_BINAT) { + nr = s->nat_rule; + pf_rule_counters_inc(pd, s->nat_rule, dir_out, + op_pass, af, src_host, dst_host); + /* Use post-NAT addresses from now on */ + key = s->key[s_dir_in]; + src_host = &(key->addr[s_dir_out]); + dst_host = &(key->addr[s_dir_in]); + af = key->af; } } + } - tr = r; - if (s != NULL && s->nat_rule != NULL && - r == &V_pf_default_rule) - tr = s->nat_rule; - - if (tr->src.addr.type == PF_ADDR_TABLE) - pfr_update_stats(tr->src.addr.p.tbl, - (s == NULL) ? pd->src : - &s->key[(s->direction == PF_IN)]-> - addr[(s->direction == PF_OUT)], - pd->af, pd->tot_len, dir == PF_OUT, - r->action == PF_PASS, tr->src.neg); - if (tr->dst.addr.type == PF_ADDR_TABLE) - pfr_update_stats(tr->dst.addr.p.tbl, - (s == NULL) ? pd->dst : - &s->key[(s->direction == PF_IN)]-> - addr[(s->direction == PF_IN)], - pd->af, pd->tot_len, dir == PF_OUT, - r->action == PF_PASS, tr->dst.neg); + SLIST_FOREACH(ri, mr, entry) { + pf_rule_counters_inc(pd, ri->r, dir_out, op_pass, af, + src_host, dst_host); + if (s && s->nat_rule == ri->r) { + /* Use post-NAT addresses after a match NAT rule */ + key = s->key[s_dir_in]; + src_host = &(key->addr[s_dir_out]); + dst_host = &(key->addr[s_dir_in]); + af = key->af; + } + } + + if (s == NULL) { + pf_free_match_rules(mr); } + + if (a != NULL) { + pf_rule_counters_inc(pd, a, dir_out, op_pass, af, + src_host, dst_host); + } + + if (r != nr) { + pf_rule_counters_inc(pd, r, dir_out, op_pass, af, + src_host, dst_host); + } + pf_counter_u64_critical_exit(); } + static void pf_log_matches(struct pf_pdesc *pd, struct pf_krule *rm, struct pf_krule *am, struct pf_kruleset *ruleset, - struct pf_krule_slist *matchrules) + struct pf_krule_slist *match_rules) { struct pf_krule_item *ri; @@ -10739,7 +10787,7 @@ pf_log_matches(struct pf_pdesc *pd, struct pf_krule *rm, if (rm->log & PF_LOG_MATCHES) return; - SLIST_FOREACH(ri, matchrules, entry) + SLIST_FOREACH(ri, match_rules, entry) if (ri->r->log & PF_LOG_MATCHES) PFLOG_PACKET(rm->action, PFRES_MATCH, rm, am, ruleset, pd, 1, ri->r); @@ -10756,6 +10804,8 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 struct pf_krule *a = NULL, *r = &V_pf_default_rule; struct pf_kstate *s = NULL; struct pf_kruleset *ruleset = NULL; + struct pf_krule_item *ri; + struct pf_krule_slist match_rules; struct pf_pdesc pd; int use_2nd_queue = 0; uint16_t tag; @@ -10792,6 +10842,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 } pf_init_pdesc(&pd, *m0); + SLIST_INIT(&match_rules); if (pd.pf_mtag != NULL && (pd.pf_mtag->flags & PF_MTAG_FLAG_ROUTE_TO)) { pd.pf_mtag->flags &= ~PF_MTAG_FLAG_ROUTE_TO; @@ -10888,7 +10939,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 action = PF_DROP; else action = pf_test_rule(&r, &s, &pd, &a, - &ruleset, &reason, inp); + &ruleset, &reason, inp, &match_rules); if (action != PF_PASS) REASON_SET(&reason, PFRES_FRAG); break; @@ -10946,7 +10997,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 break; } else { action = pf_test_rule(&r, &s, &pd, - &a, &ruleset, &reason, inp); + &a, &ruleset, &reason, inp, &match_rules); } } break; @@ -10967,7 +11018,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 a = s->anchor; } else if (s == NULL) { action = pf_test_rule(&r, &s, - &pd, &a, &ruleset, &reason, inp); + &pd, &a, &ruleset, &reason, inp, &match_rules); } break; @@ -10995,7 +11046,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 a = s->anchor; } else if (s == NULL) action = pf_test_rule(&r, &s, &pd, - &a, &ruleset, &reason, inp); + &a, &ruleset, &reason, inp, &match_rules); break; } @@ -11004,8 +11055,11 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 done: PF_RULES_RUNLOCK(); - if (pd.m == NULL) + /* if packet sits in reassembly queue, return without error */ + if (pd.m == NULL) { + pf_free_match_rules(&match_rules); goto eat_pkt; + } if (s) memcpy(&pd.act, &s->act, sizeof(s->act)); @@ -11102,6 +11156,8 @@ done: (dir == PF_IN) ? PF_DIVERT_MTAG_DIR_IN : PF_DIVERT_MTAG_DIR_OUT; + pf_counters_inc(action, &pd, s, r, a, &match_rules); + if (s) PF_STATE_UNLOCK(s); @@ -11143,7 +11199,6 @@ done: if (pd.act.log) { struct pf_krule *lr; - struct pf_krule_item *ri; if (s != NULL && s->nat_rule != NULL && s->nat_rule->log & PF_LOG_ALL) @@ -11162,7 +11217,7 @@ done: } } - pf_counters_inc(action, &pd, s, r, a); + pf_counters_inc(action, &pd, s, r, a, &match_rules); switch (action) { case PF_SYNPROXY_DROP: diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 9f993eec61d0..d63431e64a96 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -5,6 +5,7 @@ TESTS_SUBDIRS+= ioctl ATF_TESTS_SH+= altq \ anchor \ + counters \ debug \ divert-to \ dup \ diff --git a/tests/sys/netpfil/pf/counters.sh b/tests/sys/netpfil/pf/counters.sh new file mode 100644 index 000000000000..a0119b4710c1 --- /dev/null +++ b/tests/sys/netpfil/pf/counters.sh @@ -0,0 +1,817 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2025 Kajetan Staszkiewicz +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +get_counters() +{ + echo " === rules ===" + rules=$(mktemp) || exit + (jexec router pfctl -qvvsn ; jexec router pfctl -qvvsr) | normalize_pfctl_s > $rules + cat $rules + + echo " === tables ===" + tables=$(mktemp) || exit 1 + jexec router pfctl -qvvsT > $tables + cat $tables + + echo " === states ===" + states=$(mktemp) || exit 1 + jexec router pfctl -qvvss | normalize_pfctl_s > $states + cat $states + + echo " === nodes ===" + nodes=$(mktemp) || exit 1 + jexec router pfctl -qvvsS | normalize_pfctl_s > $nodes + cat $nodes +} + +atf_test_case "match_pass_state" "cleanup" +match_pass_state_head() +{ + atf_set descr 'Counters on match and pass rules' + atf_set require.user root +} + +match_pass_state_body() +{ + setup_router_server_ipv6 + + # Thest counters for a statefull firewall. Expose the behaviour of + # increasing table counters if a table is used multiple times. + # The table "tbl_in" is used both in match and pass rule. It's counters + # are incremented twice. The tables "tbl_out_match" and "tbl_out_pass" + # are used only once and have their countes increased only once. + # Test source node counters for this simple scenario too. + pft_set_rules router \ + "set state-policy if-bound" \ + "table { ${net_tester_host_tester} }" \ + "table { ${net_server_host_server} }" \ + "table { ${net_server_host_server} }" \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "match in on ${epair_tester}b inet6 proto tcp from scrub (random-id)" \ + "pass in on ${epair_tester}b inet6 proto tcp from keep state (max-src-states 3 source-track rule)" \ + "match out on ${epair_server}a inet6 proto tcp to scrub (random-id)" \ + "pass out on ${epair_server}a inet6 proto tcp to keep state" + + # Use a real TCP connection so that it will be properly closed, guaranteeing the amount of packets. + atf_check -s exit:0 -o match:"This is a test" -x \ + "echo 'This is a test' | nc -w3 ${net_server_host_server} echo" + # Let FINs pass through. + sleep 1 + get_counters + + for rule_regexp in \ + "@3 match in on ${epair_tester}b .* Packets: 10 Bytes: 766 States: 1 " \ + "@4 pass in on ${epair_tester}b .* Packets: 10 Bytes: 766 States: 1 " \ + "@5 match out on ${epair_server}a .* Packets: 10 Bytes: 766 States: 1 " \ + "@6 pass out on ${epair_server}a .* Packets: 10 Bytes: 766 States: 1 " \ + ; do + grep -qE "${rule_regexp}" $rules || atf_fail "Rule regexp not found for '${rule_regexp}'" + done + + table_counters_single="Evaluations: NoMatch: 0 Match: 1 In/Block: Packets: 0 Bytes: 0 In/Pass: Packets: 4 Bytes: 311 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 6 Bytes: 455 Out/XPass: Packets: 0 Bytes: 0" + table_counters_double="Evaluations: NoMatch: 0 Match: 2 In/Block: Packets: 0 Bytes: 0 In/Pass: Packets: 12 Bytes: 910 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 8 Bytes: 622 Out/XPass: Packets: 0 Bytes: 0" + for table_test in \ + "tbl_in___${table_counters_double}" \ + "tbl_out_match___${table_counters_single}" \ + "tbl_out_pass___${table_counters_single}" \ + ; do + table_name=${table_test%%___*} + table_regexp=${table_test##*___} + table=$(mktemp) || exit 1 + cat $tables | grep -A10 $table_name | tr '\n' ' ' | awk '{gsub("[\\[\\]]", " ", $0); gsub("[[:blank:]]+"," ",$0); print $0}' > ${table} + grep -qE "${table_regexp}" ${table} || atf_fail "Bad counters for table ${table_name}" + done; + + for state_regexp in \ + "${epair_tester}b tcp ${net_server_host_server}.* <- ${net_tester_host_tester}.* 6:4 pkts, 455:311 bytes, rule 4," \ + "${epair_server}a tcp ${net_server_host_tester}.* -> ${net_server_host_server}.* 6:4 pkts, 455:311 bytes, rule 6," \ + ; do + grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" + done + + for node_regexp in \ + "${net_tester_host_tester} -> :: .* 10 pkts, 766 bytes, filter rule 4, limit source-track"\ + ; do + grep -qE "${node_regexp}" $nodes || atf_fail "Source node not found for '${node_regexp}'" + done +} + +match_pass_state_cleanup() +{ + pft_cleanup +} + +atf_test_case "match_pass_no_state" "cleanup" +match_pass_no_state_head() +{ + atf_set descr 'Counters on match and pass rules without keep state' + atf_set require.user root +} + +match_pass_no_state_body() +{ + setup_router_server_ipv6 + + # Test counters for a stateless firewall. + # The table "tbl_in" is used both in match and pass rule in the inbound + # direction. The "In/Pass" counter is incremented twice. The table + # "tbl_inout" matches the same host on inbound and outbound direction. + # It will also be incremented twice. The tables "tbl_out_match" and + # "tbl_out_pass" will have their counters increased only once. + pft_set_rules router \ + "table { ${net_tester_host_tester} }" \ + "table { ${net_tester_host_tester} }" \ + "table { ${net_server_host_server} }" \ + "table { ${net_server_host_server} }" \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "match in on ${epair_tester}b inet6 proto tcp from " \ + "match in on ${epair_tester}b inet6 proto tcp from " \ + "pass in on ${epair_tester}b inet6 proto tcp from no state" \ + "pass out on ${epair_tester}b inet6 proto tcp to no state" \ + "match in on ${epair_server}a inet6 proto tcp from " \ + "pass in on ${epair_server}a inet6 proto tcp from no state" \ + "match out on ${epair_server}a inet6 proto tcp from no state" \ + "pass out on ${epair_server}a inet6 proto tcp to no state" + + # Use a real TCP connection so that it will be properly closed, guaranteeing the amount of packets. + atf_check -s exit:0 -o match:"This is a test" -x \ + "echo 'This is a test' | nc -w3 ${net_server_host_server} echo" + sleep 1 + get_counters + + for rule_regexp in \ + "@3 match in on ${epair_tester}b .* Packets: 6 Bytes: 455 " \ + "@4 match in on ${epair_tester}b .* Packets: 6 Bytes: 455 " \ + "@5 pass in on ${epair_tester}b .* Packets: 6 Bytes: 455 " \ + "@6 pass out on ${epair_tester}b .* Packets: 4 Bytes: 311 " \ + "@7 match in on ${epair_server}a .* Packets: 4 Bytes: 311 " \ + "@8 pass in on ${epair_server}a .* Packets: 4 Bytes: 311 " \ + "@10 pass out on ${epair_server}a .* Packets: 6 Bytes: 455 " \ + ; do + grep -qE "${rule_regexp}" $rules || atf_fail "Rule regexp not found for '${rule_regexp}'" + done + + for table_test in \ + "tbl_in___Evaluations: NoMatch: 0 Match: 16 In/Block: Packets: 0 Bytes: 0 In/Pass: Packets: 12 Bytes: 910 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 4 Bytes: 311 Out/XPass: Packets: 0 Bytes: 0" \ + "tbl_out_match___Evaluations: NoMatch: 0 Match: 4 In/Block: Packets: 0 Bytes: 0 In/Pass: Packets: 4 Bytes: 311 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 0 Bytes: 0 Out/XPass: Packets: 0 Bytes: 0" \ + "tbl_out_pass___Evaluations: NoMatch: 0 Match: 10 In/Block: Packets: 0 Bytes: 0 In/Pass: Packets: 4 Bytes: 311 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 6 Bytes: 455 Out/XPass: Packets: 0 Bytes: 0" \ + "tbl_inout___Evaluations: NoMatch: 0 Match: 12 In/Block: Packets: 0 Bytes: 0 In/Pass: Packets: 6 Bytes: 455 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 6 Bytes: 455 Out/XPass: Packets: 0 Bytes: 0" \ + ; do + table_name=${table_test%%___*} + table_regexp=${table_test##*___} + table=$(mktemp) || exit 1 + cat $tables | grep -A10 $table_name | tr '\n' ' ' | awk '{gsub("[\\[\\]]", " ", $0); gsub("[[:blank:]]+"," ",$0); print $0}' > ${table} + grep -qE "${table_regexp}" ${table} || atf_fail "Bad counters for table ${table_name}" + done; +} + +match_pass_no_state_cleanup() +{ + pft_cleanup +} + +atf_test_case "match_block" "cleanup" +match_block_head() +{ + atf_set descr 'Counters on match and block rules' + atf_set require.user root +} + +match_block_body() +{ + setup_router_server_ipv6 + + # Stateful firewall with a blocking rule. The rule will have its + # counters increased because it matches and applies correctly. + # The "match" rule before the "pass" rule will have its counters + # increased for blocked traffic too. + pft_set_rules router \ + "set state-policy if-bound" \ + "table { ${net_server_host_server} }" \ + "table { ${net_server_host_server} }" \ + "block" \ + "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ + "match in on ${epair_tester}b inet6 proto tcp to scrub (random-id)" \ + "block in on ${epair_tester}b inet6 proto tcp to " \ + "pass out on ${epair_server}a inet6 proto tcp keep state" + + # Wait 3 seconds, that will cause 2 SYNs to be sent out. + echo 'This is a test' | nc -w3 ${net_server_host_server} echo + sleep 1 + get_counters + + for rule_regexp in \ + "@3 match in on ${epair_tester}b .* Packets: 2 Bytes: 160 States: 0 " \ + "@4 block drop in on ${epair_tester}b .* Packets: 2 Bytes: 160 States: 0 " \ + ; do + grep -qE "${rule_regexp}" $rules || atf_fail "Rule regexp not found for '${rule_regexp}'" + done + + # OpenBSD has (In|Out)/Match. We don't (yet) have it in FreeBSD + # so we follow the action of the "pass" rule ("block" for this test) + # in "match" rules. + for table_test in \ + "tbl_in_match___Evaluations: NoMatch: 0 Match: 2 In/Block: Packets: 2 Bytes: 160 In/Pass: Packets: 0 Bytes: 0 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 0 Bytes: 0 Out/XPass: Packets: 0 Bytes: 0" \ + "tbl_in_block___Evaluations: NoMatch: 0 Match: 2 In/Block: Packets: 2 Bytes: 160 In/Pass: Packets: 0 Bytes: 0 In/XPass: Packets: 0 Bytes: 0 Out/Block: Packets: 0 Bytes: 0 Out/Pass: Packets: 0 Bytes: 0 Out/XPass: Packets: 0 Bytes: 0" \ + ; do + table_name=${table_test%%___*} + table_regexp=${table_test##*___} + table=$(mktemp) || exit 1 + cat $tables | grep -A10 $table_name | tr '\n' ' ' | awk '{gsub("[\\[\\]]", " ", $0); gsub("[[:blank:]]+"," ",$0); print $0}' > ${table} + grep -qE "${table_regexp}" ${table} || atf_fail "Bad counters for table ${table_name}" + done; +} + +match_block_cleanup() *** 696 LINES SKIPPED *** From nobody Wed Oct 1 16:10:55 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccKfS56cyz69sPl; Wed, 01 Oct 2025 16:10: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccKfS0HZtz3QDj; Wed, 01 Oct 2025 16:10:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QoEoJWF9Tfl5Vjtlr0EL1CZwJi2sqlEjinj8axpcdbg=; b=WvKEh3AB8WenkWwitQnAK0cRuQOFyx/oPqbU/f1Nsvvkdqc5Ydw/RwOp5XhYqQulkATRyv KPbDmuFDvu9coM645PQGgQdM3F2c+moeM3kWXtU1jC01tmXP+O5CLHNBO6vAKhYtoeUWsS J74a0Xdu3VNMikMcJ9giveLGz24J3ljM5j0co5Ix3ZzMpWUmg9YXY2VSVStkmoSwmVWBXk /gqKjFAPypp7DGwxaRVHc/Suqu/NO/QfbZOudOFA2XR3qOLxLJRaKnojBozFWSkrdDlavU iJhyrXql4vo+ov3fy+irPQN8LZtQvovkTEtdALCU+lc+5BjyT7rZNvss2X3CFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759335056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QoEoJWF9Tfl5Vjtlr0EL1CZwJi2sqlEjinj8axpcdbg=; b=Q8ePfbpKYnFEQvD5L/u0le0Nsca0NVxW9kMtIPRtmZjeZOHJWmrBPymAi5xygjZebaUSaF 9HyUDIiIlLGDhRWJKtckqi5gBt7mEnyQPMknNQxSbE1G+iOMWrPLaegT0LuLYK2HjouEvQ 2H28CToOQnhZSCcZmF5FoZzLYaCvvSXgDvfytU8gbTelOw17Co7LAOS5YVw6310qIS/5L1 eyEnj/XsLludxBVw+XmzxfVEwCgy2fxcfjY/CiVcfSZgLiKf3bz0xV/AbpnyYm3xtQTMRn QLknoeMtb+uFw+44urf6FamfkQU4BXcphpyeTpeQVRxByUXOZMf88S81Qn9H7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759335056; a=rsa-sha256; cv=none; b=wdadYyG+PBLxLsqp5tYZKpM3wbnoc/VmauaoD0MgRQSnaCXCEZjd7GbqADZgNsluf8Jclj rdppifQ3xc5oqBUhaCzORE8rzTDZSC6l4AY/778NcdAdZxYHWhTz6B5YO/Eh6J0Uu3+axE xcnHvz9V+K1nxLB8tuPYDtuuLoor414im3CbfYnQLwgfx79kHcRG1uBh8118bRJo0vrtpu POw+0yNhuLc1j4a/cksZS2AYTcRM5Lr0j/TjKp4gJyaOrbgvIsn48vv89FuGIh8krwMFzb QwCZK3QlT3qweaG0ByVtew5ayB1G1+PjLiXhdf9uHy0H00bV5jm63YZ9BHC8rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccKfR6xkfzDTy; Wed, 01 Oct 2025 16:10: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 591GAtcI066232; Wed, 1 Oct 2025 16:10:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GAtRf066229; Wed, 1 Oct 2025 16:10:55 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:10:55 GMT Message-Id: <202510011610.591GAtRf066229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kajetan Staszkiewicz Subject: git: ad428a318b60 - stable/15 - pf: Fix interface counters for af-to rules List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: ad428a318b60c0278a146b04fbc7520c322e55ef Auto-Submitted: auto-generated The branch stable/15 has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=ad428a318b60c0278a146b04fbc7520c322e55ef commit ad428a318b60c0278a146b04fbc7520c322e55ef Author: Kajetan Staszkiewicz AuthorDate: 2025-09-08 17:53:48 +0000 Commit: Kajetan Staszkiewicz CommitDate: 2025-10-01 16:00:47 +0000 pf: Fix interface counters for af-to rules An inbound af-to rule creates a state bypassing outbound pf_test(). In such case increase counters of the outbound interface directly in pf_route() for post-af-to address family. For outbound af-to rules ensure that post-af-to address family is used to increase interface counters. Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D52448 (cherry picked from commit 7cd3854f827faaad1ecf414d20bdf6802cfa60f8) --- sys/netpfil/pf/pf.c | 151 +++++++++++++++++++++++++-------------- tests/sys/netpfil/pf/counters.sh | 18 ++++- 2 files changed, 115 insertions(+), 54 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 66096133acd4..fb13f22bf0b1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9203,25 +9203,38 @@ pf_route(struct pf_krule *r, struct ifnet *oifp, if (r->rt == PF_DUPTO || (pd->af != pd->naf && s->direction == PF_IN)) skip_test = true; - if (pd->dir == PF_IN && !skip_test) { - if (pf_test(AF_INET, PF_OUT, PFIL_FWD, ifp, &m0, inp, - &pd->act) != PF_PASS) { - action = PF_DROP; - SDT_PROBE1(pf, ip, route_to, drop, __LINE__); - goto bad; - } else if (m0 == NULL) { - action = PF_DROP; - SDT_PROBE1(pf, ip, route_to, drop, __LINE__); - goto done; - } - if (m0->m_len < sizeof(struct ip)) { - DPFPRINTF(PF_DEBUG_URGENT, - "%s: m0->m_len < sizeof(struct ip)", __func__); - SDT_PROBE1(pf, ip, route_to, drop, __LINE__); - action = PF_DROP; - goto bad; + if (pd->dir == PF_IN) { + if (skip_test) { + struct pfi_kkif *out_kif = (struct pfi_kkif *)ifp->if_pf_kif; + MPASS(s != NULL); + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected( + &out_kif->pfik_bytes[pd->naf == AF_INET6][1] + [action != PF_PASS && action != PF_AFRT], pd->tot_len); + pf_counter_u64_add_protected( + &out_kif->pfik_packets[pd->naf == AF_INET6][1] + [action != PF_PASS && action != PF_AFRT], 1); + pf_counter_u64_critical_exit(); + } else { + if (pf_test(AF_INET, PF_OUT, PFIL_FWD, ifp, &m0, inp, + &pd->act) != PF_PASS) { + action = PF_DROP; + SDT_PROBE1(pf, ip, route_to, drop, __LINE__); + goto bad; + } else if (m0 == NULL) { + action = PF_DROP; + SDT_PROBE1(pf, ip, route_to, drop, __LINE__); + goto done; + } + if (m0->m_len < sizeof(struct ip)) { + DPFPRINTF(PF_DEBUG_URGENT, + "%s: m0->m_len < sizeof(struct ip)", __func__); + SDT_PROBE1(pf, ip, route_to, drop, __LINE__); + action = PF_DROP; + goto bad; + } + ip = mtod(m0, struct ip *); } - ip = mtod(m0, struct ip *); } if (ifp->if_flags & IFF_LOOPBACK) @@ -9520,26 +9533,39 @@ pf_route6(struct pf_krule *r, struct ifnet *oifp, if (r->rt == PF_DUPTO || (pd->af != pd->naf && s->direction == PF_IN)) skip_test = true; - if (pd->dir == PF_IN && !skip_test) { - if (pf_test(AF_INET6, PF_OUT, PFIL_FWD | PF_PFIL_NOREFRAGMENT, - ifp, &m0, inp, &pd->act) != PF_PASS) { - action = PF_DROP; - SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); - goto bad; - } else if (m0 == NULL) { - action = PF_DROP; - SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); - goto done; - } - if (m0->m_len < sizeof(struct ip6_hdr)) { - DPFPRINTF(PF_DEBUG_URGENT, - "%s: m0->m_len < sizeof(struct ip6_hdr)", - __func__); - action = PF_DROP; - SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); - goto bad; + if (pd->dir == PF_IN) { + if (skip_test) { + struct pfi_kkif *out_kif = (struct pfi_kkif *)ifp->if_pf_kif; + MPASS(s != NULL); + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected( + &out_kif->pfik_bytes[pd->naf == AF_INET6][1] + [action != PF_PASS && action != PF_AFRT], pd->tot_len); + pf_counter_u64_add_protected( + &out_kif->pfik_packets[pd->naf == AF_INET6][1] + [action != PF_PASS && action != PF_AFRT], 1); + pf_counter_u64_critical_exit(); + } else { + if (pf_test(AF_INET6, PF_OUT, PFIL_FWD | PF_PFIL_NOREFRAGMENT, + ifp, &m0, inp, &pd->act) != PF_PASS) { + action = PF_DROP; + SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); + goto bad; + } else if (m0 == NULL) { + action = PF_DROP; + SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); + goto done; + } + if (m0->m_len < sizeof(struct ip6_hdr)) { + DPFPRINTF(PF_DEBUG_URGENT, + "%s: m0->m_len < sizeof(struct ip6_hdr)", + __func__); + action = PF_DROP; + SDT_PROBE1(pf, ip6, route_to, drop, __LINE__); + goto bad; + } + ip6 = mtod(m0, struct ip6_hdr *); } - ip6 = mtod(m0, struct ip6_hdr *); } if (ifp->if_flags & IFF_LOOPBACK) @@ -10665,21 +10691,32 @@ pf_counters_inc(int action, struct pf_pdesc *pd, struct pf_kstate *s, struct pf_addr *dst_host = pd->dst; struct pf_state_key *key; int dir_out = (pd->dir == PF_OUT); - int op_pass = (r->action == PF_PASS); - sa_family_t af = pd->af; + int op_r_pass = (r->action == PF_PASS); + int op_pass = (action == PF_PASS || action == PF_AFRT); int s_dir_in, s_dir_out, s_dir_rev; + sa_family_t af = pd->af; pf_counter_u64_critical_enter(); + /* + * Set AF for interface counters, it will be later overwritten for + * rule and state counters with value from proper state key. + */ + if (action == PF_AFRT) { + MPASS(s != NULL); + if (s->direction == PF_OUT && dir_out) + af = pd->naf; + } + pf_counter_u64_add_protected( - &pd->kif->pfik_bytes[pd->af == AF_INET6][dir_out][action != PF_PASS], + &pd->kif->pfik_bytes[af == AF_INET6][dir_out][!op_pass], pd->tot_len); pf_counter_u64_add_protected( - &pd->kif->pfik_packets[pd->af == AF_INET6][dir_out][action != PF_PASS], + &pd->kif->pfik_packets[af == AF_INET6][dir_out][!op_pass], 1); /* If the rule has failed to apply, don't increase its counters */ - if (!(action == PF_PASS || action == PF_AFRT || r->action == PF_DROP)) { + if (!(op_pass || r->action == PF_DROP)) { pf_counter_u64_critical_exit(); return; } @@ -10690,22 +10727,32 @@ pf_counters_inc(int action, struct pf_pdesc *pd, struct pf_kstate *s, /* * For af-to on the inbound direction we can determine - * the direction only by checking direction of AF translation, - * since the state is always "in" and so is packet's direction. + * the direction of passing packet only by checking direction + * of AF translation. The af-to in "in" direction covers both + * the inbound and the outbound side of state tracking, + * so pd->dir is always PF_IN. We set dir_out and s_dir_rev + * in a way to count packets as if the state was outbound, + * because pfctl -ss shows the state with "->", as if it was + * oubound. */ - if (pd->af != pd->naf && s->direction == PF_IN) { + if (action == PF_AFRT && s->direction == PF_IN) { dir_out = (pd->naf == s->rule->naf); s_dir_in = 1; s_dir_out = 0; - s_dir_rev = (pd->naf != s->rule->naf); - } - else { + s_dir_rev = (pd->naf == s->rule->af); + } else { dir_out = (pd->dir == PF_OUT); s_dir_in = (s->direction == PF_IN); s_dir_out = (s->direction == PF_OUT); s_dir_rev = (pd->dir != s->direction); } + /* pd->tot_len is a problematic with af-to rules. Sure, we can + * agree that it's the post-af-to packet length that was + * forwarded through a state, but what about tables which match + * on pre-af-to addresses? We don't have access the the original + * packet length anymore. + */ s->packets[s_dir_rev]++; s->bytes[s_dir_rev] += pd->tot_len; @@ -10737,7 +10784,7 @@ pf_counters_inc(int action, struct pf_pdesc *pd, struct pf_kstate *s, s->nat_rule->action == PF_BINAT) { nr = s->nat_rule; pf_rule_counters_inc(pd, s->nat_rule, dir_out, - op_pass, af, src_host, dst_host); + op_r_pass, af, src_host, dst_host); /* Use post-NAT addresses from now on */ key = s->key[s_dir_in]; src_host = &(key->addr[s_dir_out]); @@ -10748,7 +10795,7 @@ pf_counters_inc(int action, struct pf_pdesc *pd, struct pf_kstate *s, } SLIST_FOREACH(ri, mr, entry) { - pf_rule_counters_inc(pd, ri->r, dir_out, op_pass, af, + pf_rule_counters_inc(pd, ri->r, dir_out, op_r_pass, af, src_host, dst_host); if (s && s->nat_rule == ri->r) { /* Use post-NAT addresses after a match NAT rule */ @@ -10764,12 +10811,12 @@ pf_counters_inc(int action, struct pf_pdesc *pd, struct pf_kstate *s, } if (a != NULL) { - pf_rule_counters_inc(pd, a, dir_out, op_pass, af, + pf_rule_counters_inc(pd, a, dir_out, op_r_pass, af, src_host, dst_host); } if (r != nr) { - pf_rule_counters_inc(pd, r, dir_out, op_pass, af, + pf_rule_counters_inc(pd, r, dir_out, op_r_pass, af, src_host, dst_host); } diff --git a/tests/sys/netpfil/pf/counters.sh b/tests/sys/netpfil/pf/counters.sh index a0119b4710c1..20d7dc3c6d89 100644 --- a/tests/sys/netpfil/pf/counters.sh +++ b/tests/sys/netpfil/pf/counters.sh @@ -684,7 +684,7 @@ nat64_in_body() "table { 64:ff9b::${net_server1_4_host_server} }" \ "table { ${net_tester_6_host_tester} }" \ "table { 64:ff9b::${net_server1_4_host_server} }" \ - "block" \ + "block log" \ "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ "match in on ${epair_tester}b inet6 proto tcp from to scrub (random-id)" \ "pass in on ${epair_tester}b inet6 proto tcp from to \ @@ -726,6 +726,13 @@ nat64_in_body() ; do grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" done + + echo " === interfaces === " + echo " === tester === " + jexec router pfctl -qvvsI -i ${epair_tester}b + echo " === server === " + jexec router pfctl -qvvsI -i ${epair_server1}a + echo " === " } nat64_in_cleanup() @@ -753,7 +760,7 @@ nat64_out_body() "table { 64:ff9b::${net_server1_4_host_server} }" \ "table { ${net_tester_6_host_tester} }" \ "table { 64:ff9b::${net_server1_4_host_server} }" \ - "block" \ + "block log " \ "pass inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ "pass in on ${epair_tester}b inet6 proto tcp keep state" \ "match out on ${epair_server1}a inet6 proto tcp from to scrub (random-id)" \ @@ -794,6 +801,13 @@ nat64_out_body() ; do grep -qE "${state_regexp}" $states || atf_fail "State not found for '${state_regexp}'" done + + echo " === interfaces === " + echo " === tester === " + jexec router pfctl -qvvsI -i ${epair_tester}b + echo " === server === " + jexec router pfctl -qvvsI -i ${epair_server1}a + echo " === " } nat64_out_cleanup() From nobody Wed Oct 1 16:31:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccL6j3GS1z69vJQ; Wed, 01 Oct 2025 16:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccL6j2lr6z3Sv1; Wed, 01 Oct 2025 16:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759336317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Q2xSdQsM2G6CP2q3xnb5B+AOdk+dgo2CNqC7nkWh0I=; b=dhV/BcRtwd7dJjxIxQ0qKzUvHSTrBFV8MacWo6dG9VqXK1dhjyAM319ENqgEYB2nN4jPwI qM1sqHgcej+s8MEqKBLqYkE0rhC/VGhJwLQJyz34wBLWgZp6W6s/4CXGgaTCfIfynkTEVk 7SnHcTP9m2hwEaO8tPQsX+wQaAchKszOQkMn/qleIwkPJqq9eGidJhwlN+8zgBj8wCWYio RKOp18n7DqYT/+kTL6MkvUTkANZB4dAmdBNqZRxpTglnYyEXDeDcTdqFCsYSmfaMCB9QZO top0DDmZyDu53Qu7osL9QEpbvYY77IsWOyilMUTJ5soZbxBoJRip3J0hYcFGtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759336317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Q2xSdQsM2G6CP2q3xnb5B+AOdk+dgo2CNqC7nkWh0I=; b=QEwlxFyDeEwPo8jGbX5qFJT1TEJMQPNuHvybv4VGNMNQdUGYRuPpc9sCRwYpnyvZfEuwDw AHcLPH88+U3/UELyeeQ5nJuCeaVxXNdH8zlP/wyJQhasrx/CEgnw6I7ojU7CLyBST+WB5L cPyqfqhiKaZO9QW9eNK4pUdSJFT9suly+83valVsyc8nvnc/wifXcGh8GpwRKhEA1KWRmq Nob3J26SDasDgw1b5WiivOTjkYhUS0YdX57CfZvXUEHxGtRffnm177XpdKAeV7f0tuJoRu 7HIPhlCt8VrjU5ap9v9nc2jbgjnmXxtqeofTw/EDl6I7n2iiWo/+BqU4wFmfaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759336317; a=rsa-sha256; cv=none; b=Coo8C2GPvmwBlaZhblG3endwu1ZvsxMd4yW4FLp5t+6UIRSnoI3wVnArWTepPVjwHykrY6 BQIuAcAkttcEk4gxQ5FMy/7OHbNB++k7Fl+SkvsprAEL9Mo41J09d+yxNbDvqq/Zp8ufHv RdmkpQmCTIvTyZgefeBPHRs5Q4oLjbjkT9w83LqcgLJMBoyeWbQckADRHzU1Y05FroNzFZ 0SoUbaBQHIGJaBzE/L3vLPY8R+vOrxCCq+tVkAOd5LKkkpCd/m8QOXBhN5nb1tTy38c2mO le2LDeQYd/M3cUu1xhfTBQ65k4zHtII8bama0gZovmXwwTwtodOlyuUnRcEN/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccL6j2KwCzV7C; Wed, 01 Oct 2025 16:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 591GVvSc008665; Wed, 1 Oct 2025 16:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GVvPB008662; Wed, 1 Oct 2025 16:31:57 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:31:57 GMT Message-Id: <202510011631.591GVvPB008662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: ae87c1af4419 - stable/13 - mktemp.1: Document TMPDIR in ENVIRONMENT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae87c1af4419a8c84954a22691712cc8897a85bf Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=ae87c1af4419a8c84954a22691712cc8897a85bf commit ae87c1af4419a8c84954a22691712cc8897a85bf Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-09-27 15:21:13 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-10-01 16:31:45 +0000 mktemp.1: Document TMPDIR in ENVIRONMENT While here, use Ev for TMPDIR consistently. MFC after: 3 days Event: EuroBSDCon 2025 (cherry picked from commit 6b164f18118d0e8dbf9826d7117e0e757f7eb727) --- usr.bin/mktemp/mktemp.1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/usr.bin/mktemp/mktemp.1 b/usr.bin/mktemp/mktemp.1 index 68a5a54aa5c5..47545ee9e5b8 100644 --- a/usr.bin/mktemp/mktemp.1 +++ b/usr.bin/mktemp/mktemp.1 @@ -27,7 +27,7 @@ .\" .\" From: $OpenBSD: mktemp.1,v 1.8 1998/03/19 06:13:37 millert Exp $ .\" -.Dd August 4, 2022 +.Dd September 27, 2025 .Dt MKTEMP 1 .Os .Sh NAME @@ -185,6 +185,13 @@ but still introduces a race condition. Use of this option is not encouraged. .El +.Sh ENVIRONMENT +.Bl -tag -width TMPDIR +.It Ev TMPDIR +The directory in which to store temporary files. +Refer to +.Xr environ 7 . +.El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -200,7 +207,8 @@ TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 echo "program output" >> $TMPFILE .Ed .Pp -To allow the use of $TMPDIR: +To allow the use of +.Ev TMPDIR : .Bd -literal -offset indent tempfoo=`basename $0` TMPFILE=`mktemp -t ${tempfoo}` || exit 1 From nobody Wed Oct 1 16:32:07 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccL6v52vQz69v73; Wed, 01 Oct 2025 16:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccL6v4Wdqz3TC0; Wed, 01 Oct 2025 16:32:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759336327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+hM3VFrABE+QW1pXGWqZgSgCEr9fj8wIHn87Jlp75M=; b=n8f4V03CoVuOjEzQI80csMgFHzBXb/YDttqT0y9ZpgGlfLD7FVFaNfk3lYu+30fOsacUce l0swHa0wpzAtkT00pDPOWnVD3CuaZOuz00AQkIMZReamoFUrpmUcJRE0K1K2j9NEMmrXay vHEhguvorEmgjVJbpafWEmau98Y0M6YdeShNozRPPH1dwFbZQLOBDumo+Nr+Q26Jeiae1C BJogGN1Ti5h9MiX3b8vDVKwUuZU4WmFZi4JryGk7gR2ncxmB0dvJNV0NHr2dpQHbk4/eMd nIQZYWGDyIUcYkizO4P7UgnKhpWzQ3hdxbMWifETbRgJPg+WdEwWVSkeJQl3jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759336327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+hM3VFrABE+QW1pXGWqZgSgCEr9fj8wIHn87Jlp75M=; b=kRx5BJVxelbVOoEfAbug3VJbu0nBjturnb+REJz5iSrerhizWSltYMlHO9c+YVSNZ9k3Qj 3kqUpL0nw7uNcRH97Gtgz4U6OXE+icE+tiZ1Fs+qGKSX01C+8W2nQxu8i76UJbr97TBNP4 RmvKz0BraCfguGnpTuzBn/5ce8GrylkPcifB87A2DHJNXgQDzrZ4how/S6daqr1xYcPZWE cHPYk9CTAmFw5GNSKlia09BytaUv5N6bZdMa/Nj6v9f/NbuTRoNP18OScPloZuL2Kl9zxG ANdhVn8EVH9E94fvKPH4hzEt0y1d/ew9JODSYUm3XJ69f0Ev+tUtRZQr2bRG2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759336327; a=rsa-sha256; cv=none; b=nRGLQJvtMt/qj2rIZp71rPqDuu7oUdQl1rMtjTUawO4bs7GgHYCW1oIzSEX4aGOMBF1Grw w3qqTj9DDNWdj0uMn4kDkJyYB63pqDrKm5JcVyJdTCMrVxvgQbGch006ppsma5OvJ+E5L7 mJmpAd8KEUL+tRE6mee6NvMVr3HDDdmpsByPv0XEYD4oKblu+KG4Vmkyqc8ZKEBOvf+pmZ dy6EVmua34LV6GraJyNSCHAn4LVbsQQQuw211ZBKS+g9ahwMxfKN47Bhr0gzf+d9E4Am7J kHlNSlMrvNBW154P23wyTqQN7PWSUMhm5LJRLWJWamDbIKBWSN4Ku69+VFIilw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccL6v44yhzTvM; Wed, 01 Oct 2025 16:32: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 591GW7Wk011478; Wed, 1 Oct 2025 16:32:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GW7JT011475; Wed, 1 Oct 2025 16:32:07 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:32:07 GMT Message-Id: <202510011632.591GW7JT011475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 08a2145902a7 - stable/14 - mktemp.1: Document TMPDIR in ENVIRONMENT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 08a2145902a71b4533f840f02a69dbdb63cb891e Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=08a2145902a71b4533f840f02a69dbdb63cb891e commit 08a2145902a71b4533f840f02a69dbdb63cb891e Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-09-27 15:21:13 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-10-01 16:31:59 +0000 mktemp.1: Document TMPDIR in ENVIRONMENT While here, use Ev for TMPDIR consistently. MFC after: 3 days Event: EuroBSDCon 2025 (cherry picked from commit 6b164f18118d0e8dbf9826d7117e0e757f7eb727) --- usr.bin/mktemp/mktemp.1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/usr.bin/mktemp/mktemp.1 b/usr.bin/mktemp/mktemp.1 index 68a5a54aa5c5..47545ee9e5b8 100644 --- a/usr.bin/mktemp/mktemp.1 +++ b/usr.bin/mktemp/mktemp.1 @@ -27,7 +27,7 @@ .\" .\" From: $OpenBSD: mktemp.1,v 1.8 1998/03/19 06:13:37 millert Exp $ .\" -.Dd August 4, 2022 +.Dd September 27, 2025 .Dt MKTEMP 1 .Os .Sh NAME @@ -185,6 +185,13 @@ but still introduces a race condition. Use of this option is not encouraged. .El +.Sh ENVIRONMENT +.Bl -tag -width TMPDIR +.It Ev TMPDIR +The directory in which to store temporary files. +Refer to +.Xr environ 7 . +.El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -200,7 +207,8 @@ TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 echo "program output" >> $TMPFILE .Ed .Pp -To allow the use of $TMPDIR: +To allow the use of +.Ev TMPDIR : .Bd -literal -offset indent tempfoo=`basename $0` TMPFILE=`mktemp -t ${tempfoo}` || exit 1 From nobody Wed Oct 1 16:32:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccL793XTxz69v75; Wed, 01 Oct 2025 16:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccL792WBQz3TLc; Wed, 01 Oct 2025 16:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759336341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HqUflQLALwSP/oXDi5uqwIfptXprWr+r8Ad++UP6rsE=; b=KxJMNQMe2DY0QSqP+n2qdQ+3huPgv7dSz537i/Qy5TbDC/6yDRYCgejaOS2xwRjTN15Ef3 93gMv0yRKc3WOHali/ZojAN5nRkQyYbHOQIYdBBxOKNgH0swmJ+SvQY5Z2425Kn8M06ICg Vu9ODqQbzVByAk/c8/kA6kiGvLm+LOjlqR6TjnM+y64cBNg+r5drYQeGG5haCqwa3IBNkl YJ9GmjByhLdNRBDgngjS+EIAZ5Ca287FI1KqE8HtWFSkoGhOycnmagRGLbKBjEKisJQKyR Nr4GSWuasj9SxorPVQQcDo48KmnVcJAKEILEd4lc7DFMVxc7a8OP5LV3AerBmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759336341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HqUflQLALwSP/oXDi5uqwIfptXprWr+r8Ad++UP6rsE=; b=hg8y7+7I2r1ANQGHyy/mRFUi5msnNm//+gqRLcjrf0XNxkP9TU7MyClGTRlLRpjNg3RshT Rw7lbLkJ1oTCIDm4On3Flrz+6GwclMJimpDvkx+9+yEeXfaPPOHKGDGs3cTaro15mOmuIy qUAXE/qIovvz8+d+KI6xtT3uacT/blUIrWSRUBOuPEAByatOXgtxD2O7iyIi7uDqgPUGZl M7A2uKOubsi/itTZZnwzNNEULM+4szGgKiowLZlzxWDxTHT7o13gqszQjMu/2IMrams11D H0s4NA7MxoZQS1LfQVrtnime6GMIvNqXJGhXF8HVid1+U3B3XxmhjixvoRE6sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759336341; a=rsa-sha256; cv=none; b=k4wsoU8gfetUwi+h7Qq2DhBmPlmclanTnUBFNa12cpumtfsvwgDbfhxpm6Gg2jbwn/S72e a7jV5NmjS7VZfUwwJ8j//zr1NAmaRwuwcz5VuLREY5ejVkwQgVYDOU8Dj27V2L/M7Qob9P QXQCTQlXOhr8JHhLKI+LW8gbbQlY8cgvv9g7Wb54QyyIhd/LlUDPLd08fq7iQuTho5WZdx 7HwuqvRSzFiZoouzC0BTQFJIZf5iLVmr27uCpfg7rPATINZvbdDXS+r/ckz11bcB2JHCj0 XjzQMNeCQo7Ln9t9Gmp4LmY+QckEcvlkUDi7aXiYiC1Nwav9DGqEEtl8HhPzdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccL791xs2zVQv; Wed, 01 Oct 2025 16:32: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 591GWLKq011660; Wed, 1 Oct 2025 16:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591GWLxp011657; Wed, 1 Oct 2025 16:32:21 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:32:21 GMT Message-Id: <202510011632.591GWLxp011657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e3a9e2f029ab - stable/15 - mktemp.1: Document TMPDIR in ENVIRONMENT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e3a9e2f029ab7a0674f44b64e5d246fbc9f932ca Auto-Submitted: auto-generated The branch stable/15 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=e3a9e2f029ab7a0674f44b64e5d246fbc9f932ca commit e3a9e2f029ab7a0674f44b64e5d246fbc9f932ca Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-09-27 15:21:13 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-10-01 16:32:17 +0000 mktemp.1: Document TMPDIR in ENVIRONMENT While here, use Ev for TMPDIR consistently. MFC after: 3 days Event: EuroBSDCon 2025 (cherry picked from commit 6b164f18118d0e8dbf9826d7117e0e757f7eb727) --- usr.bin/mktemp/mktemp.1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/usr.bin/mktemp/mktemp.1 b/usr.bin/mktemp/mktemp.1 index 063f25f216dc..3b8381c0586c 100644 --- a/usr.bin/mktemp/mktemp.1 +++ b/usr.bin/mktemp/mktemp.1 @@ -27,7 +27,7 @@ .\" .\" From: $OpenBSD: mktemp.1,v 1.8 1998/03/19 06:13:37 millert Exp $ .\" -.Dd August 4, 2022 +.Dd September 27, 2025 .Dt MKTEMP 1 .Os .Sh NAME @@ -185,6 +185,13 @@ but still introduces a race condition. Use of this option is not encouraged. .El +.Sh ENVIRONMENT +.Bl -tag -width TMPDIR +.It Ev TMPDIR +The directory in which to store temporary files. +Refer to +.Xr environ 7 . +.El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -200,7 +207,8 @@ TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXXXXXX` || exit 1 echo "program output" >> $TMPFILE .Ed .Pp -To allow the use of $TMPDIR: +To allow the use of +.Ev TMPDIR : .Bd -literal -offset indent tempfoo=`basename $0` TMPFILE=`mktemp -t ${tempfoo}` || exit 1 From nobody Wed Oct 1 16:52:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccLZc5Cl0z68xxd; Wed, 01 Oct 2025 16:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccLZc4dxxz3YrB; Wed, 01 Oct 2025 16:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759337560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FdncK2+ZtzT3nChbIReV2EiQokK9jK3m6LV8n7a6Wyw=; b=pI5Z/uxaeGTP3BZwjoyMFqoYsKq0me7KE8k0R7ZaX4VfgdJyWJ6QIYtZkUzmWmzq9LEJci 1rJTuvBb98Aj3WQ9e0mhSnWq2VnLVPWT1qGElKxHknDJsVyDCWWlZLgUJSrVK3o/Pzbett dM8pBfXS+rg8VXx4jcEDSoL2brXwtjCc8UZWDH8gKry4+WAaVf0Xu8I50uRD4+UZPX+N4u ZBR/AmnKIUVYh31zKQqbDeye6R6iwto5O06KxzQIO6wJfqWdabNt7O9VDJqZ4qRAHCrauv iCJ9gD9QhSpLSjrkPt7bLrOy4wRjbNOJ7yMpbz9sa1Xq7txNZrhRyJlJAk+wsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759337560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FdncK2+ZtzT3nChbIReV2EiQokK9jK3m6LV8n7a6Wyw=; b=kOu6mLR6q4axUOmheRwN1rTz6joHCvY0PtlXKCAvkITQ4ed0RtRXoh6QSSxtNGwE2PEEI6 duvDvd6Y72yRl1zOl0+8nFna69p/P+5ADJreY+AJRLcn2k+Tt37GArxUkX0X8qOGpEUS2/ 43sueQelC0dc6JL0u5iA2KLc3/bAUYPTuJ0rsy06dvmy8CtYVJ69US53LNvYus1Qu84dds EVuHBTbpi6m8zK+e3bhnLEr1l0JiDSsj6vo4KZxK920/8g2x+lVbYnCBNYoAOaguv7yTLG 0AubTlR0+3FqdUUYvXR2ZxLd2znNaT6tdcNnIWYmNtE4sPGswWm4fSTgyoVevA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759337560; a=rsa-sha256; cv=none; b=wGONayym//Yr7/4kdHP8eSrY86ZH4hGFQQ5UTdepiSSXx5u7hvxM3NvF/FamjnvClwkHj6 Zp3D13LfuuUijwV1bJq08VwcVrBUcC/2czZihP8FfFL4JJUWG5vmPX0djoCQ6bokE5o436 9ta7L2b3njvauLEsVa2xqkxgDtpv3Vk/1vNGLtHm9FAykbhYEpv3hCM8W8ys/v0pKtN4fi vYcPWvNKgxzgqD9OQUN91UlYiAFX5ZervhO1XKs0YW3c8zEsf6H90DHeJ164D5dnP7bnQC hCQeb+CpELf/9HgIRf4i5Ycfzk3bso879OGYr6pcrs8AcByiovkPPT9szw5BCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccLZc4BvszWTn; Wed, 01 Oct 2025 16:52: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 591GqeIA048891; Wed, 1 Oct 2025 16:52:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591Gqe9v048888; Wed, 1 Oct 2025 16:52:40 GMT (envelope-from git) Date: Wed, 1 Oct 2025 16:52:40 GMT Message-Id: <202510011652.591Gqe9v048888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 224d270f6c6c - stable/15 - mrsas.4: Cleaning List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 224d270f6c6c3c26e3302fdf0f54617c26c229f2 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=224d270f6c6c3c26e3302fdf0f54617c26c229f2 commit 224d270f6c6c3c26e3302fdf0f54617c26c229f2 Author: Alexander Ziaee AuthorDate: 2025-09-28 03:41:33 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-01 16:52:30 +0000 mrsas.4: Cleaning + Rewrite SYNOPSIS for consistency + Rewrite HARDWARE for HW Relnotes, and add some stragglers + Correct mdoc grammar, making sysctls aproposable and linking xrefs + Clean up TODO, cannonicalize to CAVEATS, a standard section + Editorial pass, tag SPDX MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D52125 (cherry picked from commit 52eb7e394a7e28e9b08e2096c4a085a384cc1dd0) --- share/man/man4/mrsas.4 | 199 ++++++++++++++++++++++--------------------------- 1 file changed, 91 insertions(+), 108 deletions(-) diff --git a/share/man/man4/mrsas.4 b/share/man/man4/mrsas.4 index 36e9a7b5c7e7..5f7a0e6e45ea 100644 --- a/share/man/man4/mrsas.4 +++ b/share/man/man4/mrsas.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 2014 LSI Corp .\" All rights reserved. .\" Author: Kashyap Desai @@ -32,43 +35,42 @@ .\" are those of the authors and should not be interpreted as representing .\" official policies, either expressed or implied, of the FreeBSD Project. .\" -.Dd February 4, 2021 +.Dd August 22, 2025 .Dt MRSAS 4 .Os .Sh NAME .Nm mrsas -.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA RAID controller driver" +.Nd Broadcom/LSI MegaRAID 6/12Gb/s SAS+SATA RAID controller driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: -.Bd -ragged -offset indent .Cd "device pci" .Cd "device mrsas" -.Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +In .Xr loader.conf 5 : -.Bd -literal -offset indent -mrsas_load="YES" -.Ed +.Cd mrsas_load="YES" +.Pp +In +.Xr sysctl.conf 5 : +.Cd dev.mrsas.X.disable_ocr +.Cd dev.mrsas.X.fw_outstanding +.Cd dev.mrsas.X.mrsas_fw_fault_check_delay +.Cd dev.mrsas.X.mrsas_io_timeout +.Cd hw.mrsas.X.debug_level .Sh DESCRIPTION The .Nm -driver will detect LSI's next generation (6Gb/s and 12Gb/s) PCI Express -SAS/SATA RAID controllers. -See the -.Nm HARDWARE -section for the supported devices list. -A disk (virtual disk/physical disk) attached to the +driver will detect Broadcom/LSI's 6Gb/s and 12Gb/s +PCI Express SAS/SATA/NVMe RAID controllers. +A disk +.Pq virtual disk/physical disk +attached to the .Nm driver will be visible to the user through .Xr camcontrol 8 as .Pa /dev/da? device nodes. -A simple management interface is also provided on a per-controller basis via the +A simple management interface is also provided per-controller via the .Pa /dev/mrsas? device node. .Pp @@ -77,8 +79,7 @@ The name is derived from the phrase "MegaRAID SAS HBA", which is substantially different than the old "MegaRAID" Driver .Xr mfi 4 -which does not connect targets -to the +which does not connect targets to the .Xr cam 4 layer and thus requires a new driver which attaches targets to the .Xr cam 4 @@ -91,8 +92,8 @@ but both the .Xr mfi 4 and .Nm -drivers can detect and manage the LSI MegaRAID SAS 2208/2308/3008/3108 series of -controllers. +drivers can detect and manage the +Broadcom/LSI MegaRAID SAS 2208/2308/3008/3108 series of controllers. .Pp The .Xr device.hints 5 @@ -103,7 +104,7 @@ By default, the .Xr mfi 4 driver will detect these controllers. See the -.Nm PRIORITY +.Sx PRIORITY section to know more about driver priority for MR-Fusion devices. .Pp .Nm @@ -124,46 +125,32 @@ rather then JBOD virtual mode. .Sh HARDWARE The .Nm -driver supports the following hardware: -.Pp -[ Thunderbolt 6Gb/s MR controller ] -.Bl -bullet -compact -.It -LSI MegaRAID SAS 9265 -.It -LSI MegaRAID SAS 9266 -.It -LSI MegaRAID SAS 9267 -.It -LSI MegaRAID SAS 9270 -.It -LSI MegaRAID SAS 9271 -.It -LSI MegaRAID SAS 9272 -.It -LSI MegaRAID SAS 9285 -.It -LSI MegaRAID SAS 9286 -.It -DELL PERC H810 -.It -DELL PERC H710/P -.El +driver supports the following LSI/Broadcom SATA/SAS RAID controllers: .Pp -[ Invader/Fury 12Gb/s MR controller ] -.Bl -bullet -compact -.It -LSI MegaRAID SAS 9380 -.It -LSI MegaRAID SAS 9361 -.It -LSI MegaRAID SAS 9341 -.It -DELL PERC H830 -.It -DELL PERC H730/P -.It -DELL PERC H330 +.Bl -column -compact "LSI MegaRAID SAS 9380" "Invader/Fury" "12Gb/s" +.It Controller Ta Chip Ta Speed +.It Broadcom SAS3916 Ta Aero Ta 12Gb/s +.It Broadcom SAS3908 Ta Aero Ta 12Gb/s +.It LSI MegaRAID SAS 9380 Ta Invader/Fury Ta 12Gb/s +.It LSI MegaRAID SAS 9361 Ta Invader/Fury Ta 12Gb/s +.It LSI MegaRAID SAS 9341 Ta Invader/Fury Ta 12Gb/s +.It LSI MegaRAID SAS 9286 Ta Thunderbolt Ta 6Gb/s +.It LSI MegaRAID SAS 9285 Ta Thunderbolt Ta 6Gb/s +.It LSI MegaRAID SAS 9272 Ta Thunderbolt Ta 6Gb/s +.It LSI MegaRAID SAS 9271 Ta Thunderbolt Ta 6Gb/s +.It LSI MegaRAID SAS 9270 Ta Thunderbolt Ta 6Gb/s +.It LSI MegaRAID SAS 9267 Ta Thunderbolt Ta 6Gb/s +.It LSI MegaRAID SAS 9266 Ta Thunderbolt Ta 6Gb/s +.It LSI MegaRAID SAS 9265 Ta Thunderbolt Ta 6Gb/s +.It LSI SAS 3108 Ta Ta 12Gb/s +.It LSI SAS 3008 Ta Ta 12Gb/s +.It LSI SAS 2308 Ta Ta 6Gb/s +.It LSI SAS 2208 Ta Ta 6Gb/s +.It DELL PERC H830 Ta Invader/Fury Ta 12Gb/s +.It DELL PERC H810 Ta Thunderbolt Ta 6Gb/s +.It DELL PERC H730/P Ta Invader/Fury Ta 12Gb/s +.It DELL PERC H710/P Ta Thunderbolt Ta 6Gb/s +.It DELL PERC H330 Ta Invader/Fury Ta 12Gb/s .El .Sh CONFIGURATION To disable Online Controller Reset(OCR) for a specific @@ -171,9 +158,8 @@ To disable Online Controller Reset(OCR) for a specific driver instance, set the following tunable value in .Xr loader.conf 5 : -.Bd -literal -offset indent -dev.mrsas.X.disable_ocr=1 -.Ed +.Pp +.Dl Va dev.mrsas.X.disable_ocr=1 .Pp where X is the adapter number. .Pp @@ -181,9 +167,8 @@ To change the I/O timeout value for a specific .Nm driver instance, set the following tunable value in .Xr loader.conf 5 : -.Bd -literal -offset indent -dev.mrsas.X.mrsas_io_timeout=NNNNNN -.Ed +.Pp +.Dl Va dev.mrsas.X.mrsas_io_timeout=NNNNNN .Pp where NNNNNN is the timeout value in milli-seconds. .Pp @@ -191,9 +176,8 @@ To change the firmware fault check timer value for a specific .Nm driver instance, set the following tunable value in .Xr loader.conf 5 : -.Bd -literal -offset indent -dev.mrsas.X.mrsas_fw_fault_check_delay=NN -.Ed +.Pp +.Dl Va dev.mrsas.X.mrsas_fw_fault_check_delay=NN .Pp where NN is the fault check delay value in seconds. .Pp @@ -248,7 +232,8 @@ or subsystem for selection of MR-Fusion cards. With the above design in place, the .Xr mfi 4 -driver will attach to a MR-Fusion card given that it has a higher priority than +driver will attach to a MR-Fusion card +given that it has a higher priority than .Nm . .Pp Using @@ -267,45 +252,48 @@ At boot time, the .Xr mfi 4 driver will get priority to detect MR-Fusion controllers by default. Before -changing this default driver selection policy, LSI advises users to understand -how the driver selection policy works. +changing this default driver selection policy, +LSI advises users to understand how the driver selection policy works. LSI's policy is to provide priority to the .Xr mfi 4 -driver to detect MR-Fusion cards, but allow for the ability to choose the +driver to detect MR-Fusion cards, +but allow for the ability to choose the .Nm driver to detect MR-Fusion cards. .Pp -LSI recommends setting hw.mfi.mrsas_enable="0" for customers who are using the -older +LSI recommends setting +.Va hw.mfi.mrsas_enable="0" +for customers who are using the older .Xr mfi 4 driver and do not want to switch to .Nm . -For those customers who are using a MR-Fusion controller for the first time, LSI -recommends using the +For those using a MR-Fusion controller for the first time, +LSI recommends using the .Nm -driver and setting hw.mfi.mrsas_enable="1". +driver and setting +.Va hw.mfi.mrsas_enable="1". .Pp -Changing the default behavior is well tested under most conditions, but -unexpected behavior may pop up if more complex and unrealistic operations are -executed by switching between the +Changing the default behavior is well tested under most conditions, +but unexpected behavior may pop up +if more complex and unrealistic operations are executed +by switching between the .Xr mfi 4 and .Nm drivers for MR-Fusion. Switching drivers is designed to happen only one time. -Although multiple -switching is possible, it is not recommended. +Although multiple switching is possible, it is not recommended. The user should decide from -.Nm Start of Day +.Sy boot which driver they want to use for the MR-Fusion card. .Pp The user may see different device names when switching from .Xr mfi 4 to .Nm . -This behavior is -.Nm Functions As Designed +This behavior +.Sy works as intended and the user needs to change the .Xr fstab 5 entry manually if they are doing any experiments with @@ -314,7 +302,7 @@ and .Nm interoperability. .Sh FILES -.Bl -tag -width ".Pa /dev/mrsas?" -compact +.Bl -tag -width "/dev/mrsas?" -compact .It Pa /dev/da? array/logical disk interface .It Pa /dev/mrsas? @@ -337,7 +325,8 @@ driver first appeared in is the old .Fx driver which started with support for Gen-1 Controllers and -was extended to support up to MR-Fusion (Device ID = 0x005B, 0x005D, 0x005F). +was extended to support up to MR-Fusion +.Pq Device ID = 0x005B, 0x005D, 0x005F . .Ed .Bd -ragged .Cd "mrsas Driver:" @@ -348,12 +337,12 @@ The SAS+SATA RAID controller with device id 0x005b is referred to as the Thunderbolt controller throughout this man page. .Ed .Bd -ragged -.Nm cam aware HBA drivers: +.Sy cam aware HBA drivers: .Fx has a .Xr cam 4 -layer which attaches storage devices and provides a common access mechanism to -storage controllers and attached devices. +layer which attaches storage devices and provides a +common access mechanism to storage controllers and attached devices. The .Nm driver is @@ -368,13 +357,13 @@ driver does not understand the .Xr cam 4 layer and it directly associates storage disks to the block layer. .Pp -.Nm Thunderbolt Controller: +.Sy Thunderbolt Controller: This is the 6Gb/s MegaRAID HBA card which has device id 0x005B. .Pp -.Nm Invader Controller: +.Sy Invader Controller: This is 12Gb/s MegaRAID HBA card which has device id 0x005D. .Pp -.Nm Fury Controller: +.Sy Fury Controller: This is the 12Gb/s MegaRAID HBA card which has device id 0x005F. .Ed .Sh AUTHORS @@ -382,12 +371,7 @@ The .Nm driver and this manual page were written by .An Kashyap Desai Aq Mt Kashyap.Desai@lsi.com . -.Sh TODO -The driver does not support alias for device name (it is required when the user -switches between two drivers and does not want to edit -.Pa /etc/fstab -manually). -.Pp +.Sh CAVEATS The .Nm driver exposes devices as @@ -398,8 +382,7 @@ exposes devices as .Pa /dev/mfid? . .Pp .Nm -does not support the Linux Emulator interface. -.Pp -.Nm -will not work with -.Xr mfiutil 8 . +does not support the Linux Emulator Interface, +.Xr mfiutil 8 , +or device name aliases for switching drivers without editing +.Xr fstab 5 . From nobody Wed Oct 1 21:20:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccSW44Nvgz69Qxp; Wed, 01 Oct 2025 21:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccSW43txcz3CyB; Wed, 01 Oct 2025 21:20:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759353600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YpaaSFWxC4Ce0d9s5plpneZxmiUdQM27pq5SEjYwtcY=; b=CdA5sWR1uBsBUio2SP000jyhRPZsTG5dgk7yzpo0fraw2EOTLb4R23HZInvuRhfImOfyWR 6FTKI/051xFyRXk/Npn9HzPW1vFPaooDKDlHrF6H/yO5MTCAF02+2Rd6rHupEF9wMlEPht 0UgxDLs4moqO6cOL4tYVrzn1FN5FC0GSnizn70KkvkQzqzQGw43Xhlt2Y37keFd7KC8olV tP0op8PUPWW8uNZy8uUTrWF1Okq0/u1sydkJXJacifzpKG4xiANxQ9OfJyv4x3zkzvmd23 scbjWq9Kx8yjkapEGg8Vmhdsd0NgUkPlKXOxKn1AfU4CMHd5zCOcpcJuwbrR7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759353600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YpaaSFWxC4Ce0d9s5plpneZxmiUdQM27pq5SEjYwtcY=; b=BBFqN9ugMGY4y1wMV6eBrQaVUIpJDSz1R5bHphY0AidVsJRhpbcZ7Vj9MEBavmUj2xPKzw 55Dc37LkHsYj7A5ZeSLMECY7g623TshP46ieE3WWR8XzLUK0s3x+MbYqQrENd+Hu0VCZjJ 9C0M2GWUhHH7SGkARAX+yw6NgL5GqPfAfKf6Bko1LwkYuQ6pwglLXLbcMarKjRvkeNvkAE VUuS7UdP9ge0B0EuCzpOsAZujqnVPIyqTvl1kzFViPdEYtmkJa7SGpkiDp9FkUdm+OmSe4 xaQmBkq82a9Ayk9QDRRxDjMNkKd3p0Jw8LyS5VrdTbZ0qzJ6gyP6vAU9U85gKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759353600; a=rsa-sha256; cv=none; b=k++nlY8DjpqMMVNi+NX9rQuDwuWg40v89QKM/K7CtYJRq4x3UzQ8b1uT/+kV0WBRRzXSd5 JASzDoNjg76AMYDes6vwYxKT2jRseLwwX+d2bvyn6p/FyhdOrX9hj8Lyn/Ialjd42KpkpG qqjnkuVH8aJ7RR5fJw0x5Eh3+eRnS1cH1WPbx8dEXeC+YVLjA2EBwWquLs2YyOz4LtxzPi 85Mr2wZLxYfp7OV3JxuVYEkjMKlnEUMsxaKIqFWmQzJBEgF7XkvLb/lGxAyrgTqeKvWOYW Q+PJkV7GcIyM9/juXgEWHUdYT7LChPV19oTmX3Ndd2G1T9v3OaQ5gjw7ySushw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccSW43B4Bzf01; Wed, 01 Oct 2025 21:20: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 591LK05t048630; Wed, 1 Oct 2025 21:20:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 591LK0lU048604; Wed, 1 Oct 2025 21:20:00 GMT (envelope-from git) Date: Wed, 1 Oct 2025 21:20:00 GMT Message-Id: <202510012120.591LK0lU048604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ecfdb6df48cc - stable/15 - release: create pkgbase VM and cloud images List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ecfdb6df48cc1743b7624330d840747ca65a5479 Auto-Submitted: auto-generated The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ecfdb6df48cc1743b7624330d840747ca65a5479 commit ecfdb6df48cc1743b7624330d840747ca65a5479 Author: Isaac Freund AuthorDate: 2025-07-24 08:43:43 +0000 Commit: Ed Maste CommitDate: 2025-10-01 21:19:16 +0000 release: create pkgbase VM and cloud images VM and cloud images are now built as packaged base systems by default, matching the default for installation media. Setting -DNOPKGBASE allows building as non-pkgbase systems. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51483 (cherry picked from commit 4227d51b6e09ceaaae0f5832c85ec700d80ef18f) --- release/Makefile | 3 ++- release/Makefile.vm | 8 ++++++-- release/tools/ec2-builder.conf | 9 +++++++++ release/tools/ec2-small.conf | 9 +++++++++ release/tools/vmimage.subr | 36 ++++++++++++++++++++++++++++++++---- 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/release/Makefile b/release/Makefile index 425223747148..6aec279cf161 100644 --- a/release/Makefile +++ b/release/Makefile @@ -23,7 +23,8 @@ # (by default, the directory above this one) # NODISTSETS: if set, do not include dist sets or MANIFEST # NOPKGBASE: if set, include dist tarballs rather than pkgbase packages in -# disc1 and dvd1 installation media +# disc1 and dvd1 installation media and build VM/cloud images using +# make installkernel installworld. # PORTSDIR: location of ports tree to distribute (default: /usr/ports) # XTRADIR: xtra-bits-dir argument for /mkisoimages.sh # NOPKG: if set, do not distribute third-party packages diff --git a/release/Makefile.vm b/release/Makefile.vm index 25c37ade1121..7b1591e5390c 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -131,7 +131,7 @@ ${_CW:tu}${_FS:tu}${_FMT:tu}IMAGE= ${_CW:tl}.${_FS}.${_FMT} cw-${_CW:tl}-${_FS}-${_FMT}: cw-ec2-base-${_FS}-${_FMT} .endif -cw-${_CW:tl}-${_FS}-${_FMT}: ${QEMUTGT} +cw-${_CW:tl}-${_FS}-${_FMT}: ${QEMUTGT} ${PKGBASE_REPO_DIR} mkdir -p ${.OBJDIR}/${.TARGET} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ QEMUSTATIC=${QEMUSTATIC} \ @@ -142,6 +142,8 @@ cw-${_CW:tl}-${_FS}-${_FMT}: ${QEMUTGT} PKG_REPOS_DIR=${PKG_REPOS_DIR:U${.OBJDIR}/${.TARGET}/etc/pkg} \ PKG_REPO_NAME=${PKG_REPO_NAME:UFreeBSD-ports} \ PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ + NOPKGBASE=${NOPKGBASE} \ + PKGBASE_REPO_DIR=${.OBJDIR}/pkgbase-repo-dir \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \ -F ${"${_CW:MEC2-BUILDER}" != "":?ufs:${_FS}} \ @@ -185,7 +187,7 @@ CLEANFILES+= ${VMBASE}.${FS}.${FORMAT} vm-base: vm-image -vm-image: ${QEMUTGT} +vm-image: ${QEMUTGT} ${PKGBASE_REPO_DIR} .if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES) . for FORMAT in ${VMFORMATS} . for FS in ${VMFSLIST} @@ -198,6 +200,8 @@ vm-image: ${QEMUTGT} PKG_REPOS_DIR=${PKG_REPOS_DIR:U${.OBJDIR}/${.TARGET}-${FORMAT}-${FS}/etc/pkg} \ PKG_REPO_NAME=${PKG_REPO_NAME:UFreeBSD-ports} \ PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ + NOPKGBASE=${NOPKGBASE} \ + PKGBASE_REPO_DIR=${.OBJDIR}/pkgbase-repo-dir \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr \ -d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \ diff --git a/release/tools/ec2-builder.conf b/release/tools/ec2-builder.conf index 993dffc565eb..cf4276fc80ec 100644 --- a/release/tools/ec2-builder.conf +++ b/release/tools/ec2-builder.conf @@ -11,6 +11,15 @@ export VMSIZE=8000m export INSTALLOPTS="WITHOUT_DEBUG_FILES=YES WITHOUT_KERNEL_SYMBOLS=YES \ WITHOUT_LIB32=YES WITHOUT_TESTS=YES WITHOUT_LLDB=YES" +# Equivalent to INSTALLOPTS for pkgbase +vm_extra_filter_base_packages() { + grep -v \ + -e '.*-dbg$' \ + -e '.*-lib32$' \ + -e '^FreeBSD-tests.*' \ + -e '^FreeBSD-lldb.*' +} + # Packages to install into the image we're creating. In addition to packages # present on all EC2 AMIs, we install: # * ec2-scripts, which provides a range of EC2ification startup scripts, diff --git a/release/tools/ec2-small.conf b/release/tools/ec2-small.conf index e2a348d6ba8f..32d02cbb79e4 100644 --- a/release/tools/ec2-small.conf +++ b/release/tools/ec2-small.conf @@ -14,6 +14,15 @@ export VMSIZE=5000m export INSTALLOPTS="WITHOUT_DEBUG_FILES=YES WITHOUT_KERNEL_SYMBOLS=YES \ WITHOUT_LIB32=YES WITHOUT_TESTS=YES WITHOUT_LLDB=YES" +# Equivalent to INSTALLOPTS for pkgbase +vm_extra_filter_base_packages() { + grep -v \ + -e '.*-dbg$' \ + -e '.*-lib32$' \ + -e '^FreeBSD-tests.*' \ + -e '^FreeBSD-lldb.*' +} + # Packages to install into the image we're creating. In addition to packages # present on all EC2 AMIs, we install: # * ec2-scripts, which provides a range of EC2ification startup scripts, diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 33a87eb55f53..20f90f01c0c7 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -57,13 +57,41 @@ vm_copy_base() { return 0 } +vm_filter_base_packages() { + # Reads a list of all base system packages from stdin. + # Writes a list of base system packages to install to stdout. + grep -v -e '^FreeBSD-src.*' -e '^FreeBSD-kernel.*' + # There are several kernel variants available in separate packages. + # For VMs it is sufficient to install only the generic kernel. + echo "FreeBSD-kernel-man" + echo "FreeBSD-kernel-generic" + echo "FreeBSD-kernel-generic-dbg" +} + +vm_extra_filter_base_packages() { + # Prototype. When overridden, allows further filtering of base system + # packages, reading package names from stdin and writing to stdout. + cat +} + vm_install_base() { # Installs the FreeBSD userland/kernel to the virtual machine disk. - cd ${WORLDDIR} && \ - make DESTDIR=${DESTDIR} ${INSTALLOPTS} \ - installworld installkernel distribution || \ - err "\n\nCannot install the base system to ${DESTDIR}." + if [ -z "${NOPKGBASE}" ]; then + local pkg_cmd + pkg_cmd="pkg --rootdir ${DESTDIR} --repo-conf-dir ${PKGBASE_REPO_DIR} + -o ASSUME_ALWAYS_YES=yes -o IGNORE_OSVERSION=yes + -o INSTALL_AS_USER=yes " + $pkg_cmd update + selected=$($pkg_cmd rquery -U -r FreeBSD-base %n | \ + vm_filter_base_packages | vm_extra_filter_base_packages) + $pkg_cmd install -U -r FreeBSD-base $selected + else + cd ${WORLDDIR} && \ + make DESTDIR=${DESTDIR} ${INSTALLOPTS} \ + installworld installkernel distribution || \ + err "\n\nCannot install the base system to ${DESTDIR}." + fi # Bootstrap etcupdate(8) database. mkdir -p ${DESTDIR}/var/db/etcupdate From nobody Thu Oct 2 00:00:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccX4c1Yskz69gvP; Thu, 02 Oct 2025 00:00: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccX4b4y2mz3Skj; Thu, 02 Oct 2025 00:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759363247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DlYubNYNfbXtawxKPTUVZPJn09gl47WaU5iIdG95z0=; b=LyUly5nBPSfSjLHCn2Bzt06Pb2Msy8ADPIu/A71KHgdNuvp1Bcw+wNl/9sDol0Zf7b2B0K ACWRxo5j8T7ZqoaYE/+xYXBQUo85Cjfo+3mAtsisbpn0vaeIBjaJXYkSxthbvBohfXsDLb CZrIXvOv/qytm8Rr/7A/3YTeC16CaGY7qXMz0pwLub4FaJBszuGwCOeKzJHWPAva2fjFWL iTMDCCZEOmx0dtFvydkSBBCVW6XDjhNjCgUiFwZ92s0ltHFsHlcM8ua4Gj7n3tA/ecI9cJ Eyl74/tOi4dNLtLkv6qNVLU412uBcWEx79XnpDCGjAwS0wzHeIi+3Ro4Hk/L/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759363247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DlYubNYNfbXtawxKPTUVZPJn09gl47WaU5iIdG95z0=; b=dp4UJf60dq0nYXbO9+Z4Kk6h3UFl77SZR06mKTNciuqKV0UhJ68Z6OOZB6tV0Nj2jNS8rd NpBzTQBmCgbv1U2sv4zOFaYtA/xt/cf68SDkww+KWDBhU9tCPi3sgwChZZmEIk8L+Rt+Yl pCTR4jsMfcRYJfegCz7uMCYWa35ErZUAS/Tz2Lb4XFZA1D8suxBUcVxLrPW+S74Uo7uw+N DU6xqtCyow/RssDKSb+TkGHCHK44RTNyQtRdFQ6foUq+G64bERqgacuuFvZBXh3jY2ESeG VnICMsfuvTiIWkHJ9T+XFNMFIzB8gyZhiVPxCl5BuDllaRVTOx5sy/Ho+p8UWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759363247; a=rsa-sha256; cv=none; b=E0Exep7s/3980EM0b24MZZAynw4mU/7OwjYf1gx9n6X55w9TAqr+hVqF2o42NvTgsWUtfr ptZ9GWymbwUmOa0EwzjIZt0QBZGb3XufuBagOXA+2EdMJOvROkNWtGpMI+OCzxGQWPvcJ5 mZTNK6ko9mbZTTDbgA7zvU00yUR6EBiQ6kwCvYSFqw42Wryo9gCeaJS42YZc2X1MIPbIsZ peCsXWhgNmGU8ICUFO1OyUhUtZqMB90KHhCXD5Gxrv8MRMhjXyIgDBV/2JffgJiSVrUz0M SIgt7yAg2RRwqM076PqQhNMnNlg6w2r3w3aO/IoOJbXqi+AuWJJNhhtWOQAkDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccX4b4RX3zl8n; Thu, 02 Oct 2025 00:00: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 59200lXF057549; Thu, 2 Oct 2025 00:00:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59200lLf057546; Thu, 2 Oct 2025 00:00:47 GMT (envelope-from git) Date: Thu, 2 Oct 2025 00:00:47 GMT Message-Id: <202510020000.59200lLf057546@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: b8975e052e80 - stable/15 - ucode: use wrmsr_early_safe() for early CPU microcode update List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b8975e052e807054e2b9db5b67db45d288321ad1 Auto-Submitted: auto-generated The branch stable/15 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b8975e052e807054e2b9db5b67db45d288321ad1 commit b8975e052e807054e2b9db5b67db45d288321ad1 Author: Gleb Smirnoff AuthorDate: 2025-09-27 14:30:40 +0000 Commit: Gleb Smirnoff CommitDate: 2025-10-02 00:00:13 +0000 ucode: use wrmsr_early_safe() for early CPU microcode update Use the new method for wrmsr that is able to set up fault handler even at the very early stage of kernel boot. This prevents panic with new microcode for some new AMD EPYCs, that requires certain patchlevel of microcode to be already present in the CPU. If BSP patching failed, we print the message and we don't try to patch APs. This has been tested only on AMD booted in EFI mode. Reviewed by: stas, kib Differential Revision: https://reviews.freebsd.org/D52643 (cherry picked from commit d9f03a43f2fec917c31d48b05d751e547c8775c7) --- sys/dev/cpuctl/cpuctl.c | 2 +- sys/x86/include/ucode.h | 6 ++++-- sys/x86/x86/ucode.c | 56 +++++++++++++++++++++++++++++++++++++------------ 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/sys/dev/cpuctl/cpuctl.c b/sys/dev/cpuctl/cpuctl.c index b0ab3467df69..deaabaaaa1fc 100644 --- a/sys/dev/cpuctl/cpuctl.c +++ b/sys/dev/cpuctl/cpuctl.c @@ -344,7 +344,7 @@ ucode_intel_load_rv(void *arg) d = arg; if (PCPU_GET(cpuid) == d->cpu) - d->ret = ucode_intel_load(d->ptr, true, NULL, NULL); + d->ret = ucode_intel_load(d->ptr, SAFE, NULL, NULL); } static int diff --git a/sys/x86/include/ucode.h b/sys/x86/include/ucode.h index 75b9ff3afbd0..ea7cb07669a4 100644 --- a/sys/x86/include/ucode.h +++ b/sys/x86/include/ucode.h @@ -62,12 +62,14 @@ struct ucode_intel_extsig_table { } entries[0]; }; +typedef enum { SAFE, UNSAFE, EARLY } ucode_load_how; + const void *ucode_amd_find(const char *path, uint32_t signature, uint32_t *revision, const uint8_t *fw_data, size_t fw_size, size_t *selected_sizep); -int ucode_intel_load(const void *data, bool unsafe, +int ucode_intel_load(const void *data, ucode_load_how unsafe, uint64_t *nrevp, uint64_t *orevp); -int ucode_amd_load(const void *data, bool unsafe, +int ucode_amd_load(const void *data, ucode_load_how how, uint64_t *nrevp, uint64_t *orevp); size_t ucode_load_bsp(uintptr_t free); void ucode_load_ap(int cpu); diff --git a/sys/x86/x86/ucode.c b/sys/x86/x86/ucode.c index 1973047fafd1..72133de211f8 100644 --- a/sys/x86/x86/ucode.c +++ b/sys/x86/x86/ucode.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -58,7 +59,7 @@ static const void *ucode_amd_match(const uint8_t *data, size_t *len); static struct ucode_ops { const char *vendor; - int (*load)(const void *, bool, uint64_t *, uint64_t *); + int (*load)(const void *, ucode_load_how how, uint64_t *, uint64_t *); const void *(*match)(const uint8_t *, size_t *); } loaders[] = { { @@ -83,6 +84,7 @@ enum { NO_ERROR, NO_MATCH, VERIFICATION_FAILED, + LOAD_FAILED, } ucode_error = NO_ERROR; static uint64_t ucode_nrev, ucode_orev; @@ -103,6 +105,9 @@ log_msg(void *arg __unused) case VERIFICATION_FAILED: printf("CPU microcode: microcode verification failed\n"); break; + case LOAD_FAILED: + printf("CPU microcode load failed. BIOS update advised\n"); + break; default: break; } @@ -110,7 +115,8 @@ log_msg(void *arg __unused) SYSINIT(ucode_log, SI_SUB_CPU, SI_ORDER_FIRST, log_msg, NULL); int -ucode_intel_load(const void *data, bool unsafe, uint64_t *nrevp, uint64_t *orevp) +ucode_intel_load(const void *data, ucode_load_how how, uint64_t *nrevp, + uint64_t *orevp) { uint64_t nrev, orev; uint32_t cpuid[4]; @@ -122,10 +128,23 @@ ucode_intel_load(const void *data, bool unsafe, uint64_t *nrevp, uint64_t *orevp * undocumented errata applying to some Broadwell CPUs. */ wbinvd(); - if (unsafe) + switch (how) { + case SAFE: wrmsr_safe(MSR_BIOS_UPDT_TRIG, (uint64_t)(uintptr_t)data); - else + break; + case EARLY: +#ifdef __amd64__ + wrmsr_early_safe_start(); + if (wrmsr_early_safe(MSR_BIOS_UPDT_TRIG, + (uint64_t)(uintptr_t)data) != 0) + ucode_error = LOAD_FAILED; + wrmsr_early_safe_end(); + break; +#endif + case UNSAFE: wrmsr(MSR_BIOS_UPDT_TRIG, (uint64_t)(uintptr_t)data); + break; + } wrmsr(MSR_BIOS_SIGN, 0); /* @@ -233,20 +252,31 @@ ucode_intel_match(const uint8_t *data, size_t *len) } int -ucode_amd_load(const void *data, bool unsafe, uint64_t *nrevp, uint64_t *orevp) +ucode_amd_load(const void *data, ucode_load_how how, uint64_t *nrevp, + uint64_t *orevp) { uint64_t nrev, orev; uint32_t cpuid[4]; orev = rdmsr(MSR_BIOS_SIGN); - /* - * Perform update. - */ - if (unsafe) + switch (how) { + case SAFE: wrmsr_safe(MSR_K8_UCODE_UPDATE, (uint64_t)(uintptr_t)data); - else + break; + case EARLY: +#ifdef __amd64__ + wrmsr_early_safe_start(); + if (wrmsr_early_safe(MSR_K8_UCODE_UPDATE, + (uint64_t)(uintptr_t)data) != 0) + ucode_error = LOAD_FAILED; + wrmsr_early_safe_end(); + break; +#endif + case UNSAFE: wrmsr(MSR_K8_UCODE_UPDATE, (uint64_t)(uintptr_t)data); + break; + } /* * Serialize instruction flow. @@ -327,8 +357,8 @@ ucode_load_ap(int cpu) return; #endif - if (ucode_data != NULL) - (void)ucode_loader->load(ucode_data, false, NULL, NULL); + if (ucode_data != NULL && ucode_error != LOAD_FAILED) + (void)ucode_loader->load(ucode_data, UNSAFE, NULL, NULL); } static void * @@ -415,7 +445,7 @@ ucode_load_bsp(uintptr_t free) memcpy_early(addr, match, len); match = addr; - error = ucode_loader->load(match, false, &nrev, &orev); + error = ucode_loader->load(match, EARLY, &nrev, &orev); if (error == 0) { ucode_data = early_ucode_data = match; ucode_nrev = nrev; From nobody Thu Oct 2 02:53:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccbvZ5smFz6B06H; Thu, 02 Oct 2025 02:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccbvZ5JvFz3mQL; Thu, 02 Oct 2025 02:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqP8AJIggEex07Ug8y94Bf/3r9pSbIdwC4nyJ1JYkH4=; b=RzN69XEKBn1iMeWHRfCZz0M/b0AtEcm2wbuVbwy4RRuvFNXsaDmaMaub/drIYoAar3obGe rWL6KfStMJt/v/Rg+yFP7NvtenRZ2Y5thLlFpTym9MAgH9yrSA5ZYlwzYtPqMcPL31GgtU ZwiwP1DEaLEeq969j9YiMf4ePRAPeBr66EIcW5qZJSIUwdQuLWP6wm2loFFFqkBPCL9asi c0P2jkv4vEkNRk11QblJHhomFYPjPrdc25LU0aq95cPCyVa0Bvj029fYsPo0SvvD1MRVP6 /LGDT1A45ZM0xwrxmLXMiD7TWdDRWtoiAXX9Qy5ttumw95EN1sEsNmdOtDOEpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qqP8AJIggEex07Ug8y94Bf/3r9pSbIdwC4nyJ1JYkH4=; b=ZGNzfChLCf0aKvellXz/TE3GuLaGhn3CgdNA+j5qn7f02dXSvLaCeXZK/19nI2qNMwmLTo g/pe1sqkt3P8qn3dgHT5jzFIgD+Xrd0EAv5WzhXg782w5Gblr6YGI/BS5GXeq1YiE/DvZh t+2Id+qc75t7UxnQOwFVIzr7fRPKrwxhd8ND+Gy83wQw3nkrs9NzZfUyPChho2UvL9DJ+v 7nMPZ8jKVVgmyHY2KuPO2gX52A/07d/Q/OvhARPVyfq0ELa8sCpjZC/B/xrASnMXzDcn57 OKqzxftOTezwEcFuLLRYqGcOxERnOIkAE5cmMw4UNZdu1M1woFjLafMdg5oNjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759373594; a=rsa-sha256; cv=none; b=W1Z/hQiULJIbxX58WQnrCTmJF7mRzFKtgL3qxdQ3FjI4upVVzMC+Ea+Lx13VXHHyhj3vp/ ULkYmWaIf1XTQCIy1tWM4CjQHRkLWPAIuU3sZss6q07u778s5h6qjeb4598m3A4C3OCmJ/ /hgDIDxjnvPf3gpVotFqq5Y5v/0T+WXUURJVlygdloDPgoaT8zVj11s6QoLZ7alGerz6eg XktIIgEsqxTSj1zEkGieXjjatkIbfD7wl2c3hSGOfToY92bC+ACflpK3Xkvk+3y/xh+jWh f28cO1bSmWfsCBNB49WMaDwYFqAaO09pNZUB/Is+QUrpf4ycG9lQRO9rlFikkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccbvZ4bBczqRy; Thu, 02 Oct 2025 02:53: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 5922rEPr088009; Thu, 2 Oct 2025 02:53:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5922rEgF088006; Thu, 2 Oct 2025 02:53:14 GMT (envelope-from git) Date: Thu, 2 Oct 2025 02:53:14 GMT Message-Id: <202510020253.5922rEgF088006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: fba07ae01aec - stable/15 - mpr.4: Improve HARDWARE introductory sentance List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fba07ae01aec63ae794a88f2cb3c7b908d05f5e3 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=fba07ae01aec63ae794a88f2cb3c7b908d05f5e3 commit fba07ae01aec63ae794a88f2cb3c7b908d05f5e3 Author: Alexander Ziaee AuthorDate: 2025-09-29 13:23:24 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 02:52:56 +0000 mpr.4: Improve HARDWARE introductory sentance Add context for inclusion in Hardware Release Notes. MFC after: 3 days (cherry picked from commit c856f327fa6ccf1c5b9e4f531581fa2a0d83c3e0) --- share/man/man4/mpr.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/mpr.4 b/share/man/man4/mpr.4 index e114ecfd077b..cce21113e5c2 100644 --- a/share/man/man4/mpr.4 +++ b/share/man/man4/mpr.4 @@ -65,9 +65,9 @@ Fusion-MPT 3/3.5 IT/IR .Tn SAS/PCIe controllers. .Sh HARDWARE -These controllers are supported by the +The .Nm -driver: +driver supports the following SATA/SAS/NVMe RAID controllers: .Pp .Bl -bullet -compact .It From nobody Thu Oct 2 02:53:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccbvb6y5Qz6B06L; Thu, 02 Oct 2025 02:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccbvb6DGxz3mq8; Thu, 02 Oct 2025 02:53:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fDFjnnfIgEkOnXL48J/DzYwNaoayaXeyvnHz+PBHFcM=; b=G+WZ9KDJ/poGAbL4jJqF3KVZeGMyzk+OS+dZmae2bb1nRXmRAccndYuKfum2+w1JtqbCRa 1/lo0AmoqG7ktVUDPuapdtlw/wU13mB9WuVkLdkMfLp7hlYW/UImgJ/wX7KBQadTqLXsEO KTS7MRK07fYVRByhTmCFCaE2UoQCR+7PRlAfAN1BuvJwSbw60QZG7JRZ3QD2kAqMpVWD/v OqoWuZh1SJ+vq3rwz/rzZaW0d6b0w65fVNlCawHuOrX0l/7RrC+xzLpgrVN11fJ+Q96XM4 q+0YIzk6Ox0rok4ey7Ths7M/xlcAqDgKhVDuyOrNhg+wHBj5Di1PeNkoqomYbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fDFjnnfIgEkOnXL48J/DzYwNaoayaXeyvnHz+PBHFcM=; b=S6ajaZ6alMtuuE6vJTSflLBMnRM0EJNwryF78o0lU9Ek+zUukvZ9ZgwF6Mm6coDt5HqOYQ /CcZuj0SHd96DuKhTeLFKOJnjPMyxZMtJw35T3wPoVdciTVhxevb3ZGzfp8lqUT4xJR7vr 0cAVlc7wpq/S2nSR5PjWW5fv8VYe5JEUnlMbSPZtIzCAcKYgS4aXTb6OYuRT+uaGWORfop M9ATAq6/no9JIEg86cPPJRM/uNnv5RVUVPUwaSUV1UH3d6GYcLirX+wqypg5Y+cQJANAAE d462AawF8QkiFfpVE339VShH/ZXZ23/2uh5RHvVBPTwLK/kAL1JzUE2mIsYHGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759373595; a=rsa-sha256; cv=none; b=CAByx+lVOLwyJ2D6IsctuTPNHQrI8xE7jabCAf7EUg/QcHO9xr62C+we6Dp7kiR5g70IuQ 9joFA2FiftMyHjdoGoap96bUKsjsaGnArNp+gxv7mXZulmpjsDoeQqM/xo31GLm7TcA3Yl eDE+JkYhyvIROqdHoRQ87BNrc7C8NQ3akfjRKT/L8iH+M9vSdrzyGePFD/+nnJLnoKkLdd DTjpBWZbnvy8Vo3kHVtLik3Vr0Nxp++0xAhNKbrY/XBsd3SH4GHx4BGlb5NLcvDXaM1+8N H9S//n/cJR9wJ5SBOGyXdT0Z4gT1oi3c45+prlgW5EeXq+kKHahwPKkKv0JVRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccbvb5qthzqPM; Thu, 02 Oct 2025 02:53: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 5922rFfA088044; Thu, 2 Oct 2025 02:53:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5922rFlF088041; Thu, 2 Oct 2025 02:53:15 GMT (envelope-from git) Date: Thu, 2 Oct 2025 02:53:15 GMT Message-Id: <202510020253.5922rFlF088041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: da26590f1c95 - stable/15 - aac.4: Improve HARDWARE introductory sentance List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: da26590f1c95fc61bcaf39516a7804dfb27fe0d3 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=da26590f1c95fc61bcaf39516a7804dfb27fe0d3 commit da26590f1c95fc61bcaf39516a7804dfb27fe0d3 Author: Alexander Ziaee AuthorDate: 2025-09-29 19:58:48 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 02:52:56 +0000 aac.4: Improve HARDWARE introductory sentance For the improvement of the hardware release notes. While here, tag SPDX. MFC after: 3 days (cherry picked from commit 17be686a39a07958f61e42c4b5c797bb1d1e9895) --- share/man/man4/aac.4 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/share/man/man4/aac.4 b/share/man/man4/aac.4 index 7a7d0350dcdb..f4b431cc6b4f 100644 --- a/share/man/man4/aac.4 +++ b/share/man/man4/aac.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2000 Scott Long .\" All rights reserved. .\" @@ -21,7 +24,7 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.Dd July 10, 2009 +.Dd September 29, 2025 .Dt AAC 4 .Os .Sh NAME @@ -83,9 +86,10 @@ Linux-compatible interface for the management device will be enabled and will allow Linux-based management applications to control the card. .Sh HARDWARE -Controllers supported by the +The .Nm -driver include: +driver supports the following Parallel SCSI, SATA, and 3G SAS +RAID controllers from the Adaptec AAC family: .Pp .Bl -bullet -compact .It From nobody Thu Oct 2 02:53:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccbvd2qlTz6B0Lp; Thu, 02 Oct 2025 02:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccbvd0M2Nz3mbt; Thu, 02 Oct 2025 02:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rfWLS+7C49vBXSpUD9tJyUoWsef8p5O1NtM/+AlIHAs=; b=a3plcMiLANrkF8UiCrO/hPcsRsy+LsR6YWjjEERkJMxqzxn2PcQQeW7r4SIupVC06EbZna 4iSnGBmM+6dM+XFvg/HnYTeD9Oo9hXUFYaslf717h/67JooxClrjattnn9yNTBEEyNSAPJ 9FtM24CXFJkh4ii8VN1vEXqhkpfGt7EVP1ZrZx4zEYWYltOgUPAAacgOSo/rPlH4amESiD gTmBPUNMJ5EQriDSKHFYUfLjC2QfnqPQe8iMMmRWW1GZ+mSOE+UXYma+Q4SRHPSwqPW2B8 hU4TvFaacOWJ0s3l34PAlhVcHb5rmIfqA4CrB76jR4QM1NiQAuRmahnz+1hHcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rfWLS+7C49vBXSpUD9tJyUoWsef8p5O1NtM/+AlIHAs=; b=kMJ2vZ5c+EdI+fbpWqmMDlQEGS6ih+QBksKzvCUDz8fM/UrfhKvorjdtM5ruL43ZNMAYXO VSxZzCjo/R1eodjTqYsq/WDA6+uHnE/6Mci0GOWSAczEUPQrmZFKh1EXgjYB2A70qAn1yN oqZrO7rsRAJT7QCmv7HXZ60IMFGWFoCOlhDKiONopMEaTm3gYJl1DYv12YJxfcnRPKeNcI GUHbHTN6y/q039fEkfCiYL/exL66pXpCwKm8aLGY4p7VT776pcgNYHkVQnBCv7vhwrItpU UvVriSnot+gwcctMGWbxprLvwQzE/hK5SyIEEb9pXaUy7GR/uDSJi6sdnB4IVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759373597; a=rsa-sha256; cv=none; b=oJ0mqUkQ5zntt35234gVxGG+D3xxohtPN6Lds9/bSA8eMT1MWblixyBCSuk4M3z46HrqmB FK8EFW8qOdAu1yvliC2Ne3o3g3QX28b5w8xEMpiRAtPyRuUmdkmuW7xzU3JzShBCgse0Ee oDTJ5BWbfmM+mrs+e05ME+yyc6MvCA6WwBBiP198kcfkkFyAIwghc13HWeyBZ/0NjgqhW5 kXNLffBXIuw8Wf2r7A75d/9e5BvM4IZF34y7cLngIo7vd368ES9/asHxrEVFxV3WYM0s/w huhLO+FAEV7DwXLKWMrhm55ytNlxEj6ZKnhOjqWINaXgu01trwf2C8OSOcUisg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccbvc6fCVzq7Z; Thu, 02 Oct 2025 02:53: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 5922rGiL088083; Thu, 2 Oct 2025 02:53:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5922rGcr088080; Thu, 2 Oct 2025 02:53:16 GMT (envelope-from git) Date: Thu, 2 Oct 2025 02:53:16 GMT Message-Id: <202510020253.5922rGcr088080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 1b3408e301bf - stable/15 - ahc.4,ahd.4: Improve HARDWARE + tag SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1b3408e301bf1f6ebdd5505dfd45b08fceb60bf5 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=1b3408e301bf1f6ebdd5505dfd45b08fceb60bf5 commit 1b3408e301bf1f6ebdd5505dfd45b08fceb60bf5 Author: Alexander Ziaee AuthorDate: 2025-09-29 22:32:42 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 02:52:57 +0000 ahc.4,ahd.4: Improve HARDWARE + tag SPDX Add some context for the Hardware Relnotes, and tag SPDX while here. MFC after: 3 days (cherry picked from commit 2c2a2b8281be2f4270fd98eda743a3a8c2f36949) --- share/man/man4/ahc.4 | 10 ++++------ share/man/man4/ahd.4 | 6 ++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/share/man/man4/ahc.4 b/share/man/man4/ahc.4 index 38712c1f08b6..72a1e092f1bc 100644 --- a/share/man/man4/ahc.4 +++ b/share/man/man4/ahc.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1995, 1996, 1997, 1998, 2000 .\" Justin T. Gibbs. All rights reserved. .\" @@ -24,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 15, 2017 +.Dd September 29, 2025 .Dt AHC 4 .Os .Sh NAME @@ -172,11 +174,7 @@ adapter, defaults to enabled (0 -- disabled, 1 -- enabled). .Sh HARDWARE The .Nm -driver supports the following -.Tn SCSI -host adapter chips and -.Tn SCSI -controller cards: +driver supports the following VL/ISA/PCI parallel SCSI controllers and cards: .Pp .Bl -bullet -compact .It diff --git a/share/man/man4/ahd.4 b/share/man/man4/ahd.4 index c173a8cef619..7fa08c12b5b5 100644 --- a/share/man/man4/ahd.4 +++ b/share/man/man4/ahd.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifer: BSD-3-Clause +.\" .\" Copyright (c) 1995, 1996, 1997, 1998, 2000 .\" Justin T. Gibbs. All rights reserved. .\" Copyright (c) 2002 @@ -26,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 4, 2004 +.Dd September 29, 2025 .Dt AHD 4 .Os .Sh NAME @@ -132,7 +134,7 @@ A hint to define whether the SCSI target mode is enabled (0 -- disabled, 1 -- en .Sh HARDWARE The .Nm -driver supports the following: +driver supports the following PCI/PCI-X parallel SCSI controllers: .Pp .Bl -bullet -compact .It From nobody Thu Oct 2 02:53:17 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccbvf3vPRz6B0Yv; Thu, 02 Oct 2025 02:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccbvf0pjFz3mQs; Thu, 02 Oct 2025 02:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AvCZUX38vqN1+o6yBOwRvGG4rfgh3kxbsbt6NBV2a9U=; b=c8Q+JG+vwcb/qlO9jMUfQ3Bt/+DOdtBMd06harygmM5blR07JJkKLIfQKaZ2dEvYIzlzJl 31dwOOsF1WF6Uk0WgbV2CuyllIRMQUkFpUxcLRWOBB9MVqUKTle3ras8U5E4a2q2a7gNhr 9iaO4uf+cueEPS9MnSxfijPr7mpbdZUhv3dowPABbK8y4fta6q2aP0S9Z2JfkQxs6ER2/o VCzVhSDjiZlveH9MBDMjcaS7tT1VB29x+h613lXhA98WLW4yMVjMNnkISfTfc2aVN6lEui BgaSbyJB8JubwT5Uso1YAvTe+cqz3dK7y6lBWZ20TdChPBiMirmuOBYH+hsoJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759373598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AvCZUX38vqN1+o6yBOwRvGG4rfgh3kxbsbt6NBV2a9U=; b=WMWOpvZfvVP3C2pAtJOALzaolCaBLleKf4j8p1pYv0mKW2A7+SYA9gD68VDlxDogN7Y8qN oy9fPCUxoHWl3mkm99esj2gbG2LaLrLWY3X6d9aYRiuAOGq7vRNPYkihPPNst2xL7/33kj FIoneLRHzkHI77ygqnbSruvicJtJdtpOz4g0v1WFj8JLdh1aBuZuzAPMQGWEBkW4fEEE7J 3By4hEfp9eEcaEgIc2JL3ewLIzaDsCtN2uFSzLs9G/YAw+qhz1GeXJPcUQOUZjJtvE3Xi1 +0qYF5DfwX38u80bQ5fr9FNmI2leB1Rc3SR0weGah6wERUPWcIDSR/hutcOXDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759373598; a=rsa-sha256; cv=none; b=ckoPISi4cZ7c+a71dnIhBH6cBzubo6XxDY2pU6Z/fxzAWms0NYkN5UDN7zGwtyQQUSRXxS 5ngviUz95yvjNtbmFu4hg8oAcUCn7RPjjXqV8aQxowIkaeDDhoX9MSeSqJjphGRmVstqFi dQGPaqbTCCjVAxkJ57r3npFhx7pjWj0iIAFAYeoDgnIFYrpFCHnZQZjUbBhUT0PqvL5d6D /3OH3skYHGRtUgipnlW8wSRTEU3VC/+vSoz7bjhNm9jWwHRwFhFyi+znXahAFiKY/UZJBf CBa6bVX654DUsPBy0p2NH38FqdWqDahS+jMmsCWwP0D+hA+BIlqZAooceVFbIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccbvf0DsTzqcQ; Thu, 02 Oct 2025 02:53: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 5922rH81088115; Thu, 2 Oct 2025 02:53:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5922rHRL088112; Thu, 2 Oct 2025 02:53:17 GMT (envelope-from git) Date: Thu, 2 Oct 2025 02:53:17 GMT Message-Id: <202510020253.5922rHRL088112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 955d9b0a1093 - stable/15 - mandoc: Vendor import of upstream at 2025-09-26 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 955d9b0a1093131ac18d57d2764ee716fd428dd9 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=955d9b0a1093131ac18d57d2764ee716fd428dd9 commit 955d9b0a1093131ac18d57d2764ee716fd428dd9 Author: Alexander Ziaee AuthorDate: 2025-09-29 17:31:38 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 02:52:57 +0000 mandoc: Vendor import of upstream at 2025-09-26 Interesting changes: + mandoc db: Improve case sorting, found by our very own markj + history: Add macros for version 8 and 10 AT&T Unix + linter: Warn on blank lines in man(7) like mdoc(7) + manuals: Improve precision, man(7) syntax table, and roff(7) specifics + manuals: Fix PDF/PS footer regression detailed in our PR: 289786 PR: 289786 MFC after: 3 days (cherry picked from commit 59fc2b0166f71c791113379d16b8cef7039f289d) --- contrib/mandoc/Makefile | 2 +- contrib/mandoc/dba.c | 7 +++--- contrib/mandoc/main.c | 52 +++++++++----------------------------------- contrib/mandoc/man.c | 3 ++- contrib/mandoc/man.options.1 | 35 +++++++++++++++++++++++++---- contrib/mandoc/mandoc.1 | 16 ++++++++------ contrib/mandoc/mdoc.7 | 35 +++++++++++++++++++---------- contrib/mandoc/roff_term.c | 2 +- contrib/mandoc/term_ps.c | 6 ++--- 9 files changed, 84 insertions(+), 74 deletions(-) diff --git a/contrib/mandoc/Makefile b/contrib/mandoc/Makefile index 0830c9f289a3..d4a2c794b437 100644 --- a/contrib/mandoc/Makefile +++ b/contrib/mandoc/Makefile @@ -15,7 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.14.6s20250727 +VERSION = 1.14.6s20250926 # === LIST OF FILES ==================================================== diff --git a/contrib/mandoc/dba.c b/contrib/mandoc/dba.c index ee43933de3bf..ab40798e8eed 100644 --- a/contrib/mandoc/dba.c +++ b/contrib/mandoc/dba.c @@ -1,6 +1,6 @@ -/* $Id: dba.c,v 1.10 2017/02/17 14:43:54 schwarze Exp $ */ +/* $Id: dba.c,v 1.11 2025/09/24 13:13:30 schwarze Exp $ */ /* - * Copyright (c) 2016, 2017 Ingo Schwarze + * Copyright (c) 2016, 2017, 2025 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -318,7 +318,8 @@ compare_names(const void *vp1, const void *vp2) cp1 = *(const char * const *)vp1; cp2 = *(const char * const *)vp2; return (diff = *cp2 - *cp1) ? diff : - strcasecmp(cp1 + 1, cp2 + 1); + (diff = strcasecmp(cp1 + 1, cp2 + 1)) ? diff : + strcmp(cp1 + 1, cp2 + 1); } static int diff --git a/contrib/mandoc/main.c b/contrib/mandoc/main.c index 57b06c9b9e66..d70ff1ce77b4 100644 --- a/contrib/mandoc/main.c +++ b/contrib/mandoc/main.c @@ -1,6 +1,6 @@ -/* $Id: main.c,v 1.361 2022/04/14 16:43:43 schwarze Exp $ */ +/* $Id: main.c,v 1.364 2025/09/24 21:30:20 schwarze Exp $ */ /* - * Copyright (c) 2010-2012, 2014-2021 Ingo Schwarze + * Copyright (c) 2010-2012,2014-2021,2025 Ingo Schwarze * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010 Joerg Sonnenberger * @@ -109,7 +109,7 @@ static void parse(struct mparse *, int, const char *, struct outstate *, struct manconf *); static void passthrough(int, int); static void process_onefile(struct mparse *, struct manpage *, - int, struct outstate *, struct manconf *); + struct outstate *, struct manconf *); static void run_pager(struct outstate *, char *); static pid_t spawn_pager(struct outstate *, char *); static void usage(enum argmode) __attribute__((__noreturn__)); @@ -144,7 +144,6 @@ main(int argc, char *argv[]) int options; /* Parser options. */ int show_usage; /* Invalid argument: give up. */ int prio, best_prio; - int startdir; int c; enum mandoc_os os_e; /* Check base system conventions. */ enum outmode outmode; /* According to command line. */ @@ -514,7 +513,7 @@ main(int argc, char *argv[]) if (resnsz == 0) (void)fs_search(&search, &conf.manpath, *argv, &resn, &resnsz); - if (resnsz == 0 && strchr(*argv, '/') == NULL) { + if (resnsz == 0) { if (search.arch != NULL && arch_valid(search.arch, OSENUM) == 0) warnx("Unknown architecture \"%s\".", @@ -529,20 +528,6 @@ main(int argc, char *argv[]) mandoc_msg_setrc(MANDOCLEVEL_BADARG); continue; } - if (resnsz == 0) { - if (access(*argv, R_OK) == -1) { - mandoc_msg_setinfilename(*argv); - mandoc_msg(MANDOCERR_BADARG_BAD, - 0, 0, "%s", strerror(errno)); - mandoc_msg_setinfilename(NULL); - continue; - } - resnsz = 1; - resn = mandoc_calloc(resnsz, sizeof(*res)); - resn->file = mandoc_strdup(*argv); - resn->ipath = SIZE_MAX; - resn->form = FORM_SRC; - } if (outmode != OUTMODE_ONE || resnsz == 1) { res = mandoc_reallocarray(res, ressz + resnsz, sizeof(*res)); @@ -559,7 +544,8 @@ main(int argc, char *argv[]) best_prio = 40; for (ib = i = 0; i < resnsz; i++) { - sec = resn[i].file; + sec = resn[i].file + + strlen(conf.manpath.paths[resn[i].ipath]); sec += strcspn(sec, "123456789"); if (sec[0] == '\0') continue; /* No section at all. */ @@ -647,23 +633,13 @@ main(int argc, char *argv[]) mchars_alloc(); mp = mparse_alloc(options, os_e, os_s); - /* - * Remember the original working directory, if possible. - * This will be needed if some names on the command line - * are page names and some are relative file names. - * Do not error out if the current directory is not - * readable: Maybe it won't be needed after all. - */ - startdir = open(".", O_RDONLY | O_DIRECTORY); for (i = 0; i < ressz; i++) { - process_onefile(mp, res + i, startdir, &outst, &conf); + if (i > 0) + mparse_reset(mp); + process_onefile(mp, res + i, &outst, &conf); if (outst.wstop && mandoc_msg_getrc() != MANDOCLEVEL_OK) break; } - if (startdir != -1) { - (void)fchdir(startdir); - close(startdir); - } if (conf.output.tag != NULL && conf.output.tag_found == 0) { mandoc_msg(MANDOCERR_TAG, 0, 0, "%s", conf.output.tag); conf.output.tag = NULL; @@ -909,7 +885,7 @@ fs_search(const struct mansearch *cfg, const struct manpaths *paths, } static void -process_onefile(struct mparse *mp, struct manpage *resp, int startdir, +process_onefile(struct mparse *mp, struct manpage *resp, struct outstate *outst, struct manconf *conf) { int fd; @@ -921,8 +897,6 @@ process_onefile(struct mparse *mp, struct manpage *resp, int startdir, */ if (resp->ipath != SIZE_MAX) (void)chdir(conf->manpath.paths[resp->ipath]); - else if (startdir != -1) - (void)fchdir(startdir); mandoc_msg_setinfilename(resp->file); if (resp->file != NULL) { @@ -982,18 +956,12 @@ parse(struct mparse *mp, int fd, const char *file, struct outstate *outst, struct manconf *conf) { static struct manpaths basepaths; - static int previous; struct roff_meta *meta; assert(fd >= 0); if (file == NULL) file = ""; - if (previous) - mparse_reset(mp); - else - previous = 1; - mparse_readfd(mp, fd, file); if (fd != STDIN_FILENO) close(fd); diff --git a/contrib/mandoc/man.c b/contrib/mandoc/man.c index f651efe3de8b..26846f1cf243 100644 --- a/contrib/mandoc/man.c +++ b/contrib/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.189 2022/08/16 23:01:09 schwarze Exp $ */ +/* $Id: man.c,v 1.190 2025/08/22 13:17:06 schwarze Exp $ */ /* * Copyright (c) 2013-2015,2017-2019,2022 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons @@ -134,6 +134,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs) *ep = '\0'; return 1; } + mandoc_msg(MANDOCERR_FI_BLANK, line, i, NULL); roff_elem_alloc(man, line, offs, ROFF_sp); man->next = ROFF_NEXT_SIBLING; return 1; diff --git a/contrib/mandoc/man.options.1 b/contrib/mandoc/man.options.1 index be65ad98fddc..be101d4b5b62 100644 --- a/contrib/mandoc/man.options.1 +++ b/contrib/mandoc/man.options.1 @@ -1,4 +1,4 @@ -.\" $Id: man.options.1,v 1.8 2025/06/30 00:11:06 schwarze Exp $ +.\" $Id: man.options.1,v 1.9 2025/08/28 13:46:57 schwarze Exp $ .\" .\" Copyright (c) 2017, 2025 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 30 2025 $ +.Dd $Mdocdate: August 28 2025 $ .Dt MAN.OPTIONS 1 .Os .Sh NAME @@ -39,9 +39,18 @@ .de At5 .At V Pq January 1983 \\$1 .. +.de At8 +.No Version 8 At Pq February 1985 \\$1 +.. .de Bx43 .Bx 4.3 Pq June 1986 \\$1 .. +.de At9 +.No Version 9 At Pq September 1986 \\$1 +.. +.de At10 +.No Version 10 At Pq October 1989 \\$1 +.. .\" option was present in groff-1.01 as contained in 4.3BSD-Net/2 .\" and no mention of it could be found in the ChangeLog, .\" so it's probably older than groff-0.4, where the log started @@ -49,7 +58,7 @@ .No probably before groff-0.4 Pq before July 14, 1990 \\$1 .. .de Eaton -.No Eaton Pq before July 7, 1993; 1990/91? \\$1 +.No Eaton Pq before July 7, 1993; 1990/91?\& \\$1 .. .\" man-1.5e was released on July 11, 1998. .de man15e @@ -399,6 +408,12 @@ do not feed out paper nor stop phototypesetter .br .Nm troff : .At7 +.Pp +.Bq superseded by Fl l +interpret arguments as file names +.br +.Nm man : +.At10 .It Fl G preprocess with .Xr grap 1 @@ -549,6 +564,7 @@ mode .br .Nm man : .Bx4 , +.At10 , .Eaton ; .No POSIX , Ox , Fx , Nx , No man-db , man-1.6 , illumos , Solaris 9-11 .br @@ -720,7 +736,9 @@ specify a page number for the first page output mode .br .Nm man : -.At7 +.At7 , +.At8 , +.At10 .Pp do not create the .Xr whatis 1 @@ -852,6 +870,12 @@ invoke the simultaneous input-output mode of the .rd request .Nm nroff , troff : .At7 .Pp +quick mode: prefer preformatted page if available +.br +.Nm man : +.At8 , +.At10 +.Pp issue no warnings .br .Nm manpath : @@ -1046,6 +1070,8 @@ output mode .Bx 2 Pq May 10, 1979 , .At3 , .At5 , +.At8 , +.At10 , .Eaton ; .Fx , No man-db , man-1.6 , illumos , Solaris 9-11 .br @@ -1162,6 +1188,7 @@ list pathnames .At7 , .At3 , .At5 , +.At8 , .Eaton ; .Ox , Fx , Nx , No man-db , man-1.6 .br diff --git a/contrib/mandoc/mandoc.1 b/contrib/mandoc/mandoc.1 index 8b6fe7d19b1e..0f83bcd53f1b 100644 --- a/contrib/mandoc/mandoc.1 +++ b/contrib/mandoc/mandoc.1 @@ -1,4 +1,4 @@ -.\" $Id: mandoc.1,v 1.272 2025/07/09 13:46:05 schwarze Exp $ +.\" $Id: mandoc.1,v 1.273 2025/08/22 13:17:06 schwarze Exp $ .\" .\" Copyright (c) 2012, 2014-2023, 2025 Ingo Schwarze .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 9 2025 $ +.Dd $Mdocdate: August 22 2025 $ .Dt MANDOC 1 .Os .Sh NAME @@ -1002,14 +1002,14 @@ macro that could be represented using or .Ic \&Dx . .It Sy "errnos out of order" -.Pq mdoc, Nx +.Pq mdoc , Nx The .Ic \&Er items in a .Ic \&Bl list are not in alphabetical order. .It Sy "duplicate errno" -.Pq mdoc, Nx +.Pq mdoc , Nx A .Ic \&Bl list contains two consecutive @@ -1150,7 +1150,7 @@ The argument is used as provided anyway. Consider checking whether the file name or the argument need a correction. .It Sy "missing date, using \(dq\(dq" -.Pq mdoc, man +.Pq mdoc , man The document was parsed as .Xr mdoc 7 and it has no @@ -1732,7 +1732,7 @@ or macro contains an opening or closing parenthesis; that's probably wrong, parentheses are added automatically. .It Sy "unknown library name" -.Pq mdoc, not on Ox +.Pq mdoc , not on Ox An .Ic \&Lb macro has an unknown name argument and will be rendered as @@ -1790,7 +1790,7 @@ The last character is mapped to the blank character. .Ss "Warnings related to plain text" .Bl -ohang .It Sy "blank line in fill mode, using .sp" -.Pq mdoc +.Pq mdoc , man The meaning of blank input lines is only well-defined in non-fill mode: In fill mode, line breaks of text input lines are not supposed to be significant. @@ -1800,6 +1800,8 @@ are formatted like requests. To request a paragraph break, use .Ic \&Pp +or +.Ic \&PP instead of a blank line. .It Sy "tab in filled text" .Pq mdoc , man diff --git a/contrib/mandoc/mdoc.7 b/contrib/mandoc/mdoc.7 index 55cc7fae688d..6c2d3568baa6 100644 --- a/contrib/mandoc/mdoc.7 +++ b/contrib/mandoc/mdoc.7 @@ -1,4 +1,4 @@ -.\" $Id: mdoc.7,v 1.299 2025/06/13 16:18:28 schwarze Exp $ +.\" $Id: mdoc.7,v 1.300 2025/08/19 14:08:59 schwarze Exp $ .\" .\" Copyright (c) 2010-2021, 2024, 2025 Ingo Schwarze .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 13 2025 $ +.Dd $Mdocdate: August 19 2025 $ .Dt MDOC 7 .Os .Sh NAME @@ -979,7 +979,7 @@ Unless the .Fl compact argument is specified, list entries are separated by vertical space. .Pp -A list must specify one of the following list types: +The following list types are commonly used: .Bl -tag -width 12n -offset indent .It Fl bullet No item heads can be specified, but a bullet will be printed at the head @@ -994,7 +994,14 @@ The .Fl width argument has no effect; instead, the string length of each argument specifies the width of one column. -If the first line of the body of a +The width specification for the last column does not affect formatting. +.Pp +For two-column lists, using +.Fl tag +often results in simpler code, identical terminal output, and better HTML +output, especially when the first column contains short identifiers. +.Pp +For compatibility with legacy documents, if the first line of the body of a .Fl column list is not an .Ic \&It @@ -1016,7 +1023,7 @@ Like except that item heads are not parsed for macro invocations. Most often used in the .Em DIAGNOSTICS -section with error constants in the item heads. +section with error messages in the item heads. .It Fl enum A numbered list. No item heads can be specified. @@ -1024,6 +1031,17 @@ Formatted like .Fl bullet , except that ordinal numbers are used in place of bullets, starting at 1. +.It Fl tag +Item bodies are indented according to the +.Fl width +argument. +When an item head fits inside the indentation, the item body follows +this head on the same output line. +Otherwise, the body starts on the output line following the head. +.El +.Pp +The following list types are rarely useful: +.Bl -tag -width 12n -offset indent .It Fl hang Like .Fl tag , @@ -1050,13 +1068,6 @@ Item bodies start on the line following item heads and are not indented. The .Fl width argument is ignored. -.It Fl tag -Item bodies are indented according to the -.Fl width -argument. -When an item head fits inside the indentation, the item body follows -this head on the same output line. -Otherwise, the body starts on the output line following the head. .El .Pp Lists may be nested within lists and displays. diff --git a/contrib/mandoc/roff_term.c b/contrib/mandoc/roff_term.c index 85d2caeb2749..38321c830013 100644 --- a/contrib/mandoc/roff_term.c +++ b/contrib/mandoc/roff_term.c @@ -1,4 +1,4 @@ -/* $Id: roff_term.c,v 1.26 2025/07/16 14:33:08 schwarze Exp $ */ +/* $Id: roff_term.c,v 1.27 2025/08/21 15:38:51 schwarze Exp $ */ /* * Copyright (c) 2010, 2014, 2015, 2017-2021, 2025 * Ingo Schwarze diff --git a/contrib/mandoc/term_ps.c b/contrib/mandoc/term_ps.c index 4c6368ca1d1f..91124152d55a 100644 --- a/contrib/mandoc/term_ps.c +++ b/contrib/mandoc/term_ps.c @@ -1,4 +1,4 @@ -/* $Id: term_ps.c,v 1.94 2025/07/18 15:47:18 schwarze Exp $ */ +/* $Id: term_ps.c,v 1.95 2025/09/26 12:17:12 schwarze Exp $ */ /* * Copyright (c) 2014-2017, 2020, 2025 Ingo Schwarze * Copyright (c) 2010, 2011 Kristaps Dzonsons @@ -1222,6 +1222,8 @@ ps_endline(struct termp *p) ps_plast(p); ps_pclose(p); + p->viscol = 0; + p->minbl = 0; /* * If we're in the margin, don't try to recalculate our current @@ -1235,8 +1237,6 @@ ps_endline(struct termp *p) /* Left-justify. */ p->ps->pscol = p->ps->left; - p->viscol = 0; - p->minbl = 0; /* If we haven't printed anything, return. */ From nobody Thu Oct 2 07:32:06 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cck5L51rcz69F96; Thu, 02 Oct 2025 07:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cck5L4mFMz4Hlc; Thu, 02 Oct 2025 07:32:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759390326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MB/1tedF3FL0cBfu2Xedt0kfMQDr70Cb04nupaznS0U=; b=CVimsZLLNv5L5hoDI6azaObKzgwQ+91M5YvWb3O1NV7Y4bqhY/JtxkbxoPbkyujKR0rLHp e0X5AHJiOw3CtsjaqQ90KN5Tb2938+Oa1HrMtSi4+7BxI1krfv5VVN8RaJPE5IKLTAzvVt mPYbP/x8IWKwvIGnBkn5YXE4FcLHnkbCOUO7hrLwjz7lUVnT2rFVh6VZYkHL6SP0BnDlwV /HhjDUgN+kPB0kxNptgcvX+UvKCd6pyJemg2CWIei8Nt3XMv6ZzftNDndh6t7UBOitnc2t c3tiObbP3TXIcszV08Uhb5tRO1/9hsZgk7J5FXmH98Bj5Xn/qp9+x7Ae+QyXKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759390326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MB/1tedF3FL0cBfu2Xedt0kfMQDr70Cb04nupaznS0U=; b=oe/tiaDjAY/CyzRDJ41jwmkDgBGzXbH7u6t39MDwvAgRg2dJQ2Pjq4MBYSSkom7fA890F4 U9vk9c74bqbsX3K3x0D8dX4W0Z9mYJgT2fb+sr1/u6TRplHO7TNoGpgcebqFTAj7XwhBxg DxYFRDtUtoR/x5VNYFG8jA4KywNpRZimNVLRRwip9yPp4wIlVqkia7S5cAVuauRLomMwmo +mJMixWGzWzaZADb0SvBtsfBG6zZukxUlvpstsspL7QQWniza/nMzYM4t6MZGSnnwupPgh uei+xe2DMv/OBEsOVYGOF+R1QapXlJcXi5HY1oiFygEQhlpQHZirp4vPjxuyeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759390326; a=rsa-sha256; cv=none; b=gMTrmM7wsBGy2Aw0flOwHtkQzzt8BCbMby2Hvjz15UTQUzxkZFuklR1bVLJiI1b5Nf2qXK yDYZa5oVbcmCzU/bhb+y/7hBwjihUm1PH+GuGWpSf9jp3/JkaLYesZAiRDVUwHDskvuECf QsgZvAbyfOlOOQ6UFf7VKLjI1YHW5xVpEva+aLgshK05xZQxC9EpwoihBT0k7CWz3vhwRE olZGnWwuLjBJ4RyFMEq5IGMiOdUZicjS4A2Hl/XWu6L+TOArkwLbM2AhOUZNRd6fu/d2eo 0ucdYaCP08ZHLdHdfo/DTEyj+p+YsbebS+k8POxiuSP++bQd8K6uJwFAXCxlUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cck5L4J1Qzyld; Thu, 02 Oct 2025 07:32: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 5927W6uU031148; Thu, 2 Oct 2025 07:32:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5927W61f031145; Thu, 2 Oct 2025 07:32:06 GMT (envelope-from git) Date: Thu, 2 Oct 2025 07:32:06 GMT Message-Id: <202510020732.5927W61f031145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 5a31c623143f - stable/15 - virtual_oss: Port to base List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 5a31c623143f4a20e5b5fb337ec97ac0b39635fc Auto-Submitted: auto-generated The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5a31c623143f4a20e5b5fb337ec97ac0b39635fc commit 5a31c623143f4a20e5b5fb337ec97ac0b39635fc Author: Christos Margiolis AuthorDate: 2025-09-28 09:56:52 +0000 Commit: Christos Margiolis CommitDate: 2025-10-02 07:31:27 +0000 virtual_oss: Port to base This patch diverges quite a bit from the current upstream [1] in a few ways: 1. virtual_oss(8), virtual_bt_speaker(8) and virtual_oss_cmd(8) are actually separate programs. 2. Backends (lib/virtual_oss) are built as separate shared libraries and we dlopen() them in virtual_oss(8) and virtual_bt_speaker(8) on demand. 3. virtual_equalizer(8) and the sndio and bluetooth backends are built as ports, because they depend on third-party libraries. 4. Use newer libav API in bluetooth backend (see HAVE_LIBAV ifdefs) to address compiler errors. [1] https://github.com/freebsd/virtual_oss Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D52308 (cherry picked from commit 9cab9fde5edad9b409dd2317a2aec7815e6d6bed) (cherry picked from commit 86a7787e324b1524abfc434982bae9bf87ad7390) (cherry picked from commit 69ede18b950e32317d7741410cde7543fa0fce3c) (cherry picked from commit 0532cd2d771372d3266b97aebf4043d5b31b64bd) (cherry picked from commit 25d551b5fb1d28ed485d56d9d637993eb2d223b1) (cherry picked from commit 8af6aee96ed609456900c6dd92dafabac5e89c0a) (cherry picked from commit f040ee6e407832fc9f08d85cd792d1cfb8104976) (cherry picked from commit bce8cdaf4cb184db577a5633e82bdabe24239af1) --- etc/mtree/BSD.lib32.dist | 2 + etc/mtree/BSD.usr.dist | 2 + lib/Makefile | 2 + lib/virtual_oss/Makefile | 9 + lib/virtual_oss/Makefile.inc | 3 + lib/virtual_oss/bt/Makefile | 19 + lib/virtual_oss/bt/avdtp.c | 720 ++++++ lib/virtual_oss/bt/avdtp_signal.h | 139 ++ lib/virtual_oss/bt/bt.c | 1061 ++++++++ lib/virtual_oss/bt/bt.h | 116 + lib/virtual_oss/bt/cosdata-gen/Makefile | 12 + lib/virtual_oss/bt/cosdata-gen/cosdata.c | 177 ++ lib/virtual_oss/bt/sbc_coeffs.h | 69 + lib/virtual_oss/bt/sbc_encode.c | 701 ++++++ lib/virtual_oss/bt/sbc_encode.h | 82 + lib/virtual_oss/null/Makefile | 10 + lib/virtual_oss/null/null.c | 102 + lib/virtual_oss/oss/Makefile | 10 + lib/virtual_oss/oss/oss.c | 197 ++ lib/virtual_oss/sndio/Makefile | 12 + lib/virtual_oss/sndio/sndio.c | 203 ++ libexec/rc/rc.d/Makefile | 4 + libexec/rc/rc.d/virtual_oss | 119 + sys/sys/param.h | 2 +- usr.sbin/Makefile | 1 + usr.sbin/virtual_oss/Makefile | 9 + usr.sbin/virtual_oss/Makefile.inc | 1 + usr.sbin/virtual_oss/virtual_bt_speaker/Makefile | 11 + .../virtual_oss/virtual_bt_speaker/bt_speaker.c | 542 ++++ .../virtual_bt_speaker/virtual_bt_speaker.8 | 71 + usr.sbin/virtual_oss/virtual_equalizer/Makefile | 11 + usr.sbin/virtual_oss/virtual_equalizer/equalizer.c | 431 ++++ .../virtual_equalizer/virtual_equalizer.8 | 127 + usr.sbin/virtual_oss/virtual_oss/Makefile | 24 + usr.sbin/virtual_oss/virtual_oss/audio_delay.c | 238 ++ usr.sbin/virtual_oss/virtual_oss/backend.h | 53 + usr.sbin/virtual_oss/virtual_oss/compressor.c | 76 + usr.sbin/virtual_oss/virtual_oss/ctl.c | 615 +++++ usr.sbin/virtual_oss/virtual_oss/eq.c | 226 ++ usr.sbin/virtual_oss/virtual_oss/format.c | 429 ++++ usr.sbin/virtual_oss/virtual_oss/httpd.c | 846 +++++++ usr.sbin/virtual_oss/virtual_oss/int.h | 331 +++ usr.sbin/virtual_oss/virtual_oss/main.c | 2625 ++++++++++++++++++++ usr.sbin/virtual_oss/virtual_oss/mul.c | 175 ++ usr.sbin/virtual_oss/virtual_oss/ring.c | 213 ++ usr.sbin/virtual_oss/virtual_oss/utils.h | 31 + usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 | 355 +++ usr.sbin/virtual_oss/virtual_oss/virtual_oss.c | 914 +++++++ usr.sbin/virtual_oss/virtual_oss/virtual_oss.h | 206 ++ usr.sbin/virtual_oss/virtual_oss_cmd/Makefile | 8 + usr.sbin/virtual_oss/virtual_oss_cmd/command.c | 113 + .../virtual_oss/virtual_oss_cmd/virtual_oss_cmd.8 | 103 + 52 files changed, 12557 insertions(+), 1 deletion(-) diff --git a/etc/mtree/BSD.lib32.dist b/etc/mtree/BSD.lib32.dist index a736a7d58b66..6520b7b95116 100644 --- a/etc/mtree/BSD.lib32.dist +++ b/etc/mtree/BSD.lib32.dist @@ -21,5 +21,7 @@ .. pkgconfig .. + virtual_oss + .. .. .. diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 7d3a72f43fa1..7f54ccbcb4cb 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -101,6 +101,8 @@ .. ossl-modules .. + virtual_oss + .. .. libdata ldscripts diff --git a/lib/Makefile b/lib/Makefile index 2b7cf2fdcb7d..d43e4d395f56 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -157,6 +157,7 @@ SUBDIR_DEPEND_liblzma= libthr SUBDIR_DEPEND_libpcap= ofed .endif SUBDIR_DEPEND_nss_tacplus= libtacplus +SUBDIR_DEPEND_virtual_oss= libsamplerate # NB: keep these sorted by MK_* knobs @@ -173,6 +174,7 @@ SUBDIR+= clang .endif SUBDIR.${MK_CUSE}+= libcuse +SUBDIR.${MK_CUSE}+= virtual_oss SUBDIR.${MK_TOOLCHAIN}+=libpe SUBDIR.${MK_DIALOG}+= libdpv libfigpar SUBDIR.${MK_FDT}+= libfdt diff --git a/lib/virtual_oss/Makefile b/lib/virtual_oss/Makefile new file mode 100644 index 000000000000..dc83edd4b980 --- /dev/null +++ b/lib/virtual_oss/Makefile @@ -0,0 +1,9 @@ +.include + +SHLIBDIR?= ${LIBDIR}/virtual_oss + +SUBDIR+= null \ + oss + +.include "Makefile.inc" +.include diff --git a/lib/virtual_oss/Makefile.inc b/lib/virtual_oss/Makefile.inc new file mode 100644 index 000000000000..45c8e0b1fdfc --- /dev/null +++ b/lib/virtual_oss/Makefile.inc @@ -0,0 +1,3 @@ +.include "../Makefile.inc" + +LDFLAGS+= -L${.OBJDIR:H:H}/libsamplerate diff --git a/lib/virtual_oss/bt/Makefile b/lib/virtual_oss/bt/Makefile new file mode 100644 index 000000000000..15413b7a1f1e --- /dev/null +++ b/lib/virtual_oss/bt/Makefile @@ -0,0 +1,19 @@ +SHLIB_NAME= voss_bt.so +SHLIBDIR= ${LIBDIR}/virtual_oss + +SRCS= bt.c \ + avdtp.c \ + sbc_encode.c + +CFLAGS+= -I${SRCTOP}/usr.sbin/virtual_oss/virtual_oss \ + -I${SRCTOP}/contrib/libsamplerate +LDFLAGS+= -lbluetooth -lsdp +LIBADD= samplerate + +.if defined(HAVE_LIBAV) +CFLAGS+= -I${LOCALBASE:U/usr/local}/include -DHAVE_LIBAV +LDFLAGS+= -L${LOCALBASE:U/usr/local}/lib \ + -lavdevice -lavutil -lavcodec -lavformat +.endif + +.include diff --git a/lib/virtual_oss/bt/avdtp.c b/lib/virtual_oss/bt/avdtp.c new file mode 100644 index 000000000000..82ed0fb942b6 --- /dev/null +++ b/lib/virtual_oss/bt/avdtp.c @@ -0,0 +1,720 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2015-2016 Nathanial Sloss + * Copyright (c) 2016-2019 Hans Petter Selasky + * Copyright (c) 2019 Google LLC, written by Richard Kralovic + * + * This software is dedicated to the memory of - + * Baron James Anlezark (Barry) - 1 Jan 1949 - 13 May 2012. + * + * Barry was a man who loved his music. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "avdtp_signal.h" +#include "bt.h" + +#define DPRINTF(...) printf("backend_bt: " __VA_ARGS__) + +struct avdtpGetPacketInfo { + uint8_t buffer_data[512]; + uint16_t buffer_len; + uint8_t trans; + uint8_t signalID; +}; + +static int avdtpAutoConfig(struct bt_config *); + +/* Return received message type if success, < 0 if failure. */ +static int +avdtpGetPacket(int fd, struct avdtpGetPacketInfo *info) +{ + uint8_t *pos = info->buffer_data; + uint8_t *end = info->buffer_data + sizeof(info->buffer_data); + uint8_t message_type; + int len; + + memset(info, 0, sizeof(*info)); + + /* Handle fragmented packets */ + for (int remaining = 1; remaining > 0; --remaining) { + len = read(fd, pos, end - pos); + + if (len < AVDTP_LEN_SUCCESS) + return (-1); + if (len == (int)(end - pos)) + return (-1); /* buffer too small */ + + uint8_t trans = (pos[0] & TRANSACTIONLABEL) >> TRANSACTIONLABEL_S; + uint8_t packet_type = (pos[0] & PACKETTYPE) >> PACKETTYPE_S; + uint8_t current_message_type = (info->buffer_data[0] & MESSAGETYPE); + uint8_t shift; + if (pos == info->buffer_data) { + info->trans = trans; + message_type = current_message_type; + if (packet_type == singlePacket) { + info->signalID = (pos[1] & SIGNALID_MASK); + shift = 2; + } else { + if (packet_type != startPacket) + return (-1); + remaining = pos[1]; + info->signalID = (pos[2] & SIGNALID_MASK); + shift = 3; + } + } else { + if (info->trans != trans || + message_type != current_message_type || + (remaining == 1 && packet_type != endPacket) || + (remaining > 1 && packet_type != continuePacket)) { + return (-1); + } + shift = 1; + } + memmove(pos, pos + shift, len); + pos += len; + } + info->buffer_len = pos - info->buffer_data; + return (message_type); +} + +/* Returns 0 on success, < 0 on failure. */ +static int +avdtpSendPacket(int fd, uint8_t command, uint8_t trans, uint8_t type, + uint8_t * data0, int datasize0, uint8_t * data1, + int datasize1) +{ + struct iovec iov[3]; + uint8_t header[2]; + int retval; + + /* fill out command header */ + header[0] = (trans << 4) | (type & 3); + if (command != 0) + header[1] = command & 0x3f; + else + header[1] = 3; + + iov[0].iov_base = header; + iov[0].iov_len = 2; + iov[1].iov_base = data0; + iov[1].iov_len = datasize0; + iov[2].iov_base = data1; + iov[2].iov_len = datasize1; + + retval = writev(fd, iov, 3); + if (retval != (2 + datasize0 + datasize1)) + return (-EINVAL); + else + return (0); +} + +/* Returns 0 on success, < 0 on failure. */ +static int +avdtpSendSyncCommand(int fd, struct avdtpGetPacketInfo *info, + uint8_t command, uint8_t type, uint8_t * data0, + int datasize0, uint8_t * data1, int datasize1) +{ + static uint8_t transLabel; + uint8_t trans; + int retval; + + alarm(8); /* set timeout */ + + trans = (transLabel++) & 0xF; + + retval = avdtpSendPacket(fd, command, trans, type, + data0, datasize0, data1, datasize1); + if (retval) + goto done; +retry: + switch (avdtpGetPacket(fd, info)) { + case RESPONSEACCEPT: + if (info->trans != trans) + goto retry; + retval = 0; + break; + case RESPONSEREJECT: + if (info->trans != trans) + goto retry; + retval = -EINVAL; + break; + case COMMAND: + retval = avdtpSendReject(fd, info->trans, info->signalID); + if (retval == 0) + goto retry; + break; + default: + retval = -ENXIO; + break; + } +done: + alarm(0); /* clear timeout */ + + return (retval); +} + +/* + * Variant for acceptor role: We support any frequency, blocks, bands, and + * allocation. Returns 0 on success, < 0 on failure. + */ +static int +avdtpSendCapabilitiesResponseSBCForACP(int fd, int trans) +{ + uint8_t data[10]; + + data[0] = mediaTransport; + data[1] = 0; + data[2] = mediaCodec; + data[3] = 0x6; + data[4] = mediaTypeAudio; + data[5] = SBC_CODEC_ID; + data[6] = + (1 << (3 - MODE_STEREO)) | + (1 << (3 - MODE_JOINT)) | + (1 << (3 - MODE_DUAL)) | + (1 << (3 - MODE_MONO)) | + (1 << (7 - FREQ_44_1K)) | + (1 << (7 - FREQ_48K)) | + (1 << (7 - FREQ_32K)) | + (1 << (7 - FREQ_16K)); + data[7] = + (1 << (7 - BLOCKS_4)) | + (1 << (7 - BLOCKS_8)) | + (1 << (7 - BLOCKS_12)) | + (1 << (7 - BLOCKS_16)) | + (1 << (3 - BANDS_4)) | + (1 << (3 - BANDS_8)) | (1 << ALLOC_LOUDNESS) | (1 << ALLOC_SNR); + data[8] = MIN_BITPOOL; + data[9] = DEFAULT_MAXBPOOL; + + return (avdtpSendPacket(fd, AVDTP_GET_CAPABILITIES, trans, + RESPONSEACCEPT, data, sizeof(data), NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpSendAccept(int fd, uint8_t trans, uint8_t myCommand) +{ + return (avdtpSendPacket(fd, myCommand, trans, RESPONSEACCEPT, + NULL, 0, NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpSendReject(int fd, uint8_t trans, uint8_t myCommand) +{ + uint8_t value = 0; + + return (avdtpSendPacket(fd, myCommand, trans, RESPONSEREJECT, + &value, 1, NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpSendDiscResponseAudio(int fd, uint8_t trans, + uint8_t mySep, uint8_t is_sink) +{ + uint8_t data[2]; + + data[0] = mySep << 2; + data[1] = mediaTypeAudio << 4 | (is_sink ? (1 << 3) : 0); + + return (avdtpSendPacket(fd, AVDTP_DISCOVER, trans, RESPONSEACCEPT, + data, 2, NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpDiscoverAndConfig(struct bt_config *cfg, bool isSink) +{ + struct avdtpGetPacketInfo info; + uint16_t offset; + uint8_t chmode = cfg->chmode; + uint8_t aacMode1 = cfg->aacMode1; + uint8_t aacMode2 = cfg->aacMode2; + int retval; + + retval = avdtpSendSyncCommand(cfg->hc, &info, AVDTP_DISCOVER, 0, + NULL, 0, NULL, 0); + if (retval) + return (retval); + + retval = -EBUSY; + for (offset = 0; offset + 2 <= info.buffer_len; offset += 2) { + cfg->sep = info.buffer_data[offset] >> 2; + cfg->media_Type = info.buffer_data[offset + 1] >> 4; + cfg->chmode = chmode; + cfg->aacMode1 = aacMode1; + cfg->aacMode2 = aacMode2; + if (info.buffer_data[offset] & DISCOVER_SEP_IN_USE) + continue; + if (info.buffer_data[offset + 1] & DISCOVER_IS_SINK) { + if (!isSink) + continue; + } else { + if (isSink) + continue; + } + /* try to configure SBC */ + retval = avdtpAutoConfig(cfg); + if (retval == 0) + return (0); + } + return (retval); +} + +/* Returns 0 on success, < 0 on failure. */ +static int +avdtpGetCapabilities(int fd, uint8_t sep, struct avdtpGetPacketInfo *info) +{ + uint8_t address = (sep << 2); + + return (avdtpSendSyncCommand(fd, info, + AVDTP_GET_CAPABILITIES, 0, &address, 1, + NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpSetConfiguration(int fd, uint8_t sep, uint8_t * data, int datasize) +{ + struct avdtpGetPacketInfo info; + uint8_t configAddresses[2]; + + configAddresses[0] = sep << 2; + configAddresses[1] = INTSEP << 2; + + return (avdtpSendSyncCommand(fd, &info, AVDTP_SET_CONFIGURATION, 0, + configAddresses, 2, data, datasize)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpOpen(int fd, uint8_t sep) +{ + struct avdtpGetPacketInfo info; + uint8_t address = sep << 2; + + return (avdtpSendSyncCommand(fd, &info, AVDTP_OPEN, 0, + &address, 1, NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpStart(int fd, uint8_t sep) +{ + struct avdtpGetPacketInfo info; + uint8_t address = sep << 2; + + return (avdtpSendSyncCommand(fd, &info, AVDTP_START, 0, + &address, 1, NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpClose(int fd, uint8_t sep) +{ + struct avdtpGetPacketInfo info; + uint8_t address = sep << 2; + + return (avdtpSendSyncCommand(fd, &info, AVDTP_CLOSE, 0, + &address, 1, NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpSuspend(int fd, uint8_t sep) +{ + struct avdtpGetPacketInfo info; + uint8_t address = sep << 2; + + return (avdtpSendSyncCommand(fd, &info, AVDTP_SUSPEND, 0, + &address, 1, NULL, 0)); +} + +/* Returns 0 on success, < 0 on failure. */ +int +avdtpAbort(int fd, uint8_t sep) +{ + struct avdtpGetPacketInfo info; + uint8_t address = sep << 2; + + return (avdtpSendSyncCommand(fd, &info, AVDTP_ABORT, 0, + &address, 1, NULL, 0)); +} + +static int +avdtpAutoConfig(struct bt_config *cfg) +{ + struct avdtpGetPacketInfo info; + uint8_t freqmode; + uint8_t blk_len_sb_alloc; + uint8_t availFreqMode = 0; + uint8_t availConfig = 0; + uint8_t supBitpoolMin = 0; + uint8_t supBitpoolMax = 0; + uint8_t aacMode1 = 0; + uint8_t aacMode2 = 0; +#ifdef HAVE_LIBAV + uint8_t aacBitrate3 = 0; + uint8_t aacBitrate4 = 0; + uint8_t aacBitrate5 = 0; +#endif + int retval; + int i; + + retval = avdtpGetCapabilities(cfg->hc, cfg->sep, &info); + if (retval) { + DPRINTF("Cannot get capabilities\n"); + return (retval); + } +retry: + for (i = 0; (i + 1) < info.buffer_len;) { +#if 0 + DPRINTF("0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", + info.buffer_data[i + 0], + info.buffer_data[i + 1], + info.buffer_data[i + 2], + info.buffer_data[i + 3], + info.buffer_data[i + 4], info.buffer_data[i + 5]); +#endif + if (i + 2 + info.buffer_data[i + 1] > info.buffer_len) + break; + switch (info.buffer_data[i]) { + case mediaTransport: + break; + case mediaCodec: + if (info.buffer_data[i + 1] < 2) + break; + /* check codec */ + switch (info.buffer_data[i + 3]) { + case 0: /* SBC */ + if (info.buffer_data[i + 1] < 6) + break; + availFreqMode = info.buffer_data[i + 4]; + availConfig = info.buffer_data[i + 5]; + supBitpoolMin = info.buffer_data[i + 6]; + supBitpoolMax = info.buffer_data[i + 7]; + break; + case 2: /* MPEG2/4 AAC */ + if (info.buffer_data[i + 1] < 8) + break; + aacMode1 = info.buffer_data[i + 5]; + aacMode2 = info.buffer_data[i + 6]; +#ifdef HAVE_LIBAV + aacBitrate3 = info.buffer_data[i + 7]; + aacBitrate4 = info.buffer_data[i + 8]; + aacBitrate5 = info.buffer_data[i + 9]; +#endif + break; + default: + break; + } + } + /* jump to next information element */ + i += 2 + info.buffer_data[i + 1]; + } + aacMode1 &= cfg->aacMode1; + aacMode2 &= cfg->aacMode2; + + /* Try AAC first */ + if (aacMode1 == cfg->aacMode1 && aacMode2 == cfg->aacMode2) { +#ifdef HAVE_LIBAV + uint8_t config[12] = { mediaTransport, 0x0, mediaCodec, + 0x8, 0x0, 0x02, 0x80, aacMode1, aacMode2, aacBitrate3, + aacBitrate4, aacBitrate5 + }; + + if (avdtpSetConfiguration + (cfg->hc, cfg->sep, config, sizeof(config)) == 0) { + cfg->codec = CODEC_AAC; + return (0); + } +#endif + } + /* Try SBC second */ + if (cfg->freq == FREQ_UNDEFINED) + goto auto_config_failed; + + freqmode = (1 << (3 - cfg->freq + 4)) | (1 << (3 - cfg->chmode)); + + if ((availFreqMode & freqmode) != freqmode) { + DPRINTF("No frequency and mode match\n"); + goto auto_config_failed; + } + for (i = 0; i != 4; i++) { + blk_len_sb_alloc = (1 << (i + 4)) | + (1 << (1 - cfg->bands + 2)) | (1 << cfg->allocm); + + if ((availConfig & blk_len_sb_alloc) == blk_len_sb_alloc) + break; + } + if (i == 4) { + DPRINTF("No bands available\n"); + goto auto_config_failed; + } + cfg->blocks = (3 - i); + + if (cfg->allocm == ALLOC_SNR) + supBitpoolMax &= ~1; + + if (cfg->chmode == MODE_DUAL || cfg->chmode == MODE_MONO) + supBitpoolMax /= 2; + + if (cfg->bands == BANDS_4) + supBitpoolMax /= 2; + + if (supBitpoolMax > cfg->bitpool) + supBitpoolMax = cfg->bitpool; + else + cfg->bitpool = supBitpoolMax; + + do { + uint8_t config[10] = { mediaTransport, 0x0, mediaCodec, 0x6, + 0x0, 0x0, freqmode, blk_len_sb_alloc, supBitpoolMin, + supBitpoolMax + }; + + if (avdtpSetConfiguration + (cfg->hc, cfg->sep, config, sizeof(config)) == 0) { + cfg->codec = CODEC_SBC; + return (0); + } + } while (0); + +auto_config_failed: + if (cfg->chmode == MODE_STEREO) { + cfg->chmode = MODE_MONO; + cfg->aacMode2 ^= 0x0C; + goto retry; + } + return (-EINVAL); +} + +void +avdtpACPFree(struct bt_config *cfg) +{ + if (cfg->handle.sbc_enc) { + free(cfg->handle.sbc_enc); + cfg->handle.sbc_enc = NULL; + } +} + +/* Returns 0 on success, < 0 on failure. */ +static int +avdtpParseSBCConfig(uint8_t * data, struct bt_config *cfg) +{ + if (data[0] & (1 << (7 - FREQ_48K))) { + cfg->freq = FREQ_48K; + } else if (data[0] & (1 << (7 - FREQ_44_1K))) { + cfg->freq = FREQ_44_1K; + } else if (data[0] & (1 << (7 - FREQ_32K))) { + cfg->freq = FREQ_32K; + } else if (data[0] & (1 << (7 - FREQ_16K))) { + cfg->freq = FREQ_16K; + } else { + return -EINVAL; + } + + if (data[0] & (1 << (3 - MODE_STEREO))) { + cfg->chmode = MODE_STEREO; + } else if (data[0] & (1 << (3 - MODE_JOINT))) { + cfg->chmode = MODE_JOINT; + } else if (data[0] & (1 << (3 - MODE_DUAL))) { + cfg->chmode = MODE_DUAL; + } else if (data[0] & (1 << (3 - MODE_MONO))) { + cfg->chmode = MODE_MONO; + } else { + return -EINVAL; + } + + if (data[1] & (1 << (7 - BLOCKS_16))) { + cfg->blocks = BLOCKS_16; + } else if (data[1] & (1 << (7 - BLOCKS_12))) { + cfg->blocks = BLOCKS_12; + } else if (data[1] & (1 << (7 - BLOCKS_8))) { + cfg->blocks = BLOCKS_8; + } else if (data[1] & (1 << (7 - BLOCKS_4))) { + cfg->blocks = BLOCKS_4; + } else { + return -EINVAL; + } + + if (data[1] & (1 << (3 - BANDS_8))) { + cfg->bands = BANDS_8; + } else if (data[1] & (1 << (3 - BANDS_4))) { + cfg->bands = BANDS_4; + } else { + return -EINVAL; + } + + if (data[1] & (1 << ALLOC_LOUDNESS)) { + cfg->allocm = ALLOC_LOUDNESS; + } else if (data[1] & (1 << ALLOC_SNR)) { + cfg->allocm = ALLOC_SNR; + } else { + return -EINVAL; + } + cfg->bitpool = data[3]; + return 0; +} + +int +avdtpACPHandlePacket(struct bt_config *cfg) +{ + struct avdtpGetPacketInfo info; + int retval; + + if (avdtpGetPacket(cfg->hc, &info) != COMMAND) + return (-ENXIO); + + switch (info.signalID) { + case AVDTP_DISCOVER: + retval = + avdtpSendDiscResponseAudio(cfg->hc, info.trans, ACPSEP, 1); + if (!retval) + retval = AVDTP_DISCOVER; + break; + case AVDTP_GET_CAPABILITIES: + retval = + avdtpSendCapabilitiesResponseSBCForACP(cfg->hc, info.trans); + if (!retval) + retval = AVDTP_GET_CAPABILITIES; + break; + case AVDTP_SET_CONFIGURATION: + if (cfg->acceptor_state != acpInitial) + goto err; + cfg->sep = info.buffer_data[1] >> 2; + int is_configured = 0; + for (int i = 2; (i + 1) < info.buffer_len;) { + if (i + 2 + info.buffer_data[i + 1] > info.buffer_len) + break; + switch (info.buffer_data[i]) { + case mediaTransport: + break; + case mediaCodec: + if (info.buffer_data[i + 1] < 2) + break; + /* check codec */ + switch (info.buffer_data[i + 3]) { + case 0: /* SBC */ + if (info.buffer_data[i + 1] < 6) + break; + retval = + avdtpParseSBCConfig(info.buffer_data + i + 4, cfg); + if (retval) + return retval; + is_configured = 1; + break; + case 2: /* MPEG2/4 AAC */ + /* TODO: Add support */ + default: + break; + } + } + /* jump to next information element */ + i += 2 + info.buffer_data[i + 1]; + } + if (!is_configured) + goto err; + + retval = + avdtpSendAccept(cfg->hc, info.trans, AVDTP_SET_CONFIGURATION); + if (retval) + return (retval); + + /* TODO: Handle other codecs */ + if (cfg->handle.sbc_enc == NULL) { + cfg->handle.sbc_enc = malloc(sizeof(*cfg->handle.sbc_enc)); + if (cfg->handle.sbc_enc == NULL) + return (-ENOMEM); + } + memset(cfg->handle.sbc_enc, 0, sizeof(*cfg->handle.sbc_enc)); + + retval = AVDTP_SET_CONFIGURATION; + cfg->acceptor_state = acpConfigurationSet; + break; + case AVDTP_OPEN: + if (cfg->acceptor_state != acpConfigurationSet) + goto err; + retval = avdtpSendAccept(cfg->hc, info.trans, info.signalID); + if (retval) + return (retval); + retval = info.signalID; + cfg->acceptor_state = acpStreamOpened; + break; + case AVDTP_START: + if (cfg->acceptor_state != acpStreamOpened && + cfg->acceptor_state != acpStreamSuspended) { + goto err; + } + retval = avdtpSendAccept(cfg->hc, info.trans, info.signalID); + if (retval) + return retval; + retval = info.signalID; + cfg->acceptor_state = acpStreamStarted; + break; + case AVDTP_CLOSE: + if (cfg->acceptor_state != acpStreamOpened && + cfg->acceptor_state != acpStreamStarted && + cfg->acceptor_state != acpStreamSuspended) { + goto err; + } + retval = avdtpSendAccept(cfg->hc, info.trans, info.signalID); + if (retval) + return (retval); + retval = info.signalID; + cfg->acceptor_state = acpStreamClosed; + break; + case AVDTP_SUSPEND: + if (cfg->acceptor_state != acpStreamOpened && + cfg->acceptor_state != acpStreamStarted) { + goto err; + } + retval = avdtpSendAccept(cfg->hc, info.trans, info.signalID); + if (retval) + return (retval); + retval = info.signalID; + cfg->acceptor_state = acpStreamSuspended; + break; + case AVDTP_GET_CONFIGURATION: + case AVDTP_RECONFIGURE: + case AVDTP_ABORT: + /* TODO: Implement this. */ + default: +err: + avdtpSendReject(cfg->hc, info.trans, info.signalID); + return (-ENXIO); + } + return (retval); +} diff --git a/lib/virtual_oss/bt/avdtp_signal.h b/lib/virtual_oss/bt/avdtp_signal.h new file mode 100644 index 000000000000..a46cc6dd9dcf --- /dev/null +++ b/lib/virtual_oss/bt/avdtp_signal.h @@ -0,0 +1,139 @@ +/* $NetBSD$ */ + +/*- + * Copyright (c) 2015 Nathanial Sloss + * + * This software is dedicated to the memory of - + * Baron James Anlezark (Barry) - 1 Jan 1949 - 13 May 2012. + * + * Barry was a man who loved his music. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _AVDTP_SIGNAL_H_ +#define _AVDTP_SIGNAL_H_ + +#include +#include + +/* Our endpoint. */ +#define INTSEP 8 +#define ACPSEP 8 + +/* AVDTP signals. */ + +#define AVDTP_DISCOVER 0x01 +#define AVDTP_GET_CAPABILITIES 0x02 +#define AVDTP_SET_CONFIGURATION 0x03 +#define AVDTP_GET_CONFIGURATION 0x04 +#define AVDTP_RECONFIGURE 0x05 +#define AVDTP_OPEN 0x06 +#define AVDTP_START 0x07 +#define AVDTP_CLOSE 0x08 +#define AVDTP_SUSPEND 0x09 +#define AVDTP_ABORT 0x0a +#define AVDTP_SECUURITY_CONTROL 0x0b + +/* Signal Command & Response Header Masks. */ + +#define TRANSACTIONLABEL 0xf0 +#define TRANSACTIONLABEL_S 4 +#define SIGNALID_MASK 0x3f +#define PACKETTYPE 0x0c +#define PACKETTYPE_S 0x02 +#define MESSAGETYPE 0x03 +#define SIGNALIDENTIFIER 0x3f +#define DISCOVER_SEP_IN_USE 0x02 *** 12014 LINES SKIPPED *** From nobody Thu Oct 2 07:32:07 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cck5M6ZGbz69DQj; Thu, 02 Oct 2025 07:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cck5M5RCWz4J8h; Thu, 02 Oct 2025 07:32:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759390327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8t8GC35UlZJBwT7Ns5z/3snswByJNTBxvlbFWeoWfeA=; b=LKVLs379kluseH5KzZyumcuvRTAXN2HzIOdlpLjdcUk3/NDEcVQ/rAc7k7MLV0k1EvdLPu QwU0Glct32po8wySnGMX1ni+vph76Ngwl4o+vnSpi/zsetp88ftedZFrRKLHUOJJWzPXgb dFxQAdAzdc3rccxYClM6R01vQDOmMrdHMcU/UTBqQ5C6ar+sK4n0+/HYpqZrtQ5VwvvGGd 4o2XRLucGmLo6V4oPUXgvLIcLLmypN6FJqbk4iVkA3FB35GuaWXW6MJ/V2Lc/AeNKspfOq NDBblOor/hwvAGbZm6EGlMkY2hQW9g6PKYY78se/1EIJcoO1kZ2Ge/qFM7kyuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759390327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8t8GC35UlZJBwT7Ns5z/3snswByJNTBxvlbFWeoWfeA=; b=PnShp4NZH7TUVcqi+WwfnS0WSNZLyjX3SoFm2JWxQJS6QfojDhINTDeVOG+Tp8qt/fFxRM W+BNO0c7fDmcAZg4tYenprkllJn20Rp5xg74pWJDb8Oi5CT+T9oZNKMu5FHdnvEIVe8EL/ TqL8xS2tofGECFj1Fh2NyayP+HxhwA0WP8RHUxmGxUCbrmA87KFsSRsJ4oZAFKdsfwzrOv aoxIWM2wf3Z4lWaZDwK+zo08QC1DT5YA+SouldaQo9mFhfJUTTCc7p+7vtsQsIAygm37qY q2IFR/q8I7UbjqmFMLzBvO6OGrTyZRXkXPeYpN6nfybhcXZ4k0C/5ID3vBEO5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759390327; a=rsa-sha256; cv=none; b=uzvaid9Obgfu0zQltvdGo3xeFmt5x/rZa0zPnSfZ/YaNZAfXb57C/7RCDyT1W41KysnYdY lus3kKd56qlIWx0u1DMvXH2enXPfJFflfX3KwINknHYTHvbsIXklD57Hh/0DLHYWB6r4Mo latp2FkHOq/jMGJGCRrhf1ne/V50Hp+oDGGUdbietaC/bQGRarZ44scURFob5Xq9MvtdqH PUUGxrY9Z93HgYOQgkDmO1vyvKqOir8j27Or5MwS99FzyLMMYLsndDRaIhwOXFQ3gUA5J1 4+lERmftmtqJrDBjfazTHzAxtMI/B9jfhIbszl0CV5mcDCD3GOsGK9nXZBQdmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cck5M4tw4zyZH; Thu, 02 Oct 2025 07:32: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 5927W7XG031186; Thu, 2 Oct 2025 07:32:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5927W7Jq031183; Thu, 2 Oct 2025 07:32:07 GMT (envelope-from git) Date: Thu, 2 Oct 2025 07:32:07 GMT Message-Id: <202510020732.5927W7Jq031183@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 1cde8b0a257a - stable/15 - mixer(8): Update virtual_oss path List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 1cde8b0a257afbf2da74877b5130bdab50d42917 Auto-Submitted: auto-generated The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1cde8b0a257afbf2da74877b5130bdab50d42917 commit 1cde8b0a257afbf2da74877b5130bdab50d42917 Author: Christos Margiolis AuthorDate: 2025-09-28 09:57:23 +0000 Commit: Christos Margiolis CommitDate: 2025-10-02 07:31:28 +0000 mixer(8): Update virtual_oss path virtual_oss is part of base as of 9cab9fde5eda ("virtual_oss: Port to base"). Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52322 (cherry picked from commit 5c8835e5c0ce34ee50eba92bb5f4de36139ae7ea) --- usr.sbin/mixer/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 70a35f71b25f..15e0eae69952 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -393,7 +393,7 @@ set_dunit(struct mixer *m, int dunit, char *vctl) warn("fork"); break; case 0: - rc = execl("/usr/local/sbin/virtual_oss_cmd", + rc = execl("/usr/sbin/virtual_oss_cmd", "virtual_oss_cmd", dev, opt, buf, NULL); if (rc < 0) warn("virtual_oss_cmd"); From nobody Thu Oct 2 07:32:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cck5P1CYrz69DtT; Thu, 02 Oct 2025 07:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cck5N6mTQz4JCg; Thu, 02 Oct 2025 07:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759390329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9vGcNK8UgCgUtUASTtl1Af8BD4UvUjTlAb2EaME/+CA=; b=dE57maiwWJKIRnEK7SGw/i16rLF6CZlI+Y8X9r89Y4DSfwfg3Zw3503Hm4NkFePHDnKn2e HsTNkr7xFPyYgtTkB3RfJSdSQdFpuD0ghXeIpOqcqbLocpMusviV4/ICaWlBfxIrxpp+G6 w3zdwBkKx8onLSyTYfJjXB4KogmPgWFHC+BxBTIhTS0dtXQQcMcLLxB8i7smXrjSTKltGf XlRPrGf6FK7crd/NqwJEXAxWbT7pu5uHfe+8GJ9K6qVFL/wvzfYaosb4ymShppp902FpM3 P+4URsO6kx6sWBnb6jYSUTcQfkP1RCm2hejmHmBNLlji79JufYiSc61Y4J0Aew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759390329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9vGcNK8UgCgUtUASTtl1Af8BD4UvUjTlAb2EaME/+CA=; b=pAWS9NsT7bZX/1vgm6BuD+D4lNFnQ3/Ph64lJuw1Rdo+c1R5WVIqDxd2NOIfLG6uJa/Kwz WvjwKYzK6PgaSc4EWbTPn1ngnzYvPTGRSV9lWzElWMdj3wDWZa8L5QmeRH7GivTh573mh1 0QxLIAEErhXRNyYS+yVWg903ns0UaMnwMWv3NSQQxVDlhpRRSecYoaX3hI8i00MbYtoZTv r09hQO4ASdvZ5JTQRW/3UnfDzdOp/nQaFWs5GQi50S7n9aaR4IcvhBVI0H29SauZPT8S0q roTm5EEX3km21WuZe5m9gWRP3C5fMgf6keGP9C3eXCf3CVPj7K2F9TemXPB9tA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759390329; a=rsa-sha256; cv=none; b=aBpIVUNbsNv+FIJdr4LKpqGZ/HEwZqfIOkbJBzhKU1fMClWb5FqSa8HtX4uTfwO+kes1Vj IH4HEogkvbyCMnNxwyuHco4gaSS+MfHo8vZM4I6NwDs3a1Nh8bwY34sW2atEtfCRiXJvMv 2LyF15bDTdSV0VLkrVnK0LgoZWQIE2+9BLIljxc3XgotcLyYJsybpXJu7CzG1EkoSKjWhN R7NWW+zUFiH6qz4e9IQNGHzCl08S7urSZkNDua/pLTrfj4yY87q9P0X7X+mR8LZOsBtdMr aqUeNRyxaLIHmEcaIysEzs17pyvWEdl/XsP5ycpsKBDq+q/a7GeHo9SMqtQlyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cck5N5w8vzyX2; Thu, 02 Oct 2025 07:32: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 5927W8Y1031221; Thu, 2 Oct 2025 07:32:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5927W8ck031218; Thu, 2 Oct 2025 07:32:08 GMT (envelope-from git) Date: Thu, 2 Oct 2025 07:32:08 GMT Message-Id: <202510020732.5927W8ck031218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 57327328f141 - stable/15 - snd_hda: Implement automatic redirection between associations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 57327328f141bcdb6dbb81f0cd456eeca2080f43 Auto-Submitted: auto-generated The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=57327328f141bcdb6dbb81f0cd456eeca2080f43 commit 57327328f141bcdb6dbb81f0cd456eeca2080f43 Author: Christos Margiolis AuthorDate: 2025-09-30 10:52:44 +0000 Commit: Christos Margiolis CommitDate: 2025-10-02 07:31:29 +0000 snd_hda: Implement automatic redirection between associations For audio to be redirected to the headphones/headset after plugging the jack, or back to the speaker/internal mic when unplugging it, the speaker and headphone pins need to be part of the same association (i.e., the same PCM device). This patch makes it possible to redirect audio even between different associations, which can reduce the need for manual pin patching. The idea is that we issue a devctl_notify() from within the jack detection callback whenever a jack is (un-)plugged to redirect audio to the appropriate device. Then the snd.conf devd script is responsible for using virtual_oss to change the playback/recording device to whatever snd_hda(4) selected. The reason for requiring virtual_oss is that it has hot-swapping support, which is necessary for jack redirection. Sponsored by: The FreeBSD Foundation MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D50070 (cherry picked from commit 2ffaca551eaf32c17f701762ecf29a961cf19aa4) (cherry picked from commit 5cc36854ee63dc695d90a841d9db587bec67ba24) --- sbin/devd/Makefile | 2 +- sbin/devd/devd.conf.5 | 16 +++++++++++++ sbin/devd/snd.conf | 23 +++++++++++++++++++ sys/dev/sound/pci/hda/hdaa.c | 53 +++++++++++++++++++++++++++++++++----------- 4 files changed, 80 insertions(+), 14 deletions(-) diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile index 5d5721d16884..dad6f4f9c340 100644 --- a/sbin/devd/Makefile +++ b/sbin/devd/Makefile @@ -4,7 +4,7 @@ WARNS?= 6 PACKAGE=devd CONFGROUPS= CONFS DEVD CONFS= devd.conf -DEVD= devmatch.conf +DEVD= devmatch.conf snd.conf DEVDDIR= /etc/devd .if ${MK_ACPI} != "no" DEVD+= asus.conf diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index baf4b9d3a183..8df3e910e076 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -652,6 +652,22 @@ and for details. .El .Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li SND Ta Ta Ta +Events related to the +.Xr sound 4 +driver. +.It Li SND Ta Li CONN Ta Li IN Ta +Connected input device specified in +.Pa cdev +variable. +.It Li SND Ta Li CONN Ta Li OUT Ta +Connected output device specified in +.Pa cdev +variable. +.El +.Pp .\" .\" End of tables .\" diff --git a/sbin/devd/snd.conf b/sbin/devd/snd.conf new file mode 100644 index 000000000000..cf9cd9e94191 --- /dev/null +++ b/sbin/devd/snd.conf @@ -0,0 +1,23 @@ +# Audio redirection +notify 0 { + match "system" "SND"; + match "subsystem" "CONN"; + match "type" "IN"; + match "cdev" "dsp[0-9]+"; + + # FIXME: We are hardcoding /dev/vdsp.ctl here, simply because it is a + # common virtual_oss control device name. Until we find a proper way to + # define control devices here, /dev/vdsp.ctl can be changed to the + # control device of choice. + action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -R /dev/$cdev"; +}; + +notify 0 { + match "system" "SND"; + match "subsystem" "CONN"; + match "type" "OUT"; + match "cdev" "dsp[0-9]+"; + + # FIXME: See comment above. + action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -P /dev/$cdev"; +}; diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index 1e486b01b168..5dbb5c4f4453 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -532,9 +532,11 @@ static void hdaa_presence_handler(struct hdaa_widget *w) { struct hdaa_devinfo *devinfo = w->devinfo; - struct hdaa_audio_as *as; + struct hdaa_audio_as *as, *asp; + char buf[32]; uint32_t res; - int connected, old; + int connected, old, i; + bool active; if (w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) @@ -552,13 +554,6 @@ hdaa_presence_handler(struct hdaa_widget *w) if (connected == old) return; w->wclass.pin.connected = connected; - HDA_BOOTVERBOSE( - if (connected || old != 2) { - device_printf(devinfo->dev, - "Pin sense: nid=%d sense=0x%08x (%sconnected)\n", - w->nid, res, !connected ? "dis" : ""); - } - ); as = &devinfo->as[w->bindas]; if (as->hpredir >= 0 && as->pins[15] == w->nid) @@ -567,6 +562,38 @@ hdaa_presence_handler(struct hdaa_widget *w) hdaa_autorecsrc_handler(as, w); if (old != 2) hdaa_channels_handler(as); + + if (connected || old != 2) { + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Pin sense: nid=%d sense=0x%08x (%sconnected)\n", + w->nid, res, !connected ? "dis" : ""); + ); + if (as->hpredir >= 0) + return; + for (i = 0, active = false; i < devinfo->num_devs; i++) { + if (device_get_unit(devinfo->devs[i].dev) == snd_unit) { + active = true; + break; + } + } + /* Proceed only if we are currently using this codec. */ + if (!active) + return; + for (i = 0; i < devinfo->ascnt; i++) { + asp = &devinfo->as[i]; + if (!asp->enable) + continue; + if ((connected && asp->index == as->index) || + (!connected && asp->dir == as->dir)) { + snprintf(buf, sizeof(buf), "cdev=dsp%d", + device_get_unit(asp->pdevinfo->dev)); + devctl_notify("SND", "CONN", + asp->dir == HDAA_CTL_IN ? "IN" : "OUT", buf); + break; + } + } + } } /* @@ -6193,16 +6220,16 @@ hdaa_configure(device_t dev) device_printf(dev, "Applying direct built-in patches...\n"); ); hdaa_patch_direct(devinfo); - HDA_BOOTHVERBOSE( - device_printf(dev, "Pin sense init...\n"); - ); - hdaa_sense_init(devinfo); HDA_BOOTHVERBOSE( device_printf(dev, "Creating PCM devices...\n"); ); hdaa_unlock(devinfo); hdaa_create_pcms(devinfo); hdaa_lock(devinfo); + HDA_BOOTHVERBOSE( + device_printf(dev, "Pin sense init...\n"); + ); + hdaa_sense_init(devinfo); HDA_BOOTVERBOSE( if (devinfo->quirks != 0) { From nobody Thu Oct 2 08:20:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9M44rdz69KRR; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9M3NTbz4MvC; Thu, 02 Oct 2025 08:20:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ReamLlaJAERdo7FDF0HV0Gytuc8HqKGzzT7ArspQ/ic=; b=ePEeg38r3wu/acO60G6OgyfGrHUlf9R3FaGBS7MfwbRauKogU9SjOmic6Uq2mYkiGG7i8x 4j5TdnJzEd3ISenzEIi+epOFXXQ55LTYBlpiLBtfDzHI+SAqNaLYEeHoQQSUWDQSyLpopo Q/kWrAO5xhjHaIS0uH8uZyrtwATzlHfDUD1nDUtJR6QGQn6NX89MzW/fjAit5S47C+XiHM cKc6rO0SThT6JdOEnIxIFAGBAFesVr+FSN8M+KfQLZA8unwhDaCQyROa72dsMgnGuvR4jz am7yY4wf5C7cY265jZAOraoccTOkegYuX8ws1AMw9IxOjLtIibQMG9Ve8O8yfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ReamLlaJAERdo7FDF0HV0Gytuc8HqKGzzT7ArspQ/ic=; b=KuVfYajTYZXadLWs3j0Rh7Qkduj2I3VmN1EwR35AP43JG1fYnXpH52gTuJ26gjmYGmM6le diNSXnvA9T15mgfjZuF3/bN8dciC1TMQMGBwDFSWOFAuXrbYCIoC+MuXNBwUjVwWAnvqqx QQKfDI3I4pF4vX5pHZt5krnC6F3pLXycf44SyPEfAbqWlUZ2n1YJAZDje9js44Lq8QGujy iJb8zwoSM++R8/SbG+yH3PtZ3rU3q35mKSDNUMfc5LigyJveWD1eGDicvxnJyqIgvHvI+v FD1hZpPYwvjDdE6v8XMyd0DK0dHqBUV0e10SDw0vI4ujriXNcVRKCSocedx1DA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393239; a=rsa-sha256; cv=none; b=SlQeF6EpCGWJ/MQp0JvuX6ikWUJfNgDit7vhNVkf7NGpkBTQc86I2edw0/sy4G2rYtABXK KYPNQ18wQjDcfTxLqkXcbN9xKCIFFd1fu9DVmbZcesWEzMF4BpDvxdUqwkoqk45lz9x8h9 FWZNurmk9mmGJaI5O731QVA6KpOwyM9Gab37xcg1H7VGvfSiC/fpsApfNVLfTE70Ad2KXS RMEtI0UaNkjqm1nopH6bhso+kPvElC2gAHFJEQq67wujOISt0+buCQoq+KkN7dQKYMsSE/ HME3aYC0z+yClhXyPQ+kqO3wHHKHM4h2pg9tCdeZLgqd1/CyuJkKAVOKIzdFEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9M2mY4z10Kk; Thu, 02 Oct 2025 08:20: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 5928Kd9p022974; Thu, 2 Oct 2025 08:20:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KdU6022971; Thu, 2 Oct 2025 08:20:39 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:39 GMT Message-Id: <202510020820.5928KdU6022971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 384006a4c59f - stable/15 - rc.subr: Move the sleep in wait_for_pids List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 384006a4c59f9f8c844cf0eb51a3144dd2a1795d Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=384006a4c59f9f8c844cf0eb51a3144dd2a1795d commit 384006a4c59f9f8c844cf0eb51a3144dd2a1795d Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:55:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:22 +0000 rc.subr: Move the sleep in wait_for_pids Instead of sleeping while constructing the list of PIDs to wait for, sleep briefly after pwait to give init a chance to reap the processes that just terminated before we loop around and start probing them. PR: 289630 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D52619 (cherry picked from commit 5953e7c98427e038500221e885dffa181dcc064b) --- libexec/rc/rc.subr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 06b1bd51384c..6be226021949 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -804,7 +804,6 @@ wait_for_pids() for _j in $_list; do if kill -0 $_j 2>/dev/null; then _nlist="${_nlist}${_nlist:+ }$_j" - [ -n "$_prefix" ] && sleep 1 fi done if [ -z "$_nlist" ]; then @@ -814,6 +813,10 @@ wait_for_pids() echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " pwait -o $_list 2>/dev/null + # At least one of the processes we were waiting for + # has terminated. Give init a chance to collect it + # before looping around and checking again. + sleep 1 done if [ -n "$_prefix" ]; then echo "." From nobody Thu Oct 2 08:20:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9N5RDFz69KX2; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9N4XqRz4N0x; Thu, 02 Oct 2025 08:20:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KI6k6bLNcOLzIU3YbD69fUb+FIIB0pn7dXMzcAxMxhE=; b=CqhemUenpecZD9YJS+9/d7QCKGeQVYQquAc0ZW1Y8lDfqLipj3QU0mhbdhxiEEdHG17nVF /ebXFJAHyTu0J64p4l12sM3D7CHGGZ7yL0OIXPj5iEs5H8Q50FF9duSXGvTkhBuHL/3VjK MiIve4u2pVV9mB3Z7IH+OWcz/H529HYYrKCZlk2Ow5Hi8Ea2rOosjA4N08HxZGLvyCeZpE NY5ly9SdBY39tx4EBXMqmEtFQzsfjgZWegRg2BvTLVubtn2wdiXWM1LkBSxec42qXXEJN9 /cNvjTzWPy8LzA4Ml3xfC6ZlrerCzpFXl3RNZde9yoK6InPgZvABu6TMNVJyrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KI6k6bLNcOLzIU3YbD69fUb+FIIB0pn7dXMzcAxMxhE=; b=Fb9Y57WUBrzD++d7fq/JXtA8aAkzWokN5mU4kquX/X9irFDsjFQuiKcSv92psaVElbpOFK 8TzAsgZR3QUhdDu0EJ3Nj24ClH8Zwvo/leNw6bJFckboeYsqO9fK93BJqASyjp4ogc8Qlt E30cDbyvb43yRzHR+J1sRvp6e96PtIutsuVTqH2eWk92QFsNc/pGwmI3fXylhTxbg6zdti M0KXGwpYx2SDZ6eWA+W0eavs2N0fi0uRefIKuv2AL6hlbv67CFPeVUjIW/FAGN8HfST99n WSMByjQZHKVSPrZv4i7ExFORLd0f1d+ZtSBZNUGYEmF40geGxHm90ne3NN1LZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393240; a=rsa-sha256; cv=none; b=t7RDmYcoeDGBx9yYwl+YYAd5THzaeBIyI783VjfJ6RzezcNxRG9Fs7FQaaPfH4PdoX5sTt zEfA4SkS8B/9zv3j+ZEPtVm9VuHw6Dw1IemWc2LoCCDOKnbITW4OY9TljE1B+hGMkE2dTX jAGv/lixD31APxSxfcA4w/cZz9JQhN75hGiX9+JZqssXk6uSmfb55FjBzRxmQjCckqjiyt bGXdk5Kyd9kuO7r3Tx1BUX0/o3gzcpejhqNeGu6NLtAl+Cf+Xy6SHbKTtDKRyeaA3Yn6kZ OZky1/l2C2MqN8X9roPewJp6GPg4mzenrY8Q+JXavt9iaD0p0LUrD5eyzHILMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9N3hx6zynt; Thu, 02 Oct 2025 08:20: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 5928KekL023025; Thu, 2 Oct 2025 08:20:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Ketv023022; Thu, 2 Oct 2025 08:20:40 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:40 GMT Message-Id: <202510020820.5928Ketv023022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 76fd9309e55e - stable/15 - pwait: Fix timeout unit parser List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 76fd9309e55e93c0c998db16c26ab480e49887a2 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=76fd9309e55e93c0c998db16c26ab480e49887a2 commit 76fd9309e55e93c0c998db16c26ab480e49887a2 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:56:04 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:23 +0000 pwait: Fix timeout unit parser The timeout parser would check the first character after the number and ignore any subsequent ones. While here, switch to bool for booleans and fix some style nits. MFC after: 1 week Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D52612 (cherry picked from commit 3aac05f56620712744cb57d71a0ef42f8d8e3b52) --- bin/pwait/pwait.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/bin/pwait/pwait.c b/bin/pwait/pwait.c index 0fae22562607..a78c0bb84ca8 100644 --- a/bin/pwait/pwait.c +++ b/bin/pwait/pwait.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,6 @@ static void usage(void) { - fprintf(stderr, "usage: pwait [-t timeout] [-ov] pid ...\n"); exit(EX_USAGE); } @@ -61,15 +61,15 @@ main(int argc, char *argv[]) { struct itimerval itv; struct kevent *e; - int oflag, tflag, verbose; - int i, kq, n, nleft, opt, status; - long pid; char *end, *s; double timeout; + long pid; + int i, kq, n, nleft, opt, status; + bool oflag, tflag, verbose; - oflag = 0; - tflag = 0; - verbose = 0; + oflag = false; + tflag = false; + verbose = false; memset(&itv, 0, sizeof(itv)); while ((opt = getopt(argc, argv, "ot:v")) != -1) { @@ -78,25 +78,31 @@ main(int argc, char *argv[]) oflag = 1; break; case 't': - tflag = 1; + tflag = true; errno = 0; timeout = strtod(optarg, &end); if (end == optarg || errno == ERANGE || timeout < 0) { errx(EX_DATAERR, "timeout value"); } - switch(*end) { - case 0: + switch (*end) { + case '\0': + break; case 's': + end++; break; case 'h': timeout *= 60; /* FALLTHROUGH */ case 'm': timeout *= 60; + end++; break; default: errx(EX_DATAERR, "timeout unit"); } + if (*end != '\0') { + errx(EX_DATAERR, "timeout unit"); + } if (timeout > 100000000L) { errx(EX_DATAERR, "timeout value"); } @@ -106,7 +112,7 @@ main(int argc, char *argv[]) (suseconds_t)(timeout * 1000000UL); break; case 'v': - verbose = 1; + verbose = true; break; default: usage(); @@ -134,7 +140,7 @@ main(int argc, char *argv[]) for (n = 0; n < argc; n++) { s = argv[n]; /* Undocumented Solaris compat */ - if (!strncmp(s, "/proc/", 6)) { + if (strncmp(s, "/proc/", 6) == 0) { s += 6; } errno = 0; From nobody Thu Oct 2 08:20:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9P6bwsz69KX8; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9P5BlLz4MxY; Thu, 02 Oct 2025 08:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scKFyn18xstHD5ER67/fV7/khhsqs5ljm+dkswwyhM0=; b=xh22ToX773thyu5vB7FxL0YYA/LUR/d80TY4AFopmy3XlGH80jGSdYYD3Eh5CuxeqWZYta pCJjZeGdfcU/lNVguXG4s6na86vlwqzFYZ1xYzKaq6EWMdWefrCJA37DV/GjO+YqwY2zgL OQ/TShkwbFDmPOPGAQq/CChCEXEWb8hojYpu0UuyhGZXVITC/jOg7373fKUHkre3WetJmY 4w4+uzGrzKzupZY1Yo432rnEbiwDN0TkuOKybqRykR8iPAtSqB3IvcDVObNUWixMOZjGoS DQMQgvQMJC2wD8j4FQ7KEeeYC8g8bxeg1lTE+r1x0S1YMk2Lj0qWqlX1p1tK+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scKFyn18xstHD5ER67/fV7/khhsqs5ljm+dkswwyhM0=; b=j/XJ8z/Wa72vfv7aPpCWwlQiuGqzp9s6NldcrqZIlq0oVPChW5jIqBFSCWHt03a5z+bNyE +0moejeeV/0j95N1/q2+RXOPhcQzgJrLoUxAsJLnJ5HbEFeUVggTr50uszn3Z8i1uIhwMN OpTayYR0yxE3A8YGEeAHBQeBcFYEViefxg5/5BM2oTM86OpgyuyumIXNt3F4eRFjxqOVYQ khRJj0qT1WPIqhFJBf19bK3ONiUbo1K/l+bwZ3TVpLWC7b4O0YhszZJbjLDuFijaCgZ2FN hqXphLCu3pAGO6mIFEb2Wdu9ARVj4RPEVkXyVDtiAUWfJKFd0RNKdQZrMIKkcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393241; a=rsa-sha256; cv=none; b=nl2WnUR0cwETRxBkdhVv2nkr5ojPC/yX54IOv7LuOalFwYZsuQpf1lxjBeyrZIHlg1Pak5 l5X3woXNV+OCtizGjADea14cXATpyhgXJZqVFqLWksasazJfCwo8t86I+Ew53sApUNIj96 9OVrMKS7/JxIv5b/XVMx/0hJEksySvk5mAuUtCDO+RrH4d/9g5E/702P6p6eXQLaGZsks5 DjKlt0vDsmsN9Lhhxi0CQklX22ml1MHp4DueDbrhz2bSmhA3WqPO75oVTXG78ece3sOvbY iUtSP0mY6tczinHtPQdNjxXXZkI2jprix1QGk4LoXH+h7Gem0yDwdsTUETGJpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9P4fKBz103J; Thu, 02 Oct 2025 08:20: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 5928Kfa2023078; Thu, 2 Oct 2025 08:20:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Kfd9023075; Thu, 2 Oct 2025 08:20:41 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:41 GMT Message-Id: <202510020820.5928Kfd9023075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 89e460f6c013 - stable/15 - tzcode: Use -00 only for invalid time zones List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 89e460f6c013e5930b75372766be1096b7a02359 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=89e460f6c013e5930b75372766be1096b7a02359 commit 89e460f6c013e5930b75372766be1096b7a02359 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:56:11 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:23 +0000 tzcode: Use -00 only for invalid time zones As of tzcode 2025a, if we are unable to load a time zone, we set tzname to "-00" to indicate an error. This penalizes users who simply don't set TZ or create /etc/localtime as a faster way of setting the time zone to UTC (pointing /etc/localtime at /usr/share/zoneinfo/UTC forces us to parse it every time for no real benefit). To rectify this, use "-00" only if TZ was set or zoneinit() returned something else than ENOENT. MFC after: 3 days Fixes: 967a49a21a27 ("Update tzcode to 2025b") Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D52680 (cherry picked from commit a5f14e4f9069a8ffed66d923bb0ecf20d8a0e6af) --- contrib/tzcode/localtime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 15afeeecb6d0..7ba72d730648 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -1649,9 +1649,13 @@ tzset_unlocked_name(char const *name) lclptr = sp = malloc(sizeof *lclptr); # endif if (sp) { - if (zoneinit(sp, name, TZLOAD_FROMENV | TZLOAD_TZSTRING) != 0) { + int err = zoneinit(sp, name, TZLOAD_FROMENV | TZLOAD_TZSTRING); + if (err != 0) { zoneinit(sp, "", 0); - strcpy(sp->chars, UNSPEC); + /* Abbreviate with "-00" if there was an error. + Do not treat a missing TZDEFAULT file as an error. */ + if (name || err != ENOENT) + strcpy(sp->chars, UNSPEC); } if (0 < lcl) strcpy(lcl_TZname, name); From nobody Thu Oct 2 08:20:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9R1MWQz69KRd; Thu, 02 Oct 2025 08:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9Q5wNBz4N1W; Thu, 02 Oct 2025 08:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZSl/t5kyWMMQfSwJj91O4Qjuh9mrz0CoFQxi/G0bXUM=; b=TpXfr80r+M1WA75w2TKlVZ2zdYefE+AE/ndwGXdeBZR/TI42CGYTArYTZL9CdjKS50a1XI Wl+nkBa0FjqKFNDn/AGG4I2LZ0tJJH16pLPK+1QtnuFnqeARKE39gn/gA0xJcGZAGf1PcO 6MvzjJs4zZjBV9GGTSkJTSb7pIBDmS2I3vFmqi12RLyUgDL1ieYioo3ylnaxM8WI9UN1fq V59Bf24sZCCGOIBuIoIh5Tga5//OPfC4EPeMqRIwZlhvJnsLCKI6Rq8rCnjBtVcpzUqJlj Mh9Od2gAR/r5rokL5g0NwGHn99jgsUwDn7oLUk19KW8CIu/17+nIvxTkw5FHXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZSl/t5kyWMMQfSwJj91O4Qjuh9mrz0CoFQxi/G0bXUM=; b=c4r0lYJOuMHWZKdG12Dji4WFg8eNd5NRzWzClAEGpS4eAlBlUg1niHcyjpIeRVrfa6B2yo Y+VVr1wnwJfZVQXkp8efoTm7qwHavoDoQa8j/O0bHWPEEBxU6BbtlYXkx6tIVCepcM89UY Dv2mGd7RuyxZn9g+Is2wLmwcBoCQPa8rC/NvyFqhSdyvBWY8bfrLIMmc3lh0sCXqQwqai4 JO+1ALC0lHTBAA3wu+rb8KfvLbEV123uq/Q/pQDr3My7jKS6y9VtxBfwdOn/ZfFcJIMbdg yG/HlGmw6GKch02nTy0DljMCSYfxafR+iwT97vMS8Hp9eIxvxGDrigQV7PF+Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393242; a=rsa-sha256; cv=none; b=gEDSTrzRj0kAoXq35gOM+deBj/JCQmoeVuCfJwzk2n2dfMioW+KVrJ2ZD7c/jYSRUvhRbw PiQACTl+fAYlhNszz9PBGu3J2aiRdz2Iyu9ZI0c62upidRLx6y0zPspqRg4YL6urxXjr1c seiXYhXlfj109YHr0WPHSCiqgvuyYkRN02UAhQPiRIDYuF/HEAT+x7cYuvNXIeSYYDM14S f/619bdC+9N6/AlVjxAEE+3fBHh8nJHQZ4brdk1FvDas2UAB49YM/74Hxo06govFGTVN9I mKeCcRHpvwplNOCRUwY98xsgRKUiHL8gd9Bm7aYW3CFA4mjGnsKyLbaknXf2LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9Q59wYzynv; Thu, 02 Oct 2025 08:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5928Kgn3023125; Thu, 2 Oct 2025 08:20:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KgN0023122; Thu, 2 Oct 2025 08:20:42 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:42 GMT Message-Id: <202510020820.5928KgN0023122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b28b04428732 - stable/15 - tzcode: Expose and document offtime() and offtime_r() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: b28b04428732b996aa29a79b8b3916c5cd7aa627 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b28b04428732b996aa29a79b8b3916c5cd7aa627 commit b28b04428732b996aa29a79b8b3916c5cd7aa627 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 18:52:10 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:23 +0000 tzcode: Expose and document offtime() and offtime_r() Includes diff reduction to upstream version of this patch. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D39715 (cherry picked from commit 155290b23f0b503b9db675d6a45f85b189ee1926) --- contrib/tzcode/localtime.c | 2 +- contrib/tzcode/private.h | 2 +- include/time.h | 2 ++ lib/libc/stdtime/ctime.3 | 39 +++++++++++++++++++++++++++++++++------ 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 7ba72d730648..a8f97e31a4bb 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -2021,7 +2021,7 @@ offtime_key_init(void) } #endif /* __FreeBSD__ */ struct tm * -offtime(const time_t *timep, long offset) +offtime(time_t const *timep, long offset) { # if !SUPPORT_C89 static struct tm tm; diff --git a/contrib/tzcode/private.h b/contrib/tzcode/private.h index 532d9ddc81c8..e6b206690b73 100644 --- a/contrib/tzcode/private.h +++ b/contrib/tzcode/private.h @@ -823,7 +823,7 @@ extern long altzone; struct tm *offtime(time_t const *, long); # endif # if TZ_TIME_T || !defined offtime_r -struct tm *offtime_r(time_t const *, long, struct tm *); +struct tm *offtime_r(time_t const *restrict, long, struct tm *restrict); # endif # if TZ_TIME_T || !defined timelocal time_t timelocal(struct tm *); diff --git a/include/time.h b/include/time.h index 89a76ca5fd93..9e71a85f6a9a 100644 --- a/include/time.h +++ b/include/time.h @@ -174,6 +174,8 @@ time_t timegm(struct tm * const); int timer_oshandle_np(timer_t timerid); time_t time2posix(time_t t); time_t posix2time(time_t t); +struct tm *offtime(const time_t *, long); +struct tm *offtime_r(const time_t *__restrict, long, struct tm *__restrict); #endif /* __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) diff --git a/lib/libc/stdtime/ctime.3 b/lib/libc/stdtime/ctime.3 index 96b7f775535a..6384e8bd959b 100644 --- a/lib/libc/stdtime/ctime.3 +++ b/lib/libc/stdtime/ctime.3 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 26, 2024 +.Dd September 23, 2025 .Dt CTIME 3 .Os .Sh NAME @@ -41,6 +41,8 @@ .Nm localtime , .Nm localtime_r , .Nm mktime , +.Nm offtime , +.Nm offtime_r , .Nm timegm .Nd transform binary date and time values .Sh LIBRARY @@ -68,14 +70,19 @@ .Fn localtime_r "const time_t *clock" "struct tm *result" .Ft time_t .Fn mktime "struct tm *tm" +.Ft struct tm * +.Fn offtime "const time_t *clock" "long offset" +.Ft struct tm * +.Fn offtime_r "const time_t *clock" "long offset" "struct tm *result" .Ft time_t .Fn timegm "struct tm *tm" .Sh DESCRIPTION The .Fn ctime , .Fn gmtime , +.Fn localtime , and -.Fn localtime +.Fn offtime functions all take as argument a pointer to a time value representing the time in seconds since the Epoch (00:00:00 UTC on January 1, 1970; see @@ -123,6 +130,18 @@ adjustment, and returns a pointer to a .Vt struct tm . .Pp The +.Fn offtime +function similarly converts the time value with a time zone adjustment +corresponding to the provided +.Fa offset , +which is expressed in seconds, with positive values indicating a time +zone ahead of UTC (east of the Prime Meridian). +It does not call +.Xr tzset 3 +or modify +.Va tzname . +.Pp +The .Fn ctime function adjusts the time value for the current time zone in the same manner as @@ -155,13 +174,15 @@ except the caller must provide the output buffer .Fa buf , which must be at least 26 characters long, to store the result in. The -.Fn localtime_r +.Fn localtime_r , +.Fn gmtime_r , and -.Fn gmtime_r +.Fn offtime_r functions provide the same functionality as -.Fn localtime +.Fn localtime , +.Fn gmtime , and -.Fn gmtime +.Fn offtime respectively, except the caller must provide the output buffer .Fa result . .Pp @@ -368,6 +389,12 @@ and .Fn localtime_r functions have been available since .Fx 8.0 . +The +.Fn offtime +and +.Fn offtime_r +functions were added in +.Fx 15.0 . .Sh BUGS Except for .Fn difftime , From nobody Thu Oct 2 08:20:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9S2TTtz69KTp; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9R5tFWz4Mvh; Thu, 02 Oct 2025 08:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dz08MPEARtOmv9ZVF2omWbx05dTe5zrNkwOOqnZpx48=; b=WjxVj6zFi3bWjhwAqBHH7TZblb9nbFqz5vqzul7ziybBTcKqBmPoF3JXsuxTZjTobkGzsV 6mHYsY5prrHOI0GPKk1nOkYCZE8gNJ1clz7i7YsW24UI3IlMQPR+Wulq7BkVloSrbGC/96 gKyHyTPcIpuw56RSLbnMychNi/dGdPXU2e4Kj1F5bZHfaoM/gia4ntSWB5WedgxTIgRtYs SkyAyqqRAwj2e61d9tBidldGAul+S+sP940RXpxhO60fPQ9tRKRQ0A/7lYcgQnHo4sPLpA di0l16JSA0XWgrMh6wUIrfbesAVpMKV/eKxpuPAp72FMkDN/IkV1ivKNdvG1Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dz08MPEARtOmv9ZVF2omWbx05dTe5zrNkwOOqnZpx48=; b=XX8yxFP1jDb14puQ1LvOyQ7pbTHgQCA6WfX8GeWDVr91lt4qm1dUTk4DKOrhcTEuP6Dx/6 +k6DdrNg8WMQvmMQ34w8VQvD2lUcsyAuq5NxJVIu16pUGg4Rs0zNr6+Dgx7cSWRH4lJIzT Ek6Bb2rZFU8/bVq73sffC0yW1yYjcufQkqOfn9VIBmptJA8BYhXRplMy0R8w+5dHe1bLKb nu2yqyEItFfwUTXwCO7MNEIoFzfRtJ+zRsh1BP1Ox4OnnXAk0tssnrG7tPHrZNMl+WndXV 4r2yUoLmrF7xYVVMkFlBdj/wtMkPptdOL723uZnf6qjdGMt+YNJQUii5RlyTaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393243; a=rsa-sha256; cv=none; b=hYm8p7bTSTmYeOtGujp3UtLl0xwaCISCqen9RtSX3miiuXv7Jg3t6AFOQmJnm0FKhUKnpC rv20+TDzNs7VoG5+FdMwIeXmGg/jNKSnC26KdB02XV85pjnybb4wYCQw9UYF1bbOazrluw RVKw6GAOSAfjbD1SCy5zsbpLmmxk0VTNvk9pdLXjUW3ITFe1BAEcejZOoOKaH5rKy/4Zx3 fcAafFrx9DqmqRFPciv7iKF0bdOj2W4VQc1zjF1D8821UqAi4zLc455AWdlt5mM/5uJZ42 uxuS7KJT1ewbGdRbstBXeSbZwrFvZxy45VfW0Ikw3nQDq2RSTh9IHeBO2r5X3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9R5PxTz103M; Thu, 02 Oct 2025 08:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5928KhFO023167; Thu, 2 Oct 2025 08:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Khvk023164; Thu, 2 Oct 2025 08:20:43 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:43 GMT Message-Id: <202510020820.5928Khvk023164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a46136a8beb6 - stable/15 - tzcode: Drop libc namespace List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: a46136a8beb60be82267b6a7b49304ae9a57f1eb Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a46136a8beb60be82267b6a7b49304ae9a57f1eb commit a46136a8beb60be82267b6a7b49304ae9a57f1eb Author: Dag-Erling Smørgrav AuthorDate: 2025-09-27 17:06:58 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:23 +0000 tzcode: Drop libc namespace This hasn't been needed in years and is a maintenance headache. MFC after: 1 week Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D52694 (cherry picked from commit d58339f398748b50ff84421e9d81f8f6d94cb949) --- contrib/tzcode/asctime.c | 2 -- contrib/tzcode/difftime.c | 2 -- contrib/tzcode/localtime.c | 52 ++++++++++++++++++++++------------------------ 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/contrib/tzcode/asctime.c b/contrib/tzcode/asctime.c index 1977a2272896..491d23bf73ac 100644 --- a/contrib/tzcode/asctime.c +++ b/contrib/tzcode/asctime.c @@ -14,9 +14,7 @@ /*LINTLIBRARY*/ -#include "namespace.h" #include "private.h" -#include "un-namespace.h" #include enum { STD_ASCTIME_BUF_SIZE = 26 }; diff --git a/contrib/tzcode/difftime.c b/contrib/tzcode/difftime.c index 43af402cdc12..ff78f03c5705 100644 --- a/contrib/tzcode/difftime.c +++ b/contrib/tzcode/difftime.c @@ -7,9 +7,7 @@ /*LINTLIBRARY*/ -#include "namespace.h" #include "private.h" /* for time_t and TYPE_SIGNED */ -#include "un-namespace.h" /* Return -X as a double. Using this avoids casting to 'double'. */ static double diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index a8f97e31a4bb..c98134f7be7c 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -14,7 +14,6 @@ #define LOCALTIME_IMPLEMENTATION #ifdef __FreeBSD__ -#include "namespace.h" #include #endif /* __FreeBSD__ */ #ifdef DETECT_TZ_CHANGES @@ -31,7 +30,6 @@ int __tz_change_interval = DETECT_TZ_CHANGES_INTERVAL; #include #ifdef __FreeBSD__ #include "libc_private.h" -#include "un-namespace.h" #endif /* __FreeBSD__ */ #if HAVE_SYS_STAT_H @@ -45,8 +43,8 @@ int __tz_change_interval = DETECT_TZ_CHANGES_INTERVAL; #if defined THREAD_SAFE && THREAD_SAFE # include #ifdef __FreeBSD__ -# define pthread_mutex_lock(l) (__isthreaded ? _pthread_mutex_lock(l) : 0) -# define pthread_mutex_unlock(l) (__isthreaded ? _pthread_mutex_unlock(l) : 0) +# define pthread_mutex_lock(l) (__isthreaded ? pthread_mutex_lock(l) : 0) +# define pthread_mutex_unlock(l) (__isthreaded ? pthread_mutex_unlock(l) : 0) #endif /* __FreeBSD__ */ static pthread_mutex_t locallock = PTHREAD_MUTEX_INITIALIZER; static int lock(void) { return pthread_mutex_lock(&locallock); } @@ -525,7 +523,7 @@ tzfile_changed(const char *name, int fd) static struct stat old_sb; struct stat sb; - if (_fstat(fd, &sb) != 0) + if (fstat(fd, &sb) != 0) return -1; if (strcmp(name, old_name) != 0) { @@ -668,7 +666,7 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, } #endif } - fid = _open(name, (O_RDONLY | O_BINARY | O_CLOEXEC | O_CLOFORK + fid = open(name, (O_RDONLY | O_BINARY | O_CLOEXEC | O_CLOFORK | O_IGNORE_CTTY | O_NOCTTY)); #else /* __FreeBSD__ */ if ((tzloadflags & TZLOAD_FROMENV) && strcmp(name, TZDEFAULT) == 0) @@ -676,7 +674,7 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, relname = name; if (strncmp(relname, TZDIR "/", strlen(TZDIR) + 1) == 0) relname += strlen(TZDIR) + 1; - dd = _open(TZDIR, O_DIRECTORY | O_RDONLY); + dd = open(TZDIR, O_DIRECTORY | O_RDONLY); if ((tzloadflags & TZLOAD_FROMENV) && issetugid()) { if (dd < 0) return errno; @@ -686,18 +684,18 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, fid = -1; errno = EINVAL; } else { - fid = _openat(dd, relname, O_RDONLY | O_BINARY, AT_RESOLVE_BENEATH); + fid = openat(dd, relname, O_RDONLY | O_BINARY, AT_RESOLVE_BENEATH); } } else { if (dd < 0) { relname = name; dd = AT_FDCWD; } - fid = _openat(dd, relname, O_RDONLY | O_BINARY, 0); + fid = openat(dd, relname, O_RDONLY | O_BINARY, 0); } if (dd != AT_FDCWD && dd >= 0) { serrno = errno; - _close(dd); + close(dd); errno = serrno; } #endif /* __FreeBSD__ */ @@ -714,23 +712,23 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, switch (tzfile_changed(name, fid)) { case -1: serrno = errno; - _close(fid); + close(fid); return serrno; case 0: - _close(fid); + close(fid); return 0; case 1: break; } } #endif /* DETECT_TZ_CHANGES */ - nread = _read(fid, up->buf, sizeof up->buf); + nread = read(fid, up->buf, sizeof up->buf); if (nread < tzheadsize) { int err = nread < 0 ? errno : EINVAL; - _close(fid); + close(fid); return err; } - if (_close(fid) < 0) + if (close(fid) < 0) return errno; for (stored = 4; stored <= 8; stored *= 2) { char version = up->tzhead.tzh_version[0]; @@ -1890,7 +1888,7 @@ localtime_tzset(time_t const *timep, struct tm *tmp, bool setname) static void localtime_key_init(void) { - localtime_key_error = _pthread_key_create(&localtime_key, free); + localtime_key_error = pthread_key_create(&localtime_key, free); } #endif /* __FreeBSD__ */ struct tm * @@ -1903,16 +1901,16 @@ localtime(const time_t *timep) struct tm *p_tm = &tm; if (__isthreaded != 0) { - _pthread_once(&localtime_once, localtime_key_init); + pthread_once(&localtime_once, localtime_key_init); if (localtime_key_error != 0) { errno = localtime_key_error; return (NULL); } - if ((p_tm = _pthread_getspecific(localtime_key)) == NULL) { + if ((p_tm = pthread_getspecific(localtime_key)) == NULL) { if ((p_tm = malloc(sizeof(*p_tm))) == NULL) { return (NULL); } - if (_pthread_setspecific(localtime_key, p_tm) != 0) { + if (pthread_setspecific(localtime_key, p_tm) != 0) { free(p_tm); return (NULL); } @@ -1969,7 +1967,7 @@ gmtime_r(time_t const *restrict timep, struct tm *restrict tmp) static void gmtime_key_init(void) { - gmtime_key_error = _pthread_key_create(&gmtime_key, free); + gmtime_key_error = pthread_key_create(&gmtime_key, free); } #endif /* __FreeBSD__ */ struct tm * @@ -1982,16 +1980,16 @@ gmtime(const time_t *timep) struct tm *p_tm = &tm; if (__isthreaded != 0) { - _pthread_once(&gmtime_once, gmtime_key_init); + pthread_once(&gmtime_once, gmtime_key_init); if (gmtime_key_error != 0) { errno = gmtime_key_error; return (NULL); } - if ((p_tm = _pthread_getspecific(gmtime_key)) == NULL) { + if ((p_tm = pthread_getspecific(gmtime_key)) == NULL) { if ((p_tm = malloc(sizeof(*p_tm))) == NULL) { return (NULL); } - if (_pthread_setspecific(gmtime_key, p_tm) != 0) { + if (pthread_setspecific(gmtime_key, p_tm) != 0) { free(p_tm); return (NULL); } @@ -2017,7 +2015,7 @@ offtime_r(time_t const *restrict timep, long offset, struct tm *restrict tmp) static void offtime_key_init(void) { - offtime_key_error = _pthread_key_create(&offtime_key, free); + offtime_key_error = pthread_key_create(&offtime_key, free); } #endif /* __FreeBSD__ */ struct tm * @@ -2030,16 +2028,16 @@ offtime(time_t const *timep, long offset) struct tm *p_tm = &tm; if (__isthreaded != 0) { - _pthread_once(&offtime_once, offtime_key_init); + pthread_once(&offtime_once, offtime_key_init); if (offtime_key_error != 0) { errno = offtime_key_error; return (NULL); } - if ((p_tm = _pthread_getspecific(offtime_key)) == NULL) { + if ((p_tm = pthread_getspecific(offtime_key)) == NULL) { if ((p_tm = malloc(sizeof(*p_tm))) == NULL) { return (NULL); } - if (_pthread_setspecific(offtime_key, p_tm) != 0) { + if (pthread_setspecific(offtime_key, p_tm) != 0) { free(p_tm); return (NULL); } From nobody Thu Oct 2 08:20:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9T1whsz69KTy; Thu, 02 Oct 2025 08:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9T0B0Rz4MhV; Thu, 02 Oct 2025 08:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g92UVaPKCQ9mC0cJ/yCkWXZK6gmbXQTpIQnnq6h06i8=; b=UOHwmMnUbhbdMGQdOltUw52Y4OQJ104kCqKAiybSOZQQVjHC4QYFSgCix0hxbXyTF/miRG GVzrRmgIKYFr3fyjdjDOnBs1AGgDTvstSa5JhjyxIS3FYfcqezYJQ2pj+ryP9pZqdmPumq 6/p5QOqdTXwud30CP6Rw6ghOxs3OnaIQtubb9pG7pzu3zaY76JZVwFXR/2MlG0B9RIMxtb pctIfUodTuo+pUERA0Hu+moalflZbNWX+VcwqNOiCuN1BkhF3eugAWYxsPCHlQQNktonj5 RoPZEy5ogJiXWAxvm51uvDJwtpm7q2kpiGmz2Ae/27HgbAU1PoFhS9QYVg1W+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g92UVaPKCQ9mC0cJ/yCkWXZK6gmbXQTpIQnnq6h06i8=; b=RDqSJ42Uc4K0Mgsmus6mfcHn2+mAcZEXkmTQCKVr5a+ZZQPcXBQT373CUBzhIQ5No9C9WB B9nnZnPcn+GFo3KUaQjC8VJP3PEdu5zs2AFrqNUuWjtjYH1KoG0R2JDIs0CspZ7mVzdE7v qbNTdKbt9TcKc9pKTcYyCe30KRNMZzuj65iw4ubgMvz6Km5K3wDvFEQ3Wod+/xLLu9ZNk3 UK0IprTrmJaCW4xgK9cob543RHd748lP+xV4zOO7RP8FS0/dTt7lgw2LJ9olaKJTsjedtj McCFrA2NkR86ws3XlwlLwz24flLI0A5MXlh5kXRI9GB3JnW+ivCfU3xx11bL4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393245; a=rsa-sha256; cv=none; b=JFQ9P0XMqqlO08L9+Oneud2oeviUOxnpthwTF3gR/DEZrUWoPjl0Mw7yCoUnkY/ng1tHj5 GnFpMoY0rvg7imduKgRsUeGZgvDs+KR9mzj9Yl0Yh+OrtHVO4ropcyh6WtxuyhY0wS/CeI dER+dBQRqUnJY+PaCc0KzzdQoAr5A8u+9UNmUz3OnG0R1lsCna2bcD6BGO1ip34OBRtVDC OvTdcdmhMd2Z0hS6NYOwWsc80QQkXCamE5lgtWnuMqvqkxqhkRNS2Bcuf9e4M3FM+MGZyz mK8M6KnYnqtdFspXR//D8DOGo/xFwNroOZbasbMZI2iYxsGTReID8ldJXVybzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9S669zz10Km; Thu, 02 Oct 2025 08:20: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 5928KiJD023203; Thu, 2 Oct 2025 08:20:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Ki1B023200; Thu, 2 Oct 2025 08:20:44 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:44 GMT Message-Id: <202510020820.5928Ki1B023200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4048c39cfa6f - stable/15 - tzcode: Fix issues when TZ is an absolute path List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 4048c39cfa6f5db13042bed68f27d0070eaac25e Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4048c39cfa6f5db13042bed68f27d0070eaac25e commit 4048c39cfa6f5db13042bed68f27d0070eaac25e Author: Dag-Erling Smørgrav AuthorDate: 2025-09-27 17:07:04 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:24 +0000 tzcode: Fix issues when TZ is an absolute path * If TZ starts with TZDIR, strip any additional slashes so relname does not end up looking like an absolute path. For instance, TZ=/usr/share/zoneinfo//UTC should result in UTC, not /UTC. * In the setugid case, we were incorrectly passing name rather than relname to fstatat(). * Modify the tz_env and tz_env_setugid test cases to exercise both of these scenarios. * Also add test cases for invalid values of TZ, which I wrote earlier but forgot to include in a5f14e4f9069. Reported by: Paul Eggert MFC after: 3 days Fixes: 967a49a21a27 ("Update tzcode to 2025b") Fixes: a5f14e4f9069 ("tzcode: Use -00 only for invalid time zones") Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D52753 (cherry picked from commit df8bc705eb04aff2f718678fffb9d5d4f5d7c223) tzcode: Really fix issues when TZ is an absolute path This was accidentally left out of the previous commit. Fixes: df8bc705eb04 ("tzcode: Fix issues when TZ is an absolute path") (cherry picked from commit 202b59c35ead5bd2b71331169bdeb4845cb655c1) tzcode: Tweak open flags. Upstream uses a set of flags that reduces to O_RDONLY | O_CLOEXEC when you ignore flags that either don't exist in FreeBSD or have no effect. We were using O_RDONLY | O_BINARY, which reduces to O_RDONLY. Add O_CLOEXEC. Also replace O_RDONLY with the more accurate O_SEARCH when opening TZDIR. MFC after: 3 days Fixes: 967a49a21a27 ("Update tzcode to 2025b") (cherry picked from commit d28e4ce6cb61916b4f6bedcf4205a4da1ae121e1) --- contrib/tzcode/localtime.c | 13 ++-- lib/libc/gen/sysconf.c | 2 +- lib/libc/tests/stdtime/Makefile | 1 + lib/libc/tests/stdtime/detect_tz_changes_test.c | 90 ++++++++++++++++++++++--- 4 files changed, 92 insertions(+), 14 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index c98134f7be7c..1668475ea646 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -672,26 +672,29 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags, if ((tzloadflags & TZLOAD_FROMENV) && strcmp(name, TZDEFAULT) == 0) tzloadflags &= ~TZLOAD_FROMENV; relname = name; - if (strncmp(relname, TZDIR "/", strlen(TZDIR) + 1) == 0) + if (strncmp(relname, TZDIR "/", strlen(TZDIR) + 1) == 0) { relname += strlen(TZDIR) + 1; - dd = open(TZDIR, O_DIRECTORY | O_RDONLY); + while (*relname == '/') + relname++; + } + dd = open(TZDIR, O_DIRECTORY | O_SEARCH | O_CLOEXEC); if ((tzloadflags & TZLOAD_FROMENV) && issetugid()) { if (dd < 0) return errno; - if (fstatat(dd, name, &sb, AT_RESOLVE_BENEATH) < 0) { + if (fstatat(dd, relname, &sb, AT_RESOLVE_BENEATH) < 0) { fid = -1; } else if (!S_ISREG(sb.st_mode)) { fid = -1; errno = EINVAL; } else { - fid = openat(dd, relname, O_RDONLY | O_BINARY, AT_RESOLVE_BENEATH); + fid = openat(dd, relname, O_RDONLY | O_CLOEXEC | O_RESOLVE_BENEATH); } } else { if (dd < 0) { relname = name; dd = AT_FDCWD; } - fid = openat(dd, relname, O_RDONLY | O_BINARY, 0); + fid = openat(dd, relname, O_RDONLY | O_CLOEXEC); } if (dd != AT_FDCWD && dd >= 0) { serrno = errno; diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index 66562d0e29f0..b5b732eed05d 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -51,7 +51,7 @@ #include "un-namespace.h" #include "../stdlib/atexit.h" -#include "tzdir.h" /* from ../../../contrib/tzcode/stdtime */ +#include "tzdir.h" /* from ../../../contrib/tzcode */ #include "libc_private.h" #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ diff --git a/lib/libc/tests/stdtime/Makefile b/lib/libc/tests/stdtime/Makefile index 6b9068e1641b..590dea22da31 100644 --- a/lib/libc/tests/stdtime/Makefile +++ b/lib/libc/tests/stdtime/Makefile @@ -3,6 +3,7 @@ ATF_TESTS_C+= strptime_test ATF_TESTS_C+= detect_tz_changes_test +CFLAGS.detect_tz_changes_test+= -I${SRCTOP}/contrib/tzcode .if ${MK_DETECT_TZ_CHANGES} != "no" CFLAGS.detect_tz_changes_test+= -DDETECT_TZ_CHANGES .endif diff --git a/lib/libc/tests/stdtime/detect_tz_changes_test.c b/lib/libc/tests/stdtime/detect_tz_changes_test.c index 6648d8498cc5..fe6b04357331 100644 --- a/lib/libc/tests/stdtime/detect_tz_changes_test.c +++ b/lib/libc/tests/stdtime/detect_tz_changes_test.c @@ -20,6 +20,8 @@ #include #include +#include "tzdir.h" + #include static const struct tzcase { @@ -62,9 +64,9 @@ debug(const char *fmt, ...) static void change_tz(const char *tzn) { - static const char *zfn = "/usr/share/zoneinfo"; - static const char *tfn = "root/etc/.localtime"; - static const char *dfn = "root/etc/localtime"; + static const char *zfn = TZDIR; + static const char *tfn = "root" TZDEFAULT ".tmp"; + static const char *dfn = "root" TZDEFAULT; ssize_t clen; int zfd, sfd, dfd; @@ -96,6 +98,50 @@ test_tz(const char *expect) ATF_CHECK_STREQ(expect, buf); } +ATF_TC(tz_default); +ATF_TC_HEAD(tz_default, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test default zone"); + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(tz_default, tc) +{ + /* prepare chroot with no /etc/localtime */ + ATF_REQUIRE_EQ(0, mkdir("root", 0755)); + ATF_REQUIRE_EQ(0, mkdir("root/etc", 0755)); + /* enter chroot */ + ATF_REQUIRE_EQ(0, chroot("root")); + ATF_REQUIRE_EQ(0, chdir("/")); + /* check timezone */ + unsetenv("TZ"); + test_tz("+0000 (UTC)"); +} + +ATF_TC(tz_invalid_file); +ATF_TC_HEAD(tz_invalid_file, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test invalid zone file"); + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(tz_invalid_file, tc) +{ + static const char *dfn = "root/etc/localtime"; + int fd; + + /* prepare chroot with bogus /etc/localtime */ + ATF_REQUIRE_EQ(0, mkdir("root", 0755)); + ATF_REQUIRE_EQ(0, mkdir("root/etc", 0755)); + ATF_REQUIRE((fd = open(dfn, O_RDWR | O_CREAT, 0644)) >= 0); + ATF_REQUIRE_EQ(8, write(fd, "invalid\n", 8)); + ATF_REQUIRE_EQ(0, close(fd)); + /* enter chroot */ + ATF_REQUIRE_EQ(0, chroot("root")); + ATF_REQUIRE_EQ(0, chdir("/")); + /* check timezone */ + unsetenv("TZ"); + test_tz("+0000 (-00)"); +} + ATF_TC(thin_jail); ATF_TC_HEAD(thin_jail, tc) { @@ -327,10 +373,38 @@ ATF_TC_HEAD(tz_env, tc) } ATF_TC_BODY(tz_env, tc) { - const struct tzcase *tzcase; + char path[MAXPATHLEN]; + const struct tzcase *tzcase = tzcases; + int len; + /* relative path */ for (tzcase = tzcases; tzcase->tzfn != NULL; tzcase++) test_tz_env(tzcase->tzfn, tzcase->expect); + /* absolute path */ + for (tzcase = tzcases; tzcase->tzfn != NULL; tzcase++) { + len = snprintf(path, sizeof(path), "%s/%s", TZDIR, tzcase->tzfn); + ATF_REQUIRE(len > 0 && (size_t)len < sizeof(path)); + test_tz_env(path, tzcase->expect); + } + /* absolute path with additional slashes */ + for (tzcase = tzcases; tzcase->tzfn != NULL; tzcase++) { + len = snprintf(path, sizeof(path), "%s/////%s", TZDIR, tzcase->tzfn); + ATF_REQUIRE(len > 0 && (size_t)len < sizeof(path)); + test_tz_env(path, tzcase->expect); + } +} + + +ATF_TC(tz_invalid_env); +ATF_TC_HEAD(tz_invalid_env, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test invalid TZ value"); + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(tz_invalid_env, tc) +{ + test_tz_env("invalid", "+0000 (-00)"); + test_tz_env(":invalid", "+0000 (-00)"); } ATF_TC(setugid); @@ -367,23 +441,23 @@ ATF_TC_HEAD(tz_env_setugid, tc) } ATF_TC_BODY(tz_env_setugid, tc) { - const struct tzcase *tzcase = tzcases; - ATF_REQUIRE_EQ(0, seteuid(UID_NOBODY)); ATF_REQUIRE(issetugid()); - for (tzcase = tzcases; tzcase->tzfn != NULL; tzcase++) - test_tz_env(tzcase->tzfn, tzcase->expect); + ATF_TC_BODY_NAME(tz_env)(tc); } ATF_TP_ADD_TCS(tp) { debugging = !getenv("__RUNNING_INSIDE_ATF_RUN") && isatty(STDERR_FILENO); + ATF_TP_ADD_TC(tp, tz_default); + ATF_TP_ADD_TC(tp, tz_invalid_file); ATF_TP_ADD_TC(tp, thin_jail); #ifdef DETECT_TZ_CHANGES ATF_TP_ADD_TC(tp, detect_tz_changes); #endif /* DETECT_TZ_CHANGES */ ATF_TP_ADD_TC(tp, tz_env); + ATF_TP_ADD_TC(tp, tz_invalid_env); ATF_TP_ADD_TC(tp, setugid); ATF_TP_ADD_TC(tp, tz_env_setugid); return (atf_no_error()); From nobody Thu Oct 2 08:20:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9V2FJgz69KV4; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9V0pyRz4MnW; Thu, 02 Oct 2025 08:20:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lq6k5Dm7JqrV9liJHkuIh9snqPQs5m1iH3QeGmtPv5w=; b=YBwaCp5JhKMVhBo40WfwwXgjUToeOYGl0y8bu8XR7b6lNT2+HXgIGBYYTX71pvFlbIP20E +U5/K4EXASBTnzWQF6WvENbvqh8PICBn3zIKLHQmqKFg41IR2HPhC2jID8ySr43QR3MlkE 1sqadRtXvfDQU9ymyS6TtdA4JRyGq6SdiQ1lN2QAMo+dwUQLD6lriMbQEF8Ok/q22eH+b1 tPVFmK2EMY/pj1AiwFb8PwKxZXcr/UXma76XBYKyxg7woGNsM5RKbuYGBYU1oY4xDZciiA 7uv3cxsuWRaUd98hEpIqx1LZiiaLM3WHn9zTAFXXFmTAIbLosyQVXt19eDdHrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lq6k5Dm7JqrV9liJHkuIh9snqPQs5m1iH3QeGmtPv5w=; b=yii7ewkiIbo5BNwJ72Fu/LN7ZKLqSUmNocaGEboC10ZhBajh8WM3x24HRSUsDe06Cil2OR Atd2c4FvN+LOs0hxZ44ZGKFUa7kRm+S4WaLIaP583PsrCKM4ExLas/PZ5wC7neOTy5ML9f MJe8ur/g4DgNMSYmRPrMO4n+eD8qopIJzRbRE5SYJuJ+MrbnFygv3A8clmBtoBKF7JV+2r nL/pr3ys1ydRURofbi8hDB0odU5MyrPMkEXVvYwm58Q4++DlhxycTIXtaFaIyovpAJA31f 2UgqmWdH2DNLQ26DJzB3/HthHlOUHOVuvW9ab+VV09mHnS709+Ia/Xqy0Zno1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393246; a=rsa-sha256; cv=none; b=iLeJBeH90f363VmHeQBXR/7yQftFdj+Hymtk3yLQFbb2KoB2GMLrNbsv57BvHV/FR+/gWg Y86q2ncozzybTroEThHvCUW2kRvHcqn7xnfJqxVV1tAVExbjt2bADkcPb+aBnVtkk+Fo/3 uQnvedg2OpjRxVT/mNEKjsA8msEIceNgrZ4UD8sGRloog1JRX7rHhGrZeJeRz9f4kM6vl3 Iz6JBvBEHcX2MzZrXm9n01aBUKJzEQfECZ+fGAzNWbj7dOOH6RIfZBsSxHiR0XU4zTDE/C umRdU/CXYi51hAhwIezilVeROddlnkmcvOo+C7MRJdB7ZS0mZGZLTbgLoodeKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9V03FWz10ZL; Thu, 02 Oct 2025 08:20: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 5928KjAx023240; Thu, 2 Oct 2025 08:20:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KjCB023237; Thu, 2 Oct 2025 08:20:45 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:45 GMT Message-Id: <202510020820.5928KjCB023237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: cbb155ce4e45 - stable/15 - tzcode: Test escape from TZDIR List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: cbb155ce4e45955bf7bbcda4f6f5c75e90054ff0 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=cbb155ce4e45955bf7bbcda4f6f5c75e90054ff0 commit cbb155ce4e45955bf7bbcda4f6f5c75e90054ff0 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-29 12:36:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:24 +0000 tzcode: Test escape from TZDIR Test a value of TZ that temporarily escapes from TZDIR (which is not permitted when setugid) then reenters it. MFC after: 3 days (cherry picked from commit cf76bfbb235116702ea1689bf984f200a72d2790) --- lib/libc/tests/stdtime/detect_tz_changes_test.c | 39 ++++++++++++++++--------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/libc/tests/stdtime/detect_tz_changes_test.c b/lib/libc/tests/stdtime/detect_tz_changes_test.c index fe6b04357331..06c31c9fbc3d 100644 --- a/lib/libc/tests/stdtime/detect_tz_changes_test.c +++ b/lib/libc/tests/stdtime/detect_tz_changes_test.c @@ -24,10 +24,12 @@ #include -static const struct tzcase { +struct tzcase { const char *tzfn; const char *expect; -} tzcases[] = { +}; + +static const struct tzcase tzcases[] = { /* * A handful of time zones and the expected result of * strftime("%z (%Z)", tm) when that time zone is active @@ -43,7 +45,8 @@ static const struct tzcase { { "UTC", "+0000 (UTC)" }, { 0 }, }; - +static const struct tzcase utc = { "UTC", "+0000 (UTC)" }; +static const struct tzcase invalid = { "invalid", "+0000 (-00)" }; static const time_t then = 1751328000; /* 2025-07-01 00:00:00 UTC */ static bool debugging; @@ -139,7 +142,7 @@ ATF_TC_BODY(tz_invalid_file, tc) ATF_REQUIRE_EQ(0, chdir("/")); /* check timezone */ unsetenv("TZ"); - test_tz("+0000 (-00)"); + test_tz(invalid.expect); } ATF_TC(thin_jail); @@ -366,12 +369,8 @@ test_tz_env(const char *tzval, const char *expect) test_tz(expect); } -ATF_TC(tz_env); -ATF_TC_HEAD(tz_env, tc) -{ - atf_tc_set_md_var(tc, "descr", "Test TZ environment variable"); -} -ATF_TC_BODY(tz_env, tc) +static void +tz_env_common(void) { char path[MAXPATHLEN]; const struct tzcase *tzcase = tzcases; @@ -394,6 +393,18 @@ ATF_TC_BODY(tz_env, tc) } } +ATF_TC(tz_env); +ATF_TC_HEAD(tz_env, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test TZ environment variable"); +} +ATF_TC_BODY(tz_env, tc) +{ + tz_env_common(); + /* escape from TZDIR is permitted when not setugid */ + test_tz_env("../zoneinfo/UTC", utc.expect); +} + ATF_TC(tz_invalid_env); ATF_TC_HEAD(tz_invalid_env, tc) @@ -403,8 +414,8 @@ ATF_TC_HEAD(tz_invalid_env, tc) } ATF_TC_BODY(tz_invalid_env, tc) { - test_tz_env("invalid", "+0000 (-00)"); - test_tz_env(":invalid", "+0000 (-00)"); + test_tz_env("invalid", invalid.expect); + test_tz_env(":invalid", invalid.expect); } ATF_TC(setugid); @@ -443,7 +454,9 @@ ATF_TC_BODY(tz_env_setugid, tc) { ATF_REQUIRE_EQ(0, seteuid(UID_NOBODY)); ATF_REQUIRE(issetugid()); - ATF_TC_BODY_NAME(tz_env)(tc); + tz_env_common(); + /* escape from TZDIR is not permitted when setugid */ + test_tz_env("../zoneinfo/UTC", invalid.expect); } ATF_TP_ADD_TCS(tp) From nobody Thu Oct 2 08:20:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9X2Xb7z69KXD; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9X1kcwz4MtS; Thu, 02 Oct 2025 08:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mPFUf1dClAPpWArnFlhSb1qSNlyYbLZ4PBpRNZ84ius=; b=R7TaJ9efCEpNRTR41eQE25mm+XmADr4FeiLx8dvNolJq2MjWuQY1TPuLWUgk90FBFSmo7Z N9jWvFXGK4CwGricETRarO7Dax+yMuJCWFwqN6HDFV4cs0O4hCfyULaKTZq/ouUmOTB5ga NSsZP6hq9YBJtUDk6HCEHPTE2DVJRjPys0/wd+9z88AxjvUx2iVnC+no7YwsEf8wECWgcu MsqoPdsP39aXoqnqdRphpYBT4VxZWeI50nLwcFD0glU/sdaaClcb5Uf4eiaPt7V+PAhPJP 0CLZ1+yqk2Le9jihzR0w0cycGwpsIruOoO9AI71UZ5T1lYlIRKeARU9qnwug/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mPFUf1dClAPpWArnFlhSb1qSNlyYbLZ4PBpRNZ84ius=; b=QYLYbGjD3HDL+/gkF2N5dcTzIszuid+ZeBzNuuDUKr0Nw3TRBnUghAHD/00g2edfH73VXa qiiDS9mIn/2jhiCLPjR3j8AQSwDfFsFrERPiiWMoZON8tXhKa2U54kypz4AYy/vpn3zu2f 2HuMKwZaJOLSZuIrRRLyEwBFj4lut7qM4WgAYivb85U2U9+KztxayXXvislt2DD6QUIeZt DExww13cBNqWNT14WhunY4QcXUV6CwD5P/P7yTFFfuzBIWz7qI/bq2wvBqB2vXClUJYOgy TAIzMqRkCK1QaoQyjpXbx0mznmwM4cvrxjPNVE1SpWEIceyrBm1PWFc1V2wi8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393248; a=rsa-sha256; cv=none; b=H9anCxE0RdUThzzmtOezA0EvljyaNVO9fq9aLjU0qb/B6k/HkjT9gjpSi1ZIXSMqeh8WY/ E7t263/QjjCfX+A5SnSsYtrYnsopdWfjDq4fcoXEe6YvRmFPf8PHfEzmLFQN+ui/5qaYQW PpSgZkJDpBRIGBtO8Z0EHJuUoaCQNidDPj/AuE6NRBrudXCs61VWmS4yf9SVvacyUBtodf hDUNvHm/vscbUEPjLPP+vL4KD4+FgKqdEbvR3TI6WxsgDjqN+MGaw8jOcyDcvIN3OkHbxg ELxl8Y7msHBQRucRsiZkn40iuRZY2GWgQECh1cVF4XAxZmcYxbdNeVMoY5pzZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9X1Jkkz10j3; Thu, 02 Oct 2025 08:20: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 5928Kmdg023318; Thu, 2 Oct 2025 08:20:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KmB2023315; Thu, 2 Oct 2025 08:20:48 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:48 GMT Message-Id: <202510020820.5928KmB2023315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 073895078ef1 - stable/15 - libucl: Fix bugs in C-style comment parser List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 073895078ef1b73a461acaf2eaa3776929279047 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=073895078ef1b73a461acaf2eaa3776929279047 commit 073895078ef1b73a461acaf2eaa3776929279047 Author: Dag-Erling Smørgrav AuthorDate: 2025-10-01 09:28:30 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:24 +0000 libucl: Fix bugs in C-style comment parser When an asterisk is encountered inside a C-style comment, we first check if there is at least one more character left in the buffer, and if that character is a slash, which would terminate the comment. If that is not the case, the next two characters are consumed without being inspected. If one of those is a double quote, or the initial asterisk of an asterisk-slash pair, we end up misparsing the comment. MFC after: 3 days Reviewed by: kevans, bofh Differential Revision: https://reviews.freebsd.org/D52808 (cherry picked from commit b5e2bd5ef38181ce4a445ec19f1fa5cb6c8ea692) --- contrib/libucl/src/ucl_parser.c | 77 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/contrib/libucl/src/ucl_parser.c b/contrib/libucl/src/ucl_parser.c index 6be16d12169c..728cd6381056 100644 --- a/contrib/libucl/src/ucl_parser.c +++ b/contrib/libucl/src/ucl_parser.c @@ -164,51 +164,50 @@ start: } } } - else if (chunk->remain >= 2 && *p == '/') { - if (p[1] == '*') { - beg = p; - ucl_chunk_skipc (chunk, p); - comments_nested ++; - ucl_chunk_skipc (chunk, p); - - while (p < chunk->end) { - if (*p == '"' && *(p - 1) != '\\') { - quoted = !quoted; - } - - if (!quoted) { - if (*p == '*') { - ucl_chunk_skipc (chunk, p); - if (chunk->remain > 0 && *p == '/') { - comments_nested --; - if (comments_nested == 0) { - if (parser->flags & UCL_PARSER_SAVE_COMMENTS) { - ucl_save_comment (parser, beg, p - beg + 1); - beg = NULL; - } - - ucl_chunk_skipc (chunk, p); - goto start; - } - } - ucl_chunk_skipc (chunk, p); - } - else if (p[0] == '/' && chunk->remain >= 2 && p[1] == '*') { - comments_nested ++; - ucl_chunk_skipc (chunk, p); - ucl_chunk_skipc (chunk, p); - continue; + else if (chunk->remain >= 2 && *p == '/' && p[1] == '*') { + beg = p; + comments_nested ++; + ucl_chunk_skipc (chunk, p); + ucl_chunk_skipc (chunk, p); + while (p < chunk->end) { + if (*p == '"' && *(p - 1) != '\\') { + /* begin or end double-quoted string */ + quoted = !quoted; + ucl_chunk_skipc (chunk, p); + } + else if (quoted) { + /* quoted character */ + ucl_chunk_skipc (chunk, p); + } + else if (chunk->remain >= 2 && *p == '*' && p[1] == '/') { + /* end of comment */ + ucl_chunk_skipc (chunk, p); + ucl_chunk_skipc (chunk, p); + comments_nested --; + if (comments_nested == 0) { + if (parser->flags & UCL_PARSER_SAVE_COMMENTS) { + ucl_save_comment (parser, beg, p - beg + 1); + beg = NULL; } + goto start; } - + } + else if (chunk->remain >= 2 && *p == '/' && p[1] == '*') { + /* start of nested comment */ + comments_nested ++; + ucl_chunk_skipc (chunk, p); ucl_chunk_skipc (chunk, p); } - if (comments_nested != 0) { - ucl_set_err (parser, UCL_ENESTED, - "unfinished multiline comment", &parser->err); - return false; + else { + /* anything else */ + ucl_chunk_skipc (chunk, p); } } + if (comments_nested != 0) { + ucl_set_err (parser, UCL_ENESTED, + "unfinished multiline comment", &parser->err); + return false; + } } if (beg && p > beg && (parser->flags & UCL_PARSER_SAVE_COMMENTS)) { From nobody Thu Oct 2 08:20:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9W2vNSz69KZV; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9W1DHqz4N3r; Thu, 02 Oct 2025 08:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FILQDoyWfhvXJ4OOj8x/5tN57uQPp4CFY1JtVtlFsWQ=; b=giowrEX8s7nwvQjJnWSfFxG5DWUSfU9TyG4YTtPv95aNo9M9gxPlTcivFRAD4K+Q3yUKD+ qxW6KbDGUoxm2/orckQektwz9RFBvvRjBWxTPRts4mTgjx9Xq33OhNbm/GWpj01Gc4eD5L IAtofaIRl6kwMi6lEIc5pKeaqpLOtPG2Uf9qqfknMgK4p6TxvjjLPKQEeNm11tikGRFVNe sVWzr2NA4SSjzajYC11Dfp1/Fq80T2tE9xwojy9EIAivxm7AwQ55dOJFHB1zybtwu1gUAV +T+Bwoa5s5V9tgR2/SDVQMglL3hY/EDX4t5Cds7k/zokJADGEmnnFY6rrAbzZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FILQDoyWfhvXJ4OOj8x/5tN57uQPp4CFY1JtVtlFsWQ=; b=vt9UO4PWMqdkqVZuqbcUi4NRjN9hDQK4hUUk8md3ewMGt6FvaKNjMsstSnJ5vmiXveBTQ8 WV5BpHYpJs5ThCH68AdAOtQ26Uh3jawddP5SZifg2hkBjffyMGqVl12y2e+wGQYm9vLUlj 19qjvmXl1/cFBGwYm3iIhJ1E0Ys2H/kKztrff47efoSswzhy3FmX4SC6gSYff5l7fib0z8 BTeKoQHdYluuACO6AOW47aeOZcq6iASFEsKtvwp6NKu9lpOj20p8PrFtHd2EHhOu3YZQRJ kDKe3RUKdEzj5kxRaPeao3v6ImAZl4inh6oxgFaEM1eeYyvc77IMBpEh0VIrMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393247; a=rsa-sha256; cv=none; b=D7r6QStebA/iPf0tRB9tPtE8NcR++2a57YoECBPVU71va1aNGdDcwZjFRwj/3tE9mAMYcS bfu68eXPnQJpw3lymfwEfoOT2FbF35DmUR1uQhMLg6t6NU6dwWo6nA6UHnR1RnqpwUuw3j cmXeoWetmvfQX5Aym6ujYIsVR9FKPDk24PKOqlgGJoEvtEkR809RfsL3LBy91PtQGlM2tB rUjZpa/hBJCNVpMLzTVctbUgoOuqy8AOeBeCkbOlAWr3dimVWmbKtsiay/ZyIDMWSyvFK5 K4M+w7ssAxgeaaiOtW7CX4/GveiPOzvYqRqKpndDOA48evkgURl5JvxAU8j1HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9W0bVFz10nq; Thu, 02 Oct 2025 08:20: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 5928KkBI023282; Thu, 2 Oct 2025 08:20:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KkKq023279; Thu, 2 Oct 2025 08:20:46 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:46 GMT Message-Id: <202510020820.5928KkKq023279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 52ae229c9224 - stable/15 - libc: Add missing MLINK for tzname(3) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 52ae229c9224d3788721d081d8c957536041ceb2 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=52ae229c9224d3788721d081d8c957536041ceb2 commit 52ae229c9224d3788721d081d8c957536041ceb2 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-30 12:27:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:24 +0000 libc: Add missing MLINK for tzname(3) While here, fix manlint warnings and a typo in tzset(3). MFC after: 3 days (cherry picked from commit be8830612314d9afb64b5c040db689de44eb4b85) --- lib/libc/stdtime/Makefile.inc | 3 ++- lib/libc/stdtime/tzset.3 | 57 +++++++++++++++++-------------------------- 2 files changed, 24 insertions(+), 36 deletions(-) diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc index 647cbe6f40ba..1baa39a6c0a6 100644 --- a/lib/libc/stdtime/Makefile.inc +++ b/lib/libc/stdtime/Makefile.inc @@ -32,4 +32,5 @@ MLINKS+=strftime.3 strftime_l.3 MLINKS+=strptime.3 strptime_l.3 MLINKS+=time2posix.3 posix2time.3 MLINKS+=tzset.3 daylight.3 \ - tzset.3 timezone.3 + tzset.3 timezone.3 \ + tzset.3 tzname.3 diff --git a/lib/libc/stdtime/tzset.3 b/lib/libc/stdtime/tzset.3 index 94ccbec9aba7..33e6a556306d 100644 --- a/lib/libc/stdtime/tzset.3 +++ b/lib/libc/stdtime/tzset.3 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 25, 2023 +.Dd September 30, 2025 .Dt TZSET 3 .Os .Sh NAME @@ -58,8 +58,8 @@ specifies how this is done. .Pp If .Ev TZ -does not appear in the environment, the best available approximation to -local wall clock time, as specified by the +does not appear in the environment, the best available approximation +to local wall clock time, as specified by the .Xr tzfile 5 Ns -format file .Pa /etc/localtime @@ -68,9 +68,7 @@ is used. If .Ev TZ appears in the environment but its value is a null string, Coordinated -Universal Time -.Pq Tn UTC -is used (without leap second correction). +Universal Time (UTC) is used (without leap second correction). .Pp If .Ev TZ @@ -81,13 +79,12 @@ the rest of its value is used as a pathname of a file from which to read the time conversion information. If the first character of the pathname is a slash .Pq Ql / -it is used as -an absolute pathname; otherwise, it is used as a pathname relative to -the system time conversion information directory. +it is used as an absolute pathname; otherwise, it is used as a +pathname relative to the system time conversion information directory. .Pp -If its value does not begin with a colon, it is first used as the pathname -of a file (as described above) from which to read the time conversion -information. +If its value does not begin with a colon, it is first used as the +pathname of a file (as described above) from which to read the time +conversion information. If that file cannot be read, the value is then interpreted as a direct specification (the format is described below) of the time conversion information. @@ -96,24 +93,23 @@ If the .Ev TZ environment variable does not specify a .Xr tzfile 5 Ns -format -file and cannot be interpreted as a direct specification, -.Tn UTC -is used. +file and cannot be interpreted as a direct specification, UTC is used. .Pp After the first call to .Nm tzset , the .Vt timezone -variable is set to the difference, in seconds, between Coordinated Universal -Time (UTC) and the local time. +variable is set to the difference, in seconds, between Coordinated +Universal Time (UTC) and the local time. The .Vt daylight variable is set to 0 if the local timezone is observing standard time. -It is set to 1 if the local timezone ever observes an alternate time, such as summer time. +It is set to 1 if the local timezone ever observes an alternate time, +such as summer time. The first element of the .Vt tzname -array is the timezone name of standard time, while the second element is the -name of the altnerative time zone. +array is the timezone name of standard time, while the second element +is the name of the altnerative time zone. .Sh SPECIFICATION FORMAT When .Ev TZ @@ -151,8 +147,7 @@ minus .Pq Ql \- , plus .Pq Ql + , -and -.Tn ASCII +and ASCII .Dv NUL are allowed. .It Em offset @@ -294,10 +289,8 @@ by the file .Em posixrules in the system time conversion information directory are used, with the -standard and summer time offsets from -.Tn UTC -replaced by those specified by -the +standard and summer time offsets from UTC replaced by those specified +by the .Em offset values in .Ev TZ . @@ -315,20 +308,14 @@ local time zone file .It Pa /usr/share/zoneinfo time zone directory .It Pa /usr/share/zoneinfo/posixrules -rules for -.Tn POSIX Ns -style -.Tn TZ Ns 's +rules for POSIX-style TZs .It Pa /usr/share/zoneinfo/Etc/GMT -for -.Tn UTC -leap seconds +for UTC leap seconds .El .Pp If the file .Pa /usr/share/zoneinfo/UTC -does not exist, -.Tn UTC -leap seconds are loaded from +does not exist, UTC leap seconds are loaded from .Pa /usr/share/zoneinfo/posixrules . .Sh SEE ALSO .Xr date 1 , From nobody Thu Oct 2 08:20:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9Y46YXz69KXF; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9Y2jSJz4N4Z; Thu, 02 Oct 2025 08:20:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cYlLPHoR1xs79GAl45Cmt6w6rlaf+MDxj6BApJPMiJU=; b=Z8fC2G0C6Au8ixihpywlTkZlilvMm58iDCzzvC2sVmxUuRtFw89LafToN3fncUa0T7fLRD gEZQ6OiB5z/Q9h6JjKQz2jgUGOP529yHs0BwaM4ew3XR0OYj9FJUS1/7gmYC/JHfaCOIPt oGyD9L8JIZmx0C5cz8RDnONd+HjUm0j8uN7ZIGn8zX3WJwuECeknm2G2S1ki6wydMPh/9Q X9QQLC/4mnE3JlX8xKssym7dRsaQznjFGwQ2kgns8Y4LMcpAgat9zKhUfD1o1JbLPjhp8D MqYkVUV+Z/FG9FCR37bi4tWLy8goAFPiZAjLuB69CEFXH0FKk5ug8gFUhQtngQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cYlLPHoR1xs79GAl45Cmt6w6rlaf+MDxj6BApJPMiJU=; b=BcApmxTGewwMyyVFej/etP677A7aP6vRY27Ib4EbrG55Q5mkpqYqmypEy+yBfz4g8f0b+X 07JWqmJaBATWk3BYTUrz879Tg7AuSmQljy2xhi7CCAFxbleMSSqonMDJDOXOHYNo2VKekc ZetAS2djt9V1JnNrfIZ+wE5+1RbQzN7G25yU3l5QVNemS7yfVzdzDFiA8aIvVh1xbidAFK WT0ryq6UXmRYSfoiE2AkkBokC5rRisnISNlZJmiOATcjplhs3PNWYIYJ9IvNaNveXDYMCV nDGf3isd6PM0Va9pNRy89jMwNK1LvggiRUynSUiwFZ4qk9UudQXH1P/JqCr7nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393249; a=rsa-sha256; cv=none; b=nSsWZHI7SEMq8mxeVhllnMG3hIeRMZft7mZ1lpSfUYth/xwnippNZGp9AVrnIyJFEnv0P9 vDl+ffzrWAb4cfdkew+++zc+V7EFHEK6A41cIW3N7yOmAxGu9vUxI0O66jXnPKmR4wPiEm kUN9VPIiUWb9e3o/K0AOi9OPd2HncbHg2SN6HguemChdONzi2uyIf1R51M6/lhSlZI/2Sv SoIvOkD6xmTOKMNYvS6kOZyh7n8GTK65FbK9ZNhRFkA1FtMF5DmfM1UvZOdXk4ByrYBHjq x5GV0ULFhiAKyZ1Uo0lTFEnStDNUFHTxqJpsTm4RSPmzknHE71wElaPYrgbPVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9Y2FPyz10ZN; Thu, 02 Oct 2025 08:20: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 5928KnGe023356; Thu, 2 Oct 2025 08:20:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Knjw023353; Thu, 2 Oct 2025 08:20:49 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:49 GMT Message-Id: <202510020820.5928Knjw023353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: cb06890f791c - stable/15 - nss_tacplus: Fix typo in Makefile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: cb06890f791c61ae35de69f75c99071e344eb695 Auto-Submitted: auto-generated The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=cb06890f791c61ae35de69f75c99071e344eb695 commit cb06890f791c61ae35de69f75c99071e344eb695 Author: Dag-Erling Smørgrav AuthorDate: 2025-10-02 07:24:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 08:19:25 +0000 nss_tacplus: Fix typo in Makefile Reported by: ivy@ MFC after: 3 days (cherry picked from commit e98d3416916cdb6285d4d1807582baf6faa3ddcc) --- lib/nss_tacplus/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nss_tacplus/Makefile b/lib/nss_tacplus/Makefile index f39788cfbdea..a969cd85778d 100644 --- a/lib/nss_tacplus/Makefile +++ b/lib/nss_tacplus/Makefile @@ -1,5 +1,5 @@ LIB= nss_tacplus -SRCS= ${LIB}.8 +SRCS= ${LIB}.c SHLIB_MAJOR= 1 SHLIB_NAME= ${LIB}.so.${SHLIB_MAJOR} LIBADD= tacplus From nobody Thu Oct 2 08:20:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9f0kFxz69KRs; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9d6qwQz4NRF; Thu, 02 Oct 2025 08:20:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PxfffDDST+unS/AjjKaScxfY36BmsEKHSe4Rk0BW98M=; b=i76ng8gi6YlRWuz9I0V2ESJduMb458fAD0AjN9ARmIHfYM3Fy/1kmNJ2sBDPtrdAmhjgWO nQJUNT/umk5Pw626hzlKzUN7IpLmVURwYAPWfUhImSWW9Lyn0eWOppJcOrVC336EISA7T3 065H1YZ+Stq1FlfjPBuS76RUsPeSkBon+lYxWFIo7hEgtMXFORSteb/uqUTw7O31y91/r4 6Fe7iR4Cbj+ZafyD/d3M8CfG+1yiKvOoUKCNIREw5y/ezO0z2n0eKluS9inceuIDKuukpC eyBadLGMSJSNWbhzA9F+yeaN44ihUawEfTFqZfN2NPV7Kovh5DrDExckW8Z04w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PxfffDDST+unS/AjjKaScxfY36BmsEKHSe4Rk0BW98M=; b=eeZ6jrgdlwChlXYgbfPLo1hF3FDtFi7AtL+JfZIDIDosLhTkFFS/JT2cixDvdItyKtVHuL qEFfzbKr1lnD8jcjzsWzHrJBmGKFwtu09boHFNBDSY49QY6cDpufXPh3Uhma9Cp3W047Tl SfqV5c/bpKIeLR2aTa39MGFOWgohnyjFxUgQw0bxWE8Xdj9vMTbNYvU/f59d84EA6xhAk3 45badAfWJNhx0j4mDjhxv31iFyPz0Zt1DZv2ULmIoxpEno3bd3vrIgs2SbOOjKaD/ZsTMs 9c6TS6gKAF5AqzhBatPymqFH/+pCYsMhMLE8T5LGjzlzD9yFS4uqf+LO1bIR0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393254; a=rsa-sha256; cv=none; b=RxAUfoMKA1Ots7uhjuZAydwn/AYa1OPeBvNMQwJujmDro6DVG8qolp/FI4Oe2wTh8vEKK0 MbXgMVH+ISc7nSjfwSaFluPrb1SlsEVEiL2I7I+FvxRmvqOCZ1X3hDnWsuTQM61E5gn5xY xB9Rroqitx/AE+ZUUr6CQ3TMxUycvl96rvGn9zlU/4fBEzOlzlTCy+AtX2IkhxgPzEr8L4 aW5G9CH2yRV19RJ8bginqEVYl+dk5ARD5pdQYRthJqing6rbrFmD5nvSEAJVKWfpH63PGs pxp7cFmwwNudC+g9A+XDjn0jVaIS+fGlbBufwMa5uo0N9l/bZOuilYd19h0NIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9d6NZMz10lg; Thu, 02 Oct 2025 08:20: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 5928Kr0p023587; Thu, 2 Oct 2025 08:20:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KrIJ023584; Thu, 2 Oct 2025 08:20:53 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:53 GMT Message-Id: <202510020820.5928KrIJ023584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 65f3a787b6d7 - stable/14 - rc.subr: Fix wait_for_pids List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 65f3a787b6d7495f1638bc064277b320b4784019 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=65f3a787b6d7495f1638bc064277b320b4784019 commit 65f3a787b6d7495f1638bc064277b320b4784019 Author: Dag-Erling Smørgrav AuthorDate: 2025-08-01 23:11:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28: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 (cherry picked from commit 7f04c09fe74535c1646a4af120f8f1342fe1c328) --- 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 239ec4707b33..5423af476ad0 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -642,7 +642,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" @@ -655,7 +655,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 Thu Oct 2 08:20:54 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9g53xRz69KVC; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9g0yp4z4NRT; Thu, 02 Oct 2025 08:20:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I8MGBwHFJKOXe+42+cu5LxE/wPTZDx/Tu5E8m1bVWas=; b=lNY0TMobD1hVqKyy57VPdWdMmbgwLQwt3KTsIIxgVxOfkWvUtNXhMYloWL5cwh8LJ9eCEO 174ZatxAik+SrmftCYwpWXnYQQOUbxlOe5NMwYuEeuJLdrlqCFgVzwGhtdMjyj9WjJKNoN JG9SJvSxayB3wkcU1NT681JXl/OlLlhQ/7puK2lZ/pRPgI25idKTdpIZS1hCZODPc+WAT4 +hedS+xKolfbhJ/ZSz2Ol3U6NK5ya0tDg2/38/xhVDq2rEA33XATWIVRMhl5MqAurBlSGT 1kOJiPR1McGL6JGuujGY4v+b7XsUfReETvHFlIWYoiiPJFFlOQbLjwCwub+ZUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I8MGBwHFJKOXe+42+cu5LxE/wPTZDx/Tu5E8m1bVWas=; b=wPVGG/IH3cVyBpc0tEjuoz/BwCKejS7r2S0bPcCJFrb8w9JljQoA64wQLL2Q2PaMWY5Y+V XvOLEWAp5I2xv8bkRPCAPyluoAcZSyNf49tLe4pQB/EIbo5cGKSnhqWBjHY7Bxtv6Om9Ee 7N1U0hucxU23JV19+CoCaaelNXpFuAOGZXYfXwdB64H8eD6HFrw0XqvOmIUOOZtBFhO1Bv 2bJngfVG1ukrmuDjEO2nwn8nSNDUVmL4XqUCgCnFielip8oBstZAqI8T8uKzOGzaiCmGKq ttRBTKQAYSnH8KqJINZqqwYEQALdBJrIbgoHM3ZIf/zd72atD44fTO1z5cW5zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393255; a=rsa-sha256; cv=none; b=Vo6hpID2d4tCCWvDQtdifGOdUS6Vf0+Ewn546RZqp/za7Ll5BmvbYa+a76QvD0fTBu7V/4 6oPgVRFJJrrHPkiXf7uUTLXMn37LdvbdBF2pmItA5dVeiV89YpkvqiDZQFyrqr6tSRW2sY 30ULhkArocT/SOo9vyRIbaD4bZrE3PmKY5hcCbFt2CkTgP6AE7ekrbR8RIFipU/WkKLCad PuIoJaExs5TuhrqELCelgiHN22E81xJNStbjQ5ErBREYpZwF99qjSxvHBwGBi6szXK5LEU pzPRe2OQ4F2NsWWwzojusjjz8DuusF+X50UOObK+Pp224N2zK+b7NXPqtgasYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9g0PjZz10VN; Thu, 02 Oct 2025 08:20: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 5928KsAo023627; Thu, 2 Oct 2025 08:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Ksqk023624; Thu, 2 Oct 2025 08:20:54 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:54 GMT Message-Id: <202510020820.5928Ksqk023624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 50f554a5475f - stable/14 - rc.subr: Move the sleep in wait_for_pids List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 50f554a5475fa274d7b832e2f7fa5add0218f222 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=50f554a5475fa274d7b832e2f7fa5add0218f222 commit 50f554a5475fa274d7b832e2f7fa5add0218f222 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:55:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:57 +0000 rc.subr: Move the sleep in wait_for_pids Instead of sleeping while constructing the list of PIDs to wait for, sleep briefly after pwait to give init a chance to reap the processes that just terminated before we loop around and start probing them. PR: 289630 Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D52619 (cherry picked from commit 5953e7c98427e038500221e885dffa181dcc064b) --- libexec/rc/rc.subr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 5423af476ad0..a4f3762afd2c 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -646,7 +646,6 @@ wait_for_pids() for _j in $_list; do if kill -0 $_j 2>/dev/null; then _nlist="${_nlist}${_nlist:+ }$_j" - [ -n "$_prefix" ] && sleep 1 fi done if [ -z "$_nlist" ]; then @@ -656,6 +655,10 @@ wait_for_pids() echo -n ${_prefix:-"Waiting for PIDS: "}$_list _prefix=", " pwait -o $_list 2>/dev/null + # At least one of the processes we were waiting for + # has terminated. Give init a chance to collect it + # before looping around and checking again. + sleep 1 done if [ -n "$_prefix" ]; then echo "." From nobody Thu Oct 2 08:20:56 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9h3nLcz69KqM; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9h1994z4NMG; Thu, 02 Oct 2025 08:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O9+WufHkbecKSSCVGM/PCR/Np2MoqoGmFDo2SCga79k=; b=bE4q9n4LQ3p4t4MHBJN5tN1Y0tecz1H3P7nZOBhfsK0huG1yjSg0PDZfx5XKEhStvRZNy5 OAmRGhI1xlnrfrz31I3O4tH4PIanpjjGfJc3+n4/j0dmhC0Pt996hrFeXDPoA+vmklZHUx KfTfFZhqmbeEApZyHLdkMtlxXVJG4te1GCRjxFqlDFXkQv9wYfxWwmnT9+wVchgVDYWdPF JAuxV5Cr7clAm1+VZon8vXFjAamdqKTXrFnbJSqeNyK1wT7g65fmdcgVsOUOn07qAAS5mt h+NevjOWTnlYLupuJGzt+L+tNgVq0kf8l3Cq5m5XGIWmrYGb+Mztsc7kmI/6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O9+WufHkbecKSSCVGM/PCR/Np2MoqoGmFDo2SCga79k=; b=ppyaGkmYIS8JXIcDYTnI+0AmYkZyoiNShv39WTvtn1YdBjoFd/sTcVJoMHcQSVXRrQzsGL UF/1Lc6Xkjm00p3tP9ttwoJeEMV4c1Sc4K5q3P5NmJLvT3nB5AqjLseEFV0uIed2tlTohp K7Ng9rkljHVLQ0TDRxd9uuFiCutEO81K4Iay16hpalWxbOjYXwsueJUeKwAskPDdwrgMQR 2L6iV8n1VgxsqHVd5l78V6LeU1F89O6o6PDAu0LFMoCCtbq2/X3qJ61ipSg/VTECPOb/2m s9ZUX12xmQ/Zx4619qnYCj2et0fL3czg/cU0YJ//mIxfzYNUiCm1CFNtDcIRuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393256; a=rsa-sha256; cv=none; b=IXlN4uXQNc51jRfS/pVIsL0Ti2go+/GUq+PbL9aiUFkI5FRXwcGO+LAB4sjMMlZ5ut3/cf pAGfsX3ao4jt6EuSjsKnoIO/Dw8tM4f0kTGxb3Wcg9lvnAt8HjrkNI1fPN4JJbmK2WtuNd UEbZ1rtcVRRpalRs38C3v5XmF25i8EZo+YDEPxIohizb5JnVpfu/eqfGIYI97zFLFJAh8n uM2/UQVqAkev+ygVKJfKCO0v94cvdJ2GPSBFFkD9ZAl3QVzn5WXs02wlmkVmME+rLombQa F3D38Bn/QuEF56z7RbEVQ9bHKE9K9fGTsds/b1YD1foAAU+tX4NsuN4C8HW8Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9h0cv1z10lh; Thu, 02 Oct 2025 08:20: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 5928KuXf023684; Thu, 2 Oct 2025 08:20:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KuEN023681; Thu, 2 Oct 2025 08:20:56 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:56 GMT Message-Id: <202510020820.5928KuEN023681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 278c371fd2db - stable/14 - pwait: Fix timeout unit parser List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 278c371fd2db6a534d5a553d5eb18e53e14b2a8d Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=278c371fd2db6a534d5a553d5eb18e53e14b2a8d commit 278c371fd2db6a534d5a553d5eb18e53e14b2a8d Author: Dag-Erling Smørgrav AuthorDate: 2025-09-23 12:56:04 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:58 +0000 pwait: Fix timeout unit parser The timeout parser would check the first character after the number and ignore any subsequent ones. While here, switch to bool for booleans and fix some style nits. MFC after: 1 week Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D52612 (cherry picked from commit 3aac05f56620712744cb57d71a0ef42f8d8e3b52) --- bin/pwait/pwait.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/bin/pwait/pwait.c b/bin/pwait/pwait.c index c3adb2a8b741..b402328849ef 100644 --- a/bin/pwait/pwait.c +++ b/bin/pwait/pwait.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,6 @@ static void usage(void) { - fprintf(stderr, "usage: pwait [-t timeout] [-ov] pid ...\n"); exit(EX_USAGE); } @@ -62,15 +62,15 @@ main(int argc, char *argv[]) { struct itimerval itv; struct kevent *e; - int oflag, tflag, verbose; - int i, kq, n, nleft, opt, status; - long pid; char *end, *s; double timeout; + long pid; + int i, kq, n, nleft, opt, status; + bool oflag, tflag, verbose; - oflag = 0; - tflag = 0; - verbose = 0; + oflag = false; + tflag = false; + verbose = false; memset(&itv, 0, sizeof(itv)); while ((opt = getopt(argc, argv, "ot:v")) != -1) { @@ -79,25 +79,31 @@ main(int argc, char *argv[]) oflag = 1; break; case 't': - tflag = 1; + tflag = true; errno = 0; timeout = strtod(optarg, &end); if (end == optarg || errno == ERANGE || timeout < 0) { errx(EX_DATAERR, "timeout value"); } - switch(*end) { - case 0: + switch (*end) { + case '\0': + break; case 's': + end++; break; case 'h': timeout *= 60; /* FALLTHROUGH */ case 'm': timeout *= 60; + end++; break; default: errx(EX_DATAERR, "timeout unit"); } + if (*end != '\0') { + errx(EX_DATAERR, "timeout unit"); + } if (timeout > 100000000L) { errx(EX_DATAERR, "timeout value"); } @@ -107,7 +113,7 @@ main(int argc, char *argv[]) (suseconds_t)(timeout * 1000000UL); break; case 'v': - verbose = 1; + verbose = true; break; default: usage(); @@ -135,7 +141,7 @@ main(int argc, char *argv[]) for (n = 0; n < argc; n++) { s = argv[n]; /* Undocumented Solaris compat */ - if (!strncmp(s, "/proc/", 6)) { + if (strncmp(s, "/proc/", 6) == 0) { s += 6; } errno = 0; From nobody Thu Oct 2 08:20:56 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9j2SyYz69KZs; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9h5W31z4NK7; Thu, 02 Oct 2025 08:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51dEC1jJb1I3DOx24ZjekAJr0ti4MlR9tShmqAsiGIo=; b=p3JySHdAkUslJGHxNk6IeMj6KRM1o3kyyNQEClks84ziTsv8v/whus8bM6VXHoBk/dVZ8A BNWg5+gAZMbwtjoN7Y8LzkeGtx5d12bogp+qr5rTvPLYB+Cp6Ehdy2acCf2aKlJ1PjiLFY bAw7IEcD+snYNS1HdbxoUphwzjuFQ7GBNBwQH157KOjqxMZj7o/LFeXoy96Y9wfxWlhcbE Z6/tRxGYGMrWY58cX8HZFhgakMwp2EfzgGwPgdkFuBWvfatt5stpHWOS+w5kg2zL/jyc3b 64vjrtjRCAk3KY7gjfwLA34m5hn/KogOaLmTo6CLv88Vfyv4aLZSNdamf/5wEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51dEC1jJb1I3DOx24ZjekAJr0ti4MlR9tShmqAsiGIo=; b=Hwj37MYSxFVzUqsOkehDN8SRS+DNaynJhxDi9qSHyM3pxJbP+9jfzt9bGRW/jQ/VPL6DX5 dFQx8EoQhF2cIWKeDkaiD9imaKXyx9OnQ2zj0+5BK3g+Ql9liQq4D266+Cd4WYmQSsyehA fcUNGoP5H8cwl942jCCrjywgmDPrLuqMuYdtyXNvWFCYhK2vt0X5dcJcDskKmsiC8uYn8u XcbPwxn93QVVYLkYBkdCXaZNHV8hLwTLDA39ebd9dcHlH29wxM1tCYge48+/g069Ch6Hv2 bCnPPFQ7gbHIK6+f3u0onJDazpu+K/6mAnlXwXa3fI97zhFENREmc/tEG1eFqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393256; a=rsa-sha256; cv=none; b=ubhHXDO+1tRq4e3Qsn8PTh7TexjZYz87X4U6fyra+VgO0rWBi7BjOq6EIMEWx1FBHQwm1I JtmiDojmxVjitFuR4zeEoRIVuD/inqUHTBaAEcxAaJ6kGnJiqJQOQtWAyJqHqKud6ApZZO TnSPTloUo+AY/LcOVka787yQJNGCl9pbs8fdWgjDbv9sIvNG1SjAiw2Vd6G2U1+i30BAVG e7zjnVpWwG0mc8sbq68N2WrSDX5GdjlHXAZta+OWvF3T67Ll10s77fZVb/zLvN1Kno788B kFj0UwoSTLUbErbRBeE1MrkggupKYuemf0rKtzyjSao9ea0zLl9LSgZrjpRjTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9h4WKYz10nw; Thu, 02 Oct 2025 08:20: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 5928Kuu3023794; Thu, 2 Oct 2025 08:20:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KuOh023791; Thu, 2 Oct 2025 08:20:56 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:56 GMT Message-Id: <202510020820.5928KuOh023791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 817170736b8a - stable/13 - libucl: import snapshot 2024-02-06 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 817170736b8a6ab8340b2f8a193a8795d77239bf Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=817170736b8a6ab8340b2f8a193a8795d77239bf commit 817170736b8a6ab8340b2f8a193a8795d77239bf Author: Baptiste Daroussin AuthorDate: 2024-02-29 12:27:03 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:55 +0000 libucl: import snapshot 2024-02-06 (cherry picked from commit ddca081d382c7275bb6328c730182a007334c939) --- contrib/libucl/libucl.pc | 11 ++++ contrib/libucl/python/ucl.pyi | 15 +++++ .../libucl/tests/schema/definitions.json.disabled | 32 +++++++++ .../libucl/tests/schema/refRemote.json.disabled | 76 ++++++++++++++++++++++ 4 files changed, 134 insertions(+) diff --git a/contrib/libucl/libucl.pc b/contrib/libucl/libucl.pc new file mode 100644 index 000000000000..4878bebafcdd --- /dev/null +++ b/contrib/libucl/libucl.pc @@ -0,0 +1,11 @@ +prefix=/usr/local +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: LibUCL +Description: Universal configuration library +Version: 0.9.0 +Libs: -L${libdir} -lucl +Libs.private: +Cflags: -I${includedir}/ diff --git a/contrib/libucl/python/ucl.pyi b/contrib/libucl/python/ucl.pyi new file mode 100644 index 000000000000..79fa2901ba9f --- /dev/null +++ b/contrib/libucl/python/ucl.pyi @@ -0,0 +1,15 @@ +# Stubs for ucl (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +UCL_EMIT_CONFIG = ... # type: int +UCL_EMIT_JSON = ... # type: int +UCL_EMIT_JSON_COMPACT = ... # type: int +UCL_EMIT_MSGPACK = ... # type: int +UCL_EMIT_YAML = ... # type: int + +def dump(*args, **kwargs): ... +def load(*args, **kwargs): ... +def validate(*args, **kwargs): ... + +class SchemaError(Exception): ... diff --git a/contrib/libucl/tests/schema/definitions.json.disabled b/contrib/libucl/tests/schema/definitions.json.disabled new file mode 100644 index 000000000000..1ab9b2163c44 --- /dev/null +++ b/contrib/libucl/tests/schema/definitions.json.disabled @@ -0,0 +1,32 @@ +[ + { + "description": "valid definition", + "schema": {"$ref": "http://highsecure.ru/ucl-schema/schema#"}, + "tests": [ + { + "description": "valid definition schema", + "data": { + "definitions": { + "foo": {"type": "integer"} + } + }, + "valid": true + } + ] + }, + { + "description": "invalid definition", + "schema": {"$ref": "http://highsecure.ru/ucl-schema/schema#"}, + "tests": [ + { + "description": "invalid definition schema", + "data": { + "definitions": { + "foo": {"type": 1} + } + }, + "valid": false + } + ] + } +] diff --git a/contrib/libucl/tests/schema/refRemote.json.disabled b/contrib/libucl/tests/schema/refRemote.json.disabled new file mode 100644 index 000000000000..067c666b0ec8 --- /dev/null +++ b/contrib/libucl/tests/schema/refRemote.json.disabled @@ -0,0 +1,76 @@ +[ + { + "description": "remote ref", + "schema": {"$ref": "http://highsecure.ru/ucl-schema/remotes/integer.json"}, + "tests": [ + { + "description": "remote ref valid", + "data": 1, + "valid": true + }, + { + "description": "remote ref invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "fragment within remote ref", + "schema": {"$ref": "http://highsecure.ru/ucl-schema/remotes/subSchemas.json#/integer"}, + "tests": [ + { + "description": "remote fragment valid", + "data": 1, + "valid": true + }, + { + "description": "remote fragment invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "ref within remote ref", + "schema": { + "$ref": "http://highsecure.ru/ucl-schema/remotes/subSchemas.json#/refToInteger" + }, + "tests": [ + { + "description": "ref within ref valid", + "data": 1, + "valid": true + }, + { + "description": "ref within ref invalid", + "data": "a", + "valid": false + } + ] + } +/* + { + "description": "change resolution scope", + "schema": { + "id": "http://highsecure.ru/ucl-schema/remotes/", + "items": { + "id": "folder/", + "items": {"$ref": "folderInteger.json"} + } + }, + "tests": [ + { + "description": "changed scope ref valid", + "data": [[1]], + "valid": true + }, + { + "description": "changed scope ref invalid", + "data": [["a"]], + "valid": false + } + ] + } +*/ +] From nobody Thu Oct 2 08:20:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9j4tgYz69KZv; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9j252lz4NTx; Thu, 02 Oct 2025 08:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gavaygoIrDpRdky1nCrNcKEIFxuIrocfAeIijrR9kmQ=; b=aEhRjDNrV4QNIlT7s60v6v7xDiwPk5gq+DbBqT755A9dpU5gppXOgUJr+9kOxzK6SUn+oi lnF5RQ6tagRb46S6DMQq6PHPGR6s6RIazaKbuuzh91A25NzJwUxVy8PDyKOm5HAJTKSWks 8xYvRP9oHB8cQ5wGGE4bqfn0C+plTdCMNdaIEARnBwLKEUsVPNCQX1ssZ8juZ3hQ1LuWIl 7lpogtMm7FKz7JNEOWkf2WxxhIS0hdvIqZMC+VswmOh7EUSrDsHbvCPG1mHwi7JcWQkabn Vy3hORpQP5c7yV9jeC0T5HSpOsnUwmD2X/DpTZRkLYgbW4+tKuRjtpKnimILKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gavaygoIrDpRdky1nCrNcKEIFxuIrocfAeIijrR9kmQ=; b=DP9qucYBK3vqm7rCEOoZ8lmTRzGOI2WK7HgGe6Q1eZG45Xqza8wwEQiQ0AFblQPttD33TR UVbDuNA3FuAAAgX1qQbPlw+3hQ4ThmDps+RLpNr37RoYBocamEdneSEjtD/ZEIJ0n3on5K zGvP4JQGrlBPj8Oc3tfuoeyEMn0PGs7KcyfKoUO/HwBQmH9lvbSZ/YVeXdKyrspyXs0WLZ 3afsn2Xq8JJ3GOmZDxXEG8fibp2g5e1PQhBwlFp6+UQYY9eaZ8BnqLe0mDomVM7eBE/rja /alReWGOe7Dy/5CNfWMCiB16zR1VjaHTOxKo11WnEoHdPMEO74yhvD3k2C6h2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393257; a=rsa-sha256; cv=none; b=FUoP7wVCXwuUQ6IOJT0vbLSYwfabakeW3iLe0NbsA0zdXnDAHM6X0e7xrZXjS3NnyL+ML8 NNrUrvxXtyELi978HXqwns0jObdeZPV413lpdM1sZe8gh4/mzrQjTkVaNblI22XPCAQ67Z WglptCRmRMa8qA/kEAMmsgjVi4GH8Fon0fGS2NetP6XBGEKWWZGoOU+XdBJwf6vMSfOmUO YEhfMWrkg0IBD8ZfPnQnOE+8vBchE4OLmcQVFRs0Q2hDmSk5H1avxfcfZUsqwougsXtGfg SbVixq+RgTpMeJiaJsGzL2IdV/o9gL8Tvh9y9bp64HmecTO7lMkZwBIhpRuGKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9j1bQQz10nx; Thu, 02 Oct 2025 08:20: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 5928Kv3E023832; Thu, 2 Oct 2025 08:20:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Kvit023829; Thu, 2 Oct 2025 08:20:57 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:57 GMT Message-Id: <202510020820.5928Kvit023829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 50df33fd0dc8 - stable/14 - libc: Add missing MLINK for tzname(3) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 50df33fd0dc86d2f50269af0d3e5b463c5c20934 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=50df33fd0dc86d2f50269af0d3e5b463c5c20934 commit 50df33fd0dc86d2f50269af0d3e5b463c5c20934 Author: Dag-Erling Smørgrav AuthorDate: 2025-09-30 12:27:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:58 +0000 libc: Add missing MLINK for tzname(3) While here, fix manlint warnings and a typo in tzset(3). MFC after: 3 days (cherry picked from commit be8830612314d9afb64b5c040db689de44eb4b85) --- lib/libc/stdtime/Makefile.inc | 3 ++- lib/libc/stdtime/tzset.3 | 46 +++++++++++++++---------------------------- 2 files changed, 18 insertions(+), 31 deletions(-) diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc index 5d0ce7765b63..842166201fd1 100644 --- a/lib/libc/stdtime/Makefile.inc +++ b/lib/libc/stdtime/Makefile.inc @@ -31,4 +31,5 @@ MLINKS+=strftime.3 strftime_l.3 MLINKS+=strptime.3 strptime_l.3 MLINKS+=time2posix.3 posix2time.3 MLINKS+=tzset.3 daylight.3 \ - tzset.3 timezone.3 + tzset.3 timezone.3 \ + tzset.3 tzname.3 diff --git a/lib/libc/stdtime/tzset.3 b/lib/libc/stdtime/tzset.3 index 723ffc55979b..5a9fb67300d9 100644 --- a/lib/libc/stdtime/tzset.3 +++ b/lib/libc/stdtime/tzset.3 @@ -30,7 +30,7 @@ .\" .\" @(#)tzset.3 8.2 (Berkeley) 11/17/93 .\" -.Dd March 6, 2023 +.Dd September 30, 2025 .Dt TZSET 3 .Os .Sh NAME @@ -54,8 +54,8 @@ specifies how this is done. .Pp If .Ev TZ -does not appear in the environment, the best available approximation to -local wall clock time, as specified by the +does not appear in the environment, the best available approximation +to local wall clock time, as specified by the .Xr tzfile 5 Ns -format file .Pa /etc/localtime @@ -64,9 +64,7 @@ is used. If .Ev TZ appears in the environment but its value is a null string, Coordinated -Universal Time -.Pq Tn UTC -is used (without leap second correction). +Universal Time (UTC) is used (without leap second correction). .Pp If .Ev TZ @@ -77,13 +75,12 @@ the rest of its value is used as a pathname of a file from which to read the time conversion information. If the first character of the pathname is a slash .Pq Ql / -it is used as -an absolute pathname; otherwise, it is used as a pathname relative to -the system time conversion information directory. +it is used as an absolute pathname; otherwise, it is used as a +pathname relative to the system time conversion information directory. .Pp -If its value does not begin with a colon, it is first used as the pathname -of a file (as described above) from which to read the time conversion -information. +If its value does not begin with a colon, it is first used as the +pathname of a file (as described above) from which to read the time +conversion information. If that file cannot be read, the value is then interpreted as a direct specification (the format is described below) of the time conversion information. @@ -92,9 +89,7 @@ If the .Ev TZ environment variable does not specify a .Xr tzfile 5 Ns -format -file and cannot be interpreted as a direct specification, -.Tn UTC -is used. +file and cannot be interpreted as a direct specification, UTC is used. .Sh SPECIFICATION FORMAT When .Ev TZ @@ -132,8 +127,7 @@ minus .Pq Ql \- , plus .Pq Ql + , -and -.Tn ASCII +and ASCII .Dv NUL are allowed. .It Em offset @@ -275,10 +269,8 @@ by the file .Em posixrules in the system time conversion information directory are used, with the -standard and summer time offsets from -.Tn UTC -replaced by those specified by -the +standard and summer time offsets from UTC replaced by those specified +by the .Em offset values in .Ev TZ . @@ -296,20 +288,14 @@ local time zone file .It Pa /usr/share/zoneinfo time zone directory .It Pa /usr/share/zoneinfo/posixrules -rules for -.Tn POSIX Ns -style -.Tn TZ Ns 's +rules for POSIX-style TZs .It Pa /usr/share/zoneinfo/Etc/GMT -for -.Tn UTC -leap seconds +for UTC leap seconds .El .Pp If the file .Pa /usr/share/zoneinfo/UTC -does not exist, -.Tn UTC -leap seconds are loaded from +does not exist, UTC leap seconds are loaded from .Pa /usr/share/zoneinfo/posixrules . .Sh SEE ALSO .Xr date 1 , From nobody Thu Oct 2 08:20:57 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9k1Jxnz69KJ1; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9j5pCLz4NBP; Thu, 02 Oct 2025 08:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Zf67EE6JqNHcMO7V1cJ7nYWBlc2idqYagL+n4vgXeU=; b=qQg52xY482Vq/DpNhi/2ddw4k3Oy4Dc5aDP2ec0wVYRY+vRzGeI2JgdwgQL9XNXLyTtwo1 n87SG8gctugMDvi/SrnRGl+Moe7WoScFnkNzfBCC3XNSEylFjNFfk9J+GaGIQAwirqTUft tipFc/7qT/TEZPwH8CjFrDnovxpnXeCMS0vF2T5XNbUa6hj1Kib/kneDz8vbqnPqOf7pQD 1QR2tBVilZ/ZmzhbGCWFbAR3GSr9wfLOoz/xatjxKA6Hxrbuqs3Q1fQDFOEpyNyRPBl1qO rv9JGsCZFxAkZTdp584XaiOYO6J+EhC4UbaBwuXuMTBYGPIFFYzasGoT6ifdOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Zf67EE6JqNHcMO7V1cJ7nYWBlc2idqYagL+n4vgXeU=; b=WlkvCm00wnism8w8p5E0FVpMeW/WTgn2t1yC6ti7imu4VvC6WdmJ6FpzoMP1UtT2WV5ckd wA0Jr/saaVX3D5RGosfIXWG2eFwADldu+6m5YjYihyeBAq0ln118jw88MfzbpiiFiaz4d+ /KNqhtE216ktqZ10PRiTNH8uiVIwUTSB+vQikBy+E1ozwD+oaVGUdRX0y/dFMNiLmsuU2L iAbaPlZ1HaioiT5IeZN3umVdb9OsOWh4CAgyirswqeH35vOL1IDBPn2Q9Gv1dxMuq78gXs m218lbe7qaROVuIwetoIq8b2knXSX/I54vUUVp7CJsyEKeeXAJPdnyXo9J6TQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393257; a=rsa-sha256; cv=none; b=VE937k9ekN6Y74WJ0zR4ReS7L0pk9VaTYVlE/fCkz9zfdGDYvYIY5GQlGrKKeFkHx55I7Q 5/0p/7BAHNbiIKuIguUeGT6TZsXYOxiSudniI2MXDPey+Id5lvVQJX/cNoAxQZG0IBVnVA ymOjnBam8LdsZ9tDB1ZJ+qWx9HhFsNv6zsPmvLMbHnUxsp9VEdBIpTNMAK9zoZ2k5HAhey RiSpQ+36U6FS9wBIdoXo7aMQmAsVSM0/4QGbx4c/Sdw7uBbf1KBlzYFP3QNjNqzWE90/kj O5E4t1FBy912/p+gGa8PdxBfxb5IkA9mdAJYAYrO8JMQC0rhoKq/Wa3MWhNHpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9j5PrQz10lj; Thu, 02 Oct 2025 08:20: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 5928KvYR023865; Thu, 2 Oct 2025 08:20:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928Kv9Y023862; Thu, 2 Oct 2025 08:20:57 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:57 GMT Message-Id: <202510020820.5928Kv9Y023862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 97d4b45ae39c - stable/13 - libucl: Add a ucl::Ucl::forced_string_value method List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 97d4b45ae39cc922981f42fe16e751b0fead5751 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=97d4b45ae39cc922981f42fe16e751b0fead5751 commit 97d4b45ae39cc922981f42fe16e751b0fead5751 Author: John Baldwin AuthorDate: 2025-08-04 19:38:06 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:55 +0000 libucl: Add a ucl::Ucl::forced_string_value method This is a wrapper around ucl_object_tostring_forced. Sponsored by: Chelsio Communications Pull Request: https://github.com/freebsd/freebsd-src/pull/1794 (cherry picked from commit 47586ffc8bde236bab65da05ad3c0a660709ba96) --- contrib/libucl/include/ucl++.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/libucl/include/ucl++.h b/contrib/libucl/include/ucl++.h index fb63430d400d..1cd17eac0c75 100644 --- a/contrib/libucl/include/ucl++.h +++ b/contrib/libucl/include/ucl++.h @@ -396,6 +396,11 @@ public: return default_val; } + std::string forced_string_value () const + { + return ucl_object_tostring_forced(obj.get()); + } + size_t size () const { if (type () == UCL_ARRAY) { From nobody Thu Oct 2 08:20:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9l72j9z69KqV; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9l45fkz4NN5; Thu, 02 Oct 2025 08:20:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zNerz12PJMy8A4deRJIl0K8MqdY2kFh72QN2rTxK7so=; b=UxQ5EV2g3KzRWiJ47jl5hs8YbivwpsdqZ/0xE88OAKNP3OUPuEGTBB7L6ktEr9erdzBXW1 NhDP2S0GYbK8spDFXRfxrys7ZGu4LvLZ6PfweWq1/KEKTUxyVh+LO2ITOpP0HEwvrm+jKD FTa2UBiaZmMCqbaZlUkm5aPpGTm50c6VR7x/Lfbb++WhAAY7Cjx4VSnWjYIoX+Rb5YX15Q gMGbn1ok6iVHC2NQO3gjw/aHFmlzgMGiFTXmD1wHPReimmp6GAxDbV0RhOiUIN+oBwHMbo P8dRmZT0nCnda28rZ2eP8WK5V7PZQVhet1Zvlahv4r0yTOygGFfKLzTH8DKRCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zNerz12PJMy8A4deRJIl0K8MqdY2kFh72QN2rTxK7so=; b=k4dXKjuWW5ELTdoHKmwNMD/qJcF4OzUNiPPp4U4jALfCbaciwXnt1UEWl7X6pfEWwLfnWw w/W0szcxcQGugJHaDMP/tA0MUMRDxj2H90Kmx2MAOIaMLKpE4IhJFpNk0tKBo5GqwXUJaJ vTSsli1cSPS9cEGRGQc8NmRXhiRv/0VM3TmVT4JFoatWA3tK72q7msqB1vB0QJF8KB0pjL /+SfaieFwfrRN9zhivGDACTI52NiCsGEI8kkcHhev0M7giGZo9o5+YfhK2dLFXgRNHllCZ ecRlblxvEsnm4o+hS6yjz3+FkD9oRuF2ZEiiWGPHNZFhVfYufge7GHkKdu7Hnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393259; a=rsa-sha256; cv=none; b=noD76u4tNE05izYafWXX4F4iZ6ASuBNTm/xqwn5LCMK2fuwH5Qv3Zkdbpu5+38l7jF24d9 VaTennXltdT9lc/VZs7Hu8RComISi7KKKv/YEURlkKLFbFgo51aV0FXh/6Ck45XV7RUicF PqvzJVx4yQXR59nnsGlWBkVcIPsdH5CDI6t8DBF7RyVkuSHo0M+J9z/Lz8cD9AOOcSGYzE ZCwc14lKTFNcrsHoW745UCas5TGrCahGYLI1Rdb2iC0UzcVkZyu92li/VxcM4gLkIGEjGx bOKx0xGNdByU12ANjYkGAM9q/2Kvlz4TlIYeYmhMxjVlEE+HA+z1zSMW5cLP/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9l3RpRz103R; Thu, 02 Oct 2025 08:20: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 5928Kxp4023980; Thu, 2 Oct 2025 08:20:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KxI1023977; Thu, 2 Oct 2025 08:20:59 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:59 GMT Message-Id: <202510020820.5928KxI1023977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0a8d8b0c878f - stable/14 - MFV: libucl: Update to 0.9.2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0a8d8b0c878f85462f52fe5faebfb07678fc2c34 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0a8d8b0c878f85462f52fe5faebfb07678fc2c34 commit 0a8d8b0c878f85462f52fe5faebfb07678fc2c34 Author: Muhammad Moinur Rahman AuthorDate: 2025-08-27 18:36:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:58 +0000 MFV: libucl: Update to 0.9.2 - Add FREEBSD-upgrade instructions - Add FREEBSD-Xlist file - Remove all unnecessary files which are not required for in-tree build Approved by: bapt Differential Revision: https://reviews.freebsd.org/D50472 Event: Oslo Hackathon 202508 Sponsored by: The FreeBSD Foundation (cherry picked from commit 2326db40a1d2dd98631d70aae200ca52575139fb) --- contrib/libucl/CMakeLists.txt | 314 ----------- contrib/libucl/ChangeLog.md | 103 ---- contrib/libucl/FREEBSD-Xlist | 40 ++ contrib/libucl/FREEBSD-upgrade | 39 ++ contrib/libucl/Makefile.am | 81 --- contrib/libucl/Makefile.unix | 89 --- contrib/libucl/Makefile.w32 | 92 --- contrib/libucl/README.md | 418 -------------- contrib/libucl/autogen.sh | 2 - contrib/libucl/configure.ac | 188 ------- contrib/libucl/doc/Makefile.am | 9 - contrib/libucl/doc/api.md | 506 ----------------- contrib/libucl/doc/lua_api.md | 196 ------- contrib/libucl/doc/pandoc.template | 12 - contrib/libucl/examples/ucl_cpp.cc | 26 - contrib/libucl/haskell/hucl.hs | 123 ---- contrib/libucl/include/ucl.h | 4 +- contrib/libucl/libucl.pc | 11 - contrib/libucl/libucl.pc.in | 11 - contrib/libucl/lua/Makefile.am | 26 - contrib/libucl/lua/libucl.rockspec.in | 26 - contrib/libucl/lua/lua_ucl.c | 83 ++- contrib/libucl/m4/ax_lua.m4 | 664 ---------------------- contrib/libucl/m4/gcov.m4 | 89 --- contrib/libucl/python/MANIFEST.in | 5 - contrib/libucl/python/setup.py | 75 --- contrib/libucl/python/src/uclmodule.c | 335 ----------- contrib/libucl/python/tests/__init__.py | 0 contrib/libucl/python/tests/compat.py | 8 - contrib/libucl/python/tests/test_dump.py | 66 --- contrib/libucl/python/tests/test_example.py | 59 -- contrib/libucl/python/tests/test_load.py | 122 ---- contrib/libucl/python/tests/test_validation.py | 50 -- contrib/libucl/python/ucl.pyi | 15 - contrib/libucl/src/Makefile.am | 30 - contrib/libucl/src/mum.h | 2 - contrib/libucl/src/ucl_emitter.c | 80 ++- contrib/libucl/src/ucl_emitter_streamline.c | 9 +- contrib/libucl/src/ucl_hash.c | 146 +++-- contrib/libucl/src/ucl_msgpack.c | 4 +- contrib/libucl/src/ucl_parser.c | 214 +++++-- contrib/libucl/src/ucl_schema.c | 1 + contrib/libucl/src/ucl_util.c | 87 +-- contrib/libucl/stamp-h.in | 1 - contrib/libucl/tests/.gitignore | 10 + contrib/libucl/tests/Makefile.am | 45 -- contrib/libucl/tests/schema/definitions.json | 32 -- contrib/libucl/tests/schema/ref.json | 16 - contrib/libucl/tests/schema/refRemote.json | 76 --- contrib/libucl/tests/test_speed.c | 2 +- contrib/libucl/tests/test_streamline.c | 43 +- contrib/libucl/uthash/utlist.h | 749 ++++++++++++++++++------- contrib/libucl/utils/CMakeLists.txt | 12 - contrib/libucl/utils/Makefile.am | 23 - contrib/libucl/utils/chargen.c | 128 ----- contrib/libucl/utils/objdump.c | 185 ------ contrib/libucl/utils/ucl-tool.c | 170 ------ 57 files changed, 1072 insertions(+), 4880 deletions(-) diff --git a/contrib/libucl/CMakeLists.txt b/contrib/libucl/CMakeLists.txt deleted file mode 100644 index 5fe772a30f88..000000000000 --- a/contrib/libucl/CMakeLists.txt +++ /dev/null @@ -1,314 +0,0 @@ -PROJECT(libucl C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) - -SET(LIBUCL_VERSION_MAJOR 0) -SET(LIBUCL_VERSION_MINOR 5) -SET(LIBUCL_VERSION_PATCH 0) - -SET(LIBUCL_VERSION - "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") - -INCLUDE(CheckCCompilerFlag) -INCLUDE(CheckCSourceCompiles) -INCLUDE(FindOpenSSL) -INCLUDE(GNUInstallDirs) - -OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) -OPTION(ENABLE_URL_SIGN "Enable signatures check in ucl includes (requires openssl) [default: OFF]" OFF) -OPTION(BUILD_SHARED_LIBS "Build Shared Libraries [default: OFF]" OFF) -OPTION(ENABLE_LUA "Enable lua support [default: OFF]" OFF) -OPTION(ENABLE_LUAJIT "Enable luajit support [default: OFF]" OFF) -OPTION(ENABLE_UTILS "Enable building utility binaries [default: OFF]" OFF) - -# Find lua installation -MACRO(FindLua) - # Find lua libraries - UNSET(LUA_INCLUDE_DIR CACHE) - UNSET(LUA_LIBRARY CACHE) - CMAKE_PARSE_ARGUMENTS(LUA "" "VERSION_MAJOR;VERSION_MINOR;ROOT" "" ${ARGN}) - - IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) - MESSAGE(FATAL_ERROR "Invalid FindLua invocation: ${ARGN}") - ENDIF() - - IF(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Check for luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - FIND_PATH(LUA_INCLUDE_DIR luajit.h - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES "include/luajit-2.0" - "include/luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/luajit" - "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - include/lua include - PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} - ) - FIND_LIBRARY(LUA_LIBRARY - NAMES luajit - "luajit-2.0" - "luajit2.0" - "luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib - PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} - DOC "Lua library" - ) - - IF(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR) - MESSAGE(STATUS "Fallback from luajit to plain lua") - SET(ENABLE_LUAJIT "OFF") - MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - FIND_PATH(LUA_INCLUDE_DIR lua.h - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - include/lua include - PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} - ) - FIND_LIBRARY(LUA_LIBRARY - NAMES lua - "lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib - PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} - DOC "Lua library" - ) - ENDIF() - ELSE(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - FIND_PATH(LUA_INCLUDE_DIR lua.h - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - include/lua include - PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} - ) - FIND_LIBRARY(LUA_LIBRARY - NAMES lua - "lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib - PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} - DOC "Lua library" - ) - ENDIF(ENABLE_LUAJIT MATCHES "ON") - - IF(LUA_LIBRARY AND LUA_INCLUDE_DIR) - SET(LUA_FOUND 1) - IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) - SET(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR}) - SET(LUA_VERSION_MINOR ${LUA_VERSION_MINOR}) - ENDIF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) - IF(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Found luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - ELSE(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - ENDIF(ENABLE_LUAJIT MATCHES "ON") - ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR) -ENDMACRO() - -IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt) -ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - -IF(ENABLE_URL_INCLUDE MATCHES "ON") - FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib - PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw - /opt/local - /opt/csw - /opt - DOC "Path where the libfetch library can be found") - IF(LIBFETCH_LIBRARY) - FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include - /opt/include - /usr/local/include - DOC "Path to libfetch header") - ELSE(LIBFETCH_LIBRARY) - # Try to find libcurl - FIND_PACKAGE(CURL) - IF(NOT CURL_FOUND) - MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") - ENDIF(NOT CURL_FOUND) - ENDIF(LIBFETCH_LIBRARY) -ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") - -set(SYNC_BUILTINS_TEST_SOURCE [====[ -int main() -{ - unsigned long val; - - __sync_bool_compare_and_swap(&val, 0, 1); - __sync_add_and_fetch(&val, 1); - __sync_fetch_and_add(&val, 0); - __sync_sub_and_fetch(&val, 1); - - return 0; -} -]====]) - -CHECK_C_SOURCE_COMPILES("${SYNC_BUILTINS_TEST_SOURCE}" HAVE_ATOMIC_BUILTINS) -IF(NOT HAVE_ATOMIC_BUILTINS) - MESSAGE(WARNING "Libucl references could be thread-unsafe because atomic builtins are missing") -ENDIF(NOT HAVE_ATOMIC_BUILTINS) - -SET(CMAKE_C_WARN_FLAGS "") -CHECK_C_COMPILER_FLAG(-W SUPPORT_W) -CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN) -CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WUNUSED_PARAMETER) -IF(SUPPORT_W) - SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -W") -ENDIF(SUPPORT_W) -IF(SUPPORT_WPOINTER_SIGN) - SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign") -ENDIF(SUPPORT_WPOINTER_SIGN) -IF(SUPPORT_WUNUSED_PARAMETER) - SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-unused-parameter") -ENDIF(SUPPORT_WUNUSED_PARAMETER) - -SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_WARN_FLAGS}" ) - -IF(ENABLE_URL_SIGN MATCHES "ON") - IF(OPENSSL_FOUND) - SET(HAVE_OPENSSL 1) - INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}") - ENDIF(OPENSSL_FOUND) -ENDIF(ENABLE_URL_SIGN MATCHES "ON") - -SET(UCL_COMPILE_DEFS) -IF(HAVE_FETCH_H) - LIST(APPEND UCL_COMPILE_DEFS -DHAVE_FETCH_H=1) -ENDIF(HAVE_FETCH_H) -IF(CURL_FOUND) - LIST(APPEND UCL_COMPILE_DEFS -DCURL_FOUND=1) -ENDIF(CURL_FOUND) -IF(HAVE_OPENSSL) - LIST(APPEND UCL_COMPILE_DEFS -DHAVE_OPENSSL=1) -ENDIF(HAVE_OPENSSL) -IF(HAVE_ATOMIC_BUILTINS) - LIST(APPEND UCL_COMPILE_DEFS -DHAVE_ATOMIC_BUILTINS=1) -ENDIF(HAVE_ATOMIC_BUILTINS) - -SET(UCLSRC src/ucl_util.c - src/ucl_parser.c - src/ucl_emitter.c - src/ucl_emitter_streamline.c - src/ucl_emitter_utils.c - src/ucl_hash.c - src/ucl_schema.c - src/ucl_msgpack.c - src/ucl_sexp.c) - -SET(UCLHDR include/ucl.h - include/ucl++.h) - -SET (LIB_TYPE STATIC) -IF (BUILD_SHARED_LIBS) - SET (LIB_TYPE SHARED) -ENDIF (BUILD_SHARED_LIBS) -ADD_LIBRARY(ucl ${LIB_TYPE} ${UCLSRC}) -ADD_LIBRARY(ucl::ucl ALIAS ucl) -SET_TARGET_PROPERTIES(ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR}) -TARGET_INCLUDE_DIRECTORIES(ucl - PUBLIC - include - PRIVATE - src - uthash - klib) -TARGET_COMPILE_DEFINITIONS(ucl - PRIVATE - ${UCL_COMPILE_DEFS} -) - -IF(ENABLE_LUA MATCHES "ON") - IF(ENABLE_LUAJIT MATCHES "ON") - FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") - IF(NOT LUA_FOUND) - MESSAGE(FATAL_ERROR "Lua not found, lua support is required") - ELSE(NOT LUA_FOUND) - INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") - ENDIF(NOT LUA_FOUND) - ELSE(ENABLE_LUAJIT MATCHES "ON") - FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}") - IF(NOT LUA_FOUND) - FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") - ENDIF(NOT LUA_FOUND) - IF(NOT LUA_FOUND) - MESSAGE(FATAL_ERROR "Lua not found, lua support is required") - ELSE(NOT LUA_FOUND) - INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") - ENDIF(NOT LUA_FOUND) - ENDIF(ENABLE_LUAJIT MATCHES "ON") - SET(UCL_LUA_SRC lua/lua_ucl.c) - ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC}) - ADD_LIBRARY(ucl::lua ALIAS lua-ucl) - IF(ENABLE_LUAJIT MATCHES "ON") - TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}") - ELSE(ENABLE_LUAJIT MATCHES "ON") - TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}") - ENDIF(ENABLE_LUAJIT MATCHES "ON") - TARGET_LINK_LIBRARIES(lua-ucl ucl) - TARGET_INCLUDE_DIRECTORIES(lua-ucl PUBLIC include PRIVATE src uthash) - SET_TARGET_PROPERTIES(lua-ucl PROPERTIES - VERSION ${LIBUCL_VERSION} - SOVERSION ${LIBUCL_VERSION_MAJOR} - PUBLIC_HEADER include/lua_ucl.h) - INSTALL(TARGETS lua-ucl DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -ENDIF() - -IF(HAVE_FETCH_H) - TARGET_LINK_LIBRARIES(ucl fetch) -ELSE(HAVE_FETCH_H) - IF(CURL_FOUND) - TARGET_LINK_LIBRARIES(ucl ${CURL_LIBRARIES}) - ENDIF(CURL_FOUND) -ENDIF(HAVE_FETCH_H) -IF(ENABLE_URL_SIGN MATCHES "ON") - IF(OPENSSL_FOUND) - TARGET_LINK_LIBRARIES(ucl ${OPENSSL_LIBRARIES}) - ENDIF(OPENSSL_FOUND) -ENDIF(ENABLE_URL_SIGN MATCHES "ON") - -IF(UNIX) - TARGET_LINK_LIBRARIES(ucl -lm) -ENDIF(UNIX) - -SET_TARGET_PROPERTIES(ucl PROPERTIES - PUBLIC_HEADER "${UCLHDR}") - -INSTALL(TARGETS ucl DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - -IF(ENABLE_UTILS MATCHES "ON") - ADD_SUBDIRECTORY(utils) -ENDIF() - diff --git a/contrib/libucl/ChangeLog.md b/contrib/libucl/ChangeLog.md deleted file mode 100644 index cba29aa9a7b5..000000000000 --- a/contrib/libucl/ChangeLog.md +++ /dev/null @@ -1,103 +0,0 @@ -# Version history - -## Libucl 0.5 - -- Streamline emitter has been added, so it is now possible to output partial `ucl` objects -- Emitter now is more flexible due to emitter_context structure - -### 0.5.1 -- Fixed number of bugs and memory leaks - -### 0.5.2 - -- Allow userdata objects to be emitted and destructed -- Use userdata objects to store lua function references - -### Libucl 0.6 - -- Reworked macro interface - -### Libucl 0.6.1 - -- Various utilities fixes - -### Libucl 0.7.0 - -- Move to klib library from uthash to reduce memory overhead and increase performance - -### Libucl 0.7.1 - -- Added safe iterators API - -### Libucl 0.7.2 - -- Fixed serious bugs in schema and arrays iteration - -### Libucl 0.7.3 - -- Fixed a bug with macros that come after an empty object -- Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free) - -### Libucl 0.8.0 - -- Allow to save comments and macros when parsing UCL documents -- C++ API -- Python bindings (by Eitan Adler) -- Add msgpack support for parser and emitter -- Add Canonical S-expressions parser for libucl -- CLI interface for parsing and validation (by Maxim Ignatenko) -- Implement include with priority -- Add 'nested' functionality to .include macro (by Allan Jude) -- Allow searching an array of paths for includes (by Allan Jude) -- Add new .load macro (by Allan Jude) -- Implement .inherit macro (#100) -- Add merge strategies -- Add schema validation to lua API -- Add support for external references to schema validation -- Add coveralls integration to libucl -- Implement tests for 80% of libucl code lines -- Fix tonns of minor and major bugs -- Improve documentation -- Rework function names to the common conventions (old names are preserved for backwards compatibility) -- Add Coverity scan integration -- Add fuzz tests - -**Incompatible changes**: - -- `ucl_object_emit_full` now accepts additional argument `comments` that could be used to emit comments with UCL output - -### Libucl 0.8.1 - -- Create ucl_parser_add_file_full() to be able to specify merge mode and parser type (by Allan Jude) -- C++ wrapper improvements (by @ftilde) -- C++ wrapper: add convenience method at() and lookup() (by Yonghee Kim) -- C++ wrapper: add assignment operator to Ucl class (by Yonghee Kim) -- C++ wrapper: support variables in parser (by Yonghee Kim) -- C++ wrapper: refactoring C++ interface (by Yonghee Kim): - - use auto variables (if possible) - - remove dangling expressions - - use std::set::emplace instead of std::set::insert - - not use std::move in return statement; considering copy elision -- C++ wrapper: fix compilation error and warnings (by Zhe Wang) -- C++ wrapper: fix iteration over objects in which the first value is `false` (by Zhe Wang) -- C++ wrapper: Macro helper functions (by Chris Meacham) -- C++ wrapper: Changing the duplicate strategy in the C++ API (by Chris Meacham) -- C++ wrapper: Added access functions for the size of a UCL_ARRAY (by Chris Meacham) -- Fix caseless comparison -- Fix include when EPERM is issued -- Fix Windows build -- Allow to reserve space in arrays and hashes -- Fix bug with including of empty files -- Move to mum_hash from xxhash -- Fix msgpack on non-x86 -- python: Add support to Python 3 (by Denis Volpato Martins) -- python: Add support for Python 2.6 tests (by Denis Volpato Martins) -- python: Implement validation function and tests (by Denis Volpato Martins) -- python: Added UCL_NULL handling and tests (by Denis Volpato Martins) -- Fix schema validation for patternProperties with object data (by Denis Volpato Martins) -- Remove the dependency on NBBY, add missing include (by Ed Schouten) -- Allow to emit msgpack from Lua -- Performance improvements in Lua API -- Allow to pass opaque objects in Lua API for transparent C passthrough -- Various bugs fixed -- Couple of memory leaks plugged \ No newline at end of file diff --git a/contrib/libucl/FREEBSD-Xlist b/contrib/libucl/FREEBSD-Xlist new file mode 100644 index 000000000000..6d8cb4ff8f5b --- /dev/null +++ b/contrib/libucl/FREEBSD-Xlist @@ -0,0 +1,40 @@ +.github +.gitignore +CMakeLists.txt +ChangeLog.md +Makefile.am +Makefile.unix +Makefile.w32 +README.md +autogen.sh +configure.ac +doc/Makefile.am +doc/api.md +doc/lua_api.md +doc/pandoc.template +examples/ucl_cpp.cc +haskell/hucl.hs +libucl.pc.in +lua/Makefile.am +lua/libucl.rockspec.in +m4/.gitignore +m4/ax_lua.m4 +m4/gcov.m4 +python/MANIFEST.in +python/setup.py +python/src/uclmodule.c +python/tests/__init__.py +python/tests/compat.py +python/tests/test_dump.py +python/tests/test_example.py +python/tests/test_load.py +python/tests/test_validation.py +python/ucl.pyi +src/Makefile.am +stamp-h.in +tests/Makefile.am +utils/CMakeLists.txt +utils/Makefile.am +utils/chargen.c +utils/objdump.c +utils/ucl-tool.c diff --git a/contrib/libucl/FREEBSD-upgrade b/contrib/libucl/FREEBSD-upgrade new file mode 100644 index 000000000000..b80736d7877b --- /dev/null +++ b/contrib/libucl/FREEBSD-upgrade @@ -0,0 +1,39 @@ +# FreeBSD libucl import instruction +# +# At least the following ports are required when importing libucl: +# - devel/autoconf +# - devel/automake +# - devel/git +# - devel/gmake +# - devel/libtool +# +# 1. Vendor import +# +# $ git clone https://github.com/vstakhov/libucl.git /tmp/libucl +# $ cd /tmp/libucl +# $ git checkout +# $ cd /usr/src +# $ git checkout vendor/libucl +# $ rsync -va --delete --exclude=.git /tmp/libucl/ /usr/src/contrib/libucl/ +# $ git add . +# $ git commit -m "vendor import libucl " +# $ git tag -a vendor/libucl/ -m "vendor import libucl " +# $ git push --follow-tags freebsd vendor/libucl/ +# +# 2. Test +# +# $ cd /usr/src +# $ git checkout vendor/libucl/ +# $ ./autogen.sh +# $ ./configure +# $ gmake +# $ gmake check +# $ gmake clean +# +# 3. Merge vendor tree +# +# $ git subtree merge -P contrib/libucl vendor/libucl/ +# $ sh -c 'for F in `cat FREEBSD-Xlist | grep -v FreeBSD`; do rm -rf ./$F ; done' +# +# Recheck if there were any new files were added which are not necessary in the +# contrib tree. If so, remove them and also add them to the FREEBSD-Xlist file. diff --git a/contrib/libucl/Makefile.am b/contrib/libucl/Makefile.am deleted file mode 100644 index 5b51bcc3b468..000000000000 --- a/contrib/libucl/Makefile.am +++ /dev/null @@ -1,81 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = uthash klib README.md - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libucl.pc - -if LUA_SUB - LUA_SUBDIR = lua -endif - -COVERAGE_INFO_FILE = $(top_builddir)/coverage.info -COVERAGE_REPORT_DIR = $(top_builddir)/coverage - -.PHONY = coverage-requirement-check clean-coverage-report - -coverage-requirement-check: - @if test ! -e $(GCOV); then \ - echo "Cannot find $(GCOV). Please install gcov."; \ - exit 1; \ - fi - -coverage: coverage-requirement-check clean-coverage coverage-build coverage-check coverage-report - @echo "Please execute 'make clean' before 'make' or 'make check' to remove instrumented object files(compiled with -O0 etc.). Note that 'make clean' also remove coverage data." - -coverage-build: coverage-requirement-check - @if test `find $(top_builddir) -name "*.gcno" | wc -l` -eq 0; then \ - echo "Start to remove old non-instrumented object files..."; \ - $(MAKE) $(AM_MAKEFLAGS) clean; \ - echo "Successfully removed old non-instrumented object files."; \ - fi - @echo "Start to build libraries with coverage options..." - $(MAKE) $(AM_MAKEFLAGS) \ - CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ - CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ - LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ - LIBS="$(LIBS) $(COVERAGE_LIBS)" - @echo "Successfully built libraries with coverage options." - -coverage-check: coverage-requirement-check - @echo "Start to run tests with instrumented libraries..." - $(MAKE) $(AM_MAKEFLAGS) check \ - CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ - CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ - LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ - LIBS="$(LIBS) $(COVERAGE_LIBS)" - @echo "Successfully run tests with instrumented libraries." - -coverage-lcov: coverage-check coverage-requirement-check - $(LCOV) --capture \ - --directory "$(top_builddir)/" \ - --output-file $(COVERAGE_INFO_FILE) \ - --gcov-tool $(GCOV) \ - --compat-libtool --checksum - $(LCOV) --extract $(COVERAGE_INFO_FILE) `pwd`/src/ucl_\* \ - --output-file $(COVERAGE_INFO_FILE) - -coverage-report: coverage-lcov - @echo "Start to create coverage reports..." - $(GENHTML) --prefix "$(top_srcdir)" \ - --output-directory $(COVERAGE_REPORT_DIR) \ - --title $(PACKAGE_NAME) \ - --legend --show-details \ - $(GENHTML_OPTIONS) \ - $(COVERAGE_INFO_FILE) - @echo "Successfully created coverage reports into $(COVERAGE_REPORT_DIR) directory." - -clean-coverage-report: - -rm -rf $(COVERAGE_INFO_FILE) - -rm -rf $(COVERAGE_REPORT_DIR) - -clean-coverage: clean-coverage-report - -$(LCOV) --gcov-tool $(GCOV) --zerocounters --directory $(top_builddir) - @if xargs --version 2>/dev/null; then \ - find $(top_builddir) -name "*.gcno" | xargs --no-run-if-empty rm; \ - else \ - find $(top_builddir) -name "*.gcno" | xargs rm; \ - fi - -clean-local: clean-coverage - -SUBDIRS = src tests utils doc $(LUA_SUBDIR) diff --git a/contrib/libucl/Makefile.unix b/contrib/libucl/Makefile.unix deleted file mode 100644 index 0653d4843f7e..000000000000 --- a/contrib/libucl/Makefile.unix +++ /dev/null @@ -1,89 +0,0 @@ -CC ?= gcc -DESTDIR ?= /usr/local -LD ?= gcc -C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src -I./klib -MAJOR_VERSION = 0 -MINOR_VERSION = 2 -PATCH_VERSION = 9 -VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" -SONAME = libucl.so -SONAME_FULL = $(SONAME).$(MAJOR_VERSION) -OBJDIR ?= .obj -TESTDIR ?= tests -SRCDIR ?= src -INCLUDEDIR ?= include -MKDIR ?= mkdir -INSTALL ?= install -RM ?= rm -RMDIR ?= rmdir -LN ?= ln -LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm -LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl -LD_ADD ?= -lrt -COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h \ - $(SRCDIR)/ucl_chartable.h \ - $(SRCDIR)/ucl_internal.h \ - $(INCLUDEDIR)/ucl.h \ - $(SRCDIR)/mum.h -OBJECTS = $(OBJDIR)/ucl_hash.o \ - $(OBJDIR)/ucl_util.o \ - $(OBJDIR)/ucl_parser.o \ - $(OBJDIR)/ucl_emitter.o \ - $(OBJDIR)/ucl_schema.o - -all: $(OBJDIR) $(OBJDIR)/$(SONAME) - -$(OBJDIR)/$(SONAME): $(OBJDIR)/$(SONAME_FULL) - $(LN) -sf $(SONAME_FULL) $(OBJDIR)/$(SONAME) - -$(OBJDIR)/$(SONAME_FULL): $(OBJECTS) - $(CC) -o $(OBJDIR)/$(SONAME_FULL) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) - -$(OBJDIR): - @$(MKDIR) -p $(OBJDIR) - -# Compile rules -$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c -$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c -$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c -$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c -$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c - -clean: - $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate $(OBJDIR)/test_schema || true - $(RMDIR) $(OBJDIR) - -# Utils - -chargen: utils/chargen.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c -objdump: utils/objdump.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) - -# Tests - -test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema - -run-test: test - TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema - -$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) -$(OBJDIR)/test_schema: $(TESTDIR)/test_schema.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_schema $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_schema.c $(LD_UCL_FLAGS) -$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) -$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) - -install: $(OBJDIR)/$(SONAME) - $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) - $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h - -.PHONY: clean $(OBJDIR) diff --git a/contrib/libucl/Makefile.w32 b/contrib/libucl/Makefile.w32 deleted file mode 100644 index 5d9398bf1988..000000000000 --- a/contrib/libucl/Makefile.w32 +++ /dev/null @@ -1,92 +0,0 @@ -CC ?= gcc -DESTDIR ?= /usr/local -LD ?= gcc -C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src -MAJOR_VERSION = 0 -MINOR_VERSION = 2 -PATCH_VERSION = 9 -VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" -SONAME = libucl.dll -OBJDIR ?= .obj -TESTDIR ?= tests -SRCDIR ?= src -INCLUDEDIR ?= include -MKDIR ?= mkdir -INSTALL ?= install -RM ?= rm -RMDIR ?= rmdir -ifeq (Windows_NT, $(OS)) -LN ?= ln -else -LN ?= rem ln -endif -LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm -LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl -LD_ADD ?= -lrt -COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h \ - $(SRCDIR)/ucl_chartable.h \ - $(SRCDIR)/ucl_internal.h \ - $(INCLUDEDIR)/ucl.h \ - $(SRCDIR)/mum.h -OBJECTS = $(OBJDIR)/ucl_hash.o \ - $(OBJDIR)/ucl_util.o \ - $(OBJDIR)/ucl_parser.o \ - $(OBJDIR)/ucl_emitter.o \ - $(OBJDIR)/ucl_emitter_utils.o \ - $(OBJDIR)/ucl_schema.o - -all: $(OBJDIR) $(OBJDIR)/$(SONAME) - -$(OBJDIR)/$(SONAME): $(OBJECTS) - $(CC) -o $(OBJDIR)/$(SONAME) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) - -$(OBJDIR): - @$(MKDIR) -p $(OBJDIR) - -# Compile rules -$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c -$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c -$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c -$(OBJDIR)/ucl_emitter_utils.o: $(SRCDIR)/ucl_emitter_utils.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_emitter_utils.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter_utils.c -$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c -$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c -$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) - $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c - -clean: - $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate - $(RMDIR) $(OBJDIR) - -# Utils - -chargen: utils/chargen.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c -objdump: utils/objdump.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) - -# Tests - -test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate - -run-test: test - TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate - -$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) -$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) -$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) - -install: $(OBJDIR)/$(SONAME) - $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) - $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h - -.PHONY: clean $(OBJDIR) diff --git a/contrib/libucl/README.md b/contrib/libucl/README.md deleted file mode 100644 index 53d8a651d73b..000000000000 --- a/contrib/libucl/README.md +++ /dev/null @@ -1,418 +0,0 @@ -# LIBUCL - -[![CircleCI](https://circleci.com/gh/vstakhov/libucl.svg?style=svg)](https://circleci.com/gh/vstakhov/libucl) -[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) -[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) - -**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* - -- [Introduction](#introduction) -- [Basic structure](#basic-structure) -- [Improvements to the json notation](#improvements-to-the-json-notation) - - [General syntax sugar](#general-syntax-sugar) - - [Automatic arrays creation](#automatic-arrays-creation) - - [Named keys hierarchy](#named-keys-hierarchy) - - [Convenient numbers and booleans](#convenient-numbers-and-booleans) -- [General improvements](#general-improvements) - - [Comments](#comments) - - [Macros support](#macros-support) - - [Variables support](#variables-support) - - [Multiline strings](#multiline-strings) - - [Single quoted strings](#single-quoted-strings) -- [Emitter](#emitter) -- [Validation](#validation) -- [Performance](#performance) -- [Conclusion](#conclusion) - -## Introduction - -This document describes the main features and principles of the configuration -language called `UCL` - universal configuration language. - -If you are looking for the libucl API documentation you can find it at [this page](doc/api.md). - -## Basic structure - -UCL is heavily infused by `nginx` configuration as the example of a convenient configuration -system. However, UCL is fully compatible with `JSON` format and is able to parse json files. -For example, you can write the same configuration in the following ways: - -* in nginx like: - -```nginx -param = value; -section { - param = value; - param1 = value1; - flag = true; - number = 10k; - time = 0.2s; - string = "something"; - subsection { - host = { - host = "hostname"; - port = 900; - } - host = { - host = "hostname"; - port = 901; - } - } -} -``` - -* or in JSON: - -```json -{ - "param": "value", - "section": { - "param": "value", - "param1": "value1", - "flag": true, - "number": 10000, - "time": "0.2s", - "string": "something", - "subsection": { - "host": [ - { - "host": "hostname", - "port": 900 - }, - { - "host": "hostname", - "port": 901 - } - ] - } - } -} -``` - -## Improvements to the json notation. - -There are various things that make ucl configuration more convenient for editing than strict json: - -### General syntax sugar - *** 6765 LINES SKIPPED *** From nobody Thu Oct 2 08:20:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9l38Lyz69KcW; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9l06ryz4NH1; Thu, 02 Oct 2025 08:20:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O4bxbtmy/QrFV1bXP8ixec231snDzIkzeaUizYdb478=; b=INL/b1XICDY+sFOmUdIqFkEoNTXEYBmY9/rmUMu8JA58HHRRJO+WZiJ8yvcMEQPxi6GtLC Aos1uFZBigMjkxULb8BHWMoT22PruxFgT6hqOK0SPz3EGsWzVHk3PJ3IkfC66h6GmYf7an JoUgjGC2mNjPfidUo+zwvyLzFlh5lrn1SSki6iBssOTZSLvHLYAz1Kc3BG3khUJsI55LCP wS+k9c50dcCknrKYHcuTfeJ9bqNd9/U8dKxEiQlNOfql/z1kZ8SEzeQmv7za0mozQTRxpE 780D7jNkg+GeZ0PjFJk2eZ0wbFXsHCe5Ykfgge7fSTFoVWI9udebzFdgFvxA0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O4bxbtmy/QrFV1bXP8ixec231snDzIkzeaUizYdb478=; b=H0pykHFcYTz9DGBqpH2hmzgqbL4l6VrET3/I9qirT0sx3dFJw8Rp42cS+XnhJHsK/hf08P RlPUzqTYMPf3fkf4b8UV6BRit2xvSJQyNx8wa4b1ohLFc9/S0lqLgqTyFb+ZNrgHoc56G2 NjcpP8b33irKQ0VMlUmCA2VWrtusi2eTY+Aev+h9RQZCt/Qaemufmm4weAalNGsnSH6gV3 4E+Dea1lygRAMRE0Pcd7X1rin8PFQq5ZkkEKsYZS1zNv++MvCos5xLpzO5dRrizKXC80Fy myUL6bbO1GMuh+jsSgjTq+f63PjTnRwyLwQJv3kHmykArbpjafwBBRgfWzAz+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393259; a=rsa-sha256; cv=none; b=fvGOvf8FThU/y89GzNCK9SKF9A0NqgFnb1B6O37d8+664o8iforyDLjimKzld5+cAAlGR9 xMx8irqFUOV9AqYSD2nc3rS70GgA7HqMS300R9Z7QaQp3O6ZuLXj4CCuo600jG35PXcXqc hV69x/KqlkcFIaIU5lZ8aNe+Ej84vPur7mWkseufMoXwzhNBhHpWPrVcrJjEHT3o+p64V/ ZtWQ6Vok4jW5am9jILH1RByPBy7fH0Bc4hC46MOQEg6lQHRRlAcyCavWVo04ueuGNQHeav pWWSgs/cUI6MAE6G/9nn//kIOiKA5LNHIRi+WepBui0CvjWBhpT6wQRR3GU1WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9k6hVbz10ny; Thu, 02 Oct 2025 08:20: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 5928KwOg023942; Thu, 2 Oct 2025 08:20:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KwOj023939; Thu, 2 Oct 2025 08:20:58 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:58 GMT Message-Id: <202510020820.5928KwOj023939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 1d6e02cfc3f0 - stable/13 - MFV: libucl: Update to 0.9.2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1d6e02cfc3f091503f441834840cfcba34c29cae Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1d6e02cfc3f091503f441834840cfcba34c29cae commit 1d6e02cfc3f091503f441834840cfcba34c29cae Author: Muhammad Moinur Rahman AuthorDate: 2025-08-27 18:36:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:55 +0000 MFV: libucl: Update to 0.9.2 - Add FREEBSD-upgrade instructions - Add FREEBSD-Xlist file - Remove all unnecessary files which are not required for in-tree build Approved by: bapt Differential Revision: https://reviews.freebsd.org/D50472 Event: Oslo Hackathon 202508 Sponsored by: The FreeBSD Foundation (cherry picked from commit 2326db40a1d2dd98631d70aae200ca52575139fb) --- contrib/libucl/CMakeLists.txt | 314 ----------- contrib/libucl/ChangeLog.md | 103 ---- contrib/libucl/FREEBSD-Xlist | 40 ++ contrib/libucl/FREEBSD-upgrade | 39 ++ contrib/libucl/Makefile.am | 81 --- contrib/libucl/Makefile.unix | 89 --- contrib/libucl/Makefile.w32 | 92 --- contrib/libucl/README.md | 418 -------------- contrib/libucl/autogen.sh | 2 - contrib/libucl/configure.ac | 188 ------- contrib/libucl/doc/Makefile.am | 9 - contrib/libucl/doc/api.md | 506 ----------------- contrib/libucl/doc/lua_api.md | 196 ------- contrib/libucl/doc/pandoc.template | 12 - contrib/libucl/examples/ucl_cpp.cc | 26 - contrib/libucl/haskell/hucl.hs | 123 ---- contrib/libucl/include/ucl.h | 4 +- contrib/libucl/libucl.pc | 11 - contrib/libucl/libucl.pc.in | 11 - contrib/libucl/lua/Makefile.am | 26 - contrib/libucl/lua/libucl.rockspec.in | 26 - contrib/libucl/lua/lua_ucl.c | 83 ++- contrib/libucl/m4/ax_lua.m4 | 664 ---------------------- contrib/libucl/m4/gcov.m4 | 89 --- contrib/libucl/python/MANIFEST.in | 5 - contrib/libucl/python/setup.py | 75 --- contrib/libucl/python/src/uclmodule.c | 335 ----------- contrib/libucl/python/tests/__init__.py | 0 contrib/libucl/python/tests/compat.py | 8 - contrib/libucl/python/tests/test_dump.py | 66 --- contrib/libucl/python/tests/test_example.py | 59 -- contrib/libucl/python/tests/test_load.py | 122 ---- contrib/libucl/python/tests/test_validation.py | 50 -- contrib/libucl/python/ucl.pyi | 15 - contrib/libucl/src/Makefile.am | 30 - contrib/libucl/src/mum.h | 2 - contrib/libucl/src/ucl_emitter.c | 80 ++- contrib/libucl/src/ucl_emitter_streamline.c | 9 +- contrib/libucl/src/ucl_hash.c | 146 +++-- contrib/libucl/src/ucl_msgpack.c | 4 +- contrib/libucl/src/ucl_parser.c | 214 +++++-- contrib/libucl/src/ucl_schema.c | 1 + contrib/libucl/src/ucl_util.c | 87 +-- contrib/libucl/stamp-h.in | 1 - contrib/libucl/tests/.gitignore | 10 + contrib/libucl/tests/Makefile.am | 45 -- contrib/libucl/tests/schema/definitions.json | 32 -- contrib/libucl/tests/schema/ref.json | 16 - contrib/libucl/tests/schema/refRemote.json | 76 --- contrib/libucl/tests/test_speed.c | 2 +- contrib/libucl/tests/test_streamline.c | 43 +- contrib/libucl/uthash/utlist.h | 749 ++++++++++++++++++------- contrib/libucl/utils/CMakeLists.txt | 12 - contrib/libucl/utils/Makefile.am | 23 - contrib/libucl/utils/chargen.c | 128 ----- contrib/libucl/utils/objdump.c | 185 ------ contrib/libucl/utils/ucl-tool.c | 170 ------ 57 files changed, 1072 insertions(+), 4880 deletions(-) diff --git a/contrib/libucl/CMakeLists.txt b/contrib/libucl/CMakeLists.txt deleted file mode 100644 index 5fe772a30f88..000000000000 --- a/contrib/libucl/CMakeLists.txt +++ /dev/null @@ -1,314 +0,0 @@ -PROJECT(libucl C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) - -SET(LIBUCL_VERSION_MAJOR 0) -SET(LIBUCL_VERSION_MINOR 5) -SET(LIBUCL_VERSION_PATCH 0) - -SET(LIBUCL_VERSION - "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") - -INCLUDE(CheckCCompilerFlag) -INCLUDE(CheckCSourceCompiles) -INCLUDE(FindOpenSSL) -INCLUDE(GNUInstallDirs) - -OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) -OPTION(ENABLE_URL_SIGN "Enable signatures check in ucl includes (requires openssl) [default: OFF]" OFF) -OPTION(BUILD_SHARED_LIBS "Build Shared Libraries [default: OFF]" OFF) -OPTION(ENABLE_LUA "Enable lua support [default: OFF]" OFF) -OPTION(ENABLE_LUAJIT "Enable luajit support [default: OFF]" OFF) -OPTION(ENABLE_UTILS "Enable building utility binaries [default: OFF]" OFF) - -# Find lua installation -MACRO(FindLua) - # Find lua libraries - UNSET(LUA_INCLUDE_DIR CACHE) - UNSET(LUA_LIBRARY CACHE) - CMAKE_PARSE_ARGUMENTS(LUA "" "VERSION_MAJOR;VERSION_MINOR;ROOT" "" ${ARGN}) - - IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) - MESSAGE(FATAL_ERROR "Invalid FindLua invocation: ${ARGN}") - ENDIF() - - IF(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Check for luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - FIND_PATH(LUA_INCLUDE_DIR luajit.h - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES "include/luajit-2.0" - "include/luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/luajit" - "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - include/lua include - PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} - ) - FIND_LIBRARY(LUA_LIBRARY - NAMES luajit - "luajit-2.0" - "luajit2.0" - "luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "luajit-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib - PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} - DOC "Lua library" - ) - - IF(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR) - MESSAGE(STATUS "Fallback from luajit to plain lua") - SET(ENABLE_LUAJIT "OFF") - MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - FIND_PATH(LUA_INCLUDE_DIR lua.h - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - include/lua include - PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} - ) - FIND_LIBRARY(LUA_LIBRARY - NAMES lua - "lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib - PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} - DOC "Lua library" - ) - ENDIF() - ELSE(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Check for lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - FIND_PATH(LUA_INCLUDE_DIR lua.h - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES "include/lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "include/lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "include/lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - include/lua include - PATHS ${RSPAMD_DEFAULT_INCLUDE_PATHS} - ) - FIND_LIBRARY(LUA_LIBRARY - NAMES lua - "lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}" - "lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - "lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" - HINTS - "${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}" - $ENV{LUA_DIR} - PATH_SUFFIXES lib64 lib - PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS} - DOC "Lua library" - ) - ENDIF(ENABLE_LUAJIT MATCHES "ON") - - IF(LUA_LIBRARY AND LUA_INCLUDE_DIR) - SET(LUA_FOUND 1) - IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) - SET(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR}) - SET(LUA_VERSION_MINOR ${LUA_VERSION_MINOR}) - ENDIF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR) - IF(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Found luajit ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - ELSE(ENABLE_LUAJIT MATCHES "ON") - MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") - ENDIF(ENABLE_LUAJIT MATCHES "ON") - ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR) -ENDMACRO() - -IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt) -ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - -IF(ENABLE_URL_INCLUDE MATCHES "ON") - FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib - PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw - /opt/local - /opt/csw - /opt - DOC "Path where the libfetch library can be found") - IF(LIBFETCH_LIBRARY) - FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include - /opt/include - /usr/local/include - DOC "Path to libfetch header") - ELSE(LIBFETCH_LIBRARY) - # Try to find libcurl - FIND_PACKAGE(CURL) - IF(NOT CURL_FOUND) - MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") - ENDIF(NOT CURL_FOUND) - ENDIF(LIBFETCH_LIBRARY) -ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") - -set(SYNC_BUILTINS_TEST_SOURCE [====[ -int main() -{ - unsigned long val; - - __sync_bool_compare_and_swap(&val, 0, 1); - __sync_add_and_fetch(&val, 1); - __sync_fetch_and_add(&val, 0); - __sync_sub_and_fetch(&val, 1); - - return 0; -} -]====]) - -CHECK_C_SOURCE_COMPILES("${SYNC_BUILTINS_TEST_SOURCE}" HAVE_ATOMIC_BUILTINS) -IF(NOT HAVE_ATOMIC_BUILTINS) - MESSAGE(WARNING "Libucl references could be thread-unsafe because atomic builtins are missing") -ENDIF(NOT HAVE_ATOMIC_BUILTINS) - -SET(CMAKE_C_WARN_FLAGS "") -CHECK_C_COMPILER_FLAG(-W SUPPORT_W) -CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN) -CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WUNUSED_PARAMETER) -IF(SUPPORT_W) - SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -W") -ENDIF(SUPPORT_W) -IF(SUPPORT_WPOINTER_SIGN) - SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign") -ENDIF(SUPPORT_WPOINTER_SIGN) -IF(SUPPORT_WUNUSED_PARAMETER) - SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-unused-parameter") -ENDIF(SUPPORT_WUNUSED_PARAMETER) - -SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_WARN_FLAGS}" ) - -IF(ENABLE_URL_SIGN MATCHES "ON") - IF(OPENSSL_FOUND) - SET(HAVE_OPENSSL 1) - INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}") - ENDIF(OPENSSL_FOUND) -ENDIF(ENABLE_URL_SIGN MATCHES "ON") - -SET(UCL_COMPILE_DEFS) -IF(HAVE_FETCH_H) - LIST(APPEND UCL_COMPILE_DEFS -DHAVE_FETCH_H=1) -ENDIF(HAVE_FETCH_H) -IF(CURL_FOUND) - LIST(APPEND UCL_COMPILE_DEFS -DCURL_FOUND=1) -ENDIF(CURL_FOUND) -IF(HAVE_OPENSSL) - LIST(APPEND UCL_COMPILE_DEFS -DHAVE_OPENSSL=1) -ENDIF(HAVE_OPENSSL) -IF(HAVE_ATOMIC_BUILTINS) - LIST(APPEND UCL_COMPILE_DEFS -DHAVE_ATOMIC_BUILTINS=1) -ENDIF(HAVE_ATOMIC_BUILTINS) - -SET(UCLSRC src/ucl_util.c - src/ucl_parser.c - src/ucl_emitter.c - src/ucl_emitter_streamline.c - src/ucl_emitter_utils.c - src/ucl_hash.c - src/ucl_schema.c - src/ucl_msgpack.c - src/ucl_sexp.c) - -SET(UCLHDR include/ucl.h - include/ucl++.h) - -SET (LIB_TYPE STATIC) -IF (BUILD_SHARED_LIBS) - SET (LIB_TYPE SHARED) -ENDIF (BUILD_SHARED_LIBS) -ADD_LIBRARY(ucl ${LIB_TYPE} ${UCLSRC}) -ADD_LIBRARY(ucl::ucl ALIAS ucl) -SET_TARGET_PROPERTIES(ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR}) -TARGET_INCLUDE_DIRECTORIES(ucl - PUBLIC - include - PRIVATE - src - uthash - klib) -TARGET_COMPILE_DEFINITIONS(ucl - PRIVATE - ${UCL_COMPILE_DEFS} -) - -IF(ENABLE_LUA MATCHES "ON") - IF(ENABLE_LUAJIT MATCHES "ON") - FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") - IF(NOT LUA_FOUND) - MESSAGE(FATAL_ERROR "Lua not found, lua support is required") - ELSE(NOT LUA_FOUND) - INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") - ENDIF(NOT LUA_FOUND) - ELSE(ENABLE_LUAJIT MATCHES "ON") - FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}") - IF(NOT LUA_FOUND) - FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") - ENDIF(NOT LUA_FOUND) - IF(NOT LUA_FOUND) - MESSAGE(FATAL_ERROR "Lua not found, lua support is required") - ELSE(NOT LUA_FOUND) - INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") - ENDIF(NOT LUA_FOUND) - ENDIF(ENABLE_LUAJIT MATCHES "ON") - SET(UCL_LUA_SRC lua/lua_ucl.c) - ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC}) - ADD_LIBRARY(ucl::lua ALIAS lua-ucl) - IF(ENABLE_LUAJIT MATCHES "ON") - TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}") - ELSE(ENABLE_LUAJIT MATCHES "ON") - TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}") - ENDIF(ENABLE_LUAJIT MATCHES "ON") - TARGET_LINK_LIBRARIES(lua-ucl ucl) - TARGET_INCLUDE_DIRECTORIES(lua-ucl PUBLIC include PRIVATE src uthash) - SET_TARGET_PROPERTIES(lua-ucl PROPERTIES - VERSION ${LIBUCL_VERSION} - SOVERSION ${LIBUCL_VERSION_MAJOR} - PUBLIC_HEADER include/lua_ucl.h) - INSTALL(TARGETS lua-ucl DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -ENDIF() - -IF(HAVE_FETCH_H) - TARGET_LINK_LIBRARIES(ucl fetch) -ELSE(HAVE_FETCH_H) - IF(CURL_FOUND) - TARGET_LINK_LIBRARIES(ucl ${CURL_LIBRARIES}) - ENDIF(CURL_FOUND) -ENDIF(HAVE_FETCH_H) -IF(ENABLE_URL_SIGN MATCHES "ON") - IF(OPENSSL_FOUND) - TARGET_LINK_LIBRARIES(ucl ${OPENSSL_LIBRARIES}) - ENDIF(OPENSSL_FOUND) -ENDIF(ENABLE_URL_SIGN MATCHES "ON") - -IF(UNIX) - TARGET_LINK_LIBRARIES(ucl -lm) -ENDIF(UNIX) - -SET_TARGET_PROPERTIES(ucl PROPERTIES - PUBLIC_HEADER "${UCLHDR}") - -INSTALL(TARGETS ucl DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - -IF(ENABLE_UTILS MATCHES "ON") - ADD_SUBDIRECTORY(utils) -ENDIF() - diff --git a/contrib/libucl/ChangeLog.md b/contrib/libucl/ChangeLog.md deleted file mode 100644 index cba29aa9a7b5..000000000000 --- a/contrib/libucl/ChangeLog.md +++ /dev/null @@ -1,103 +0,0 @@ -# Version history - -## Libucl 0.5 - -- Streamline emitter has been added, so it is now possible to output partial `ucl` objects -- Emitter now is more flexible due to emitter_context structure - -### 0.5.1 -- Fixed number of bugs and memory leaks - -### 0.5.2 - -- Allow userdata objects to be emitted and destructed -- Use userdata objects to store lua function references - -### Libucl 0.6 - -- Reworked macro interface - -### Libucl 0.6.1 - -- Various utilities fixes - -### Libucl 0.7.0 - -- Move to klib library from uthash to reduce memory overhead and increase performance - -### Libucl 0.7.1 - -- Added safe iterators API - -### Libucl 0.7.2 - -- Fixed serious bugs in schema and arrays iteration - -### Libucl 0.7.3 - -- Fixed a bug with macros that come after an empty object -- Fixed a bug in include processing when an incorrect variable has been destroyed (use-after-free) - -### Libucl 0.8.0 - -- Allow to save comments and macros when parsing UCL documents -- C++ API -- Python bindings (by Eitan Adler) -- Add msgpack support for parser and emitter -- Add Canonical S-expressions parser for libucl -- CLI interface for parsing and validation (by Maxim Ignatenko) -- Implement include with priority -- Add 'nested' functionality to .include macro (by Allan Jude) -- Allow searching an array of paths for includes (by Allan Jude) -- Add new .load macro (by Allan Jude) -- Implement .inherit macro (#100) -- Add merge strategies -- Add schema validation to lua API -- Add support for external references to schema validation -- Add coveralls integration to libucl -- Implement tests for 80% of libucl code lines -- Fix tonns of minor and major bugs -- Improve documentation -- Rework function names to the common conventions (old names are preserved for backwards compatibility) -- Add Coverity scan integration -- Add fuzz tests - -**Incompatible changes**: - -- `ucl_object_emit_full` now accepts additional argument `comments` that could be used to emit comments with UCL output - -### Libucl 0.8.1 - -- Create ucl_parser_add_file_full() to be able to specify merge mode and parser type (by Allan Jude) -- C++ wrapper improvements (by @ftilde) -- C++ wrapper: add convenience method at() and lookup() (by Yonghee Kim) -- C++ wrapper: add assignment operator to Ucl class (by Yonghee Kim) -- C++ wrapper: support variables in parser (by Yonghee Kim) -- C++ wrapper: refactoring C++ interface (by Yonghee Kim): - - use auto variables (if possible) - - remove dangling expressions - - use std::set::emplace instead of std::set::insert - - not use std::move in return statement; considering copy elision -- C++ wrapper: fix compilation error and warnings (by Zhe Wang) -- C++ wrapper: fix iteration over objects in which the first value is `false` (by Zhe Wang) -- C++ wrapper: Macro helper functions (by Chris Meacham) -- C++ wrapper: Changing the duplicate strategy in the C++ API (by Chris Meacham) -- C++ wrapper: Added access functions for the size of a UCL_ARRAY (by Chris Meacham) -- Fix caseless comparison -- Fix include when EPERM is issued -- Fix Windows build -- Allow to reserve space in arrays and hashes -- Fix bug with including of empty files -- Move to mum_hash from xxhash -- Fix msgpack on non-x86 -- python: Add support to Python 3 (by Denis Volpato Martins) -- python: Add support for Python 2.6 tests (by Denis Volpato Martins) -- python: Implement validation function and tests (by Denis Volpato Martins) -- python: Added UCL_NULL handling and tests (by Denis Volpato Martins) -- Fix schema validation for patternProperties with object data (by Denis Volpato Martins) -- Remove the dependency on NBBY, add missing include (by Ed Schouten) -- Allow to emit msgpack from Lua -- Performance improvements in Lua API -- Allow to pass opaque objects in Lua API for transparent C passthrough -- Various bugs fixed -- Couple of memory leaks plugged \ No newline at end of file diff --git a/contrib/libucl/FREEBSD-Xlist b/contrib/libucl/FREEBSD-Xlist new file mode 100644 index 000000000000..6d8cb4ff8f5b --- /dev/null +++ b/contrib/libucl/FREEBSD-Xlist @@ -0,0 +1,40 @@ +.github +.gitignore +CMakeLists.txt +ChangeLog.md +Makefile.am +Makefile.unix +Makefile.w32 +README.md +autogen.sh +configure.ac +doc/Makefile.am +doc/api.md +doc/lua_api.md +doc/pandoc.template +examples/ucl_cpp.cc +haskell/hucl.hs +libucl.pc.in +lua/Makefile.am +lua/libucl.rockspec.in +m4/.gitignore +m4/ax_lua.m4 +m4/gcov.m4 +python/MANIFEST.in +python/setup.py +python/src/uclmodule.c +python/tests/__init__.py +python/tests/compat.py +python/tests/test_dump.py +python/tests/test_example.py +python/tests/test_load.py +python/tests/test_validation.py +python/ucl.pyi +src/Makefile.am +stamp-h.in +tests/Makefile.am +utils/CMakeLists.txt +utils/Makefile.am +utils/chargen.c +utils/objdump.c +utils/ucl-tool.c diff --git a/contrib/libucl/FREEBSD-upgrade b/contrib/libucl/FREEBSD-upgrade new file mode 100644 index 000000000000..b80736d7877b --- /dev/null +++ b/contrib/libucl/FREEBSD-upgrade @@ -0,0 +1,39 @@ +# FreeBSD libucl import instruction +# +# At least the following ports are required when importing libucl: +# - devel/autoconf +# - devel/automake +# - devel/git +# - devel/gmake +# - devel/libtool +# +# 1. Vendor import +# +# $ git clone https://github.com/vstakhov/libucl.git /tmp/libucl +# $ cd /tmp/libucl +# $ git checkout +# $ cd /usr/src +# $ git checkout vendor/libucl +# $ rsync -va --delete --exclude=.git /tmp/libucl/ /usr/src/contrib/libucl/ +# $ git add . +# $ git commit -m "vendor import libucl " +# $ git tag -a vendor/libucl/ -m "vendor import libucl " +# $ git push --follow-tags freebsd vendor/libucl/ +# +# 2. Test +# +# $ cd /usr/src +# $ git checkout vendor/libucl/ +# $ ./autogen.sh +# $ ./configure +# $ gmake +# $ gmake check +# $ gmake clean +# +# 3. Merge vendor tree +# +# $ git subtree merge -P contrib/libucl vendor/libucl/ +# $ sh -c 'for F in `cat FREEBSD-Xlist | grep -v FreeBSD`; do rm -rf ./$F ; done' +# +# Recheck if there were any new files were added which are not necessary in the +# contrib tree. If so, remove them and also add them to the FREEBSD-Xlist file. diff --git a/contrib/libucl/Makefile.am b/contrib/libucl/Makefile.am deleted file mode 100644 index 5b51bcc3b468..000000000000 --- a/contrib/libucl/Makefile.am +++ /dev/null @@ -1,81 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = uthash klib README.md - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libucl.pc - -if LUA_SUB - LUA_SUBDIR = lua -endif - -COVERAGE_INFO_FILE = $(top_builddir)/coverage.info -COVERAGE_REPORT_DIR = $(top_builddir)/coverage - -.PHONY = coverage-requirement-check clean-coverage-report - -coverage-requirement-check: - @if test ! -e $(GCOV); then \ - echo "Cannot find $(GCOV). Please install gcov."; \ - exit 1; \ - fi - -coverage: coverage-requirement-check clean-coverage coverage-build coverage-check coverage-report - @echo "Please execute 'make clean' before 'make' or 'make check' to remove instrumented object files(compiled with -O0 etc.). Note that 'make clean' also remove coverage data." - -coverage-build: coverage-requirement-check - @if test `find $(top_builddir) -name "*.gcno" | wc -l` -eq 0; then \ - echo "Start to remove old non-instrumented object files..."; \ - $(MAKE) $(AM_MAKEFLAGS) clean; \ - echo "Successfully removed old non-instrumented object files."; \ - fi - @echo "Start to build libraries with coverage options..." - $(MAKE) $(AM_MAKEFLAGS) \ - CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ - CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ - LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ - LIBS="$(LIBS) $(COVERAGE_LIBS)" - @echo "Successfully built libraries with coverage options." - -coverage-check: coverage-requirement-check - @echo "Start to run tests with instrumented libraries..." - $(MAKE) $(AM_MAKEFLAGS) check \ - CFLAGS="$(CFLAGS) $(COVERAGE_CFLAGS) $(COVERAGE_OPTFLAGS)" \ - CXXFLAGS="$(CXXFLAGS) $(COVERAGE_CXXFLAGS) $(COVERAGE_OPTFLAGS)" \ - LDFLAGS="$(LDFLAGS) $(COVERAGE_LDFLAGS)" \ - LIBS="$(LIBS) $(COVERAGE_LIBS)" - @echo "Successfully run tests with instrumented libraries." - -coverage-lcov: coverage-check coverage-requirement-check - $(LCOV) --capture \ - --directory "$(top_builddir)/" \ - --output-file $(COVERAGE_INFO_FILE) \ - --gcov-tool $(GCOV) \ - --compat-libtool --checksum - $(LCOV) --extract $(COVERAGE_INFO_FILE) `pwd`/src/ucl_\* \ - --output-file $(COVERAGE_INFO_FILE) - -coverage-report: coverage-lcov - @echo "Start to create coverage reports..." - $(GENHTML) --prefix "$(top_srcdir)" \ - --output-directory $(COVERAGE_REPORT_DIR) \ - --title $(PACKAGE_NAME) \ - --legend --show-details \ - $(GENHTML_OPTIONS) \ - $(COVERAGE_INFO_FILE) - @echo "Successfully created coverage reports into $(COVERAGE_REPORT_DIR) directory." - -clean-coverage-report: - -rm -rf $(COVERAGE_INFO_FILE) - -rm -rf $(COVERAGE_REPORT_DIR) - -clean-coverage: clean-coverage-report - -$(LCOV) --gcov-tool $(GCOV) --zerocounters --directory $(top_builddir) - @if xargs --version 2>/dev/null; then \ - find $(top_builddir) -name "*.gcno" | xargs --no-run-if-empty rm; \ - else \ - find $(top_builddir) -name "*.gcno" | xargs rm; \ - fi - -clean-local: clean-coverage - -SUBDIRS = src tests utils doc $(LUA_SUBDIR) diff --git a/contrib/libucl/Makefile.unix b/contrib/libucl/Makefile.unix deleted file mode 100644 index 0653d4843f7e..000000000000 --- a/contrib/libucl/Makefile.unix +++ /dev/null @@ -1,89 +0,0 @@ -CC ?= gcc -DESTDIR ?= /usr/local -LD ?= gcc -C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src -I./klib -MAJOR_VERSION = 0 -MINOR_VERSION = 2 -PATCH_VERSION = 9 -VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" -SONAME = libucl.so -SONAME_FULL = $(SONAME).$(MAJOR_VERSION) -OBJDIR ?= .obj -TESTDIR ?= tests -SRCDIR ?= src -INCLUDEDIR ?= include -MKDIR ?= mkdir -INSTALL ?= install -RM ?= rm -RMDIR ?= rmdir -LN ?= ln -LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm -LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl -LD_ADD ?= -lrt -COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h \ - $(SRCDIR)/ucl_chartable.h \ - $(SRCDIR)/ucl_internal.h \ - $(INCLUDEDIR)/ucl.h \ - $(SRCDIR)/mum.h -OBJECTS = $(OBJDIR)/ucl_hash.o \ - $(OBJDIR)/ucl_util.o \ - $(OBJDIR)/ucl_parser.o \ - $(OBJDIR)/ucl_emitter.o \ - $(OBJDIR)/ucl_schema.o - -all: $(OBJDIR) $(OBJDIR)/$(SONAME) - -$(OBJDIR)/$(SONAME): $(OBJDIR)/$(SONAME_FULL) - $(LN) -sf $(SONAME_FULL) $(OBJDIR)/$(SONAME) - -$(OBJDIR)/$(SONAME_FULL): $(OBJECTS) - $(CC) -o $(OBJDIR)/$(SONAME_FULL) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) - -$(OBJDIR): - @$(MKDIR) -p $(OBJDIR) - -# Compile rules -$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c -$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c -$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c -$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c -$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c - -clean: - $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate $(OBJDIR)/test_schema || true - $(RMDIR) $(OBJDIR) - -# Utils - -chargen: utils/chargen.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c -objdump: utils/objdump.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) - -# Tests - -test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema - -run-test: test - TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema - -$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) -$(OBJDIR)/test_schema: $(TESTDIR)/test_schema.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_schema $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_schema.c $(LD_UCL_FLAGS) -$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) -$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) - -install: $(OBJDIR)/$(SONAME) - $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) - $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h - -.PHONY: clean $(OBJDIR) diff --git a/contrib/libucl/Makefile.w32 b/contrib/libucl/Makefile.w32 deleted file mode 100644 index 5d9398bf1988..000000000000 --- a/contrib/libucl/Makefile.w32 +++ /dev/null @@ -1,92 +0,0 @@ -CC ?= gcc -DESTDIR ?= /usr/local -LD ?= gcc -C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src -MAJOR_VERSION = 0 -MINOR_VERSION = 2 -PATCH_VERSION = 9 -VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" -SONAME = libucl.dll -OBJDIR ?= .obj -TESTDIR ?= tests -SRCDIR ?= src -INCLUDEDIR ?= include -MKDIR ?= mkdir -INSTALL ?= install -RM ?= rm -RMDIR ?= rmdir -ifeq (Windows_NT, $(OS)) -LN ?= ln -else -LN ?= rem ln -endif -LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm -LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl -LD_ADD ?= -lrt -COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h \ - $(SRCDIR)/ucl_chartable.h \ - $(SRCDIR)/ucl_internal.h \ - $(INCLUDEDIR)/ucl.h \ - $(SRCDIR)/mum.h -OBJECTS = $(OBJDIR)/ucl_hash.o \ - $(OBJDIR)/ucl_util.o \ - $(OBJDIR)/ucl_parser.o \ - $(OBJDIR)/ucl_emitter.o \ - $(OBJDIR)/ucl_emitter_utils.o \ - $(OBJDIR)/ucl_schema.o - -all: $(OBJDIR) $(OBJDIR)/$(SONAME) - -$(OBJDIR)/$(SONAME): $(OBJECTS) - $(CC) -o $(OBJDIR)/$(SONAME) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) - -$(OBJDIR): - @$(MKDIR) -p $(OBJDIR) - -# Compile rules -$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c -$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c -$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c -$(OBJDIR)/ucl_emitter_utils.o: $(SRCDIR)/ucl_emitter_utils.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_emitter_utils.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter_utils.c -$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c -$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) - $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c -$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) - $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c - -clean: - $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate - $(RMDIR) $(OBJDIR) - -# Utils - -chargen: utils/chargen.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c -objdump: utils/objdump.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) - -# Tests - -test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate - -run-test: test - TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate - -$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) -$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) -$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) - $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) - -install: $(OBJDIR)/$(SONAME) - $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) - $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h - -.PHONY: clean $(OBJDIR) diff --git a/contrib/libucl/README.md b/contrib/libucl/README.md deleted file mode 100644 index 53d8a651d73b..000000000000 --- a/contrib/libucl/README.md +++ /dev/null @@ -1,418 +0,0 @@ -# LIBUCL - -[![CircleCI](https://circleci.com/gh/vstakhov/libucl.svg?style=svg)](https://circleci.com/gh/vstakhov/libucl) -[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) -[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) - -**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* - -- [Introduction](#introduction) -- [Basic structure](#basic-structure) -- [Improvements to the json notation](#improvements-to-the-json-notation) - - [General syntax sugar](#general-syntax-sugar) - - [Automatic arrays creation](#automatic-arrays-creation) - - [Named keys hierarchy](#named-keys-hierarchy) - - [Convenient numbers and booleans](#convenient-numbers-and-booleans) -- [General improvements](#general-improvements) - - [Comments](#comments) - - [Macros support](#macros-support) - - [Variables support](#variables-support) - - [Multiline strings](#multiline-strings) - - [Single quoted strings](#single-quoted-strings) -- [Emitter](#emitter) -- [Validation](#validation) -- [Performance](#performance) -- [Conclusion](#conclusion) - -## Introduction - -This document describes the main features and principles of the configuration -language called `UCL` - universal configuration language. - -If you are looking for the libucl API documentation you can find it at [this page](doc/api.md). - -## Basic structure - -UCL is heavily infused by `nginx` configuration as the example of a convenient configuration -system. However, UCL is fully compatible with `JSON` format and is able to parse json files. -For example, you can write the same configuration in the following ways: - -* in nginx like: - -```nginx -param = value; -section { - param = value; - param1 = value1; - flag = true; - number = 10k; - time = 0.2s; - string = "something"; - subsection { - host = { - host = "hostname"; - port = 900; - } - host = { - host = "hostname"; - port = 901; - } - } -} -``` - -* or in JSON: - -```json -{ - "param": "value", - "section": { - "param": "value", - "param1": "value1", - "flag": true, - "number": 10000, - "time": "0.2s", - "string": "something", - "subsection": { - "host": [ - { - "host": "hostname", - "port": 900 - }, - { - "host": "hostname", - "port": 901 - } - ] - } - } -} -``` - -## Improvements to the json notation. - -There are various things that make ucl configuration more convenient for editing than strict json: - -### General syntax sugar - *** 6765 LINES SKIPPED *** From nobody Thu Oct 2 08:20:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9k6dsdz69KJF; Thu, 02 Oct 2025 08:20: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9k2cN5z4NMm; Thu, 02 Oct 2025 08:20:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Ugx2E7FWldrLLSVHKcDwdmCETQ+w0Hexagopx4t93s=; b=K/lNvuRon/LzeSTA+MpMtunZHLUCmj1AAWH0/902bC8Z8eGCTsdu0Py1T1z4BxbriCMPHx z4gmTP+RbkJEBUwrgKr8FsPKXNYXyr2lUuzQDcyL9p8R+j/fuj0KtmVSXQZ99vRKVEV+Vv CfRrQpbqSSaapay7Hq7JRSeX/XtViSC/J8DVvj7ZjzxvCMmuE1gZoyDePY2diNLss6uG/T GyQxkPa+tLAdD/9Kq6qVMWzT/kRJpdIUQHsb72UEhRp5wcGgNzyC8/kLgtJJnJrstDIy8+ b5nCGL9F8UXjoPzaLHTzcAj8EQwKWDadJWXwcuZzKtRv8wviaen4YQo/nShC2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Ugx2E7FWldrLLSVHKcDwdmCETQ+w0Hexagopx4t93s=; b=X6HkOt3BDEKBzcxX3sGoIXky0kW5JNh5CJvWk2IpeSkTqurpnzQ81C9NCiUqrkddgHSmoF PGqp4noykCkpuGWTytSkIlPBkRt+leoj3ON4YrxFecRffes5Q7Ca0+I6kRgbQDrTC8gamT WQcmmLNjpadakRcA9pyqxjcK0Scpljj61P1symPDM+VAdWZGn+T1zuadd257KIcJKJGS1n 5rlAzPHrLBjUjaE4pONnCjJvOu2oDhEiSCMn3hu3VqWkcnx3VYqK4OKe5U1wewiFUWPMCq 1u26cTBQ+c2sF5gQ/8+5ZCrGouaQYeVT1yuXfwreGjng/RnU5cOOdSCF0q2NKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393258; a=rsa-sha256; cv=none; b=Dj55LNz4bbNWt8SKyloCmcf3MN3RSL9WFtMj2gJkFYACaX0HOzcpBmFEUWMWlUM99S8eOL L27Jr/Z1LnJAwRDyZBsd04frQrYGdmlmeko1KBTt8/QlXgImeWWgD/dFV261z8FRtFXlY4 AvOC/CQyD+G7MDTsRSZrU0NkuoX1LoFE0l4ky8a+ObbOm8ej4kLqXnzG0l0R5wmXfsZpr5 jOr4J/KzGxS+RdKJn5eEwzEY5TFILoFFOgympZyfBS0SlcjtGXIVgJFyHXNU2kdyYaqT7M 184f1fLaYuVBuN7W7o/VRs2x777CK/OgQyYQlDouqEYNthN//RREPYEJ33odCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9k27kgz10lk; Thu, 02 Oct 2025 08:20: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 5928Kwon023908; Thu, 2 Oct 2025 08:20:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KwxM023904; Thu, 2 Oct 2025 08:20:58 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:58 GMT Message-Id: <202510020820.5928KwxM023904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 3d91e5d58581 - stable/14 - libucl: Add a ucl::Ucl::forced_string_value method List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3d91e5d58581e000932854e4acb9cc722f01826a Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3d91e5d58581e000932854e4acb9cc722f01826a commit 3d91e5d58581e000932854e4acb9cc722f01826a Author: John Baldwin AuthorDate: 2025-08-04 19:38:06 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:58 +0000 libucl: Add a ucl::Ucl::forced_string_value method This is a wrapper around ucl_object_tostring_forced. Sponsored by: Chelsio Communications Pull Request: https://github.com/freebsd/freebsd-src/pull/1794 (cherry picked from commit 47586ffc8bde236bab65da05ad3c0a660709ba96) --- contrib/libucl/include/ucl++.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/libucl/include/ucl++.h b/contrib/libucl/include/ucl++.h index fb63430d400d..1cd17eac0c75 100644 --- a/contrib/libucl/include/ucl++.h +++ b/contrib/libucl/include/ucl++.h @@ -396,6 +396,11 @@ public: return default_val; } + std::string forced_string_value () const + { + return ucl_object_tostring_forced(obj.get()); + } + size_t size () const { if (type () == UCL_ARRAY) { From nobody Thu Oct 2 08:21:00 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9n1QGyz69KVP; Thu, 02 Oct 2025 08:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9m57QMz4NXh; Thu, 02 Oct 2025 08:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jq7wMQKpjm/QjV47/pcTeB+aaLxNNBeDCiBn222jCxA=; b=U5TicYbXBRMiXuVaMlnOhvCYc2n1mgZzK6Immjylj0K7YtKxXEm3irXyH6SsLUKbwnvf0f 5wWovA3I/4oGhd5Fyve8wJn2YRHWR80clG1xB8acKezUNf45j7R8wmBFHA2dPlFFSBi819 XfmmflgMW/MeTSnjunFcSrjT6l4VWNO9nVMNsp3DX3FopP8sRDLkeRIKuMQXf6tdp7syjl rPIIQKz1BUNwrcRS6c5P4XwmnMtc329PnJLHsKFBM3uG8kUBPMHjX41YiYYwHtC/VAn2C4 LFvwi1SY9/g2GeqjW2HIdJNtx63SreCLoMOOuxpOXYesH5PyiPKLuuIF8HOFgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jq7wMQKpjm/QjV47/pcTeB+aaLxNNBeDCiBn222jCxA=; b=rDcSAXmxHgQFkvlNqDg1XShAqnpXwcwEctkZOCm9rlDsxLaIA5f1Dqih/+t8+L++i7dUCz jRhTTY/ZO3Deu0Mrf4HU3NwaI3hXVfmB6j42Q1sxmmWclQwtjy8L9nQcQE6z6b/FEjO3VE amBpSvfbMuJkzfOGqcnUzLtFkDbkjn5HMiXeX636j9b2jYsXkrw0z5Qh7D2/j3DdmUBR1B D9H8ADi/eFBazl0dyxbGNueQ6apKtMfa7Tt6BImyDmj/+tBVF94+JA8E3daluygjFMRM2u wmTQHqMgQhCowWDEBdbgWfKi6mQ8LnM70Ng6gjGZr3X7JuhX/Q/l/dzg41sxOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393260; a=rsa-sha256; cv=none; b=lw3Mj6M9wN6QWeBvNRD8KRVrNbSS8a2nNUZB7tAsI6/EKZzouyL9eKMqdDRMeBtEQgfDdy 26PvWozdaZHsKX2RP4z+kGFwUEifWp5iZvRPVuO3sF1/Vd5umt1mvZhlRBFQ/6YYobTYp+ tNjBlHfyLi/diFnQQPx6xnQuTo7Nqb0kK5JpybFmHSp4dirTdqMpXoWqHuJaE59dmEs9x1 49ZFqZAAF5HDo/qtAYc4z+py+eyhAqkbsIqa+UaJPdN2FkCRrkjpk3XXqxnxRFpLVYnL5/ zxJPAbAiOqR4rhWMGrKcADzuEYEeZGW4HiwuiikZ3BNI1VR8x9TbQ/Z0IyaAQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9m4jfDz10Kq; Thu, 02 Oct 2025 08:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5928L0LC024056; Thu, 2 Oct 2025 08:21:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928L0vM024053; Thu, 2 Oct 2025 08:21:00 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:21:00 GMT Message-Id: <202510020821.5928L0vM024053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: ff997dde8c93 - stable/14 - libucl: Fix bugs in C-style comment parser List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ff997dde8c93d07dc3f41afc502d96876a36abde Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ff997dde8c93d07dc3f41afc502d96876a36abde commit ff997dde8c93d07dc3f41afc502d96876a36abde Author: Dag-Erling Smørgrav AuthorDate: 2025-10-01 09:28:30 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:58 +0000 libucl: Fix bugs in C-style comment parser When an asterisk is encountered inside a C-style comment, we first check if there is at least one more character left in the buffer, and if that character is a slash, which would terminate the comment. If that is not the case, the next two characters are consumed without being inspected. If one of those is a double quote, or the initial asterisk of an asterisk-slash pair, we end up misparsing the comment. MFC after: 3 days Reviewed by: kevans, bofh Differential Revision: https://reviews.freebsd.org/D52808 (cherry picked from commit b5e2bd5ef38181ce4a445ec19f1fa5cb6c8ea692) --- contrib/libucl/src/ucl_parser.c | 77 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/contrib/libucl/src/ucl_parser.c b/contrib/libucl/src/ucl_parser.c index 6be16d12169c..728cd6381056 100644 --- a/contrib/libucl/src/ucl_parser.c +++ b/contrib/libucl/src/ucl_parser.c @@ -164,51 +164,50 @@ start: } } } - else if (chunk->remain >= 2 && *p == '/') { - if (p[1] == '*') { - beg = p; - ucl_chunk_skipc (chunk, p); - comments_nested ++; - ucl_chunk_skipc (chunk, p); - - while (p < chunk->end) { - if (*p == '"' && *(p - 1) != '\\') { - quoted = !quoted; - } - - if (!quoted) { - if (*p == '*') { - ucl_chunk_skipc (chunk, p); - if (chunk->remain > 0 && *p == '/') { - comments_nested --; - if (comments_nested == 0) { - if (parser->flags & UCL_PARSER_SAVE_COMMENTS) { - ucl_save_comment (parser, beg, p - beg + 1); - beg = NULL; - } - - ucl_chunk_skipc (chunk, p); - goto start; - } - } - ucl_chunk_skipc (chunk, p); - } - else if (p[0] == '/' && chunk->remain >= 2 && p[1] == '*') { - comments_nested ++; - ucl_chunk_skipc (chunk, p); - ucl_chunk_skipc (chunk, p); - continue; + else if (chunk->remain >= 2 && *p == '/' && p[1] == '*') { + beg = p; + comments_nested ++; + ucl_chunk_skipc (chunk, p); + ucl_chunk_skipc (chunk, p); + while (p < chunk->end) { + if (*p == '"' && *(p - 1) != '\\') { + /* begin or end double-quoted string */ + quoted = !quoted; + ucl_chunk_skipc (chunk, p); + } + else if (quoted) { + /* quoted character */ + ucl_chunk_skipc (chunk, p); + } + else if (chunk->remain >= 2 && *p == '*' && p[1] == '/') { + /* end of comment */ + ucl_chunk_skipc (chunk, p); + ucl_chunk_skipc (chunk, p); + comments_nested --; + if (comments_nested == 0) { + if (parser->flags & UCL_PARSER_SAVE_COMMENTS) { + ucl_save_comment (parser, beg, p - beg + 1); + beg = NULL; } + goto start; } - + } + else if (chunk->remain >= 2 && *p == '/' && p[1] == '*') { + /* start of nested comment */ + comments_nested ++; + ucl_chunk_skipc (chunk, p); ucl_chunk_skipc (chunk, p); } - if (comments_nested != 0) { - ucl_set_err (parser, UCL_ENESTED, - "unfinished multiline comment", &parser->err); - return false; + else { + /* anything else */ + ucl_chunk_skipc (chunk, p); } } + if (comments_nested != 0) { + ucl_set_err (parser, UCL_ENESTED, + "unfinished multiline comment", &parser->err); + return false; + } } if (beg && p > beg && (parser->flags & UCL_PARSER_SAVE_COMMENTS)) { From nobody Thu Oct 2 08:20:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9m3zSPz69KqW; Thu, 02 Oct 2025 08:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9m0wJCz4NXZ; Thu, 02 Oct 2025 08:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD2QTAX6nXcftQtWwx4jvKyoYZ9+Tx8il/i+W5j1huY=; b=cgZZRYAEWtLaKFEZ2dbKhCow+PRYVVTb66Ap9g3Z+K2eRRWoUpd2SPS/AQlNAS4lALGv5Y WtK9Ex5F/7OEApNTJz7hzArjXFe1Hb/2hOm5ZJCy8wuc+JL1RLo9dfLq0lmBYvPq+N+lUT fE4elCk9nRfXjtiH/Jp9ztHFtbG3Up1xPvw2CBTkT/izjW4WqAD6+Yw8lnI9Naq9Uu9Mqk gMeldZHyTH/VSZD9sFUQsKLNp6j8i5bKQ7i/2FCFU8kUA4ufoSFZZfE5SeeDxK5gjmriJp IQO3VzWf+nkX38Q8o9mziZXxwFx5RotIh9kHmEDqV/7uturFljKqSPMOXalFtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD2QTAX6nXcftQtWwx4jvKyoYZ9+Tx8il/i+W5j1huY=; b=jj/TU29//ENDWvgVUmKwRIBnhgeZkd0VzhinUVH1dyBmFh3ZRCaRy0codKNzqs1tKuDxvI uFUb02NNQDaDeTRsiIEj+7Qu+3uaAfBFCjuqqDoZ2hSb8PSL+uXfMaTACsQY/pkp5A/SB5 2QE5HXxMKBM/gUgeQzYa+bqNEfKL2pbfYapmtOOGc+Xf8bhmCRwMlUTiTY4KnT51r2NRBm ogiiyZOrZL5rcWBRQT4iH8lx/+gF0Eij8ZME69Z27cMjqTjxunehUxr1skVKfnWQfBy1AE 2UJOCRCSafbuE3Hd8J0u01BLKihW0gw8i0tBLo5rIYrhBHYsp/A9Q/+lnHEmOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393260; a=rsa-sha256; cv=none; b=cddICl4r5bOS/V79+NHe9ec9GfuF/C0gLeqrZlOEtiul6nF1hkAtl0s50zHc5I1ZNTPpu8 7S4uNt9EIVoSBuyHPPmT8z6baEHu3UbqBA4Y0byRMtOkqm7I1LVDGQv4Ok/F0NDxNQ62H4 1qFHrz/4vy18WjFmQ15tl9hMsPmaBVKrr1gG1XSYQzC8xiR48o/D7KzIe+gYulAYIhSXe9 tNZKHvAiCS6hL31rsF2ZcaUD4Ydinb9nFyPXHSWQLGwvMl5GCpOTBXf7hkO+e6FYvPjbWy +2URqxXzvzSwvxCEnZ0yYKh8iIu58fnSrsJCIWvKY73PspwHEgBWD1jkPWsX2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9m07Ptz10VR; Thu, 02 Oct 2025 08:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5928KxxZ024013; Thu, 2 Oct 2025 08:20:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928KxZ6024010; Thu, 2 Oct 2025 08:20:59 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:20:59 GMT Message-Id: <202510020820.5928KxZ6024010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4704cb6d92c0 - stable/13 - libucl: Fix bugs in C-style comment parser List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4704cb6d92c024c1204c1d0b62b82843a31c43a6 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4704cb6d92c024c1204c1d0b62b82843a31c43a6 commit 4704cb6d92c024c1204c1d0b62b82843a31c43a6 Author: Dag-Erling Smørgrav AuthorDate: 2025-10-01 09:28:30 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:56 +0000 libucl: Fix bugs in C-style comment parser When an asterisk is encountered inside a C-style comment, we first check if there is at least one more character left in the buffer, and if that character is a slash, which would terminate the comment. If that is not the case, the next two characters are consumed without being inspected. If one of those is a double quote, or the initial asterisk of an asterisk-slash pair, we end up misparsing the comment. MFC after: 3 days Reviewed by: kevans, bofh Differential Revision: https://reviews.freebsd.org/D52808 (cherry picked from commit b5e2bd5ef38181ce4a445ec19f1fa5cb6c8ea692) --- contrib/libucl/src/ucl_parser.c | 77 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/contrib/libucl/src/ucl_parser.c b/contrib/libucl/src/ucl_parser.c index 6be16d12169c..728cd6381056 100644 --- a/contrib/libucl/src/ucl_parser.c +++ b/contrib/libucl/src/ucl_parser.c @@ -164,51 +164,50 @@ start: } } } - else if (chunk->remain >= 2 && *p == '/') { - if (p[1] == '*') { - beg = p; - ucl_chunk_skipc (chunk, p); - comments_nested ++; - ucl_chunk_skipc (chunk, p); - - while (p < chunk->end) { - if (*p == '"' && *(p - 1) != '\\') { - quoted = !quoted; - } - - if (!quoted) { - if (*p == '*') { - ucl_chunk_skipc (chunk, p); - if (chunk->remain > 0 && *p == '/') { - comments_nested --; - if (comments_nested == 0) { - if (parser->flags & UCL_PARSER_SAVE_COMMENTS) { - ucl_save_comment (parser, beg, p - beg + 1); - beg = NULL; - } - - ucl_chunk_skipc (chunk, p); - goto start; - } - } - ucl_chunk_skipc (chunk, p); - } - else if (p[0] == '/' && chunk->remain >= 2 && p[1] == '*') { - comments_nested ++; - ucl_chunk_skipc (chunk, p); - ucl_chunk_skipc (chunk, p); - continue; + else if (chunk->remain >= 2 && *p == '/' && p[1] == '*') { + beg = p; + comments_nested ++; + ucl_chunk_skipc (chunk, p); + ucl_chunk_skipc (chunk, p); + while (p < chunk->end) { + if (*p == '"' && *(p - 1) != '\\') { + /* begin or end double-quoted string */ + quoted = !quoted; + ucl_chunk_skipc (chunk, p); + } + else if (quoted) { + /* quoted character */ + ucl_chunk_skipc (chunk, p); + } + else if (chunk->remain >= 2 && *p == '*' && p[1] == '/') { + /* end of comment */ + ucl_chunk_skipc (chunk, p); + ucl_chunk_skipc (chunk, p); + comments_nested --; + if (comments_nested == 0) { + if (parser->flags & UCL_PARSER_SAVE_COMMENTS) { + ucl_save_comment (parser, beg, p - beg + 1); + beg = NULL; } + goto start; } - + } + else if (chunk->remain >= 2 && *p == '/' && p[1] == '*') { + /* start of nested comment */ + comments_nested ++; + ucl_chunk_skipc (chunk, p); ucl_chunk_skipc (chunk, p); } - if (comments_nested != 0) { - ucl_set_err (parser, UCL_ENESTED, - "unfinished multiline comment", &parser->err); - return false; + else { + /* anything else */ + ucl_chunk_skipc (chunk, p); } } + if (comments_nested != 0) { + ucl_set_err (parser, UCL_ENESTED, + "unfinished multiline comment", &parser->err); + return false; + } } if (beg && p > beg && (parser->flags & UCL_PARSER_SAVE_COMMENTS)) { From nobody Thu Oct 2 08:21:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9p2Hvfz69Kqg; Thu, 02 Oct 2025 08:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9n6GsGz4NQf; Thu, 02 Oct 2025 08:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmiZu2U/DslDG+6tZvyL4gDWO82yppwwbTQ2n6JYPAE=; b=wCYyouT+FdtkNq4PJ2A+wrzhMY2zl0caS4dxEpPHQE+DQdWLA3RZnZ7nw1nXf+FaPntzz5 xwip8ATvDPPLF4JGnIqbjr/WeNQMlpTAeYlgzofrmNu9qy0mz610UBiS/RUPJrSHFf31d4 NPKJc5spiIWzneId4HFive/PssSc5LgkANd1SXw/OuXwN5XPpCc8a9YVrsD8KsJKk/zF7X otR+18JDNfy/x9nFHa0k33IhW1wlSK7Jr1iaCMKHHYU8WUogS/Pm5USC1Zow+bBgvht8wk nN36bAVzxo3HTJ4lhONBOryC/cHeWMtoaeEFSGZq/qZb8PCKbOI+BzAFAP3EBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmiZu2U/DslDG+6tZvyL4gDWO82yppwwbTQ2n6JYPAE=; b=sO9khCSS+y99us94crn9haXzlabdUfEVEz22S29/fap1dEXcFsgW5XUIPkLvWSmld4GGbv TwH8e3IkfhnJRSuiplfccSMGN59tmH+32aPlYnQ3Yj9FNZa3nRFyD7gMq+AWLFCzoiQUst I4PsmuW6DNubTVVSD2lVluOffGTQ5QqS6KTsLXpyJq6uEgFccHIgaqYsHzt/ZjQRlacTLq uA9CuVkEQDEd5jHurDD82B0HEY1ibF/Jr1LUCn/2CANe0NtDVT2efaQRX4P9DxcpH2CBcK vHoF0/ihsizbkgn2jx5GLIilWi8KEK3K9d3QTt4bbOGBuiMUI3QfCzQWngh5ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393261; a=rsa-sha256; cv=none; b=l90G96+9OJV9bn6ZIY1W4Fu4PhBH8f5S12zg9GEcKeMPQiBusPv8gl087PuRgciY0vHyUt pGtuCke+XpzbFImDc1iEex3ir+eTLIrxX8JscMdJvUNqTz87bKljWmk1wrNv0nwYY+qH3I EHXZFh9o/GPAGYCSl10OhxIYlfNLuzdFqVfaltW3jkIJbWY+53IiABhNgoeW7Ezi/eE1o5 9ExVWStz4m+G++xMTBrdbJh6bOChg9heABBUkMwBAa635egcg+mAmA4HDFuF8otDK7zErZ UIfzPDDi586ETSdxOBUs+6y5Ilcbmz7rFzHlQatNJvH6DfJjXrZmTQtkE+5rjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9n5PPRz10ZW; Thu, 02 Oct 2025 08:21: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 5928L1JS024128; Thu, 2 Oct 2025 08:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928L1Ah024126; Thu, 2 Oct 2025 08:21:01 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:21:01 GMT Message-Id: <202510020821.5928L1Ah024126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 77e2ddc52c59 - stable/14 - nss_tacplus: Fix typo in Makefile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 77e2ddc52c59239d01d44383712bec90e7b8656d Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=77e2ddc52c59239d01d44383712bec90e7b8656d commit 77e2ddc52c59239d01d44383712bec90e7b8656d Author: Dag-Erling Smørgrav AuthorDate: 2025-10-02 07:24:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:58 +0000 nss_tacplus: Fix typo in Makefile Reported by: ivy@ MFC after: 3 days (cherry picked from commit e98d3416916cdb6285d4d1807582baf6faa3ddcc) --- lib/nss_tacplus/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nss_tacplus/Makefile b/lib/nss_tacplus/Makefile index f39788cfbdea..a969cd85778d 100644 --- a/lib/nss_tacplus/Makefile +++ b/lib/nss_tacplus/Makefile @@ -1,5 +1,5 @@ LIB= nss_tacplus -SRCS= ${LIB}.8 +SRCS= ${LIB}.c SHLIB_MAJOR= 1 SHLIB_NAME= ${LIB}.so.${SHLIB_MAJOR} LIBADD= tacplus From nobody Thu Oct 2 08:21:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccl9n2vwPz69KsQ; Thu, 02 Oct 2025 08:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccl9n1X2bz4NQX; Thu, 02 Oct 2025 08:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7Q5ZSTRPQTJvIqr9KG9qXcxUr9uOt9ZZOzCpdyTARk=; b=xFcE2NUsd3AsjHgHQ6Zk0C3LsxbFTuXMSJxbjMY7l0dNLTvzKcgmA7XBI7HX8PkrjfjItb DCS3WWolyLTrQnwu4vdRMfH1YddCd7gioM7Zv2+YqT5ob1YvUewzNRqXsftGmb/t7Prm99 Pb3FbOEZ71mpwrquXw6ei7Pn3wvXqfEQSgfy5M/yuF6WR4xGAYJFos4cYrToBwTd1/Bqxm Sik5SScO6+21gRxXoicznJxSpUYsTtAYSmS/gOjHykuihVXpCc5oTeI0rktp8Uf3k0/nkU 0IB1duc5MGmjFp77GST78ScyMhdkw0/0ujwn92t66qrePhnf+gi7741yvzo2+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759393261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7Q5ZSTRPQTJvIqr9KG9qXcxUr9uOt9ZZOzCpdyTARk=; b=bkVOn0+2Td5CbgFc3ZlNYYvZcokPFZ8dheSP/bkpOrhSl+YgonAdM8sND7OUCX7F/5DW9u TWXVPzwfX+h9E3rUZyYxwYCiSRMZN3c61eRLQuD5yqXJAQFqIGQyVcguYaJ97WlLUFjIWx yZbgWrfCFjYeWKUZyed3l3LWZ/MrKh3pVo9f3znTJN55R3XkytGWiXxlmVF6CqlIoCNVoR /WxY1eWf2SveuWE3WAPXU4hPG2vBVm8Ju+k+lXYCGvmorgbQUbUiGeGYG6c5ahzbp1K0SO py7rECPpwQk52bhzbh8m6/yK2YLY+sZfjz3FyFg84auD3LsSPi29J1bffZPilA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759393261; a=rsa-sha256; cv=none; b=EUG+qGslyJaSKl+MKMbgRYtg0d2Agg5oFZRhm9RS0zggzPzvkEY+8afHrf7LFtllAVTUEB +N44ncAstWpGFS0U1Lfm8Q9TSKjTn8aERYdiVOW/7a8HpcX+5GD4hBkqTXaukJ/MAp8I6D 8ZbpxyLpBzRouCOm2nEiVYeW5Ozm/2Od2ahFsvB62MmAffDMTxzZ1EqQM3lO82ZOquM/M7 Gp+m4XBHE8cDgqUL+v8OxrO4LoGxRnSEyXx8UKi9nviEzJyo5rdMzymx6mDO8ylPUhI8Cq TzF0S7Zb08/elzM8vWOPyqub2TRZNKhdzapH5SGVUtAhzQQDWi7TlftbGdXzSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccl9n1367z103S; Thu, 02 Oct 2025 08:21: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 5928L1OK024089; Thu, 2 Oct 2025 08:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5928L13i024086; Thu, 2 Oct 2025 08:21:01 GMT (envelope-from git) Date: Thu, 2 Oct 2025 08:21:01 GMT Message-Id: <202510020821.5928L13i024086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 01c9851772d1 - stable/13 - nss_tacplus: Fix typo in Makefile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 01c9851772d1961053ab8f170c145f9e04abf9ef Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=01c9851772d1961053ab8f170c145f9e04abf9ef commit 01c9851772d1961053ab8f170c145f9e04abf9ef Author: Dag-Erling Smørgrav AuthorDate: 2025-10-02 07:24:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-02 07:28:56 +0000 nss_tacplus: Fix typo in Makefile Reported by: ivy@ MFC after: 3 days (cherry picked from commit e98d3416916cdb6285d4d1807582baf6faa3ddcc) --- lib/nss_tacplus/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nss_tacplus/Makefile b/lib/nss_tacplus/Makefile index f39788cfbdea..a969cd85778d 100644 --- a/lib/nss_tacplus/Makefile +++ b/lib/nss_tacplus/Makefile @@ -1,5 +1,5 @@ LIB= nss_tacplus -SRCS= ${LIB}.8 +SRCS= ${LIB}.c SHLIB_MAJOR= 1 SHLIB_NAME= ${LIB}.so.${SHLIB_MAJOR} LIBADD= tacplus From nobody Thu Oct 2 13:33:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cct5p3lmfz69s04; Thu, 02 Oct 2025 13:33: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cct5p2qV0z44N7; Thu, 02 Oct 2025 13:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759411982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vNrXlKtREFbhTeeoIRnNh4TTfC0bVjTTjE1PzaX91ho=; b=is31MoI+0KLNvwXqTnvjDV1lViGY34XNPBTyXMhwGdVH1xPwMhgMinmcu38XXUsjsO1BC0 hZpvNDw2HS9qIl4uVOpX3WOFB/E8h02gM8HKz0O+uoLj1JFl6iKlWmps1JfZdZmyGBZw5T GSdIcDFfqXp1h6yjJc5dB1Yr6ls3Pot5ix31GphMPZb3YOi730mtpDYEuUO9IKdV9vpz8h Pz+24EOnbyrh6cl0s84G2bctO1igKjJDZWPmNVE0P5OKlYT2i2H9DXx6qJ1j/tSxrLQj55 yd0gg4QwgNHl+xHZydcyziEPZ6ILGCP6NfbSqXs0B5b1vl053UBRVdQC8Cs6CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759411982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vNrXlKtREFbhTeeoIRnNh4TTfC0bVjTTjE1PzaX91ho=; b=PjQZyTiLnCgmr/u8w/uIxdMtcZ67PLqx390K9EgL6HdYhKExghwhXK8/xXZXQ5STCaH1pB yE3/GEltn/jD+AJUe7MWcYLXTSiUC7eqi2bwbtlnIO9AaZm3ggTIOFbvWhdoWATn+vaN2A UuJ/dhWtp4jpOU8sXrSeKTfDXnXJhB60fidH3CuJ3zFcnB/VjpOWMVbm8ATixw9qSNZotS 1ikXFKARbqWizEoBAeo57q+iJXhyvS4CF6Y4MmnOeqVbVVP2euNHEQEENjKRqDc4wlL71x kasbbRjkCgFiBC3A5l9IQZAkY9xEPrNgCTBTa4mX0gnSM1aJY2MYkA3hyXiTOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759411982; a=rsa-sha256; cv=none; b=KJffVv64hYEi9mIKeImoAQgqz0CIbM0dyCsbFyagnrf6lVW1YGCgLFOOludj6mCR8uI/3+ rJRCr/bG2DCRdf17R3k89ReFC+Av3gA9IQ5qR7z+OL+9Fl8mEJMgNub5f8iH3aH6edhnom 0Jt88mAB5joD95HoKZ1I8oLAi7jbnVJJyiNF3qTOrOx92YTOP3Stj7MCEpEUGDIY1sjKxV SLbTbLRYw8PlgjwhlosUXlNTOrAaOE+Z18f3DCpeylzL9WAGItml8H0um5F0laXgOcPb7U d14TnvLCnJRlsa9L7IDY3UuLYbuMFdk9CfcLTjDMic0bX4Yma8WD/zWHf0T9LQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cct5p2QSPz18f9; Thu, 02 Oct 2025 13:33: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 592DX2n1035762; Thu, 2 Oct 2025 13:33:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592DX2ce035759; Thu, 2 Oct 2025 13:33:02 GMT (envelope-from git) Date: Thu, 2 Oct 2025 13:33:02 GMT Message-Id: <202510021333.592DX2ce035759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 61a7d5d9bf2e - stable/15 - pkgbase: move ncurses into its own package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 61a7d5d9bf2e0543f314820558f8d7c59a39feb5 Auto-Submitted: auto-generated The branch stable/15 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=61a7d5d9bf2e0543f314820558f8d7c59a39feb5 commit 61a7d5d9bf2e0543f314820558f8d7c59a39feb5 Author: Kyle Evans AuthorDate: 2025-09-30 12:21:33 +0000 Commit: Kyle Evans CommitDate: 2025-10-02 13:32:32 +0000 pkgbase: move ncurses into its own package Pushing ncurses into clibs adds extra upgrade risk to a package that otherwise consists of integral libs with non-trivial interdependencies. Adding it to -runtime was considered, but the move was historically motivated to some extent by allowing a much smaller set of base libs to be installed for smaller VM images that don't really need all of the runtime package. This also fixes the ncurses build to ensure that libmenuw is grouped with the rest of the ncurses libraries, which doesn't seem to have been an intentional omission. Reviewed by: ivy (cherry picked from commit 06afa0a55e0acc00823f08fe17305df13502f235) (cherry picked from commit df74ea7f41090f38d9fa1c739029b135cd199a45) --- lib/ncurses/Makefile.inc | 1 + lib/ncurses/form/Makefile | 1 - lib/ncurses/ncurses/Makefile | 1 - lib/ncurses/panel/Makefile | 1 - lib/ncurses/tinfo/Makefile | 1 - release/packages/ucl/ncurses-all.ucl | 19 +++++++++++++++++++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/ncurses/Makefile.inc b/lib/ncurses/Makefile.inc index f2ed84e2e38f..eea49908474c 100644 --- a/lib/ncurses/Makefile.inc +++ b/lib/ncurses/Makefile.inc @@ -1,5 +1,6 @@ # This is to include src/lib/Makefile.inc +PACKAGE?= ncurses WARNS?= 3 .include "../Makefile.inc" diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile index d4774a5f51a8..7d8963b05ae8 100644 --- a/lib/ncurses/form/Makefile +++ b/lib/ncurses/form/Makefile @@ -3,7 +3,6 @@ SRCDIR= ${NCURSES_DIR}/form -PACKAGE= clibs LIB= formw SHLIB_MAJOR= 6 diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 512a452ad6d0..b60760281b39 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -1,4 +1,3 @@ -PACKAGE= clibs SHLIBDIR?= /lib .include diff --git a/lib/ncurses/panel/Makefile b/lib/ncurses/panel/Makefile index a51129df42e3..dfb478aa5f5b 100644 --- a/lib/ncurses/panel/Makefile +++ b/lib/ncurses/panel/Makefile @@ -3,7 +3,6 @@ SRCDIR= ${NCURSES_DIR}/panel -PACKAGE= clibs LIB= panelw SHLIB_MAJOR= 6 diff --git a/lib/ncurses/tinfo/Makefile b/lib/ncurses/tinfo/Makefile index 476df54bb72a..8f01557edaee 100644 --- a/lib/ncurses/tinfo/Makefile +++ b/lib/ncurses/tinfo/Makefile @@ -1,4 +1,3 @@ -PACKAGE= clibs SHLIBDIR?= /lib .include diff --git a/release/packages/ucl/ncurses-all.ucl b/release/packages/ucl/ncurses-all.ucl new file mode 100644 index 000000000000..c0d52e046e78 --- /dev/null +++ b/release/packages/ucl/ncurses-all.ucl @@ -0,0 +1,19 @@ +/* + * Copyright 2018-2023,2024 Thomas E. Dickey + * Copyright 1998-2017,2018 Free Software Foundation, Inc. + * + * SPDX-License-Identifier: X11 + * + * See contrib/ncurses/COPYING for the full license text. + */ + +comment = "ncurses terminal control library" +desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 4ca234b87a5d - stable/15 - pkgbase: move libedit into the -runtime package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 4ca234b87a5d6cd29cef37411c7e7a1e8b0f4df3 Auto-Submitted: auto-generated The branch stable/15 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4ca234b87a5d6cd29cef37411c7e7a1e8b0f4df3 commit 4ca234b87a5d6cd29cef37411c7e7a1e8b0f4df3 Author: Kyle Evans AuthorDate: 2025-09-30 12:21:34 +0000 Commit: Kyle Evans CommitDate: 2025-10-02 13:32:53 +0000 pkgbase: move libedit into the -runtime package libedit isn't as foundational as the rest of -clibs, but various bits of -runtime do need it. Give it a new home over in -runtime. This also fixes the libedit build to group the readline bits into the same package as the libedit that implements them. Reviewed by: ivy (cherry picked from commit 5e4e12ae64b3e0377984d22610a6b3d6ccd6cee6) --- lib/libedit/Makefile | 3 +-- lib/libedit/Makefile.inc | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index f0254c1f42bc..c7a54253dae9 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -1,7 +1,5 @@ # $NetBSD: Makefile,v 1.56 2016/03/02 19:24:20 christos Exp $ -PACKAGE=clibs - EDITDIR= ${SRCTOP}/contrib/libedit .PATH: ${EDITDIR} @@ -93,6 +91,7 @@ tc1.o: ${EDITDIR}/TEST/tc1.c test: tc1.o libedit.a ${DPADD} ${LIBTERMCAP} ${CC} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} +.include "Makefile.inc" .include CWARNFLAGS.chartype.c= ${NO_WUSE_AFTER_FREE} diff --git a/lib/libedit/Makefile.inc b/lib/libedit/Makefile.inc new file mode 100644 index 000000000000..9ec65b0d266f --- /dev/null +++ b/lib/libedit/Makefile.inc @@ -0,0 +1 @@ +PACKAGE?=runtime From nobody Thu Oct 2 15:15:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccwNL0j11z69LMf; Thu, 02 Oct 2025 15:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccwNK5wzlz3Pl7; Thu, 02 Oct 2025 15:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759418145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jIFjw87wQsNCzPZJ6tQkpc2z2zyHkXo7rWrHQZOHUWQ=; b=PkvnUw2GJ5FSiPRmZH0xc5hEXzJpU16JxDKL52qDGj69XE8AVfFGG0ehe4j5LE19+J697c Y2ohf7qw8LRG3qzTVhx/hoTHCIiihiQZCF1L8LtZr4n2xE2sbhY7XnLH5+XmZHywk9/nRA a/ecfNwEUh8byG8SJN2q6KmC8xyDi+7aQrecW0cu5W5g/YRlOcVEQQho8M00b1scOVPGIv X4k/Cg0BAyeh+ZLmVBM3nTuiKHJDNc9DZe78BR7nuzjxi341ZNAEVx2F7nGyGZV0p8T3bU dwSDe/atg2DiJDyHTRRV0fFSDEikaQklfQluBZlKCGGAxSxah1+94KnmK1oYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759418145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jIFjw87wQsNCzPZJ6tQkpc2z2zyHkXo7rWrHQZOHUWQ=; b=qmkZlLoqPO0w61ip7GuiFu5kuXyGJC4Tan+ZvrTzvemO4ksaR6Lf331ftJ1MRIsIYDBiol g4QO70OosB2lLB7g74dl3SpV9UcUwT2PhBuVy02oB3Zuvmy4QNI49lmK758FQNxubrtOrf NTy92JzM9Q1NiP1zo2b1k695itIekXRTVEJpq3Hm02BWoMN7h8j0eHBLeWXF0z8V+1ZflM z0Ggua7S7Lvu1iykp3cOFOQQijPp83N/HKwT/5XVV2oEsU8Hrf1p40s0CtEkA0f8JUkuzs HHYIqX53uPiiGQbMn80lPDlR7kqb3xG67rpwSTUhcDKlQWkgd1Cv5lb2ZO0b8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759418145; a=rsa-sha256; cv=none; b=J+Ijj/3sBpE6ZCdXYYv5j3SNk/WY1I0utRVFTmE6NUJrTUkrjIkSdEYyU6YWOQ1Gir+JUo HcQDgfPubkA0ez9EubJ3BNAda5KATii43/eS92Gu6thrcpK79E7ok6agu2mKDJxF9dHJX9 jZOMTbOZ6Zr4bxZRT+6k0pDBW1q/SKgv4NCjo6H9XflKCdxvRN+H8w5MKQEjVgOnmLGdxN eHCfYuEqvFUk1jdFNp8GCDKA3kHGsXv2EpuJOvwp/D3QAmlJwuWgb25u4/tFUZgmm3ChoU ie6x7izI/RXq9Kj+tPGORehMY2HUOb6VveYv2eWhSWZzrs5l+cpelPVArgTpGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccwNK5X9vz1CV5; Thu, 02 Oct 2025 15:15: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 592FFjCM031559; Thu, 2 Oct 2025 15:15:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592FFjgv031556; Thu, 2 Oct 2025 15:15:45 GMT (envelope-from git) Date: Thu, 2 Oct 2025 15:15:45 GMT Message-Id: <202510021515.592FFjgv031556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: b81bc40741f3 - stable/15 - mmcsd.4: s/DESCRIPTION/HARDWARE + HISTORY + SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b81bc40741f3d43a7708df2ab6d624fb10804635 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b81bc40741f3d43a7708df2ab6d624fb10804635 commit b81bc40741f3d43a7708df2ab6d624fb10804635 Author: Alexander Ziaee AuthorDate: 2025-10-02 14:55:18 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 15:15:19 +0000 mmcsd.4: s/DESCRIPTION/HARDWARE + HISTORY + SPDX This manual only describes a tiny amount suitable for the HW Relnotes. Remove the description section and replace it with a hardware section which will appear there. MFC after: 3 minutes Reported by: ivy History Ref: 5bcb64f20afff21be511cc5 (Add mmc and mmcsd) (cherry picked from commit 0c1c81c479bef8d3e67f93ea00fc5d34ccf5af33) --- share/man/man4/mmcsd.4 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/share/man/man4/mmcsd.4 b/share/man/man4/mmcsd.4 index 7466bc546b91..07d7e963b596 100644 --- a/share/man/man4/mmcsd.4 +++ b/share/man/man4/mmcsd.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2007 M. Warner Losh .\" .\" Redistribution and use in source and binary forms, with or without @@ -21,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 10, 2021 +.Dd October 2, 2025 .Dt MMCSD 4 .Os .Sh NAME @@ -29,7 +31,7 @@ .Nd MMC and SD memory card driver .Sh SYNOPSIS .Cd device mmcsd -.Sh DESCRIPTION +.Sh HARDWARE The .Nm driver implements direct access block device for MMC and SD memory cards. @@ -42,3 +44,8 @@ driver implements direct access block device for MMC and SD memory cards. .Rs .%T "The MultiMediaCard System Specification" .Re +.Sh HISTORY +The +.Nm +driver appeared in +.Fx 7.0 . From nobody Thu Oct 2 15:15:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccwNM0q3Lz69LSy; Thu, 02 Oct 2025 15:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccwNL6jmnz3PTB; Thu, 02 Oct 2025 15:15:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759418146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0eYa22NPuP79ZsTrjWuWDTZoRuPEy1mvhfOBVtIWWMw=; b=cl7sENb1eh7PeiBXJfFKpzWZnS8d1DmWkmCfPA8jntO3rgkVocKC7NOWK+pQ/hJswxfaRi NSKAHM9ejx/0mt8u20XrZs3QMDV/p+K8XphVQEyV64wSNeepkttkaacrvrkAm3kuMFGMgR jNT23ZN59HASDSVqhObRw5n/wD2F+WKrwQT3NtdXIpsbo1AB3cNfbTSiebGyrznCkF4yFy PF/Vwav0fe5nNo+TREXGxNxHwTtOPCwi7op91sJEwvvGEOYG+CAIqTQ0vBs0vvLwh8dnhE Eua9G+GXvpRCJdUw+OxHICOJOC38jvVleKNhodYdY5mK/iIUuT0fOaDtkjIdRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759418146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0eYa22NPuP79ZsTrjWuWDTZoRuPEy1mvhfOBVtIWWMw=; b=e6DhPrlZZtVzxwY7M8bCb+5RI9tTCruGgsMyb+ClWkLM9awKuKQ60Ok3W+LtB3aTGxX1Ut eHO6r7mhZziOhaefUCklCveObznsoaFWqRd8JZ6tWQrehTn1tTbhpB6XMzdbLT/9FlR3Le 9+PlgTJeUHsO93IvUTUWoivKA7ITTToR6bL0FUwWcp6PVcbGORfbENjAwkxb5LExyeRbmK rLnwmf2Ri2jxOpseN50bZsx6JnvV0+qI3iUF8stIftwWn3d5PGggF9nesLXPJTYWGHXbQs Mddr4dSTK7Yos7swPmyFw8KJ2jXJOC3Dw/zDLNTUWbCUeVN5XeZC8tTIWt9owA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759418146; a=rsa-sha256; cv=none; b=dL53JnGLdoeSt8f6C9UZMdfFKZfHWqxZhpyseTcv93tm37OXeZMt0Dnz0ho21Ln2uELQn1 hgo8n5pLFZymWGUcw+OuVk0z1fh2PtAthr5+ru5JgWj1SytmwIZsixi3VSX8dVtBWxANqc 6n0ZjfQfAJxPIpOWhCN2tXAi4IkYIgYRSQ+lavjc6ylKr2Xbr+dxl5KsK7ayabeGWM8fqL ZtE1oGybW5eJLbrsFnYui1O6h+gju0koY7h2V5wTbXNPjeGmI6Z2sUQHI5Z+8UVuqVWwpl 0bAvzIEHxnuwN+10ajNUB1Df6KiVnb7DoxHGdzZ66NqIFMwLOT6wlncWKnkZsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccwNL6Ckwz1BZy; Thu, 02 Oct 2025 15:15: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 592FFkcN031597; Thu, 2 Oct 2025 15:15:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592FFkdA031594; Thu, 2 Oct 2025 15:15:46 GMT (envelope-from git) Date: Thu, 2 Oct 2025 15:15:46 GMT Message-Id: <202510021515.592FFkdA031594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 3ae6c9735014 - stable/15 - thunderbolt.4: Initial manual for HW Relnotes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3ae6c9735014f8c6f8cc1d9acd8e8c6316296b61 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3ae6c9735014f8c6f8cc1d9acd8e8c6316296b61 commit 3ae6c9735014f8c6f8cc1d9acd8e8c6316296b61 Author: Alexander Ziaee AuthorDate: 2025-10-02 12:05:25 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 15:15:19 +0000 thunderbolt.4: Initial manual for HW Relnotes This manual contains nothing and is only suitable for the HW Relnotes, but lets get it in so we have something and then can iterate on it. MFC after: 3 minutes Fixes: 2ed9833791f2 (thunderbolt: Import USB4 code) Discussed with: obiwac Differential Revision: https://reviews.freebsd.org/D52847 (cherry picked from commit 2f7a796b590e67c5d123f2b00b3aaf7ba7a32a13) --- share/man/man4/Makefile | 1 + share/man/man4/thunderbolt.4 | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index f5d7a0e081fc..6e076722c786 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -589,6 +589,7 @@ MAN= aac.4 \ tdfx.4 \ termios.4 \ textdump.4 \ + thunderbolt.4 \ ti.4 \ timecounters.4 \ tmpfs.4 \ diff --git a/share/man/man4/thunderbolt.4 b/share/man/man4/thunderbolt.4 new file mode 100644 index 000000000000..3477c11fb60d --- /dev/null +++ b/share/man/man4/thunderbolt.4 @@ -0,0 +1,22 @@ +.\" +.\" Copyright (c) 2025 Alexander Ziaee +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd October 2, 2025 +.Dt THUNDERBOLT 4 +.Os +.Sh NAME +.Nm thunderbolt +.Nd USB4 controller driver +.Sh SYNOPSIS +.Cd device thunderbolt +.Sh HARDWARE +The +.Nm +driver supports USB4 controllers. +.Sh HISTORY +The +.Nm +driver appeared in +.Fx 15.0 . From nobody Thu Oct 2 15:56:06 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccxH9408Nz69QWh for ; Thu, 02 Oct 2025 15:56:21 +0000 (UTC) (envelope-from obiwac@gmail.com) Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (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 4ccxH86f6Cz3XSt for ; Thu, 02 Oct 2025 15:56:20 +0000 (UTC) (envelope-from obiwac@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-642d3310780so559205eaf.0 for ; Thu, 02 Oct 2025 08:56:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759420579; x=1760025379; 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=zELqeOj/IBgOZ2hupFtmUyq/JX6AGE8wqbxMY3CaYRo=; b=FSAyPNTyjWNDj8u5flWmE6Bck+apAdCo/+6GMPNPicYoVrJPyrwTdsoUI/Xn0M4hji g6dc+UdelV659EOH1PJCg9KnVXjEkOaf4E61WChRaqgN7QddWxuVzLuE1RBqicgULlrE 2lb78BnwC9RPyTCO4jJEBSmNxseVCvYysYjZZmUq+7JazAGw6Wsz+afxVMADaMix+wSn ZvjkL4pEyZ2U9HPY0Z2JksCPdvhwK+VAOYdAzAI0HomFJ8TBy9essFX6nL7Qkom88BU/ RbOkfsJJZkU0jYjiaiMOG9M2j6HPQle7snTB/bPazBbKDdfZqVHcin/j12k/PPh2YJ+V tm0g== X-Forwarded-Encrypted: i=1; AJvYcCVA7Z2uWJPefAxXiiq6imFp3jLKXLM6K+xB9D+5I7D9QH4SjKaZBOCxYNzZO8K6RHrFqXMSryCHTWs720XcdRDoeaFisiJL6X0=@freebsd.org X-Gm-Message-State: AOJu0YzPKQRt0jD0rIUOi3KztrxzGdt1QM2TXXsnqiKJDQptwvbqfh2S nlX3UXdu9vG6DEaemtbhPzKH/l3AF/GpUc4q2V20so1bGJVGB9PhwzBmvdODZL3pJNA= X-Gm-Gg: ASbGncvaEqIk2CM2+sPpMH2dOhJlia+jPP3DzIRo7cIweTRRKhKEGdq1+tz6kiFLFQ/ 1DMfZ4uvI8NpVqjpC4pl+epdIO9XecRySEOBRuIgo1TrJeGa+dNIbg+2bgX5TBr35v14H5Go/C8 6lbZjogB1qlnesY9x9RUbsYkCyCg6PTBlkwh3SY6dZ18sAPIHZs5255VjFp8WuOU+10Nz0TEK2k OBpwBaQUSoWxeYlLTipaNKdH7rNCYEPtyZRhUhRyAlFX3GRk4mlVMIr87Znr50taD5sIYboW/NK xGVp5SB75t+utHaExIdQVe7cEFUHuhQF34TLGbhnfIWbthbsJ4EAmGpy8VQnMCdspU9GhSe7sQn ktzvL9LASmwSRfVdH4cBrPWWWRKmu5AI0tUybDT4q40ihLOUtqSE59wBybXvNYrcrMulIDcw= X-Google-Smtp-Source: AGHT+IHBCZryLB7Vxx/3FQxdLxyTeemetlFzqpjmI+yRxLncPOFD0UbX561gbnT63b+XvNH6eAXFYQ== X-Received: by 2002:a05:6820:4901:b0:63f:3fc8:574 with SMTP id 006d021491bc7-64e033c76fdmr1493185eaf.3.1759420578693; Thu, 02 Oct 2025 08:56:18 -0700 (PDT) Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-64e18ce451csm534243eaf.9.2025.10.02.08.56.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Oct 2025 08:56:18 -0700 (PDT) Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-647588475c6so567664eaf.1 for ; Thu, 02 Oct 2025 08:56:18 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUe307nGxzydGVOMrG05uz/cubpgyQMj+ueHwQYNes4QAKh2cm6EEy2vbH+SWGJjTMxXXWOxHWOaEiIZCGRywibZoGSBhBZ71o=@freebsd.org X-Received: by 2002:a05:6808:4f12:b0:439:9f9c:8021 with SMTP id 5614622812f47-43fb15cb880mr2192732b6e.25.1759420578304; Thu, 02 Oct 2025 08:56:18 -0700 (PDT) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 References: <202510021515.592FFkdA031594@gitrepo.freebsd.org> In-Reply-To: <202510021515.592FFkdA031594@gitrepo.freebsd.org> From: Aymeric Wibo Date: Thu, 2 Oct 2025 17:56:06 +0200 X-Gmail-Original-Message-ID: X-Gm-Features: AS18NWAGkjJsLjsaMRBtgYJxOb2TPfzLCJWdw9e3WFHdfj-MIx6R3mbtEkWPUco Message-ID: Subject: Re: git: 3ae6c9735014 - stable/15 - thunderbolt.4: Initial manual for HW Relnotes To: Alexander Ziaee Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Bar: ---- 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] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4ccxH86f6Cz3XSt History section is still incorrect, no? On Thu, 2 Oct 2025 at 17:15, Alexander Ziaee wrote: > > The branch stable/15 has been updated by ziaee: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3ae6c9735014f8c6f8cc1d9acd8e8c6316296b61 > > commit 3ae6c9735014f8c6f8cc1d9acd8e8c6316296b61 > Author: Alexander Ziaee > AuthorDate: 2025-10-02 12:05:25 +0000 > Commit: Alexander Ziaee > CommitDate: 2025-10-02 15:15:19 +0000 > > thunderbolt.4: Initial manual for HW Relnotes > > This manual contains nothing and is only suitable for the HW Relnotes, > but lets get it in so we have something and then can iterate on it. > > MFC after: 3 minutes > Fixes: 2ed9833791f2 (thunderbolt: Import USB4 code) > Discussed with: obiwac > Differential Revision: https://reviews.freebsd.org/D52847 > > (cherry picked from commit 2f7a796b590e67c5d123f2b00b3aaf7ba7a32a13) > --- > share/man/man4/Makefile | 1 + > share/man/man4/thunderbolt.4 | 22 ++++++++++++++++++++++ > 2 files changed, 23 insertions(+) > > diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > index f5d7a0e081fc..6e076722c786 100644 > --- a/share/man/man4/Makefile > +++ b/share/man/man4/Makefile > @@ -589,6 +589,7 @@ MAN= aac.4 \ > tdfx.4 \ > termios.4 \ > textdump.4 \ > + thunderbolt.4 \ > ti.4 \ > timecounters.4 \ > tmpfs.4 \ > diff --git a/share/man/man4/thunderbolt.4 b/share/man/man4/thunderbolt.4 > new file mode 100644 > index 000000000000..3477c11fb60d > --- /dev/null > +++ b/share/man/man4/thunderbolt.4 > @@ -0,0 +1,22 @@ > +.\" > +.\" Copyright (c) 2025 Alexander Ziaee > +.\" > +.\" SPDX-License-Identifier: BSD-2-Clause > +.\" > +.Dd October 2, 2025 > +.Dt THUNDERBOLT 4 > +.Os > +.Sh NAME > +.Nm thunderbolt > +.Nd USB4 controller driver > +.Sh SYNOPSIS > +.Cd device thunderbolt > +.Sh HARDWARE > +The > +.Nm > +driver supports USB4 controllers. > +.Sh HISTORY > +The > +.Nm > +driver appeared in > +.Fx 15.0 . From nobody Thu Oct 2 16:05:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccxV83rRnz69R2q for ; Thu, 02 Oct 2025 16:05:52 +0000 (UTC) (envelope-from ziaee@runbox.com) Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [IPv6:2a0c:5a00:149::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccxV80gY3z3YJ7; Thu, 02 Oct 2025 16:05:51 +0000 (UTC) (envelope-from ziaee@runbox.com) Authentication-Results: mx1.freebsd.org; none Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1v4LoN-00Fl5Q-1V; Thu, 02 Oct 2025 18:05:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector1; h=Message-Id:In-Reply-To:Date:Subject:CC:To:From:MIME-Version: Content-Transfer-Encoding:Content-Type; bh=dzhosb8s6sCr76mKemjJMHbPvH/kYaGKXWFYm6TfYrs=; b=Xru63YcdaZbHANTFuLOOXaENvW WFR3VfPV3FHUBXPWH/paZjuSQcPWed4gRoJTv4QpYXC7+H+8SRAm3xipeMbtumiBavVaEF4a8Nwfg c1wuwCeONKDi60li/yadBaBjR3reyW/YTOmWk+0ojJnjfyobV6/kmHpz0040xeeijDMj1HloEs78o umuDcsXwOXHaslUcRCRu5PtodNCaJEb6KwqlSq78VFG/3F24TKGWJL3CIoPFJsiT/jSNJY2xgB3A5 5iNI506UyIZfOH1nhIgyC0FqpB6bsleMFRYp1w9YDeVsgkz4twZsdFHOkSBrqnwHyZQnhSpfj44mB OuObRkaw==; Received: from [10.9.9.128] (helo=rmmprod06.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1v4LoK-00016g-LJ; Thu, 02 Oct 2025 18:05:41 +0200 Received: from mail by rmmprod06.runbox with local (Exim 4.86_2) (envelope-from ) id 1v4LoK-0007L5-Iq; Thu, 02 Oct 2025 18:05:40 +0200 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Received: from [Authenticated alias (1191889)] by runbox.com with http (RMM6); Thu, 02 Oct 2025 16:05:40 GMT From: "Alexander Ziaee" To: "Aymeric Wibo" , "Alexander Ziaee" CC: "src-committers" , "dev-commits-src-all" , "dev-commits-src-branches" Subject: Re: git: 3ae6c9735014 - stable/15 - thunderbolt.4: Initial manual for HW Relnotes Date: Thu, 02 Oct 2025 16:05:40 +0000 (UTC) X-RMM-Aliasid: 1191889 X-Mailer: RMM6 In-Reply-To: Message-Id: X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4ccxV80gY3z3YJ7 On 2025-10-02 11:56 -04:00 EDT, "Aymeric Wibo" wrote: > History section is still incorrect, no? Maybe. I thought you said "This driver was committed before stable/15 was b= ranched off", meaning it is in 15.0, which is why I committed it immediatel= y so that in the beta it is discoverable with apropos. If it's wrong, I'm happy to fix it immediately. Best, Alex > On Thu, 2 Oct 2025 at 17:15, Alexander Ziaee wrote: >> >> The branch stable/15 has been updated by ziaee: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D3ae6c9735014f8c6f8cc1d9ac= d8e8c6316296b61 >> >> commit 3ae6c9735014f8c6f8cc1d9acd8e8c6316296b61 >> Author: Alexander Ziaee >> AuthorDate: 2025-10-02 12:05:25 +0000 >> Commit: Alexander Ziaee >> CommitDate: 2025-10-02 15:15:19 +0000 >> >> thunderbolt.4: Initial manual for HW Relnotes >> >> This manual contains nothing and is only suitable for the HW Relnote= s, >> but lets get it in so we have something and then can iterate on it. >> >> MFC after: 3 minutes >> Fixes: 2ed9833791f2 (thunderbolt: Import USB4 code) >> Discussed with: obiwac >> Differential Revision: https://reviews.freebsd.org/D52847 >> >> (cherry picked from commit 2f7a796b590e67c5d123f2b00b3aaf7ba7a32a13) >> --- >> share/man/man4/Makefile | 1 + >> share/man/man4/thunderbolt.4 | 22 ++++++++++++++++++++++ >> 2 files changed, 23 insertions(+) >> >> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile >> index f5d7a0e081fc..6e076722c786 100644 >> --- a/share/man/man4/Makefile >> +++ b/share/man/man4/Makefile >> @@ -589,6 +589,7 @@ MAN=3D aac.4 \ >> tdfx.4 \ >> termios.4 \ >> textdump.4 \ >> + thunderbolt.4 \ >> ti.4 \ >> timecounters.4 \ >> tmpfs.4 \ >> diff --git a/share/man/man4/thunderbolt.4 b/share/man/man4/thunderbolt.4 >> new file mode 100644 >> index 000000000000..3477c11fb60d >> --- /dev/null >> +++ b/share/man/man4/thunderbolt.4 >> @@ -0,0 +1,22 @@ >> +.\" >> +.\" Copyright (c) 2025 Alexander Ziaee >> +.\" >> +.\" SPDX-License-Identifier: BSD-2-Clause >> +.\" >> +.Dd October 2, 2025 >> +.Dt THUNDERBOLT 4 >> +.Os >> +.Sh NAME >> +.Nm thunderbolt >> +.Nd USB4 controller driver >> +.Sh SYNOPSIS >> +.Cd device thunderbolt >> +.Sh HARDWARE >> +The >> +.Nm >> +driver supports USB4 controllers. >> +.Sh HISTORY >> +The >> +.Nm >> +driver appeared in >> +.Fx 15.0 . >=20= From nobody Thu Oct 2 16:42:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyHs21CFz69WJs; Thu, 02 Oct 2025 16:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyHs1LRgz3jrn; Thu, 02 Oct 2025 16:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g0Lhjn59Sa5s76+qQr5m8mxJjHMr9AOH2Y+eY/UsW2o=; b=fCPvlwMUKszsQak3JYPxhCfmEEb5demfAVnMaPa/ut0yo9+yquSiJrf/CNLfaDctm9u27w Qebnr12gNebF6mM3Kh9miycsn9qtfg/gPvk8YPZAyFOG2gZoYmQHjRSD0tCuh6exzTDoYJ iraxeKg5MHsYWprRDMiHwCYU1mij7GiasfHHgDl9NEiznP/O7Y3gdfKlhs6b2vPlcDt1tu u0qyRuUuoe/2ypDgWP51LHd5GrVLfPxlIxS90Co5Ntv4+yxhPVPbgPW9ickrT7X61ddl9Z zzSRO5npXwxYoxwYw0leSWrXx/28WRwHgn3hs/w32avop8YeLAmcr7pPctzj4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g0Lhjn59Sa5s76+qQr5m8mxJjHMr9AOH2Y+eY/UsW2o=; b=wC7VC9z2cKv70JE703ys0U8Bofsbvh4ipB5++l8uWAr1Y7981vBoupjyjlc10KPz+ufpU+ Vevqy42GrG7baI8sHNwmS6OeQBkxFBFL8kBqak90l8jALJA7Y/Yv0RtPcX/R0PZ/eBEXMl JY8BaJEX2OXs5Kau1+2yW+/uRwW5gxAm+niXI//7FclYeiemROW3422wtwJumGK83aqrCX 6OfwVnTZ0taFp6kXGo3KRxofyt3xxWSfOM6PaSOszAJi2N/rU7wWF5ROdIIFWyxF+G/yJd RJX9lXC9ziYZjHGXCQM3oFv5nn0rMrvvLgRWxL9ZulLpDAKhWkynmAimi92+PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759423321; a=rsa-sha256; cv=none; b=RtvjgHEIRzAUTm2DfPFvYS4n5Dpsilz/R3p0Li5QVr/AF4X85ZkesA3B9XzfFVY/yFUJyz hP11B9W+OmTLPvCMcxPselq4UOz5oUttj+jmG1KeEvY5mN0oYzWbLXx4mcDH9r95iA8/64 vqLTAEKOWtUQddP4Borys0SostUZ3KRbBrJNIbCnaMRrClbn3NCC0QhYLyWpX30UmgivCz yat7AGWueo2zFgyu4YaO/6Lj4ho/VeajmJYCmYVLK90wBWd+6hEb1+G/dBU/Xoc1pbav23 5sjmOw/GJF9AtczZYyxFQoZqvafxCGjxQPbSxPhdGBFejNiulCCyKo3PRkEb2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyHs0fvSz1p7; Thu, 02 Oct 2025 16:42: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 592Gg1a1003657; Thu, 2 Oct 2025 16:42:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592Gg18C003654; Thu, 2 Oct 2025 16:42:01 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:42:01 GMT Message-Id: <202510021642.592Gg18C003654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2acabc7318ac - stable/14 - hkbd: remove error detection in KDSKBSTATE ioctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2acabc7318ac47401e078de28e7b89a38b356cb9 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2acabc7318ac47401e078de28e7b89a38b356cb9 commit 2acabc7318ac47401e078de28e7b89a38b356cb9 Author: ShengYi Hung AuthorDate: 2025-08-21 17:59:15 +0000 Commit: Ed Maste CommitDate: 2025-10-02 16:41:17 +0000 hkbd: remove error detection in KDSKBSTATE ioctl The KDSKBSTATE ioctl brings the LED up. However, some keyboards (like qemu keyboard) may not have LED or failed to set the LED due to unexpected reason. Therefore, removing the error check as ukbd(4) does allow the keyboard works correctly with kbdcontrol(4). Also move hw.hid.hkbd.no_leds sysctl out of HID_BUG thus users can disable setting LEDs PR: 288968 Reviewed by: wulf Tested by: trashcan@ellael.org, marklmi26-fbsd@yahoo.com, trkellers@gmail.coom Approved by: lwsu (mentor), markj (mentor) MFC after 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52101 (cherry picked from commit 1685192ea1faac28f2d4feede53e70b6a380500f) (cherry picked from commit 6ea7e1f92882706cc8818a13e8bd55b7d2f48e27) --- sys/dev/hid/hkbd.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sys/dev/hid/hkbd.c b/sys/dev/hid/hkbd.c index 5eff7557bc42..6255c42d3b62 100644 --- a/sys/dev/hid/hkbd.c +++ b/sys/dev/hid/hkbd.c @@ -95,14 +95,16 @@ #ifdef HID_DEBUG static int hkbd_debug = 0; +#endif static int hkbd_no_leds = 0; static SYSCTL_NODE(_hw_hid, OID_AUTO, hkbd, CTLFLAG_RW, 0, "USB keyboard"); +#ifdef HID_DEBUG SYSCTL_INT(_hw_hid_hkbd, OID_AUTO, debug, CTLFLAG_RWTUN, &hkbd_debug, 0, "Debug level"); +#endif SYSCTL_INT(_hw_hid_hkbd, OID_AUTO, no_leds, CTLFLAG_RWTUN, &hkbd_no_leds, 0, "Disables setting of keyboard leds"); -#endif #define INPUT_EPOCH global_epoch_preempt @@ -1596,8 +1598,16 @@ hkbd_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) sc->sc_state &= ~LOCK_MASK; sc->sc_state |= *(int *)arg; - /* set LEDs and quit */ - return (hkbd_ioctl_locked(kbd, KDSETLED, arg)); + /* + * Attempt to set the keyboard LEDs; ignore the return value + * intentionally. Note: Some hypervisors/emulators (e.g., QEMU, + * Parallels—at least as of the time of writing) may fail when + * setting LEDs. This can prevent kbdmux from attaching the + * keyboard, which in turn may block the console from accessing + * it. + */ + (void)hkbd_ioctl_locked(kbd, KDSETLED, arg); + return (0); case KDSETREPEAT: /* set keyboard repeat rate (new * interface) */ @@ -1766,10 +1776,8 @@ hkbd_set_leds(struct hkbd_softc *sc, uint8_t leds) SYSCONS_LOCK_ASSERT(); DPRINTF("leds=0x%02x\n", leds); -#ifdef HID_DEBUG if (hkbd_no_leds) return (0); -#endif memset(sc->sc_buffer, 0, HKBD_BUFFER_SIZE); @@ -1820,6 +1828,7 @@ hkbd_set_leds(struct hkbd_softc *sc, uint8_t leds) SYSCONS_UNLOCK(); error = hid_write(sc->sc_dev, buf, len); SYSCONS_LOCK(); + DPRINTF("error %d", error); return (error); } From nobody Thu Oct 2 16:43:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyKt3brbz69WtH; Thu, 02 Oct 2025 16:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyKt3HX8z3kg1; Thu, 02 Oct 2025 16:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tGvu1zui8Y0A+hPJxRO6VUkG49f1uVIrq6AP198eJn4=; b=hOSnUPJBpNJuvIEf5p5Hozm4JI43uKFlbaAy73mObYDaNQnwC5CGvkbGRaIkUjCisX5Qdf uUwZFWOjPkH6gAYBfFzFrAZRkx2SRc6opnEcC4H89ByOUqKrDc7BQ6GpvEd+cR62i0S/Ub TN9TnEZytHrcuNU4yx35iLk5ieCfGLlrIWiksfgvoJkEtKGAH8VjAs36x2dzYPi8SZSaTD u0v93XyUqdPG2uIGzcu7tD2z3b9dRlJJeEBZbnW+X4UApu02q/x0dpG6gTLc5oZI5y7t3t chqpcrEWCVSv+vkyWg4CW1F6F59g1EGS8JNpUVrzB4ErHwjRgIGJHwoIyhSAsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tGvu1zui8Y0A+hPJxRO6VUkG49f1uVIrq6AP198eJn4=; b=O1+NPA+b/Ej5Em9FXoRvx6fmI0C6L8qPOulemnC90zDFm3lWFA5h/84uIirtklGhPOmP8L eDYRgPNcg9Pf0A/8k81vqx9iRZnK/Wz5ZjvQLY4kIlQgP6hzfYFpcZroPEkysbtofYLGN3 9iakk/8WMhcUAwBJzdCX0ackHfPqk8alPXiizj5JaxS8XnDYq3uMMskxmXd2bcl4X+4HPG bTK595nraKOoaVgPxwzo7hb4Ip1d7xl2+A75WKNSEV0QQZ+Dz4OET+sic63xgWiSsHPYcG jQOQPH4TppebPm2fPgYTfyFOor3I4wpHdA64L3Cc1Eb+VcE93lHWy5/6Jplsbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759423426; a=rsa-sha256; cv=none; b=mTdZN2AsEEL1or0NmhJw5eTBs6BqXGK3bZMTyK5t5uFyas4RQEUZYkU4JZGpyXhh7RF5Jf m1nzNtAcBNo6wZ4OnoBmDk9CI6Z+Bz6TYPr55mZssqCftVoMVRZZ41wi6lv1c5y8LNAhkm OdKVVob7w6O5ZpQL0W4EjVEpI8cbdXylGCx3swwLsko3xxwN2vyG/vbzxAT9tYlJq3jEAZ /ll41+fhbYMXDEd4YhPBdkIVeGccq+YJhoHpUt9MXrBP5aehhfLh9aJjBDcgr02VuvY5nt tChMgQLi69gWhYY782yl8A4WRYckmhdHstiOFE58bMDd1xREzIGNmI3bcdD1mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyKt2tk8z1vR; Thu, 02 Oct 2025 16:43: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 592GhkWj006778; Thu, 2 Oct 2025 16:43:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592Ghkxu006775; Thu, 2 Oct 2025 16:43:46 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:43:46 GMT Message-Id: <202510021643.592Ghkxu006775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: dc00c4cd1684 - stable/13 - MFC: MFV: expat 2.7.3. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc00c4cd1684416c45618f830f96efbf1744908d Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=dc00c4cd1684416c45618f830f96efbf1744908d commit dc00c4cd1684416c45618f830f96efbf1744908d Author: Xin LI AuthorDate: 2025-09-29 04:28:11 +0000 Commit: Xin LI CommitDate: 2025-10-02 16:41:56 +0000 MFC: MFV: expat 2.7.3. (cherry picked from commit 8d485a8490fe1cd60e7b6a00d3c8a8cc116a56fb) --- contrib/expat/Changes | 58 ++++++++++++++++++++++- contrib/expat/README.md | 4 +- contrib/expat/configure.ac | 4 +- contrib/expat/doc/reference.html | 18 +++++--- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/lib/expat.h | 5 +- contrib/expat/lib/internal.h | 6 +++ contrib/expat/lib/xmlparse.c | 49 +++++++++++++------- contrib/expat/lib/xmlrole.h | 2 +- contrib/expat/tests/alloc_tests.c | 44 +++++++++++++----- contrib/expat/tests/misc_tests.c | 96 ++++++++++++++++++++++++++++++++++++++- contrib/expat/xmlwf/xmlfile.c | 4 +- lib/libexpat/expat_config.h | 6 +-- lib/libexpat/libbsdxml.3 | 4 +- 15 files changed, 251 insertions(+), 53 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index 092252ed1fa3..01e54b676416 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -41,6 +41,59 @@ !! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Release 2.7.3 Wed September 24 2025 + Security fixes: + #1046 #1048 Fix alignment of internal allocations for some non-amd64 + architectures (e.g. sparc32); fixes up on the fix to + CVE-2025-59375 from #1034 (of Expat 2.7.2 and related + backports) + #1059 Fix a class of false positives where input should have been + rejected with error XML_ERROR_ASYNC_ENTITY; regression from + CVE-2024-8176 fix pull request #973 (of Expat 2.7.0 and + related backports). Please check the added unit tests for + example documents. + + Other changes: + #1043 Prove and regression-proof absence of integer overflow + from function expat_realloc + #1062 Remove "harmless" cast that truncated a size_t to unsigned + #1049 Autotools: Remove "ln -s" discovery + #1054 docs: Be consistent with use of floating point around + XML_SetAllocTrackerMaximumAmplification + #1056 docs: Make it explicit that XML_GetCurrentColumnNumber + starts at 0 + #1057 docs: Better integrate the effect of the activation + thresholds + #1058 docs: Fix an in-comment typo in expat.h + #1045 docs: Fix a typo in README.md + #1041 docs: Improve change log of release 2.7.2 + #1053 xmlwf: Resolve use of functions XML_GetErrorLineNumber + and XML_GetErrorColumnNumber + #1032 Windows: Normalize .bat files to CRLF line endings + #1060 #1061 Version info bumped from 12:0:11 (libexpat*.so.1.11.0) + to 12:1:11 (libexpat*.so.1.11.1); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #1047 #1050 CI: Cleanup UndefinedBehaviorSanitizer fatality + #1044 CI|Linux: Stop aborting at first job failure + #1052 CI|FreeBSD: Upgrade to FreeBSD 15.0 + #1039 CI|FreeBSD: Do not install CMake meta-package + + Special thanks to: + Bénédikt Tran + Berkay Eren Ürün + Daniel Engberg + Hanno Böck + Matthew Fernandez + Rolf Eike Beer + Sam James + Tim Bray + and + Clang/GCC UndefinedBehaviorSanitizer + OSS-Fuzz / ClusterFuzz + Z3 Theorem Prover + Release 2.7.2 Tue September 16 2025 Security fixes: #1018 #1034 CVE-2025-59375 -- Disallow use of disproportional amounts of @@ -73,7 +126,7 @@ Release 2.7.2 Tue September 16 2025 to the pull request URL could be of help. Other changes: - #1008 #1017 Autotools: Sync CMake templates with CMake 3.31 for macOS + #1008 #1017 Autotools|macOS: Sync CMake templates with CMake 3.31 #1007 CMake: Drop support for CMake <3.15 #1004 CMake: Fix off_t detection for -Werror #1007 CMake|Windows: Fix -DEXPAT_MSVC_STATIC_CRT=ON @@ -89,7 +142,7 @@ Release 2.7.2 Tue September 16 2025 #994 docs: Drop AppVeyor badge #1000 tests: Fix portable_strndup #1036 Drop casts around malloc/free/realloc that C99 does not need - #1010 Replace empty for-loops with while loops + #1010 Replace empty for loops with while loops #1011 Add const with internal XmlInitUnknownEncodingNS #14 #1037 Drop an OpenVMS support leftover #999 #1001 Address more clang-tidy warnings @@ -111,6 +164,7 @@ Release 2.7.2 Tue September 16 2025 Neil Pang Theo Buehler and + GNU Time OSS-Fuzz / ClusterFuzz Perl XML::Parser diff --git a/contrib/expat/README.md b/contrib/expat/README.md index fdaaf459e204..c2f288ca1242 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -11,7 +11,7 @@ > at the top of the `Changes` file. -# Expat, Release 2.7.2 +# Expat, Release 2.7.3 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by @@ -120,7 +120,7 @@ project(hello VERSION 1.0.0) FetchContent_Declare( expat GIT_REPOSITORY https://github.com/libexpat/libexpat/ - GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z + GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_X_Y_Z SOURCE_SUBDIR expat/ ) diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index b9966eabcd60..072fea41ee8c 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -24,6 +24,7 @@ dnl Copyright (c) 2019 Kishore Kunche dnl Copyright (c) 2020 Jeffrey Walton dnl Copyright (c) 2024 Ferenc Géczi dnl Copyright (c) 2024 Dag-Erling Smørgrav +dnl Copyright (c) 2025 Matthew Fernandez dnl Licensed under the MIT license: dnl dnl Permission is hereby granted, free of charge, to any person obtaining @@ -85,7 +86,7 @@ dnl If the API changes incompatibly set LIBAGE back to 0 dnl LIBCURRENT=12 # sync -LIBREVISION=0 # with +LIBREVISION=1 # with LIBAGE=11 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) @@ -95,7 +96,6 @@ AH_BOTTOM([#endif // ndef EXPAT_CONFIG_H]) AM_PROG_AR AC_PROG_INSTALL -AC_PROG_LN_S AC_PROG_MAKE_SET LT_PREREQ([2.4]) diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 12b12b92ff6d..d2dded499435 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -52,7 +52,7 @@

The Expat XML Parser - Release 2.7.2 + Release 2.7.3

@@ -2137,8 +2137,8 @@ XML_Size XMLCALL XML_GetCurrentColumnNumber(XML_Parser p);
-Return the offset, from the beginning of the current line, of -the position. +Return the offset, from the beginning of the current line, of +the position. The first column is reported as 0.

XML_GetCurrentByteCount

@@ -2200,7 +2200,10 @@ XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p, returns XML_TRUE upon success and XML_FALSE upon error.

-

The amplification factor is calculated as ..

+

+ Once the threshold for activation is reached, + the amplification factor is calculated as .. +

amplification := (direct + indirect) / direct

.. while parsing, whereas @@ -2317,7 +2320,10 @@ XML_SetAllocTrackerMaximumAmplification(XML_Parser p, -

The amplification factor is calculated as ..

+

+ Once the threshold for activation is reached, + the amplification factor is calculated as .. +

amplification := allocated / direct

.. while parsing, whereas @@ -2339,7 +2345,7 @@ XML_SetAllocTrackerMaximumAmplification(XML_Parser p,

Note: - Amplifications factors greater than 100 can been observed near the start of parsing + Amplifications factors greater than 100.0 can been observed near the start of parsing even with benign files in practice. So if you do reduce the maximum allowed amplification, diff --git a/contrib/expat/doc/xmlwf.1 b/contrib/expat/doc/xmlwf.1 index 5f50ba9e4d00..aa2e9c218007 100644 --- a/contrib/expat/doc/xmlwf.1 +++ b/contrib/expat/doc/xmlwf.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "September 16, 2025" "" "" +.TH XMLWF 1 "September 24, 2025" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS diff --git a/contrib/expat/doc/xmlwf.xml b/contrib/expat/doc/xmlwf.xml index defe9df8e46a..01316bb16627 100644 --- a/contrib/expat/doc/xmlwf.xml +++ b/contrib/expat/doc/xmlwf.xml @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ Scott"> Bronson"> - September 16, 2025"> + September 24, 2025"> 1"> bronson@rinspin.com"> diff --git a/contrib/expat/lib/expat.h b/contrib/expat/lib/expat.h index bb9cdedbac7d..290dfeb0f6dd 100644 --- a/contrib/expat/lib/expat.h +++ b/contrib/expat/lib/expat.h @@ -19,6 +19,7 @@ Copyright (c) 2023 Hanno Böck Copyright (c) 2023 Sony Corporation / Snild Dolkow Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp> + Copyright (c) 2025 Matthew Fernandez Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -276,7 +277,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, /* Prepare a parser object to be reused. This is particularly valuable when memory allocation overhead is disproportionately high, - such as when a large number of small documnents need to be parsed. + such as when a large number of small documents need to be parsed. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. @@ -1081,7 +1082,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); */ # define XML_MAJOR_VERSION 2 # define XML_MINOR_VERSION 7 -# define XML_MICRO_VERSION 2 +# define XML_MICRO_VERSION 3 # ifdef __cplusplus } diff --git a/contrib/expat/lib/internal.h b/contrib/expat/lib/internal.h index 6e087858ebbe..8f5edf48ef7c 100644 --- a/contrib/expat/lib/internal.h +++ b/contrib/expat/lib/internal.h @@ -108,6 +108,7 @@ #endif #include // ULONG_MAX +#include // size_t #if defined(_WIN32) \ && (! defined(__USE_MINGW_ANSI_STDIO) \ @@ -153,6 +154,11 @@ #define EXPAT_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT \ 67108864 // 64 MiB, 2^26 +// NOTE: If function expat_alloc was user facing, EXPAT_MALLOC_ALIGNMENT would +// have to take sizeof(long double) into account +#define EXPAT_MALLOC_ALIGNMENT sizeof(long long) // largest parser (sub)member +#define EXPAT_MALLOC_PADDING ((EXPAT_MALLOC_ALIGNMENT) - sizeof(size_t)) + /* NOTE END */ #include "expat.h" // so we can use type XML_Parser below diff --git a/contrib/expat/lib/xmlparse.c b/contrib/expat/lib/xmlparse.c index de1594934900..a187a3a18f19 100644 --- a/contrib/expat/lib/xmlparse.c +++ b/contrib/expat/lib/xmlparse.c @@ -1,4 +1,4 @@ -/* 60e137abb91af642d6c3988f8f133d23329b32638659c74d47125fc0faf6ddd5 (2.7.2+) +/* 28bcd8b1ba7eb595d82822908257fd9c3589b4243e3c922d0369f35bfcd7b506 (2.7.3+) __ __ _ ___\ \/ /_ __ __ _| |_ / _ \\ /| '_ \ / _` | __| @@ -41,6 +41,7 @@ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow Copyright (c) 2024-2025 Berkay Eren Ürün Copyright (c) 2024 Hanno Böck + Copyright (c) 2025 Matthew Fernandez Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -850,14 +851,14 @@ static void * # endif expat_malloc(XML_Parser parser, size_t size, int sourceLine) { // Detect integer overflow - if (SIZE_MAX - size < sizeof(size_t)) { + if (SIZE_MAX - size < sizeof(size_t) + EXPAT_MALLOC_PADDING) { return NULL; } const XML_Parser rootParser = getRootParserOf(parser, NULL); assert(rootParser->m_parentParser == NULL); - const size_t bytesToAllocate = sizeof(size_t) + size; + const size_t bytesToAllocate = sizeof(size_t) + EXPAT_MALLOC_PADDING + size; if ((XmlBigCount)-1 - rootParser->m_alloc_tracker.bytesAllocated < bytesToAllocate) { @@ -894,7 +895,7 @@ expat_malloc(XML_Parser parser, size_t size, int sourceLine) { rootParser->m_alloc_tracker.peakBytesAllocated, sourceLine); } - return (char *)mallocedPtr + sizeof(size_t); + return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING; } # if defined(XML_TESTING) @@ -914,8 +915,9 @@ expat_free(XML_Parser parser, void *ptr, int sourceLine) { // Extract size (to the eyes of malloc_fcn/realloc_fcn) and // the original pointer returned by malloc/realloc - void *const mallocedPtr = (char *)ptr - sizeof(size_t); - const size_t bytesAllocated = sizeof(size_t) + *(size_t *)mallocedPtr; + void *const mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t); + const size_t bytesAllocated + = sizeof(size_t) + EXPAT_MALLOC_PADDING + *(size_t *)mallocedPtr; // Update accounting assert(rootParser->m_alloc_tracker.bytesAllocated >= bytesAllocated); @@ -954,7 +956,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { // Extract original size (to the eyes of the caller) and the original // pointer returned by malloc/realloc - void *mallocedPtr = (char *)ptr - sizeof(size_t); + void *mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t); const size_t prevSize = *(size_t *)mallocedPtr; // Classify upcoming change @@ -969,8 +971,13 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { } } + // NOTE: Integer overflow detection has already been done for us + // by expat_heap_increase_tolerable(..) above + assert(SIZE_MAX - sizeof(size_t) - EXPAT_MALLOC_PADDING >= size); + // Actually allocate - mallocedPtr = parser->m_mem.realloc_fcn(mallocedPtr, sizeof(size_t) + size); + mallocedPtr = parser->m_mem.realloc_fcn( + mallocedPtr, sizeof(size_t) + EXPAT_MALLOC_PADDING + size); if (mallocedPtr == NULL) { return NULL; @@ -1001,7 +1008,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { // Update in-block recorded size *(size_t *)mallocedPtr = size; - return (char *)mallocedPtr + sizeof(size_t); + return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING; } #endif // XML_GE == 1 @@ -1337,7 +1344,8 @@ parserCreate(const XML_Char *encodingName, XML_Parser parser = NULL; #if XML_GE == 1 - const size_t increase = sizeof(size_t) + sizeof(struct XML_ParserStruct); + const size_t increase + = sizeof(size_t) + EXPAT_MALLOC_PADDING + sizeof(struct XML_ParserStruct); if (parentParser != NULL) { const XML_Parser rootParser = getRootParserOf(parentParser, NULL); @@ -1352,11 +1360,13 @@ parserCreate(const XML_Char *encodingName, if (memsuite) { XML_Memory_Handling_Suite *mtemp; #if XML_GE == 1 - void *const sizeAndParser = memsuite->malloc_fcn( - sizeof(size_t) + sizeof(struct XML_ParserStruct)); + void *const sizeAndParser + = memsuite->malloc_fcn(sizeof(size_t) + EXPAT_MALLOC_PADDING + + sizeof(struct XML_ParserStruct)); if (sizeAndParser != NULL) { *(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct); - parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)); + parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t) + + EXPAT_MALLOC_PADDING); #else parser = memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); if (parser != NULL) { @@ -1369,11 +1379,12 @@ parserCreate(const XML_Char *encodingName, } else { XML_Memory_Handling_Suite *mtemp; #if XML_GE == 1 - void *const sizeAndParser - = malloc(sizeof(size_t) + sizeof(struct XML_ParserStruct)); + void *const sizeAndParser = malloc(sizeof(size_t) + EXPAT_MALLOC_PADDING + + sizeof(struct XML_ParserStruct)); if (sizeAndParser != NULL) { *(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct); - parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)); + parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t) + + EXPAT_MALLOC_PADDING); #else parser = malloc(sizeof(struct XML_ParserStruct)); if (parser != NULL) { @@ -6437,6 +6448,10 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end, // process its possible inner entities (which are added to the // m_openInternalEntities during doProlog or doContent calls above) entity->hasMore = XML_FALSE; + if (! entity->is_param + && (openEntity->startTagLevel != parser->m_tagLevel)) { + return XML_ERROR_ASYNC_ENTITY; + } triggerReenter(parser); return result; } // End of entity processing, "if" block will return here @@ -8135,7 +8150,7 @@ poolGrow(STRING_POOL *pool) { if (bytesToAllocate == 0) return XML_FALSE; - temp = REALLOC(pool->parser, pool->blocks, (unsigned)bytesToAllocate); + temp = REALLOC(pool->parser, pool->blocks, bytesToAllocate); if (temp == NULL) return XML_FALSE; pool->blocks = temp; diff --git a/contrib/expat/lib/xmlrole.h b/contrib/expat/lib/xmlrole.h index 67bdd3dd5160..9d0d4ff11b7f 100644 --- a/contrib/expat/lib/xmlrole.h +++ b/contrib/expat/lib/xmlrole.h @@ -10,7 +10,7 @@ Copyright (c) 2000 Clark Cooper Copyright (c) 2002 Karl Waclawek Copyright (c) 2002 Fred L. Drake, Jr. - Copyright (c) 2017-2024 Sebastian Pipping + Copyright (c) 2017-2025 Sebastian Pipping Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining diff --git a/contrib/expat/tests/alloc_tests.c b/contrib/expat/tests/alloc_tests.c index 644a49523c6e..5ae6c6a72025 100644 --- a/contrib/expat/tests/alloc_tests.c +++ b/contrib/expat/tests/alloc_tests.c @@ -2091,6 +2091,13 @@ START_TEST(test_alloc_reset_after_external_entity_parser_create_fail) { } END_TEST +#if XML_GE == 1 +static size_t +sizeRecordedFor(void *ptr) { + return *(size_t *)((char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t)); +} +#endif // XML_GE == 1 + START_TEST(test_alloc_tracker_size_recorded) { XML_Memory_Handling_Suite memsuite = {malloc, realloc, free}; @@ -2106,16 +2113,16 @@ START_TEST(test_alloc_tracker_size_recorded) { void *ptr = expat_malloc(parser, 10, -1); assert_true(ptr != NULL); - assert_true(*((size_t *)ptr - 1) == 10); + assert_true(sizeRecordedFor(ptr) == 10); assert_true(expat_realloc(parser, ptr, SIZE_MAX / 2, -1) == NULL); - assert_true(*((size_t *)ptr - 1) == 10); // i.e. unchanged + assert_true(sizeRecordedFor(ptr) == 10); // i.e. unchanged ptr = expat_realloc(parser, ptr, 20, -1); assert_true(ptr != NULL); - assert_true(*((size_t *)ptr - 1) == 20); + assert_true(sizeRecordedFor(ptr) == 20); expat_free(parser, ptr, -1); #endif @@ -2125,6 +2132,22 @@ START_TEST(test_alloc_tracker_size_recorded) { } END_TEST +START_TEST(test_alloc_tracker_pointer_alignment) { + XML_Parser parser = XML_ParserCreate(NULL); +#if XML_GE == 1 + assert_true(sizeof(long long) >= sizeof(size_t)); // self-test + long long *const ptr + = (long long *)expat_malloc(parser, 4 * sizeof(long long), -1); + ptr[0] = 0LL; + ptr[1] = 1LL; + ptr[2] = 2LL; + ptr[3] = 3LL; + expat_free(parser, ptr, -1); +#endif + XML_ParserFree(parser); +} +END_TEST + START_TEST(test_alloc_tracker_maximum_amplification) { if (g_reparseDeferralEnabledDefault == XML_TRUE) { return; @@ -2355,14 +2378,13 @@ make_alloc_test_case(Suite *s) { tcase_add_test__ifdef_xml_dtd( tc_alloc, test_alloc_reset_after_external_entity_parser_create_fail); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_size_recorded); - tcase_add_test__ifdef_xml_dtd(tc_alloc, - test_alloc_tracker_maximum_amplification); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_threshold); - tcase_add_test__ifdef_xml_dtd(tc_alloc, - test_alloc_tracker_getbuffer_unlimited); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_api); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_size_recorded); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_pointer_alignment); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_maximum_amplification); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_threshold); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_getbuffer_unlimited); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_api); tcase_add_test(tc_alloc, test_mem_api_cycle); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_mem_api_unlimited); + tcase_add_test__if_xml_ge(tc_alloc, test_mem_api_unlimited); } diff --git a/contrib/expat/tests/misc_tests.c b/contrib/expat/tests/misc_tests.c index 3346bce6074b..2a8054546a12 100644 --- a/contrib/expat/tests/misc_tests.c +++ b/contrib/expat/tests/misc_tests.c @@ -211,7 +211,7 @@ START_TEST(test_misc_version) { if (! versions_equal(&read_version, &parsed_version)) fail("Version mismatch"); - if (xcstrcmp(version_text, XCS("expat_2.7.2")) + if (xcstrcmp(version_text, XCS("expat_2.7.3")) != 0) /* needs bump on releases */ fail("XML_*_VERSION in expat.h out of sync?\n"); } @@ -679,6 +679,98 @@ START_TEST(test_misc_expected_event_ptr_issue_980) { } END_TEST +START_TEST(test_misc_sync_entity_tolerated) { + const char *const doc = "'>\n" + " two'>\n" + " threefourthree'>\n" + " &b;'>\n" + "]>\n" + "&a;&b;&c;&d;\n"; + XML_Parser parser = XML_ParserCreate(NULL); + + assert_true(_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), + /*isFinal=*/XML_TRUE) + == XML_STATUS_OK); + + XML_ParserFree(parser); +} +END_TEST + +START_TEST(test_misc_async_entity_rejected) { + struct test_case { + const char *doc; + enum XML_Status expectedStatusNoGE; + enum XML_Error expectedErrorNoGE; + XML_Size expectedErrorLine; + XML_Size expectedErrorColumn; + }; + const struct test_case cases[] = { + // Opened by one entity, closed by another + {"'>\n" + " '>\n" + "]>\n" + "&open;&close;\n", + XML_STATUS_OK, XML_ERROR_NONE, 5, 4}, + // Opened by tag, closed by entity (non-root case) + {"\n" + " '>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_TAG_MISMATCH, 5, 8}, + // Opened by tag, closed by entity (root case) + {"\n" + " '>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_NO_ELEMENTS, 5, 4}, + // Opened by entity, closed by tag <-- regression from 2.7.0 + {"\n" + " &g0;'>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_TAG_MISMATCH, 5, 4}, + // Opened by tag, closed by entity; then the other way around + {"'>\n" + " '>\n" + "]>\n" + "&close;&open;\n", + XML_STATUS_OK, XML_ERROR_NONE, 5, 8}, + }; + + for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) { + const struct test_case testCase = cases[i]; + set_subtest("cases[%d]", (int)i); + + const char *const doc = testCase.doc; +#if XML_GE == 1 + const enum XML_Status expectedStatus = XML_STATUS_ERROR; + const enum XML_Error expectedError = XML_ERROR_ASYNC_ENTITY; +#else + const enum XML_Status expectedStatus = testCase.expectedStatusNoGE; + const enum XML_Error expectedError = testCase.expectedErrorNoGE; +#endif + + XML_Parser parser = XML_ParserCreate(NULL); + assert_true(_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), + /*isFinal=*/XML_TRUE) + == expectedStatus); + assert_true(XML_GetErrorCode(parser) == expectedError); +#if XML_GE == 1 + assert_true(XML_GetCurrentLineNumber(parser) == testCase.expectedErrorLine); + assert_true(XML_GetCurrentColumnNumber(parser) + == testCase.expectedErrorColumn); +#endif + XML_ParserFree(parser); + } +} +END_TEST + void make_miscellaneous_test_case(Suite *s) { TCase *tc_misc = tcase_create("miscellaneous tests"); @@ -707,4 +799,6 @@ make_miscellaneous_test_case(Suite *s) { tcase_add_test(tc_misc, test_misc_stopparser_rejects_unstarted_parser); tcase_add_test__if_xml_ge(tc_misc, test_renter_loop_finite_content); tcase_add_test(tc_misc, test_misc_expected_event_ptr_issue_980); + tcase_add_test(tc_misc, test_misc_sync_entity_tolerated); + tcase_add_test(tc_misc, test_misc_async_entity_rejected); } diff --git a/contrib/expat/xmlwf/xmlfile.c b/contrib/expat/xmlwf/xmlfile.c index 54617fcc5a1a..ce0b61217ed7 100644 --- a/contrib/expat/xmlwf/xmlfile.c +++ b/contrib/expat/xmlwf/xmlfile.c @@ -96,8 +96,8 @@ reportError(XML_Parser parser, const XML_Char *filename) { ftprintf(stdout, T("%s") T(":%") T(XML_FMT_INT_MOD) T("u") T(":%") T(XML_FMT_INT_MOD) T("u") T(": %s\n"), - filename, XML_GetErrorLineNumber(parser), - XML_GetErrorColumnNumber(parser), message); + filename, XML_GetCurrentLineNumber(parser), + XML_GetCurrentColumnNumber(parser), message); else ftprintf(stderr, T("%s: (unknown message %u)\n"), filename, (unsigned int)code); diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h index 64da66e1cf6f..565404f1577b 100644 --- a/lib/libexpat/expat_config.h +++ b/lib/libexpat/expat_config.h @@ -89,7 +89,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.7.2" +#define PACKAGE_STRING "expat 2.7.3" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -98,7 +98,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.7.2" +#define PACKAGE_VERSION "2.7.3" /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -106,7 +106,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.7.2" +#define VERSION "2.7.3" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3 index 60aa64fba20d..d25249bbc155 100644 --- a/lib/libexpat/libbsdxml.3 +++ b/lib/libexpat/libbsdxml.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\"/ -.Dd April 7, 2025 +.Dd September 28, 2025 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh DESCRIPTION The .Nm -library is a verbatim copy of the eXpat XML library version 2.7.2. +library is a verbatim copy of the eXpat XML library version 2.7.3. .Pp The .Nm From nobody Thu Oct 2 16:43:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyKv4qN0z69Wdv; Thu, 02 Oct 2025 16:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyKv4Hn7z3kTy; Thu, 02 Oct 2025 16:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/BEJzpRHaZkkDnDHhmNJBDXAR72uygLMvoVgI7qqp30=; b=VHeE/ocG9OuWxpp6npJw0GrT2F8X/+A/pdrVLsotN3m++ujBwKJWiDfrXNKwvonSvo+6DC WFGUkOQ17c4oUksyhqcWfLWX2jc3wUG8HDZwyBpz9NlZYLFRRcUXCcX60dPOaDdqAOBjk6 U/x7pOtFjP/xn28L0u+Oi/NmA8sVCNseW2t/rIF1MbvRh2fjxF//+LH31eqCVibfCSIBhv yDqOLJssI5Z5jyjiKLe1ur68H70h8nOA7rUze6Vgq4yl7GkLIRdYdciHyXCm5o9qJqoieU +FyY2pVezGXuFuWOubagcgu9P4sfN4YmR20hYOObJqrRr3RtLbCVhCDwPzEmwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/BEJzpRHaZkkDnDHhmNJBDXAR72uygLMvoVgI7qqp30=; b=Xk+7djgKZ+zU/4CJXW9IMq/BoSa16J7+hiFWig4edy+qU+Ws5cjg14dk77tjrtQLKTcE4q c/SkQnjkuXjl5eQ01fQBJ5AWvqJ8+mxgy/qRb3kGTB90T3wFhKVhqChRUeCrudYZry2szn /yBkc4cxxkYsufD6hCNrOx+HJz8X2MLcds7Wo6KpSu5TXAm3SJQza8fM5PaZsi+cSCX0v3 NYiU9JE7JfNpThuQiEep4pZz6XkutuzQzReNQSjyFb9QwOln1WpRE1Z08szSnL0irZm+0/ Kk+GXpuL8rxX/aJd8yOnJ0OxlY5MG7aFZYY6j+UUxRpLvpq+F8og3U88bBS1cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759423427; a=rsa-sha256; cv=none; b=k17QcFQ8Pvmsmutu6TvJx1ClpJe0TGGD5k43TqU+l589MBbcaDHV4ZEOF3ClwocUnk0ugW EzpZsatwxEOhV3rKFiXUKVzNb9vSS/HEWlifMFtaopkgomsea+oR9/BQIf6PR3CYaAk8Fb O1jWWUPRD4weeQI0e6oEv9c9CSIbxGh+lnc6XCXEAQ5HWX7vWxfG3g3P+VFT99S+fW7tFC u/pVoPsQ8oCg3MgfhEMAOPX2ZPHa9QbHbfKa2KAsplcGn0jKwYNXX0Gz87m0qrmcFmMCGZ yXFQFM/r5ewkzQALHPj/F36G2OPX9GStSyuDRhGBNHuu5seD7vSHCN/9d1YFiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyKv3sC6z1Rh; Thu, 02 Oct 2025 16:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 592GhlBT006826; Thu, 2 Oct 2025 16:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592Ghli8006823; Thu, 2 Oct 2025 16:43:47 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:43:47 GMT Message-Id: <202510021643.592Ghli8006823@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: a85cfcb61efd - stable/14 - MFC: MFV: expat 2.7.3. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a85cfcb61efdb5ef11dd494eb82c29627d9a1ec7 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=a85cfcb61efdb5ef11dd494eb82c29627d9a1ec7 commit a85cfcb61efdb5ef11dd494eb82c29627d9a1ec7 Author: Xin LI AuthorDate: 2025-09-29 04:28:11 +0000 Commit: Xin LI CommitDate: 2025-10-02 16:43:25 +0000 MFC: MFV: expat 2.7.3. (cherry picked from commit 8d485a8490fe1cd60e7b6a00d3c8a8cc116a56fb) --- contrib/expat/Changes | 58 ++++++++++++++++++++++- contrib/expat/README.md | 4 +- contrib/expat/configure.ac | 4 +- contrib/expat/doc/reference.html | 18 +++++--- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/lib/expat.h | 5 +- contrib/expat/lib/internal.h | 6 +++ contrib/expat/lib/xmlparse.c | 49 +++++++++++++------- contrib/expat/lib/xmlrole.h | 2 +- contrib/expat/tests/alloc_tests.c | 44 +++++++++++++----- contrib/expat/tests/misc_tests.c | 96 ++++++++++++++++++++++++++++++++++++++- contrib/expat/xmlwf/xmlfile.c | 4 +- lib/libexpat/expat_config.h | 6 +-- lib/libexpat/libbsdxml.3 | 4 +- 15 files changed, 251 insertions(+), 53 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index 092252ed1fa3..01e54b676416 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -41,6 +41,59 @@ !! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Release 2.7.3 Wed September 24 2025 + Security fixes: + #1046 #1048 Fix alignment of internal allocations for some non-amd64 + architectures (e.g. sparc32); fixes up on the fix to + CVE-2025-59375 from #1034 (of Expat 2.7.2 and related + backports) + #1059 Fix a class of false positives where input should have been + rejected with error XML_ERROR_ASYNC_ENTITY; regression from + CVE-2024-8176 fix pull request #973 (of Expat 2.7.0 and + related backports). Please check the added unit tests for + example documents. + + Other changes: + #1043 Prove and regression-proof absence of integer overflow + from function expat_realloc + #1062 Remove "harmless" cast that truncated a size_t to unsigned + #1049 Autotools: Remove "ln -s" discovery + #1054 docs: Be consistent with use of floating point around + XML_SetAllocTrackerMaximumAmplification + #1056 docs: Make it explicit that XML_GetCurrentColumnNumber + starts at 0 + #1057 docs: Better integrate the effect of the activation + thresholds + #1058 docs: Fix an in-comment typo in expat.h + #1045 docs: Fix a typo in README.md + #1041 docs: Improve change log of release 2.7.2 + #1053 xmlwf: Resolve use of functions XML_GetErrorLineNumber + and XML_GetErrorColumnNumber + #1032 Windows: Normalize .bat files to CRLF line endings + #1060 #1061 Version info bumped from 12:0:11 (libexpat*.so.1.11.0) + to 12:1:11 (libexpat*.so.1.11.1); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #1047 #1050 CI: Cleanup UndefinedBehaviorSanitizer fatality + #1044 CI|Linux: Stop aborting at first job failure + #1052 CI|FreeBSD: Upgrade to FreeBSD 15.0 + #1039 CI|FreeBSD: Do not install CMake meta-package + + Special thanks to: + Bénédikt Tran + Berkay Eren Ürün + Daniel Engberg + Hanno Böck + Matthew Fernandez + Rolf Eike Beer + Sam James + Tim Bray + and + Clang/GCC UndefinedBehaviorSanitizer + OSS-Fuzz / ClusterFuzz + Z3 Theorem Prover + Release 2.7.2 Tue September 16 2025 Security fixes: #1018 #1034 CVE-2025-59375 -- Disallow use of disproportional amounts of @@ -73,7 +126,7 @@ Release 2.7.2 Tue September 16 2025 to the pull request URL could be of help. Other changes: - #1008 #1017 Autotools: Sync CMake templates with CMake 3.31 for macOS + #1008 #1017 Autotools|macOS: Sync CMake templates with CMake 3.31 #1007 CMake: Drop support for CMake <3.15 #1004 CMake: Fix off_t detection for -Werror #1007 CMake|Windows: Fix -DEXPAT_MSVC_STATIC_CRT=ON @@ -89,7 +142,7 @@ Release 2.7.2 Tue September 16 2025 #994 docs: Drop AppVeyor badge #1000 tests: Fix portable_strndup #1036 Drop casts around malloc/free/realloc that C99 does not need - #1010 Replace empty for-loops with while loops + #1010 Replace empty for loops with while loops #1011 Add const with internal XmlInitUnknownEncodingNS #14 #1037 Drop an OpenVMS support leftover #999 #1001 Address more clang-tidy warnings @@ -111,6 +164,7 @@ Release 2.7.2 Tue September 16 2025 Neil Pang Theo Buehler and + GNU Time OSS-Fuzz / ClusterFuzz Perl XML::Parser diff --git a/contrib/expat/README.md b/contrib/expat/README.md index fdaaf459e204..c2f288ca1242 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -11,7 +11,7 @@ > at the top of the `Changes` file. -# Expat, Release 2.7.2 +# Expat, Release 2.7.3 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by @@ -120,7 +120,7 @@ project(hello VERSION 1.0.0) FetchContent_Declare( expat GIT_REPOSITORY https://github.com/libexpat/libexpat/ - GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z + GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_X_Y_Z SOURCE_SUBDIR expat/ ) diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index b9966eabcd60..072fea41ee8c 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -24,6 +24,7 @@ dnl Copyright (c) 2019 Kishore Kunche dnl Copyright (c) 2020 Jeffrey Walton dnl Copyright (c) 2024 Ferenc Géczi dnl Copyright (c) 2024 Dag-Erling Smørgrav +dnl Copyright (c) 2025 Matthew Fernandez dnl Licensed under the MIT license: dnl dnl Permission is hereby granted, free of charge, to any person obtaining @@ -85,7 +86,7 @@ dnl If the API changes incompatibly set LIBAGE back to 0 dnl LIBCURRENT=12 # sync -LIBREVISION=0 # with +LIBREVISION=1 # with LIBAGE=11 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) @@ -95,7 +96,6 @@ AH_BOTTOM([#endif // ndef EXPAT_CONFIG_H]) AM_PROG_AR AC_PROG_INSTALL -AC_PROG_LN_S AC_PROG_MAKE_SET LT_PREREQ([2.4]) diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 12b12b92ff6d..d2dded499435 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -52,7 +52,7 @@

The Expat XML Parser - Release 2.7.2 + Release 2.7.3

@@ -2137,8 +2137,8 @@ XML_Size XMLCALL XML_GetCurrentColumnNumber(XML_Parser p);
-Return the offset, from the beginning of the current line, of -the position. +Return the offset, from the beginning of the current line, of +the position. The first column is reported as 0.

XML_GetCurrentByteCount

@@ -2200,7 +2200,10 @@ XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p, returns XML_TRUE upon success and XML_FALSE upon error.

-

The amplification factor is calculated as ..

+

+ Once the threshold for activation is reached, + the amplification factor is calculated as .. +

amplification := (direct + indirect) / direct

.. while parsing, whereas @@ -2317,7 +2320,10 @@ XML_SetAllocTrackerMaximumAmplification(XML_Parser p, -

The amplification factor is calculated as ..

+

+ Once the threshold for activation is reached, + the amplification factor is calculated as .. +

amplification := allocated / direct

.. while parsing, whereas @@ -2339,7 +2345,7 @@ XML_SetAllocTrackerMaximumAmplification(XML_Parser p,

Note: - Amplifications factors greater than 100 can been observed near the start of parsing + Amplifications factors greater than 100.0 can been observed near the start of parsing even with benign files in practice. So if you do reduce the maximum allowed amplification, diff --git a/contrib/expat/doc/xmlwf.1 b/contrib/expat/doc/xmlwf.1 index 5f50ba9e4d00..aa2e9c218007 100644 --- a/contrib/expat/doc/xmlwf.1 +++ b/contrib/expat/doc/xmlwf.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "September 16, 2025" "" "" +.TH XMLWF 1 "September 24, 2025" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS diff --git a/contrib/expat/doc/xmlwf.xml b/contrib/expat/doc/xmlwf.xml index defe9df8e46a..01316bb16627 100644 --- a/contrib/expat/doc/xmlwf.xml +++ b/contrib/expat/doc/xmlwf.xml @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ Scott"> Bronson"> - September 16, 2025"> + September 24, 2025"> 1"> bronson@rinspin.com"> diff --git a/contrib/expat/lib/expat.h b/contrib/expat/lib/expat.h index bb9cdedbac7d..290dfeb0f6dd 100644 --- a/contrib/expat/lib/expat.h +++ b/contrib/expat/lib/expat.h @@ -19,6 +19,7 @@ Copyright (c) 2023 Hanno Böck Copyright (c) 2023 Sony Corporation / Snild Dolkow Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp> + Copyright (c) 2025 Matthew Fernandez Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -276,7 +277,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, /* Prepare a parser object to be reused. This is particularly valuable when memory allocation overhead is disproportionately high, - such as when a large number of small documnents need to be parsed. + such as when a large number of small documents need to be parsed. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. @@ -1081,7 +1082,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); */ # define XML_MAJOR_VERSION 2 # define XML_MINOR_VERSION 7 -# define XML_MICRO_VERSION 2 +# define XML_MICRO_VERSION 3 # ifdef __cplusplus } diff --git a/contrib/expat/lib/internal.h b/contrib/expat/lib/internal.h index 6e087858ebbe..8f5edf48ef7c 100644 --- a/contrib/expat/lib/internal.h +++ b/contrib/expat/lib/internal.h @@ -108,6 +108,7 @@ #endif #include // ULONG_MAX +#include // size_t #if defined(_WIN32) \ && (! defined(__USE_MINGW_ANSI_STDIO) \ @@ -153,6 +154,11 @@ #define EXPAT_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT \ 67108864 // 64 MiB, 2^26 +// NOTE: If function expat_alloc was user facing, EXPAT_MALLOC_ALIGNMENT would +// have to take sizeof(long double) into account +#define EXPAT_MALLOC_ALIGNMENT sizeof(long long) // largest parser (sub)member +#define EXPAT_MALLOC_PADDING ((EXPAT_MALLOC_ALIGNMENT) - sizeof(size_t)) + /* NOTE END */ #include "expat.h" // so we can use type XML_Parser below diff --git a/contrib/expat/lib/xmlparse.c b/contrib/expat/lib/xmlparse.c index de1594934900..a187a3a18f19 100644 --- a/contrib/expat/lib/xmlparse.c +++ b/contrib/expat/lib/xmlparse.c @@ -1,4 +1,4 @@ -/* 60e137abb91af642d6c3988f8f133d23329b32638659c74d47125fc0faf6ddd5 (2.7.2+) +/* 28bcd8b1ba7eb595d82822908257fd9c3589b4243e3c922d0369f35bfcd7b506 (2.7.3+) __ __ _ ___\ \/ /_ __ __ _| |_ / _ \\ /| '_ \ / _` | __| @@ -41,6 +41,7 @@ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow Copyright (c) 2024-2025 Berkay Eren Ürün Copyright (c) 2024 Hanno Böck + Copyright (c) 2025 Matthew Fernandez Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -850,14 +851,14 @@ static void * # endif expat_malloc(XML_Parser parser, size_t size, int sourceLine) { // Detect integer overflow - if (SIZE_MAX - size < sizeof(size_t)) { + if (SIZE_MAX - size < sizeof(size_t) + EXPAT_MALLOC_PADDING) { return NULL; } const XML_Parser rootParser = getRootParserOf(parser, NULL); assert(rootParser->m_parentParser == NULL); - const size_t bytesToAllocate = sizeof(size_t) + size; + const size_t bytesToAllocate = sizeof(size_t) + EXPAT_MALLOC_PADDING + size; if ((XmlBigCount)-1 - rootParser->m_alloc_tracker.bytesAllocated < bytesToAllocate) { @@ -894,7 +895,7 @@ expat_malloc(XML_Parser parser, size_t size, int sourceLine) { rootParser->m_alloc_tracker.peakBytesAllocated, sourceLine); } - return (char *)mallocedPtr + sizeof(size_t); + return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING; } # if defined(XML_TESTING) @@ -914,8 +915,9 @@ expat_free(XML_Parser parser, void *ptr, int sourceLine) { // Extract size (to the eyes of malloc_fcn/realloc_fcn) and // the original pointer returned by malloc/realloc - void *const mallocedPtr = (char *)ptr - sizeof(size_t); - const size_t bytesAllocated = sizeof(size_t) + *(size_t *)mallocedPtr; + void *const mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t); + const size_t bytesAllocated + = sizeof(size_t) + EXPAT_MALLOC_PADDING + *(size_t *)mallocedPtr; // Update accounting assert(rootParser->m_alloc_tracker.bytesAllocated >= bytesAllocated); @@ -954,7 +956,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { // Extract original size (to the eyes of the caller) and the original // pointer returned by malloc/realloc - void *mallocedPtr = (char *)ptr - sizeof(size_t); + void *mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t); const size_t prevSize = *(size_t *)mallocedPtr; // Classify upcoming change @@ -969,8 +971,13 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { } } + // NOTE: Integer overflow detection has already been done for us + // by expat_heap_increase_tolerable(..) above + assert(SIZE_MAX - sizeof(size_t) - EXPAT_MALLOC_PADDING >= size); + // Actually allocate - mallocedPtr = parser->m_mem.realloc_fcn(mallocedPtr, sizeof(size_t) + size); + mallocedPtr = parser->m_mem.realloc_fcn( + mallocedPtr, sizeof(size_t) + EXPAT_MALLOC_PADDING + size); if (mallocedPtr == NULL) { return NULL; @@ -1001,7 +1008,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { // Update in-block recorded size *(size_t *)mallocedPtr = size; - return (char *)mallocedPtr + sizeof(size_t); + return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING; } #endif // XML_GE == 1 @@ -1337,7 +1344,8 @@ parserCreate(const XML_Char *encodingName, XML_Parser parser = NULL; #if XML_GE == 1 - const size_t increase = sizeof(size_t) + sizeof(struct XML_ParserStruct); + const size_t increase + = sizeof(size_t) + EXPAT_MALLOC_PADDING + sizeof(struct XML_ParserStruct); if (parentParser != NULL) { const XML_Parser rootParser = getRootParserOf(parentParser, NULL); @@ -1352,11 +1360,13 @@ parserCreate(const XML_Char *encodingName, if (memsuite) { XML_Memory_Handling_Suite *mtemp; #if XML_GE == 1 - void *const sizeAndParser = memsuite->malloc_fcn( - sizeof(size_t) + sizeof(struct XML_ParserStruct)); + void *const sizeAndParser + = memsuite->malloc_fcn(sizeof(size_t) + EXPAT_MALLOC_PADDING + + sizeof(struct XML_ParserStruct)); if (sizeAndParser != NULL) { *(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct); - parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)); + parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t) + + EXPAT_MALLOC_PADDING); #else parser = memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); if (parser != NULL) { @@ -1369,11 +1379,12 @@ parserCreate(const XML_Char *encodingName, } else { XML_Memory_Handling_Suite *mtemp; #if XML_GE == 1 - void *const sizeAndParser - = malloc(sizeof(size_t) + sizeof(struct XML_ParserStruct)); + void *const sizeAndParser = malloc(sizeof(size_t) + EXPAT_MALLOC_PADDING + + sizeof(struct XML_ParserStruct)); if (sizeAndParser != NULL) { *(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct); - parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)); + parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t) + + EXPAT_MALLOC_PADDING); #else parser = malloc(sizeof(struct XML_ParserStruct)); if (parser != NULL) { @@ -6437,6 +6448,10 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end, // process its possible inner entities (which are added to the // m_openInternalEntities during doProlog or doContent calls above) entity->hasMore = XML_FALSE; + if (! entity->is_param + && (openEntity->startTagLevel != parser->m_tagLevel)) { + return XML_ERROR_ASYNC_ENTITY; + } triggerReenter(parser); return result; } // End of entity processing, "if" block will return here @@ -8135,7 +8150,7 @@ poolGrow(STRING_POOL *pool) { if (bytesToAllocate == 0) return XML_FALSE; - temp = REALLOC(pool->parser, pool->blocks, (unsigned)bytesToAllocate); + temp = REALLOC(pool->parser, pool->blocks, bytesToAllocate); if (temp == NULL) return XML_FALSE; pool->blocks = temp; diff --git a/contrib/expat/lib/xmlrole.h b/contrib/expat/lib/xmlrole.h index 67bdd3dd5160..9d0d4ff11b7f 100644 --- a/contrib/expat/lib/xmlrole.h +++ b/contrib/expat/lib/xmlrole.h @@ -10,7 +10,7 @@ Copyright (c) 2000 Clark Cooper Copyright (c) 2002 Karl Waclawek Copyright (c) 2002 Fred L. Drake, Jr. - Copyright (c) 2017-2024 Sebastian Pipping + Copyright (c) 2017-2025 Sebastian Pipping Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining diff --git a/contrib/expat/tests/alloc_tests.c b/contrib/expat/tests/alloc_tests.c index 644a49523c6e..5ae6c6a72025 100644 --- a/contrib/expat/tests/alloc_tests.c +++ b/contrib/expat/tests/alloc_tests.c @@ -2091,6 +2091,13 @@ START_TEST(test_alloc_reset_after_external_entity_parser_create_fail) { } END_TEST +#if XML_GE == 1 +static size_t +sizeRecordedFor(void *ptr) { + return *(size_t *)((char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t)); +} +#endif // XML_GE == 1 + START_TEST(test_alloc_tracker_size_recorded) { XML_Memory_Handling_Suite memsuite = {malloc, realloc, free}; @@ -2106,16 +2113,16 @@ START_TEST(test_alloc_tracker_size_recorded) { void *ptr = expat_malloc(parser, 10, -1); assert_true(ptr != NULL); - assert_true(*((size_t *)ptr - 1) == 10); + assert_true(sizeRecordedFor(ptr) == 10); assert_true(expat_realloc(parser, ptr, SIZE_MAX / 2, -1) == NULL); - assert_true(*((size_t *)ptr - 1) == 10); // i.e. unchanged + assert_true(sizeRecordedFor(ptr) == 10); // i.e. unchanged ptr = expat_realloc(parser, ptr, 20, -1); assert_true(ptr != NULL); - assert_true(*((size_t *)ptr - 1) == 20); + assert_true(sizeRecordedFor(ptr) == 20); expat_free(parser, ptr, -1); #endif @@ -2125,6 +2132,22 @@ START_TEST(test_alloc_tracker_size_recorded) { } END_TEST +START_TEST(test_alloc_tracker_pointer_alignment) { + XML_Parser parser = XML_ParserCreate(NULL); +#if XML_GE == 1 + assert_true(sizeof(long long) >= sizeof(size_t)); // self-test + long long *const ptr + = (long long *)expat_malloc(parser, 4 * sizeof(long long), -1); + ptr[0] = 0LL; + ptr[1] = 1LL; + ptr[2] = 2LL; + ptr[3] = 3LL; + expat_free(parser, ptr, -1); +#endif + XML_ParserFree(parser); +} +END_TEST + START_TEST(test_alloc_tracker_maximum_amplification) { if (g_reparseDeferralEnabledDefault == XML_TRUE) { return; @@ -2355,14 +2378,13 @@ make_alloc_test_case(Suite *s) { tcase_add_test__ifdef_xml_dtd( tc_alloc, test_alloc_reset_after_external_entity_parser_create_fail); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_size_recorded); - tcase_add_test__ifdef_xml_dtd(tc_alloc, - test_alloc_tracker_maximum_amplification); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_threshold); - tcase_add_test__ifdef_xml_dtd(tc_alloc, - test_alloc_tracker_getbuffer_unlimited); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_api); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_size_recorded); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_pointer_alignment); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_maximum_amplification); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_threshold); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_getbuffer_unlimited); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_api); tcase_add_test(tc_alloc, test_mem_api_cycle); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_mem_api_unlimited); + tcase_add_test__if_xml_ge(tc_alloc, test_mem_api_unlimited); } diff --git a/contrib/expat/tests/misc_tests.c b/contrib/expat/tests/misc_tests.c index 3346bce6074b..2a8054546a12 100644 --- a/contrib/expat/tests/misc_tests.c +++ b/contrib/expat/tests/misc_tests.c @@ -211,7 +211,7 @@ START_TEST(test_misc_version) { if (! versions_equal(&read_version, &parsed_version)) fail("Version mismatch"); - if (xcstrcmp(version_text, XCS("expat_2.7.2")) + if (xcstrcmp(version_text, XCS("expat_2.7.3")) != 0) /* needs bump on releases */ fail("XML_*_VERSION in expat.h out of sync?\n"); } @@ -679,6 +679,98 @@ START_TEST(test_misc_expected_event_ptr_issue_980) { } END_TEST +START_TEST(test_misc_sync_entity_tolerated) { + const char *const doc = "'>\n" + " two'>\n" + " threefourthree'>\n" + " &b;'>\n" + "]>\n" + "&a;&b;&c;&d;\n"; + XML_Parser parser = XML_ParserCreate(NULL); + + assert_true(_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), + /*isFinal=*/XML_TRUE) + == XML_STATUS_OK); + + XML_ParserFree(parser); +} +END_TEST + +START_TEST(test_misc_async_entity_rejected) { + struct test_case { + const char *doc; + enum XML_Status expectedStatusNoGE; + enum XML_Error expectedErrorNoGE; + XML_Size expectedErrorLine; + XML_Size expectedErrorColumn; + }; + const struct test_case cases[] = { + // Opened by one entity, closed by another + {"'>\n" + " '>\n" + "]>\n" + "&open;&close;\n", + XML_STATUS_OK, XML_ERROR_NONE, 5, 4}, + // Opened by tag, closed by entity (non-root case) + {"\n" + " '>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_TAG_MISMATCH, 5, 8}, + // Opened by tag, closed by entity (root case) + {"\n" + " '>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_NO_ELEMENTS, 5, 4}, + // Opened by entity, closed by tag <-- regression from 2.7.0 + {"\n" + " &g0;'>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_TAG_MISMATCH, 5, 4}, + // Opened by tag, closed by entity; then the other way around + {"'>\n" + " '>\n" + "]>\n" + "&close;&open;\n", + XML_STATUS_OK, XML_ERROR_NONE, 5, 8}, + }; + + for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) { + const struct test_case testCase = cases[i]; + set_subtest("cases[%d]", (int)i); + + const char *const doc = testCase.doc; +#if XML_GE == 1 + const enum XML_Status expectedStatus = XML_STATUS_ERROR; + const enum XML_Error expectedError = XML_ERROR_ASYNC_ENTITY; +#else + const enum XML_Status expectedStatus = testCase.expectedStatusNoGE; + const enum XML_Error expectedError = testCase.expectedErrorNoGE; +#endif + + XML_Parser parser = XML_ParserCreate(NULL); + assert_true(_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), + /*isFinal=*/XML_TRUE) + == expectedStatus); + assert_true(XML_GetErrorCode(parser) == expectedError); +#if XML_GE == 1 + assert_true(XML_GetCurrentLineNumber(parser) == testCase.expectedErrorLine); + assert_true(XML_GetCurrentColumnNumber(parser) + == testCase.expectedErrorColumn); +#endif + XML_ParserFree(parser); + } +} +END_TEST + void make_miscellaneous_test_case(Suite *s) { TCase *tc_misc = tcase_create("miscellaneous tests"); @@ -707,4 +799,6 @@ make_miscellaneous_test_case(Suite *s) { tcase_add_test(tc_misc, test_misc_stopparser_rejects_unstarted_parser); tcase_add_test__if_xml_ge(tc_misc, test_renter_loop_finite_content); tcase_add_test(tc_misc, test_misc_expected_event_ptr_issue_980); + tcase_add_test(tc_misc, test_misc_sync_entity_tolerated); + tcase_add_test(tc_misc, test_misc_async_entity_rejected); } diff --git a/contrib/expat/xmlwf/xmlfile.c b/contrib/expat/xmlwf/xmlfile.c index 54617fcc5a1a..ce0b61217ed7 100644 --- a/contrib/expat/xmlwf/xmlfile.c +++ b/contrib/expat/xmlwf/xmlfile.c @@ -96,8 +96,8 @@ reportError(XML_Parser parser, const XML_Char *filename) { ftprintf(stdout, T("%s") T(":%") T(XML_FMT_INT_MOD) T("u") T(":%") T(XML_FMT_INT_MOD) T("u") T(": %s\n"), - filename, XML_GetErrorLineNumber(parser), - XML_GetErrorColumnNumber(parser), message); + filename, XML_GetCurrentLineNumber(parser), + XML_GetCurrentColumnNumber(parser), message); else ftprintf(stderr, T("%s: (unknown message %u)\n"), filename, (unsigned int)code); diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h index 64da66e1cf6f..565404f1577b 100644 --- a/lib/libexpat/expat_config.h +++ b/lib/libexpat/expat_config.h @@ -89,7 +89,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.7.2" +#define PACKAGE_STRING "expat 2.7.3" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -98,7 +98,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.7.2" +#define PACKAGE_VERSION "2.7.3" /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -106,7 +106,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.7.2" +#define VERSION "2.7.3" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3 index 60aa64fba20d..d25249bbc155 100644 --- a/lib/libexpat/libbsdxml.3 +++ b/lib/libexpat/libbsdxml.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\"/ -.Dd April 7, 2025 +.Dd September 28, 2025 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh DESCRIPTION The .Nm -library is a verbatim copy of the eXpat XML library version 2.7.2. +library is a verbatim copy of the eXpat XML library version 2.7.3. .Pp The .Nm From nobody Thu Oct 2 16:43:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyKw6rtQz69X1D; Thu, 02 Oct 2025 16:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyKw5QJGz3kPr; Thu, 02 Oct 2025 16:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OxhPDyv4SWt+E1UjCXVlmgqQQlFVijhW7SiGQldNAqQ=; b=YVOnQk0ByGRiSnrlW2+rOhQ/cH5QLdeaYvbqt67RM4D/jtUCkr1pEQIblTwQ1O9bIZTiko U/QnZ6juODygTeXCN6r2VSJFSaeYZ9lKO5Cqy16I2JHcKBixAQsL8SAv/qfVZZCWjQZw3j hNSG630Ddqs+QZQY4GlNEf2NzqTXMrKgYwkFwHdzEtcu5xJAQjjckDucMGcdkOcoOV1fAR VBRBkG06zL+xdq2w84g8jE6eE7UV2BCYSEIb72LfBYxrP/Q77H6oyyyq9bmT0Y3tcaICq6 dXXT9RZzx7831xb1TN2ZO3inl1yQbM7UWfJOusUK5ofUsMC/GwZ+sOPH1WSeAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OxhPDyv4SWt+E1UjCXVlmgqQQlFVijhW7SiGQldNAqQ=; b=eRn2CQ5qXewTj8GDMnlAdY0FTLMyK9Kbeb5p6Ppuj++ltrKk6ttkIJ/QVvQ0xwN5hYV4du v0u6mbF7yAIhEs/9hftuOWMf+c7oMWFwX9ZoXqGMnk2wdXxROtyJgPkuoMARqSAbRDnddk 835OPN+5k/P9nZpl4eZY4+7YvHYYFZbXJ/jDth4HbZTo9+Qi+XwWfnNV+S8ssGfXy48QT1 7CYJBlLzq19GyarDJ0fV1k+vYt6yDHSiw9/Ky1BYC7/Ml/mGzevR4/8wx/axXBoLS9Dt/v Jn5ypcy9+KjTFjnYsaYwEZ5oSZEM8J7ZVn1BoiA4wsghk/VGvPsbw7/85jq7GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759423428; a=rsa-sha256; cv=none; b=YvgJhFEDMNNF7bR90fRVgnzqCtAHmU56d7HXmHR9bWnkD8Mp6VS1eyIjzKczjXG4Rm9aUu Ed7O9KA/4MSxUHm2/AsZ9FA+aFL0sB/56fP3sEVSYbkCK8e0P5Oyf38CkdAU9uzM1DLAmq pHEYBJI1itYy1YRy1TYPVxKXqNo0RGXj3bUaJ2zTqPvr6A0BgbqQ4q3M/SU5HTF7IGAkxP dlOgydq2oj7GiyDXeaUH9D0bFD0G5bi/vH72ChbpleYsSPtG1pTnnEmmn5mx8HcyZMXQR9 v40OgB726xAE+E7MCn3zu1w4tJnjR4foJOBGIjABIVn9D6B2ick50QeUQpw7fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyKw4pL7z1G0; Thu, 02 Oct 2025 16:43: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 592GhmK0006878; Thu, 2 Oct 2025 16:43:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592Ghm4p006875; Thu, 2 Oct 2025 16:43:48 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:43:48 GMT Message-Id: <202510021643.592Ghm4p006875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 860583c83ef2 - stable/15 - MFC: MFV: expat 2.7.3. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 860583c83ef2acf0c974ea59d6393071121bce2b Auto-Submitted: auto-generated The branch stable/15 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=860583c83ef2acf0c974ea59d6393071121bce2b commit 860583c83ef2acf0c974ea59d6393071121bce2b Author: Xin LI AuthorDate: 2025-09-29 04:28:11 +0000 Commit: Xin LI CommitDate: 2025-10-02 16:37:58 +0000 MFC: MFV: expat 2.7.3. (cherry picked from commit 8d485a8490fe1cd60e7b6a00d3c8a8cc116a56fb) --- contrib/expat/Changes | 58 ++++++++++++++++++++++- contrib/expat/README.md | 4 +- contrib/expat/configure.ac | 4 +- contrib/expat/doc/reference.html | 18 +++++--- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/lib/expat.h | 5 +- contrib/expat/lib/internal.h | 6 +++ contrib/expat/lib/xmlparse.c | 49 +++++++++++++------- contrib/expat/lib/xmlrole.h | 2 +- contrib/expat/tests/alloc_tests.c | 44 +++++++++++++----- contrib/expat/tests/misc_tests.c | 96 ++++++++++++++++++++++++++++++++++++++- contrib/expat/xmlwf/xmlfile.c | 4 +- lib/libexpat/expat_config.h | 6 +-- lib/libexpat/libbsdxml.3 | 4 +- 15 files changed, 251 insertions(+), 53 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index 092252ed1fa3..01e54b676416 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -41,6 +41,59 @@ !! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Release 2.7.3 Wed September 24 2025 + Security fixes: + #1046 #1048 Fix alignment of internal allocations for some non-amd64 + architectures (e.g. sparc32); fixes up on the fix to + CVE-2025-59375 from #1034 (of Expat 2.7.2 and related + backports) + #1059 Fix a class of false positives where input should have been + rejected with error XML_ERROR_ASYNC_ENTITY; regression from + CVE-2024-8176 fix pull request #973 (of Expat 2.7.0 and + related backports). Please check the added unit tests for + example documents. + + Other changes: + #1043 Prove and regression-proof absence of integer overflow + from function expat_realloc + #1062 Remove "harmless" cast that truncated a size_t to unsigned + #1049 Autotools: Remove "ln -s" discovery + #1054 docs: Be consistent with use of floating point around + XML_SetAllocTrackerMaximumAmplification + #1056 docs: Make it explicit that XML_GetCurrentColumnNumber + starts at 0 + #1057 docs: Better integrate the effect of the activation + thresholds + #1058 docs: Fix an in-comment typo in expat.h + #1045 docs: Fix a typo in README.md + #1041 docs: Improve change log of release 2.7.2 + #1053 xmlwf: Resolve use of functions XML_GetErrorLineNumber + and XML_GetErrorColumnNumber + #1032 Windows: Normalize .bat files to CRLF line endings + #1060 #1061 Version info bumped from 12:0:11 (libexpat*.so.1.11.0) + to 12:1:11 (libexpat*.so.1.11.1); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #1047 #1050 CI: Cleanup UndefinedBehaviorSanitizer fatality + #1044 CI|Linux: Stop aborting at first job failure + #1052 CI|FreeBSD: Upgrade to FreeBSD 15.0 + #1039 CI|FreeBSD: Do not install CMake meta-package + + Special thanks to: + Bénédikt Tran + Berkay Eren Ürün + Daniel Engberg + Hanno Böck + Matthew Fernandez + Rolf Eike Beer + Sam James + Tim Bray + and + Clang/GCC UndefinedBehaviorSanitizer + OSS-Fuzz / ClusterFuzz + Z3 Theorem Prover + Release 2.7.2 Tue September 16 2025 Security fixes: #1018 #1034 CVE-2025-59375 -- Disallow use of disproportional amounts of @@ -73,7 +126,7 @@ Release 2.7.2 Tue September 16 2025 to the pull request URL could be of help. Other changes: - #1008 #1017 Autotools: Sync CMake templates with CMake 3.31 for macOS + #1008 #1017 Autotools|macOS: Sync CMake templates with CMake 3.31 #1007 CMake: Drop support for CMake <3.15 #1004 CMake: Fix off_t detection for -Werror #1007 CMake|Windows: Fix -DEXPAT_MSVC_STATIC_CRT=ON @@ -89,7 +142,7 @@ Release 2.7.2 Tue September 16 2025 #994 docs: Drop AppVeyor badge #1000 tests: Fix portable_strndup #1036 Drop casts around malloc/free/realloc that C99 does not need - #1010 Replace empty for-loops with while loops + #1010 Replace empty for loops with while loops #1011 Add const with internal XmlInitUnknownEncodingNS #14 #1037 Drop an OpenVMS support leftover #999 #1001 Address more clang-tidy warnings @@ -111,6 +164,7 @@ Release 2.7.2 Tue September 16 2025 Neil Pang Theo Buehler and + GNU Time OSS-Fuzz / ClusterFuzz Perl XML::Parser diff --git a/contrib/expat/README.md b/contrib/expat/README.md index fdaaf459e204..c2f288ca1242 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -11,7 +11,7 @@ > at the top of the `Changes` file. -# Expat, Release 2.7.2 +# Expat, Release 2.7.3 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by @@ -120,7 +120,7 @@ project(hello VERSION 1.0.0) FetchContent_Declare( expat GIT_REPOSITORY https://github.com/libexpat/libexpat/ - GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z + GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_X_Y_Z SOURCE_SUBDIR expat/ ) diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index b9966eabcd60..072fea41ee8c 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -24,6 +24,7 @@ dnl Copyright (c) 2019 Kishore Kunche dnl Copyright (c) 2020 Jeffrey Walton dnl Copyright (c) 2024 Ferenc Géczi dnl Copyright (c) 2024 Dag-Erling Smørgrav +dnl Copyright (c) 2025 Matthew Fernandez dnl Licensed under the MIT license: dnl dnl Permission is hereby granted, free of charge, to any person obtaining @@ -85,7 +86,7 @@ dnl If the API changes incompatibly set LIBAGE back to 0 dnl LIBCURRENT=12 # sync -LIBREVISION=0 # with +LIBREVISION=1 # with LIBAGE=11 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) @@ -95,7 +96,6 @@ AH_BOTTOM([#endif // ndef EXPAT_CONFIG_H]) AM_PROG_AR AC_PROG_INSTALL -AC_PROG_LN_S AC_PROG_MAKE_SET LT_PREREQ([2.4]) diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 12b12b92ff6d..d2dded499435 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -52,7 +52,7 @@

The Expat XML Parser - Release 2.7.2 + Release 2.7.3

@@ -2137,8 +2137,8 @@ XML_Size XMLCALL XML_GetCurrentColumnNumber(XML_Parser p);
-Return the offset, from the beginning of the current line, of -the position. +Return the offset, from the beginning of the current line, of +the position. The first column is reported as 0.

XML_GetCurrentByteCount

@@ -2200,7 +2200,10 @@ XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p, returns XML_TRUE upon success and XML_FALSE upon error.

-

The amplification factor is calculated as ..

+

+ Once the threshold for activation is reached, + the amplification factor is calculated as .. +

amplification := (direct + indirect) / direct

.. while parsing, whereas @@ -2317,7 +2320,10 @@ XML_SetAllocTrackerMaximumAmplification(XML_Parser p, -

The amplification factor is calculated as ..

+

+ Once the threshold for activation is reached, + the amplification factor is calculated as .. +

amplification := allocated / direct

.. while parsing, whereas @@ -2339,7 +2345,7 @@ XML_SetAllocTrackerMaximumAmplification(XML_Parser p,

Note: - Amplifications factors greater than 100 can been observed near the start of parsing + Amplifications factors greater than 100.0 can been observed near the start of parsing even with benign files in practice. So if you do reduce the maximum allowed amplification, diff --git a/contrib/expat/doc/xmlwf.1 b/contrib/expat/doc/xmlwf.1 index 5f50ba9e4d00..aa2e9c218007 100644 --- a/contrib/expat/doc/xmlwf.1 +++ b/contrib/expat/doc/xmlwf.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "September 16, 2025" "" "" +.TH XMLWF 1 "September 24, 2025" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS diff --git a/contrib/expat/doc/xmlwf.xml b/contrib/expat/doc/xmlwf.xml index defe9df8e46a..01316bb16627 100644 --- a/contrib/expat/doc/xmlwf.xml +++ b/contrib/expat/doc/xmlwf.xml @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ Scott"> Bronson"> - September 16, 2025"> + September 24, 2025"> 1"> bronson@rinspin.com"> diff --git a/contrib/expat/lib/expat.h b/contrib/expat/lib/expat.h index bb9cdedbac7d..290dfeb0f6dd 100644 --- a/contrib/expat/lib/expat.h +++ b/contrib/expat/lib/expat.h @@ -19,6 +19,7 @@ Copyright (c) 2023 Hanno Böck Copyright (c) 2023 Sony Corporation / Snild Dolkow Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp> + Copyright (c) 2025 Matthew Fernandez Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -276,7 +277,7 @@ XML_ParserCreate_MM(const XML_Char *encoding, /* Prepare a parser object to be reused. This is particularly valuable when memory allocation overhead is disproportionately high, - such as when a large number of small documnents need to be parsed. + such as when a large number of small documents need to be parsed. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. @@ -1081,7 +1082,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); */ # define XML_MAJOR_VERSION 2 # define XML_MINOR_VERSION 7 -# define XML_MICRO_VERSION 2 +# define XML_MICRO_VERSION 3 # ifdef __cplusplus } diff --git a/contrib/expat/lib/internal.h b/contrib/expat/lib/internal.h index 6e087858ebbe..8f5edf48ef7c 100644 --- a/contrib/expat/lib/internal.h +++ b/contrib/expat/lib/internal.h @@ -108,6 +108,7 @@ #endif #include // ULONG_MAX +#include // size_t #if defined(_WIN32) \ && (! defined(__USE_MINGW_ANSI_STDIO) \ @@ -153,6 +154,11 @@ #define EXPAT_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT \ 67108864 // 64 MiB, 2^26 +// NOTE: If function expat_alloc was user facing, EXPAT_MALLOC_ALIGNMENT would +// have to take sizeof(long double) into account +#define EXPAT_MALLOC_ALIGNMENT sizeof(long long) // largest parser (sub)member +#define EXPAT_MALLOC_PADDING ((EXPAT_MALLOC_ALIGNMENT) - sizeof(size_t)) + /* NOTE END */ #include "expat.h" // so we can use type XML_Parser below diff --git a/contrib/expat/lib/xmlparse.c b/contrib/expat/lib/xmlparse.c index de1594934900..a187a3a18f19 100644 --- a/contrib/expat/lib/xmlparse.c +++ b/contrib/expat/lib/xmlparse.c @@ -1,4 +1,4 @@ -/* 60e137abb91af642d6c3988f8f133d23329b32638659c74d47125fc0faf6ddd5 (2.7.2+) +/* 28bcd8b1ba7eb595d82822908257fd9c3589b4243e3c922d0369f35bfcd7b506 (2.7.3+) __ __ _ ___\ \/ /_ __ __ _| |_ / _ \\ /| '_ \ / _` | __| @@ -41,6 +41,7 @@ Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow Copyright (c) 2024-2025 Berkay Eren Ürün Copyright (c) 2024 Hanno Böck + Copyright (c) 2025 Matthew Fernandez Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -850,14 +851,14 @@ static void * # endif expat_malloc(XML_Parser parser, size_t size, int sourceLine) { // Detect integer overflow - if (SIZE_MAX - size < sizeof(size_t)) { + if (SIZE_MAX - size < sizeof(size_t) + EXPAT_MALLOC_PADDING) { return NULL; } const XML_Parser rootParser = getRootParserOf(parser, NULL); assert(rootParser->m_parentParser == NULL); - const size_t bytesToAllocate = sizeof(size_t) + size; + const size_t bytesToAllocate = sizeof(size_t) + EXPAT_MALLOC_PADDING + size; if ((XmlBigCount)-1 - rootParser->m_alloc_tracker.bytesAllocated < bytesToAllocate) { @@ -894,7 +895,7 @@ expat_malloc(XML_Parser parser, size_t size, int sourceLine) { rootParser->m_alloc_tracker.peakBytesAllocated, sourceLine); } - return (char *)mallocedPtr + sizeof(size_t); + return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING; } # if defined(XML_TESTING) @@ -914,8 +915,9 @@ expat_free(XML_Parser parser, void *ptr, int sourceLine) { // Extract size (to the eyes of malloc_fcn/realloc_fcn) and // the original pointer returned by malloc/realloc - void *const mallocedPtr = (char *)ptr - sizeof(size_t); - const size_t bytesAllocated = sizeof(size_t) + *(size_t *)mallocedPtr; + void *const mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t); + const size_t bytesAllocated + = sizeof(size_t) + EXPAT_MALLOC_PADDING + *(size_t *)mallocedPtr; // Update accounting assert(rootParser->m_alloc_tracker.bytesAllocated >= bytesAllocated); @@ -954,7 +956,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { // Extract original size (to the eyes of the caller) and the original // pointer returned by malloc/realloc - void *mallocedPtr = (char *)ptr - sizeof(size_t); + void *mallocedPtr = (char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t); const size_t prevSize = *(size_t *)mallocedPtr; // Classify upcoming change @@ -969,8 +971,13 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { } } + // NOTE: Integer overflow detection has already been done for us + // by expat_heap_increase_tolerable(..) above + assert(SIZE_MAX - sizeof(size_t) - EXPAT_MALLOC_PADDING >= size); + // Actually allocate - mallocedPtr = parser->m_mem.realloc_fcn(mallocedPtr, sizeof(size_t) + size); + mallocedPtr = parser->m_mem.realloc_fcn( + mallocedPtr, sizeof(size_t) + EXPAT_MALLOC_PADDING + size); if (mallocedPtr == NULL) { return NULL; @@ -1001,7 +1008,7 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) { // Update in-block recorded size *(size_t *)mallocedPtr = size; - return (char *)mallocedPtr + sizeof(size_t); + return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING; } #endif // XML_GE == 1 @@ -1337,7 +1344,8 @@ parserCreate(const XML_Char *encodingName, XML_Parser parser = NULL; #if XML_GE == 1 - const size_t increase = sizeof(size_t) + sizeof(struct XML_ParserStruct); + const size_t increase + = sizeof(size_t) + EXPAT_MALLOC_PADDING + sizeof(struct XML_ParserStruct); if (parentParser != NULL) { const XML_Parser rootParser = getRootParserOf(parentParser, NULL); @@ -1352,11 +1360,13 @@ parserCreate(const XML_Char *encodingName, if (memsuite) { XML_Memory_Handling_Suite *mtemp; #if XML_GE == 1 - void *const sizeAndParser = memsuite->malloc_fcn( - sizeof(size_t) + sizeof(struct XML_ParserStruct)); + void *const sizeAndParser + = memsuite->malloc_fcn(sizeof(size_t) + EXPAT_MALLOC_PADDING + + sizeof(struct XML_ParserStruct)); if (sizeAndParser != NULL) { *(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct); - parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)); + parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t) + + EXPAT_MALLOC_PADDING); #else parser = memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); if (parser != NULL) { @@ -1369,11 +1379,12 @@ parserCreate(const XML_Char *encodingName, } else { XML_Memory_Handling_Suite *mtemp; #if XML_GE == 1 - void *const sizeAndParser - = malloc(sizeof(size_t) + sizeof(struct XML_ParserStruct)); + void *const sizeAndParser = malloc(sizeof(size_t) + EXPAT_MALLOC_PADDING + + sizeof(struct XML_ParserStruct)); if (sizeAndParser != NULL) { *(size_t *)sizeAndParser = sizeof(struct XML_ParserStruct); - parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t)); + parser = (XML_Parser)((char *)sizeAndParser + sizeof(size_t) + + EXPAT_MALLOC_PADDING); #else parser = malloc(sizeof(struct XML_ParserStruct)); if (parser != NULL) { @@ -6437,6 +6448,10 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end, // process its possible inner entities (which are added to the // m_openInternalEntities during doProlog or doContent calls above) entity->hasMore = XML_FALSE; + if (! entity->is_param + && (openEntity->startTagLevel != parser->m_tagLevel)) { + return XML_ERROR_ASYNC_ENTITY; + } triggerReenter(parser); return result; } // End of entity processing, "if" block will return here @@ -8135,7 +8150,7 @@ poolGrow(STRING_POOL *pool) { if (bytesToAllocate == 0) return XML_FALSE; - temp = REALLOC(pool->parser, pool->blocks, (unsigned)bytesToAllocate); + temp = REALLOC(pool->parser, pool->blocks, bytesToAllocate); if (temp == NULL) return XML_FALSE; pool->blocks = temp; diff --git a/contrib/expat/lib/xmlrole.h b/contrib/expat/lib/xmlrole.h index 67bdd3dd5160..9d0d4ff11b7f 100644 --- a/contrib/expat/lib/xmlrole.h +++ b/contrib/expat/lib/xmlrole.h @@ -10,7 +10,7 @@ Copyright (c) 2000 Clark Cooper Copyright (c) 2002 Karl Waclawek Copyright (c) 2002 Fred L. Drake, Jr. - Copyright (c) 2017-2024 Sebastian Pipping + Copyright (c) 2017-2025 Sebastian Pipping Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining diff --git a/contrib/expat/tests/alloc_tests.c b/contrib/expat/tests/alloc_tests.c index 644a49523c6e..5ae6c6a72025 100644 --- a/contrib/expat/tests/alloc_tests.c +++ b/contrib/expat/tests/alloc_tests.c @@ -2091,6 +2091,13 @@ START_TEST(test_alloc_reset_after_external_entity_parser_create_fail) { } END_TEST +#if XML_GE == 1 +static size_t +sizeRecordedFor(void *ptr) { + return *(size_t *)((char *)ptr - EXPAT_MALLOC_PADDING - sizeof(size_t)); +} +#endif // XML_GE == 1 + START_TEST(test_alloc_tracker_size_recorded) { XML_Memory_Handling_Suite memsuite = {malloc, realloc, free}; @@ -2106,16 +2113,16 @@ START_TEST(test_alloc_tracker_size_recorded) { void *ptr = expat_malloc(parser, 10, -1); assert_true(ptr != NULL); - assert_true(*((size_t *)ptr - 1) == 10); + assert_true(sizeRecordedFor(ptr) == 10); assert_true(expat_realloc(parser, ptr, SIZE_MAX / 2, -1) == NULL); - assert_true(*((size_t *)ptr - 1) == 10); // i.e. unchanged + assert_true(sizeRecordedFor(ptr) == 10); // i.e. unchanged ptr = expat_realloc(parser, ptr, 20, -1); assert_true(ptr != NULL); - assert_true(*((size_t *)ptr - 1) == 20); + assert_true(sizeRecordedFor(ptr) == 20); expat_free(parser, ptr, -1); #endif @@ -2125,6 +2132,22 @@ START_TEST(test_alloc_tracker_size_recorded) { } END_TEST +START_TEST(test_alloc_tracker_pointer_alignment) { + XML_Parser parser = XML_ParserCreate(NULL); +#if XML_GE == 1 + assert_true(sizeof(long long) >= sizeof(size_t)); // self-test + long long *const ptr + = (long long *)expat_malloc(parser, 4 * sizeof(long long), -1); + ptr[0] = 0LL; + ptr[1] = 1LL; + ptr[2] = 2LL; + ptr[3] = 3LL; + expat_free(parser, ptr, -1); +#endif + XML_ParserFree(parser); +} +END_TEST + START_TEST(test_alloc_tracker_maximum_amplification) { if (g_reparseDeferralEnabledDefault == XML_TRUE) { return; @@ -2355,14 +2378,13 @@ make_alloc_test_case(Suite *s) { tcase_add_test__ifdef_xml_dtd( tc_alloc, test_alloc_reset_after_external_entity_parser_create_fail); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_size_recorded); - tcase_add_test__ifdef_xml_dtd(tc_alloc, - test_alloc_tracker_maximum_amplification); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_threshold); - tcase_add_test__ifdef_xml_dtd(tc_alloc, - test_alloc_tracker_getbuffer_unlimited); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_api); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_size_recorded); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_pointer_alignment); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_maximum_amplification); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_threshold); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_getbuffer_unlimited); + tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_api); tcase_add_test(tc_alloc, test_mem_api_cycle); - tcase_add_test__ifdef_xml_dtd(tc_alloc, test_mem_api_unlimited); + tcase_add_test__if_xml_ge(tc_alloc, test_mem_api_unlimited); } diff --git a/contrib/expat/tests/misc_tests.c b/contrib/expat/tests/misc_tests.c index 3346bce6074b..2a8054546a12 100644 --- a/contrib/expat/tests/misc_tests.c +++ b/contrib/expat/tests/misc_tests.c @@ -211,7 +211,7 @@ START_TEST(test_misc_version) { if (! versions_equal(&read_version, &parsed_version)) fail("Version mismatch"); - if (xcstrcmp(version_text, XCS("expat_2.7.2")) + if (xcstrcmp(version_text, XCS("expat_2.7.3")) != 0) /* needs bump on releases */ fail("XML_*_VERSION in expat.h out of sync?\n"); } @@ -679,6 +679,98 @@ START_TEST(test_misc_expected_event_ptr_issue_980) { } END_TEST +START_TEST(test_misc_sync_entity_tolerated) { + const char *const doc = "'>\n" + " two'>\n" + " threefourthree'>\n" + " &b;'>\n" + "]>\n" + "&a;&b;&c;&d;\n"; + XML_Parser parser = XML_ParserCreate(NULL); + + assert_true(_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), + /*isFinal=*/XML_TRUE) + == XML_STATUS_OK); + + XML_ParserFree(parser); +} +END_TEST + +START_TEST(test_misc_async_entity_rejected) { + struct test_case { + const char *doc; + enum XML_Status expectedStatusNoGE; + enum XML_Error expectedErrorNoGE; + XML_Size expectedErrorLine; + XML_Size expectedErrorColumn; + }; + const struct test_case cases[] = { + // Opened by one entity, closed by another + {"'>\n" + " '>\n" + "]>\n" + "&open;&close;\n", + XML_STATUS_OK, XML_ERROR_NONE, 5, 4}, + // Opened by tag, closed by entity (non-root case) + {"\n" + " '>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_TAG_MISMATCH, 5, 8}, + // Opened by tag, closed by entity (root case) + {"\n" + " '>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_NO_ELEMENTS, 5, 4}, + // Opened by entity, closed by tag <-- regression from 2.7.0 + {"\n" + " &g0;'>\n" + "]>\n" + "&g1;\n", + XML_STATUS_ERROR, XML_ERROR_TAG_MISMATCH, 5, 4}, + // Opened by tag, closed by entity; then the other way around + {"'>\n" + " '>\n" + "]>\n" + "&close;&open;\n", + XML_STATUS_OK, XML_ERROR_NONE, 5, 8}, + }; + + for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) { + const struct test_case testCase = cases[i]; + set_subtest("cases[%d]", (int)i); + + const char *const doc = testCase.doc; +#if XML_GE == 1 + const enum XML_Status expectedStatus = XML_STATUS_ERROR; + const enum XML_Error expectedError = XML_ERROR_ASYNC_ENTITY; +#else + const enum XML_Status expectedStatus = testCase.expectedStatusNoGE; + const enum XML_Error expectedError = testCase.expectedErrorNoGE; +#endif + + XML_Parser parser = XML_ParserCreate(NULL); + assert_true(_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), + /*isFinal=*/XML_TRUE) + == expectedStatus); + assert_true(XML_GetErrorCode(parser) == expectedError); +#if XML_GE == 1 + assert_true(XML_GetCurrentLineNumber(parser) == testCase.expectedErrorLine); + assert_true(XML_GetCurrentColumnNumber(parser) + == testCase.expectedErrorColumn); +#endif + XML_ParserFree(parser); + } +} +END_TEST + void make_miscellaneous_test_case(Suite *s) { TCase *tc_misc = tcase_create("miscellaneous tests"); @@ -707,4 +799,6 @@ make_miscellaneous_test_case(Suite *s) { tcase_add_test(tc_misc, test_misc_stopparser_rejects_unstarted_parser); tcase_add_test__if_xml_ge(tc_misc, test_renter_loop_finite_content); tcase_add_test(tc_misc, test_misc_expected_event_ptr_issue_980); + tcase_add_test(tc_misc, test_misc_sync_entity_tolerated); + tcase_add_test(tc_misc, test_misc_async_entity_rejected); } diff --git a/contrib/expat/xmlwf/xmlfile.c b/contrib/expat/xmlwf/xmlfile.c index 54617fcc5a1a..ce0b61217ed7 100644 --- a/contrib/expat/xmlwf/xmlfile.c +++ b/contrib/expat/xmlwf/xmlfile.c @@ -96,8 +96,8 @@ reportError(XML_Parser parser, const XML_Char *filename) { ftprintf(stdout, T("%s") T(":%") T(XML_FMT_INT_MOD) T("u") T(":%") T(XML_FMT_INT_MOD) T("u") T(": %s\n"), - filename, XML_GetErrorLineNumber(parser), - XML_GetErrorColumnNumber(parser), message); + filename, XML_GetCurrentLineNumber(parser), + XML_GetCurrentColumnNumber(parser), message); else ftprintf(stderr, T("%s: (unknown message %u)\n"), filename, (unsigned int)code); diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h index 64da66e1cf6f..565404f1577b 100644 --- a/lib/libexpat/expat_config.h +++ b/lib/libexpat/expat_config.h @@ -89,7 +89,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.7.2" +#define PACKAGE_STRING "expat 2.7.3" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -98,7 +98,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.7.2" +#define PACKAGE_VERSION "2.7.3" /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -106,7 +106,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.7.2" +#define VERSION "2.7.3" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3 index 60aa64fba20d..d25249bbc155 100644 --- a/lib/libexpat/libbsdxml.3 +++ b/lib/libexpat/libbsdxml.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\"/ -.Dd April 7, 2025 +.Dd September 28, 2025 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh DESCRIPTION The .Nm -library is a verbatim copy of the eXpat XML library version 2.7.2. +library is a verbatim copy of the eXpat XML library version 2.7.3. .Pp The .Nm From nobody Thu Oct 2 16:47:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyPw2TZDz69X5q; Thu, 02 Oct 2025 16:47: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyPw1syVz3lDs; Thu, 02 Oct 2025 16:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLGjnRdFjbIn3lD8slUkuZyBWiAUDSYc877emJmkkO0=; b=PiOTZUoFDX/jE6wweFrhk1S+MnBruxStADytas/MGvvD5blXNXv5otODnV8ioP+VE6/RQL RwLzWTYbYggxsrkh49ZXWj8sWvhw6CQJafnkknNODiuDaUPQ90/g+7mEE7qLWvtP+Y5T9A ukql6ivbitwIfjjc+jpoz6xRme6Nx4OEpQs/NfrQbKvxT80LtkNSlkLbF7R4x6BakCWrUs 9QpoYI5P4XdJIw+oFc8zWJa7K2gUwBaO26FwBeSIGSeUuC71TCxOEnzrDmd/CKPTN3+hDz MHV6XfdbCdsJioreUsretk/f0XGUMctPt6UQl84arLKcPxq/bWtFQ16KA5jYXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759423636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLGjnRdFjbIn3lD8slUkuZyBWiAUDSYc877emJmkkO0=; b=c12r8/JD3pE1+mEHWRRQeDkgFzI8CdcLXcdrgqsht4a+AAO/Ou3v0EMf3efzRI/Qs7KRjy 0UIJY2gM8MZojdhOGVQZpBT02IymtyiKhm0Iwv1TLe4F2vdWiqFccf+fQCEZ/d2b7eInZZ j39mUUr7FCWhSO0LkRJEzKbfETyF3lAVMg4vRPnoD1DK/i3ONO/ZJFWJNjQMam9A0RWmVs XHhdXk3NMzlmymuTB6gkRdkUudOyHE8eK1FGTVlkx+Y6bUxkDVVEAvj+05jsGb5dPHI05R GYxypF7eLwmnX0QunG7MlAp1V52nDOe8bTEIjzBfCoxKWQeHYAMDLTepscX2XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759423636; a=rsa-sha256; cv=none; b=Xkeb0z5CturYoajWsFDoA1AQal9P1IggaRcPrCjc813WfCA/aiSqw/VKB0B0uvxErqe6cc aeXzbZzFs7DzR15aNL4sAKioXM74aDH7DoE9Ras4dDFl5n+nX6nYy47Au5xTKBT2LZWDw4 bnngKzCzsayPN39cvRtm8cIiwsRwL1giFpUSn+rGtBeXWGxBl98ldnMUUptkYirZ8kStOh eHQQBqNJeK5+feabauBISKXEmMafTL8ghKeSVRtOBAJubT2osr4BMov2lPFPlxN+EhxqcH HxaOkW556obZWV+csDa7+gtdVvLYUT8o77EX1LFh5c9lbA7dsfKKBMc+Ck+jxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyPw1Bk0z1pM; Thu, 02 Oct 2025 16:47: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 592GlFnn008278; Thu, 2 Oct 2025 16:47:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592GlF7o008275; Thu, 2 Oct 2025 16:47:15 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:47:15 GMT Message-Id: <202510021647.592GlF7o008275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 5ba4a93f9180 - stable/15 - thunderbolt.4: Mention Thunderbolt 3 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 5ba4a93f9180699d6e1ba4906b0f826842cf8038 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=5ba4a93f9180699d6e1ba4906b0f826842cf8038 commit 5ba4a93f9180699d6e1ba4906b0f826842cf8038 Author: Alexander Ziaee AuthorDate: 2025-10-02 15:27:43 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 16:45:49 +0000 thunderbolt.4: Mention Thunderbolt 3 MFC after: 1 hr Reported by: emaste Fixes: 2f7a796b590e (thunderbolt.4: Initial manual) (cherry picked from commit e4e412e45a17d2f63f6693d41b274379d108c82f) --- share/man/man4/thunderbolt.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/thunderbolt.4 b/share/man/man4/thunderbolt.4 index 3477c11fb60d..fd7cb1f3f338 100644 --- a/share/man/man4/thunderbolt.4 +++ b/share/man/man4/thunderbolt.4 @@ -14,7 +14,7 @@ .Sh HARDWARE The .Nm -driver supports USB4 controllers. +driver supports Thunderbolt 3 and USB4 controllers. .Sh HISTORY The .Nm From nobody Thu Oct 2 16:58:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyfn4DYdz69YMQ; Thu, 02 Oct 2025 16:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyfn31NHz3nXg; Thu, 02 Oct 2025 16:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX/L1M/i6zr2goKTgXJjwZtUvjCdlgjTtpxbdEZQ54c=; b=N5wj4Zslz8rj+R2+Fiqfk3ctAsJj9FYspH+289KQMSft8v9JQyZkVcqhjTtWw95JizSvsW VX0OjVRAh0WDBZuxKe50x2dU78LBFWsrtheC77RT5gGcwBAB/tejvwHWaP4D0mmPjhKV/s uTLsTtKP/MYmEWMbEdqy+Rm/yKBeAHFbI0bXHSH4xbi3EhT5hsVmOGImjffMJeSSMe4AOy 3EvvIPIO2ljMQIjx4O1bW0It5DAyFxBu6nN9lqx0lCyTtiI4HiiIOtfMGQGf4lTp3kuh6G 3ij0R03nq6V21EUL6I7ILkid0X6med9u4oL6+SvEiHs0zpqzTJfKhUKhV0+Xbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX/L1M/i6zr2goKTgXJjwZtUvjCdlgjTtpxbdEZQ54c=; b=dnsmZT9ksmF0kBHORHmL/2v+weCB04bQgJS5fpFuhSLXLXCtAzw3esv8mHqioxURFXXjDY U5RJ+NpCoZt0rtY0mnBl51niCpCHWo2sdlnXIYm6b1dNaOgtD7NZZGsyrFBahcefclyPWS Co3dtQiP7e/PPb6olOp3pkl1CdVXVdF2Ecvg5cyEhle/mpMB+9ZohOX8ZvrXVnowW5fmNZ cY3hbKcxXLqL0Dta7Fd5Lxx2c43BGbgQqLG78yJAr6mMPaaXsVjFylSkw9xqIYlNZmPiGR WeeUsG2s8dnUPc5a1WKeCtXl1mkG8DEHi/IQzdA3Jq+LxyVhwsOWMcC6qz3ikA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759424305; a=rsa-sha256; cv=none; b=i8ZqL2hjBs/bqeWXTyIruhssbVsn7CupZ5W03elY5CQM7PEPqXjYiZ+B4NGVHPPfI3o0db SOHezLbrKN1WrFnmg51LZyYTiLRef1OV0LESUSVULFFMfUb+SCUeJDC/DCIznc3wkH4b/M xb1S7TFplDBxwGSJIrzgNW0er0Q0A8BMaZ1/RJdxQ/hbFSS189wyhuk+pnZwWf/kVLFrGu ebvQC6UAZmi0xi3natYY9OrUepy+ygWDtaJHVMxUp4TuUWRD2jUnsS4pPVLNKvJo0yre08 DJhT2v142ogilhQq/2ubRWLiRwQs2SaoaFeaA9M7ibu3TYbQSENTzwNnV+ooug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyfn2TqWz28r; Thu, 02 Oct 2025 16:58: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 592GwPs5028149; Thu, 2 Oct 2025 16:58:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592GwPVN028146; Thu, 2 Oct 2025 16:58:25 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:58:25 GMT Message-Id: <202510021658.592GwPVN028146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 907fbfd7e4b6 - stable/15 - mac_do.4: Mention "from" part's GID can also match supplementary groups List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 907fbfd7e4b6cae315863cf63ca77dee8afb3b00 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=907fbfd7e4b6cae315863cf63ca77dee8afb3b00 commit 907fbfd7e4b6cae315863cf63ca77dee8afb3b00 Author: Olivier Certner AuthorDate: 2025-09-28 13:55:20 +0000 Commit: Olivier Certner CommitDate: 2025-10-02 16:57:14 +0000 mac_do.4: Mention "from" part's GID can also match supplementary groups MFC after: 3 days Event: EuroBSDCon 2025 Sponsored by: The FreeBSD Foundation (cherry picked from commit c1d5fc4e0cfc63d23379457ac0b51c59c60b27c7) --- share/man/man4/mac_do.4 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4 index 4dcb54c89673..39bfafd95474 100644 --- a/share/man/man4/mac_do.4 +++ b/share/man/man4/mac_do.4 @@ -94,8 +94,10 @@ i.e., one of the literal strings or .Ql gid . .Li Aq id -must be the numerical ID of a user or group, and is matched with the current -process real ID of the corresponding type. +must be the numerical ID of a user or group and is matched against the current +process real ID of the corresponding type, and on type +.Ql gid +additionally against the supplementary groups. .Ss Rule's Ao to Ac Part The second part of a rule, .Li Aq to , @@ -377,8 +379,8 @@ Same as the first example, but lifting any constraints on groups, allowing the process to become part of any groups it sees fit. .El .Pp -Here are several examples of single rules matching processes having a real group -ID of 10001: +Here are several examples of single rules matching processes having 10001 as +their real group IDs or in their supplementary groups: .Bl -tag -width indent .It Li gid=10001>uid=0 Makes 10001 a more powerful From nobody Thu Oct 2 16:58:26 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyfq05vxz69YTk; Thu, 02 Oct 2025 16: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyfp4RS5z3ncp; Thu, 02 Oct 2025 16:58:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ltgp3+z17PdJv3cqAPNK/kvAkM952AGtNM8mApan7x8=; b=GmTbXAf3FHiSz9L6HsESPQpVj9jV6VJrcN6i30hE1H+JE+b48D6i+b/42YuaALokDT6ZGK AYr4l+/qEnUyy4cclswbI/1jFEUmbSYo9vKUYLQaqrTXMmn5u8TEFnHqURyn0VBhDMgONz ASqZoOXL+VKwU6Ap6JF395X7Ntp7q3zsFlWNlhZTsYGsL3x/LGNKAMa9HYmg9apKExuVEK +D2LrYD6nsh1A8TL+yyzjSTS4zDPmPrdympeZsl+QnHHLdRyRldiF9HwuE0JKxuXGH2SlW UaICwzxC3tzhWVenFWxIWqeHMt5qOaiYdTJs/AhIZrAW14mKk3E35kTvvy1jhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ltgp3+z17PdJv3cqAPNK/kvAkM952AGtNM8mApan7x8=; b=CSlP1k1GgNlvvDt8gg0i3VN9BQuSjvx2Kx5TnDCMgLIddsVTg52JexmGUX5VlTQ6B8Dh1X qrVcE3BSjOjW3GpTrDiT2lQR3CyIfind+sg2848j9BOiMfLUX0Xk9q/Dyo9RyJQsbV/ntl ZmXsAA9SCw4h4xJXUSgpSK9dGHN5bqF4BcwJT+kRLt77VCtKpQKtCEyoJW5ryFV3gC/RSY 1bKAJGb2fmDSx4hXRrSOMBFmn8sMf5eEu4lDNkJI+j0V545XEhXvqUWDW9+UacaCrMCpi0 nwxNO2uZMN4LKpo6D7KTNuw3d8DoEhM0mZp+BPxbzfmevnB1dge9JsGgOJEgKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759424306; a=rsa-sha256; cv=none; b=UhB8Nz2yG7UMYXpSHyQahwSx0OLIdGqM6YsckvOYM3YlUDxIpm8QMALMssiVjL9D2kY2iV MXnx15Njq06ypy1Sl0Mm0GBqElXjUBXCvFhiE16UO8ycbjRmxKXb/cBHK7FbP6ze8UOpoO Acf9PiyBo/TiS499uVr+TcdYzSQXawWB00OYpKtIabOWUCYQ49+8+jlqZTHereqMbke7La oVT6Cl4JjNGmSLzKeBSjeUHaHcPXQYgZcmgHnKVUuo83/BWn3OSRxorhyc15sTrYcrbdNZ gzeFIwcQDbzKTwtj/2N/cZb4lojn/BjjGaRZRmvQ9EdWkzrGYHCTP9k8p/45kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyfp3bYYz1fJ; Thu, 02 Oct 2025 16:58:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 592GwQ9N028183; Thu, 2 Oct 2025 16:58:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592GwQv5028180; Thu, 2 Oct 2025 16:58:26 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:58:26 GMT Message-Id: <202510021658.592GwQv5028180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 09ae06b1b224 - stable/15 - vfs cache: Add vn_fullpath_jail(), factor out common code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 09ae06b1b224517b792a799620cf6038d7b52893 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=09ae06b1b224517b792a799620cf6038d7b52893 commit 09ae06b1b224517b792a799620cf6038d7b52893 Author: Olivier Certner AuthorDate: 2025-09-26 10:18:12 +0000 Commit: Olivier Certner CommitDate: 2025-10-02 16:57:19 +0000 vfs cache: Add vn_fullpath_jail(), factor out common code Introduce vn_fullpath_jail(), which returns a path to the passed vnode relative to the current jail's root. It will be used by mac_do(4) in a subsequent commit. Factor out common code between the new variant and vn_fullpath(). While here, rework the comments a bit. Add vn_fullpath_jail() to the vn_fullpath.9 manual page. While here, document all the existing public vn_fullpath*() functions. Reviewed by: kib (except latest manual page changes) MFC after: 3 days Event: EuroBSDCon 2025 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52757 (cherry picked from commit c5a813c9f486da49551c3be2e7700ca0cb0a489a) --- share/man/man9/Makefile | 1 + share/man/man9/vn_fullpath.9 | 120 +++++++++++++++++++++++++++++++++++-------- sys/kern/vfs_cache.c | 52 ++++++++++++++++--- sys/sys/vnode.h | 1 + 4 files changed, 144 insertions(+), 30 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index fe764e7c4ed7..37b306aa23bd 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2455,6 +2455,7 @@ MLINKS+=vm_page_insert.9 vm_page_remove.9 MLINKS+=vm_page_wire.9 vm_page_unwire.9 \ vm_page_wire.9 vm_page_unwire_noq.9 \ vm_page_wire.9 vm_page_wire_mapped.9 +MLINKS+=vn_fullpath.9 vn_fullpath_jail.9 MLINKS+=VOP_ACCESS.9 VOP_ACCESSX.9 MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \ VOP_ATTRIB.9 VOP_SETATTR.9 \ diff --git a/share/man/man9/vn_fullpath.9 b/share/man/man9/vn_fullpath.9 index 116f519ec8aa..9815abc3c86c 100644 --- a/share/man/man9/vn_fullpath.9 +++ b/share/man/man9/vn_fullpath.9 @@ -1,6 +1,13 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2003 Robert N. M. Watson. .\" All rights reserved. +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Olivier Certner +.\" at Kumacom SARL under sponsorship from the FreeBSD +.\" Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -25,7 +32,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd June 15, 2021 +.Dd September 29, 2025 .Dt VN_FULLPATH 9 .Os .Sh NAME @@ -35,23 +42,64 @@ .In sys/param.h .In sys/vnode.h .Ft int -.Fo vn_fullpath -.Fa "struct vnode *vp" "char **retbuf" "char **freebuf" +.Fn vn_fullpath "struct vnode *vp" "char **retbuf" "char **freebuf" +.Ft int +.Fn vn_fullpath_jail "struct vnode *vp" "char **retbuf" "char **freebuf" +.Ft int +.Fn vn_fullpath_global "struct vnode *vp" "char **retbuf" "char **freebuf" +.Ft int +.Fo vn_fullpath_hardlink +.Fa "struct vnode *vp" "struct vnode *dvp" +.Fa "const char *hrdl_name" "size_t hrdl_name_length" +.Fa "char **retbuf" "char **freebuf" "size_t *buflen" .Fc .Sh DESCRIPTION The +.Fn vn_fullpath , +.Fn vn_fullpath_jail , +.Fn vn_fullpath_global +and +.Fn vn_fullpath_hardlink +functions make a +.Dq best effort +attempt at generating a string pathname for the passed vnode. +They differ in which directory the returned path is relative to, except for +.Fn vn_fullpath_hardlink +which behaves like .Fn vn_fullpath -function makes a -.Dq "best effort" -attempt to generate a string pathname for -the passed vnode; the resulting path, if any, will be relative to -the root directory of the process associated with the passed thread pointer. +in this respect and is described at the end. +.Pp The .Fn vn_fullpath -function -is implemented by inspecting the VFS name cache, and attempting to -reconstruct a path from the process root to the object. +function returns a path relative to the root directory of the process associated +with the passed thread pointer. +That root directory is either the system's or the thread's process' containing +jail's root directory, or some descendant directory of such established by some +.Xr chroot 2 +call. +The +.Fn vn_fullpath_jail +function returns a path relative to the passed thread's process' current jail's +root, ignoring intervening +.Xr chroot 2 +calls possibly made inside that jail. +The +.Fn vn_fullpath_global +function returns the full path from the system root, ignoring all jail roots and +.Xr chroot 2 +calls. +.Pp +Paths that the kernel intends to communicate to the passed user thread should +exclusively be obtained via +.Fn vn_fullpath . +Paths obtained via +.Fn vn_fullpath_jail +or +.Fn vn_fullpath_global +are only useful for specific kernel checks or auditing purposes. .Pp +All these functions are implemented by inspecting the VFS name cache, and +attempting to reconstruct a path from the process root to the object. This process is necessarily unreliable for several reasons: intermediate entries in the path may not be found in the cache; files may have more than one name (hard links), not all file systems use the name cache @@ -64,7 +112,7 @@ a vnode pointer value, or a device number and inode number. Code consuming the results of this function should anticipate (and properly handle) failure. .Pp -Its arguments are: +These functions take the following arguments: .Bl -tag -width ".Fa freebuf" .It Fa vp The vnode to search for. @@ -72,17 +120,13 @@ No need to be locked by the caller. .It Fa retbuf Pointer to a .Vt "char *" -that -.Fn vn_fullpath -may (on success) point at a newly -allocated buffer containing the resulting pathname. +that may be set (on success) to point at a newly allocated buffer containing the +resulting pathname. .It Fa freebuf Pointer to a .Vt "char *" -that -.Fn vn_fullpath -may (on success) point at a buffer -to be freed, when the caller is done with +that may be set (on success) to point at a buffer to be freed, when the caller +is done with .Fa retbuf . .El .Pp @@ -110,11 +154,43 @@ and if so, invoke .Xr free 9 with a pool type of .Dv M_TEMP . +.Pp +The +.Fn vn_fullpath_hardlink +function is a convenience wrapper which automatically appends the hardlink name +passed via arguments +.Fa hrdl_name +and +.Fa hrdl_name_length +to the result of calling +.Fn vn_fullpath +on the vnode's parent directory. +It requires the results of a prior call to +.Xr namei 9 +with flag +.Dv WANTPARENT +to be passed in the +.Fa vp +and +.Fa dvp +arguments. +Argument +.Fa buflen +must point to a valid storage containing the size of the desired buffer, which +will be reduced to +.Dv MAXPATHLEN +if in excess of it. .Sh RETURN VALUES If the vnode is successfully converted to a pathname, 0 is returned; otherwise, an error number is returned. .Sh SEE ALSO .Xr free 9 .Sh AUTHORS -This manual page was written by -.An Robert Watson Aq Mt rwatson@FreeBSD.org . +.An -nosplit +This manual page was initally written by +.An Robert Watson Aq Mt rwatson@FreeBSD.org +to describe the +.Fn vn_fullpath +function. +The descriptions of the other related functions were added by +.An Olivier Certner Aq Mt olce@FreeBSD.org . diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 89c1d779f04c..a5e28665aed9 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3321,12 +3321,10 @@ sys___realpathat(struct thread *td, struct __realpathat_args *uap) uap->flags, UIO_USERSPACE)); } -/* - * Retrieve the full filesystem path that correspond to a vnode from the name - * cache (if available) - */ -int -vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf) +static int +vn_fullpath_up_to_pwd_vnode(struct vnode *vp, + struct vnode *(*const get_pwd_vnode)(const struct pwd *), + char **retbuf, char **freebuf) { struct pwd *pwd; char *buf; @@ -3340,11 +3338,13 @@ vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf) buf = malloc(buflen, M_TEMP, M_WAITOK); vfs_smr_enter(); pwd = pwd_get_smr(); - error = vn_fullpath_any_smr(vp, pwd->pwd_rdir, buf, retbuf, &buflen, 0); + error = vn_fullpath_any_smr(vp, get_pwd_vnode(pwd), buf, retbuf, + &buflen, 0); VFS_SMR_ASSERT_NOT_ENTERED(); if (error < 0) { pwd = pwd_hold(curthread); - error = vn_fullpath_any(vp, pwd->pwd_rdir, buf, retbuf, &buflen); + error = vn_fullpath_any(vp, get_pwd_vnode(pwd), buf, retbuf, + &buflen); pwd_drop(pwd); } if (error == 0) @@ -3354,6 +3354,42 @@ vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf) return (error); } +static inline struct vnode * +get_rdir(const struct pwd *pwd) +{ + return (pwd->pwd_rdir); +} + +/* + * Produce a filesystem path that starts from the current chroot directory and + * corresponds to the passed vnode, using the name cache (if available). + */ +int +vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf) +{ + return (vn_fullpath_up_to_pwd_vnode(vp, get_rdir, retbuf, freebuf)); +} + +static inline struct vnode * +get_jdir(const struct pwd *pwd) +{ + return (pwd->pwd_jdir); +} + +/* + * Produce a filesystem path that starts from the current jail's root directory + * and corresponds to the passed vnode, using the name cache (if available). + * + * This function allows to ignore chroots done inside a jail (or the host), + * allowing path checks to remain unaffected by privileged or unprivileged + * chroot calls. + */ +int +vn_fullpath_jail(struct vnode *vp, char **retbuf, char **freebuf) +{ + return (vn_fullpath_up_to_pwd_vnode(vp, get_jdir, retbuf, freebuf)); +} + /* * This function is similar to vn_fullpath, but it attempts to lookup the * pathname relative to the global root mount point. This is required for the diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 6ef9bbec9446..9e0f02465067 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -723,6 +723,7 @@ int speedup_syncer(void); int vn_vptocnp(struct vnode **vp, char *buf, size_t *buflen); int vn_getcwd(char *buf, char **retbuf, size_t *buflen); int vn_fullpath(struct vnode *vp, char **retbuf, char **freebuf); +int vn_fullpath_jail(struct vnode *vp, char **retbuf, char **freebuf); int vn_fullpath_global(struct vnode *vp, char **retbuf, char **freebuf); int vn_fullpath_hardlink(struct vnode *vp, struct vnode *dvp, const char *hdrl_name, size_t hrdl_name_length, char **retbuf, From nobody Thu Oct 2 16:58:27 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyfr0bKZz69YJN; Thu, 02 Oct 2025 16:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyfq4MQbz3nS3; Thu, 02 Oct 2025 16: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=1759424307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLKPSq5AuuoaWcLdzKtYFYPrEWWu3HohWcjt/848a8k=; b=YAPdtRI/FIcR0gh5E0ha+KtNDLNwwFKJk/vpi2hwvxC1vzojfFMoxD7cq58EfTKVQJQ8f4 u/DgJMKiUXWYtgWxHSvbK3uQnaWYqOSfl0yGEpDtAE/Q/bQW7nE69EX814eLgWgHNXv9D2 TmmaWhh/tuhIAAnKaqqk54OjRwLZ258FYNP3rVQa6VyLdE4FVV/B+ci72qadys7Ble1aMi l8sIdCWy6K/FYiNXepa2CHLK+Mt8D6Fw/gfiADgs7vLdRM2/X2DWvD0LKEu+Gr5fO24aa9 m+xX6h0pdtfiaGEvzz6Jo9cNhhjoF/p61avS1BR1qsKtKdLxy9a33Be/24pgug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLKPSq5AuuoaWcLdzKtYFYPrEWWu3HohWcjt/848a8k=; b=cDR7JsWDUG6oeGUorFtmT7gqaYmXTut8CajeMvZKB7o60TusJaDaMRiam7xdTaX0j8CWgM tr7YO2cQxFuBL9+YMDNUY6AyQdjE1/Bg7L5ZS9t4eTz7cAaOKEEM/P2P7yWOaOKAaUBOWO YTTpXd2iZgy4Pc0xWw6477fe7Flonn9l/O/8UUrpNR+9u/5AkUsQY4UCIAmyMBqO5gAQMN arNH2gR8T6cbo5H/W7OgpIjzRDBDQSi/iHqs9PF/oSIBFA76gHgagSydwNvd1SWsx3T+a+ SWP9G0HLDlk5iJ4UMAUH3HFTKllwiz0argqsBiWcAKWbxXtXtUsGGAldGeoUhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759424307; a=rsa-sha256; cv=none; b=ZMZN+foZfDggJgaKkQhwF7q2fil4KTcsGJVJo5cI6fX2PiSBONV1ZNxikbscT/YsvuJ3kU txitY38oK3IVo/kXFXNFKOJrMx66/yPvp3bPN0nc4MhKsfllXZHeqJKCiBBUjWbYtig5xM FOYVsFy97ShHuS9ylM+MrB33UA1fCcrqi4qHkvOEboGvLqKGD0Vv+jxBmdvmtANVEjLMPw tl6CvDzeViGkgeSmBShAwC8ibVhF+pKPeRmy2LtExkNa4WZ3FhTQhchG5HYSn+6Lu3zgYR Fz1BYK62UV0whAZpRlLlmE+Dg/tQK0COMojVQdHDhj5LfeKnFF5/73xsEuIvtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyfq3xG7z28s; Thu, 02 Oct 2025 16: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 592GwR6S028219; Thu, 2 Oct 2025 16: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 592GwRdL028217; Thu, 2 Oct 2025 16:58:27 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:58:27 GMT Message-Id: <202510021658.592GwRdL028217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 89958992b618 - stable/15 - MAC/do: Check executable path from the current jail's root List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 89958992b6189eaecbb3d036fce90fcecb005cb2 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=89958992b6189eaecbb3d036fce90fcecb005cb2 commit 89958992b6189eaecbb3d036fce90fcecb005cb2 Author: Olivier Certner AuthorDate: 2025-09-27 09:56:33 +0000 Commit: Olivier Certner CommitDate: 2025-10-02 16:57:19 +0000 MAC/do: Check executable path from the current jail's root Contrary to my initial belief, vn_fullpath() does return a vnode's path from the current chroot, and not from the global root (which would have been a bug also, but without security consequences). This enables a "confused deputy"-like scenario where a chroot(2) can change which executable can be authorized by MAC/do, which is even more problematic for unprivileged chroot(2). This was found by re-examining the code following two close events: 1. Shawn Webb sent a mail to freebsd-hackers@ on 08/05 saying that in HardenedBSD they had added a check on P2_NO_NEW_PRIVS (in mac_do_priv_grant()), which I responded to on 08/20 saying that P2_NO_NEW_PRIVS was not necessary for mac_do(4), with a correct reasoning but based on the wrong above-mentioned assumption about vn_fullpath(). 2. I reviewed some code by Kushagra Srivastava (GSoC 2025 student working on mac_do(4)/mdo(1)) adding the ability to specify which executables can spawn processes that mac_do(4) may decide to authorize (others are simply ignored), which currently is hardcoded to '/usr/bin/mdo'. MFC after: 3 days Event: EuroBSDCon 2025 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52758 (cherry picked from commit 9f269a0a771aff4f0a735211907a52c52fc0661b) --- sys/security/mac_do/mac_do.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/security/mac_do/mac_do.c b/sys/security/mac_do/mac_do.c index 6f3e63d06198..2bcff7bba973 100644 --- a/sys/security/mac_do/mac_do.c +++ b/sys/security/mac_do/mac_do.c @@ -1992,6 +1992,10 @@ check_proc(void) /* * Only grant privileges if requested by the right executable. * + * As MAC/do configuration is per-jail, in order to avoid confused + * deputy situations in chroots (privileged or unprivileged), make sure + * to check the path from the current jail's root. + * * XXXOC: We may want to base this check on a tunable path and/or * a specific MAC label. Going even further, e.g., envisioning to * completely replace the path check with the latter, we would need to @@ -2003,7 +2007,7 @@ check_proc(void) * setting a MAC label per file (perhaps via additions to mtree(1)). So * this probably isn't going to happen overnight, if ever. */ - if (vn_fullpath(curproc->p_textvp, &path, &to_free) != 0) + if (vn_fullpath_jail(curproc->p_textvp, &path, &to_free) != 0) return (EPERM); error = strcmp(path, "/usr/bin/mdo") == 0 ? 0 : EPERM; free(to_free, M_TEMP); From nobody Thu Oct 2 16:58:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyfs3Gsbz69YWV; Thu, 02 Oct 2025 16:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyfr5Qxmz3nZd; Thu, 02 Oct 2025 16:58:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMwpHG7PBb3uC9ii44EAjzvomx2o7oRHUleGyjaMFsw=; b=ueduVDxN+Mtye5tyani65Jpo1AZYaCOR2Jfb2t0/UicRGamEtdW4wGRWTTrRBFgCR3jrH3 JBQWmwgM2MWXGJi4ngUPFLNVze5y5dPgNBxL02Ge4jyFcdTUhoVsqXlDgY+IdhY3Bkwant /s46j4P9Ioadw2HQFsW+ftNlwtDdZP8Xr8eYfl0qNKU32e3lVJPwDzkR9piVAVAFr0dSGF mdFUSu3PXInaQPeg8c4l45gHdQMWIS0MqKeFG7A5f+G1L3tJbyarfgyNfxPbTQjsO0uWNR x/+GER5Xbs5FR/joVCM7QABZVHUyJHZWPJNDu51y2lsIp6Dqdd5+9pR9AFSHgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jMwpHG7PBb3uC9ii44EAjzvomx2o7oRHUleGyjaMFsw=; b=TP07Az0NX2m+sznQ9O6Nk6y4o+rOher6U7chGafI8duYQnN6C+mVsbtYFA+mrNF9rFCmXK czfz4tXoja7aHy24shZePx5aGUwCEA4pQsCqwTXJszsvq4RWvaj052vRGphat6r4G3GZx8 fRDrH805tH87iPt0PJt6ECT9jtWXqcLoknHeBAuB3GwjGJg1BVa6Z67yZFikFw/9nL1psP 0VZ6CsRanmc9ImJt1kfxxL029IXRU1UG/lEubsPD/h33oxGejTYxmDkPr8oj3rrRHo4aAx Xph+iZUlX49f5vFOr6w9ZMlpztwXh477AC2bS4aDbL4BNaA+pfGP2LQYvmid6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759424308; a=rsa-sha256; cv=none; b=DO3gkmXqWrP3FrB50f5jG+WZ8BT6KFV6AmrfT4exoS2Tmk46ibIOXSsZ3NvcmBQMsMPlcM f4nNaeIz8PfA7bDG4dTaqFvbnukIXN3e2k4COpdXTnM3VeaNq7YCtuxwPc3r4U5Yrm3oeM fLuE4h1oI5B6tRfpd9h+iSQv29g1P1GBtWI/mAqIaIFeQyNZGpP7QS8+lfaR6YJjteyNwM 2EE8tBaooBKsd6cH0RgWH0dTMiDuutqYzpMV+YZRBHOuMgM7QcAeTObpYf/H5kSwraIrPe noPHl+syVMGP20XzSQo2BxFTsteOxbJdovM2koTux6HS/9mS/KXcFv17kGFmgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyfr4swjz1yk; Thu, 02 Oct 2025 16:58: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 592GwSfe028253; Thu, 2 Oct 2025 16:58:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592GwSmF028250; Thu, 2 Oct 2025 16:58:28 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:58:28 GMT Message-Id: <202510021658.592GwSmF028250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 51a336aca7d9 - stable/15 - vn_fullpath.9: Add missing links for described functions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 51a336aca7d9a20650c394e8a8cec7956aea7b2d Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=51a336aca7d9a20650c394e8a8cec7956aea7b2d commit 51a336aca7d9a20650c394e8a8cec7956aea7b2d Author: Olivier Certner AuthorDate: 2025-09-29 17:48:09 +0000 Commit: Olivier Certner CommitDate: 2025-10-02 16:57:20 +0000 vn_fullpath.9: Add missing links for described functions To reflect all the functions that are now described in the manual page. Fixes: 9f269a0a771a ("MAC/do: Check executable path ...") MFC after: 3 days Event: EuroBSDCon 2025 Sponsored by: The FreeBSD Foundation (cherry picked from commit 05e5de00b9ea048f868522ff0bdae4e388685ddf) (cherry picked from commit c87a9f51a0debf707cb4fc9a5e3b4425b08d154d) (Compilation fix MFCed in the same commit.) --- share/man/man9/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 37b306aa23bd..feef662a9acd 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2455,7 +2455,9 @@ MLINKS+=vm_page_insert.9 vm_page_remove.9 MLINKS+=vm_page_wire.9 vm_page_unwire.9 \ vm_page_wire.9 vm_page_unwire_noq.9 \ vm_page_wire.9 vm_page_wire_mapped.9 -MLINKS+=vn_fullpath.9 vn_fullpath_jail.9 +MLINKS+=vn_fullpath.9 vn_fullpath_jail.9 \ + vn_fullpath.9 vn_fullpath_global.9 \ + vn_fullpath.9 vn_fullpath_hardlink.9 MLINKS+=VOP_ACCESS.9 VOP_ACCESSX.9 MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \ VOP_ATTRIB.9 VOP_SETATTR.9 \ From nobody Thu Oct 2 16:58:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyft6lvyz69YMf; Thu, 02 Oct 2025 16:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyfs5lVXz3nY8; Thu, 02 Oct 2025 16:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4WgF9N5FqHXgk3E95EMqJU9nW/4bYHE9OgxCi6ZStro=; b=Vowftq4mF8F79cRdhAeyCWq/emTvwfvddyZcjOgvhu/tjNOj6LpbaQgzDKau75bILwfQee /zoLW0Qpq48h/D+NAI4QYUxVA6XE8YtSH95fs0IbRzrwnEpF5WL8FviMOZOj/cv3dav66l r08Ge+Ym4xIhv0jTfNhnWR8pJ1E/BSu72uHkspnt52tBXeh71zxy0BaDzT/8UMMb1Q81kB KIYQF3cy7kyOo0GFkJa1id0PIfJnvU6rafT/pf5ni6a/ipPyD8T/29Ym+nPx4XqUVgh+2/ ELELnpjLFN9Da1lxhy+yhsRT1pIE9OmDLrpt5OwWboBa5XUI9by0R+7K6RSy/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4WgF9N5FqHXgk3E95EMqJU9nW/4bYHE9OgxCi6ZStro=; b=iGAZuXhiZGJ9ijiKyC74fTskWfKJiY241VlXqzl/8bcy2awGxkt7OVI6IIHDXpEJbZSCTh 91EFw/aoIfo6k+vVMrZNvY/wQzxTQg6I6mfE22lCr0XklMX2ukx9UEIC341Jewy1E2ahb3 qtbT0X413EBVyBSlQcvoBZzKPpkGh161u9th0jABvDWPANy2hRFV0MfQE1SVJ6Ndco+tXR MG6Y4TlXljMq73Rvihi3zr6kiWwBFQ6PBKpK0nSB/V7nGp89kW4smkJQpE3OMlD0FceG/k eN7J8qzFv6yiZrf2irEaUgKob8fQSsBJtv3bXlNCe+bkSE4dmxGEhdgOS9Icfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759424309; a=rsa-sha256; cv=none; b=sE11CRljTVaXv3t+PuADDUoYkkZ+/hUbYhJHW6+uPWu6StvPHSRhCnOZ20TR1vJe3Fv6X1 VDArzI+wQ6XkQS4MAywTPiSZCRZGGjZgsQuEDOUpisefBlqAyJP/Lk32pTHec9KYC+ANXi oituacIFobj2JLrqLD9HGY7bkyDwlekAQQv/BRmSsUoYkhellK68kdFBwrCO7Liw6fictB hEthP7apguJqwY3DC8OTF4kC8jO6FSr1FGAmIH7Mk8tqdNuIY4iEo5DJc5q8Cgrk4E2zpZ U9yPpaxLtS1a8jT2T6PcdiJgZ/wMyka9obvM2yPdwbv/syJO9QAqU2/UZxh01A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyfs5CmVz1q1; Thu, 02 Oct 2025 16:58: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 592GwTHj028286; Thu, 2 Oct 2025 16:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592GwT1K028283; Thu, 2 Oct 2025 16:58:29 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:58:29 GMT Message-Id: <202510021658.592GwT1K028283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4ffcb1a4a99c - stable/15 - mdo(1): Add support and shortcuts for fully specifying users and groups List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4ffcb1a4a99cf4224c5c35af55a8dbef77b37ea9 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4ffcb1a4a99cf4224c5c35af55a8dbef77b37ea9 commit 4ffcb1a4a99cf4224c5c35af55a8dbef77b37ea9 Author: Olivier Certner AuthorDate: 2025-09-25 11:30:00 +0000 Commit: Olivier Certner CommitDate: 2025-10-02 16:57:20 +0000 mdo(1): Add support and shortcuts for fully specifying users and groups While preserving compatibility ('root' implied if no user is specified, option '-i' not setting groups), introduce options to control finely which user and group IDs are set in the launched process. To minimize the risks of user error, mdo(1) by default enforces that all user and group IDs are specified, either with explicit values from the command-line or, if a known user name is passed with '-u', from the corresponding content of the password and group databases. The other main type of use cases is to start from the current process' credentials, only amending part of them. It is now also possible to blend both approaches, where some parts must be specified and the others can just be amended or left as is. Options: * As before: -u: Specifies a user name or ID to change all user IDs to. If a known name is passed, also automatically sets all groups as per the password and group databases. -i: Starts from the current groups, instead of having to specify them by using '-u' with a known user name or explicitly. * New: -k: Starts from the current users (incompatible with '-u'). Implies '-i'. -g: Sets/overrides the primary group IDs with the passed group name or ID. -G: Sets/overrides the supplementary groups set with the passed list of comma-separated names or IDs. -s: Amend the supplementary groups set according to the list of comma-separated directives from the following: - @: Empties the set. Must be the first directive. Incompatible with '-G'. - +: Add a group to the set. - -: Remove a group from the set. Takes precedence over +. --euid: Overrides the effective user ID. --ruid: Overrides the real user ID. --svuid: Overrides the saved user ID. --egid: Overrides the effective group ID. --rgid: Overrides the real group ID. --svgid: Overrides the saved group ID. Option '-k' was introduced as a requirement to be explicit when one wants to keep the current user(s) instead of specifying new ones. This is both for the purpose of avoiding foot-shooting and preserving the possibility to omit '-u' to switch to 'root'. In order to avoid confusion, if any user or group overrides are specified, mdo(1) however enforces that either '-u' or '-k' has been specified (so, in practice, '-u root' is implied only in the absence of any other options except '-i'). Some base supplementary groups set is needed when '-s' is used without directive '@'. It can be an explicit one specified with '-G', effectively meaning that '-G' is processed before '-s'. Else, it is determined from the password/group database (see initgroups(3)) if '-u' with a user name was passed, or is simply the current set if '-i' (or '-k') was specified. Other cases require specifying the full set (using '-G' or '-s' with '@'), and will fail otherwise. As the release process for 15.0 is progressing, this is committed in advance of the still-in-progress tests and manual page updates. Note for MFC to stable/14: As initgroups() has its old behavior, consistently with it, remove the effective GID from being passed also as a supplementary group. Reviewed by: bapt MFC after: 3 days Relnotes: yes Event: EuroBSDCon 2025 Sponsored by: The FreeBSD Foundation Sponsored by: Google LLC (GSoC 2025) Co-authored-by: Kushagra Srivastava Differential Revision: https://reviews.freebsd.org/D52613 (cherry picked from commit 3ca1e69028acdee30739c0e0856692395a36fd21) --- usr.bin/mdo/mdo.c | 857 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 816 insertions(+), 41 deletions(-) diff --git a/usr.bin/mdo/mdo.c b/usr.bin/mdo/mdo.c index 8435fc17f26f..3eb5d4e5c23f 100644 --- a/usr.bin/mdo/mdo.c +++ b/usr.bin/mdo/mdo.c @@ -1,13 +1,24 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright(c) 2024 Baptiste Daroussin + * Copyright (c) 2025 Kushagra Srivastava + * Copyright (c) 2025 The FreeBSD Foundation * - * SPDX-License-Identifier: BSD-2-Clause + * Portions of this software were developed by Olivier Certner + * at Kumacom SARL under sponsorship from the FreeBSD + * Foundation. */ +#include #include +#include #include +#include #include +#include +#include #include #include #include @@ -16,84 +27,848 @@ #include #include + static void usage(void) { - fprintf(stderr, "usage: mdo [-u username] [-i] [--] [command [args]]\n"); - exit(EXIT_FAILURE); + fprintf(stderr, + "Usage: mdo [options] [--] [command [args...]]\n" + "\n" + "Options:\n" + " -u Target user (name or UID; name sets groups)\n" + " -k Keep current user, allows selective overrides " + "(implies -i)\n" + " -i Keep current groups, unless explicitly overridden\n" + " -g Override primary group (name or GID)\n" + " -G Set supplementary groups (name or GID list)\n" + " -s Modify supplementary groups using:\n" + " @ (first) to reset, +group to add, -group to remove\n" + "\n" + "Advanced UID/GID overrides:\n" + " --euid Set effective UID\n" + " --ruid Set real UID\n" + " --svuid Set saved UID\n" + " --egid Set effective GID\n" + " --rgid Set real GID\n" + " --svgid Set saved GID\n" + "\n" + " -h Show this help message\n" + "\n" + "Examples:\n" + " mdo -u alice id\n" + " mdo -u 1001 -g wheel -G staff,operator sh\n" + " mdo -u bob -s +wheel,+operator id\n" + " mdo -k --ruid 1002 --egid 1004 id\n" + ); + exit(1); +} + +struct alloc { + void *start; + size_t size; +}; + +static const struct alloc ALLOC_INITIALIZER = { + .start = NULL, + .size = 0, +}; + +/* + * The default value should cover almost all cases. + * + * For getpwnam_r(), we assume: + * - 88 bytes for 'struct passwd' + * - Less than 16 bytes for the user name + * - A typical shadow hash of 106 bytes + * - Less than 16 bytes for the login class name + * - Less than 64 bytes for GECOS info + * - Less than 128 bytes for the home directory + * - Less than 32 bytes for the shell path + * Total: 256 + 88 + 106 = 450. + * + * For getgrnam_r(), we assume: + * - 32 bytes for 'struct group' + * - Less than 16 bytes for the group name + * - Some hash of 106 bytes + * - No more than 16 members, each of less than 16 bytes (=> 256 bytes) + * Total: 256 + 32 + 16 + 106 = 410. + * + * We thus choose 512 (leeway, power of 2). + */ +static const size_t ALLOC_FIRST_SIZE = 512; + +static bool +alloc_is_empty(const struct alloc *const alloc) +{ + if (alloc->size == 0) { + assert(alloc->start == NULL); + return (true); + } else { + assert(alloc->start != NULL); + return (false); + } +} + +static void +alloc_realloc(struct alloc *const alloc) +{ + const size_t old_size = alloc->size; + size_t new_size; + + if (old_size == 0) { + assert(alloc->start == NULL); + new_size = ALLOC_FIRST_SIZE; + } else if (old_size < PAGE_SIZE) + new_size = 2 * old_size; + else + /* + * We never allocate more than a page at a time when reaching + * a page (except perhaps for the first increment, up to two). + * Use roundup2() to be immune to previous cases' changes. */ + new_size = roundup2(old_size, PAGE_SIZE) + PAGE_SIZE; + + alloc->start = realloc(alloc->start, new_size); + if (alloc->start == NULL) + errx(EXIT_FAILURE, + "cannot realloc allocation (old size: %zu, new: %zu)", + old_size, new_size); + alloc->size = new_size; +} + +static void +alloc_free(struct alloc *const alloc) +{ + if (!alloc_is_empty(alloc)) { + free(alloc->start); + *alloc = ALLOC_INITIALIZER; + } +} + +struct alloc_wrap_data { + int (*func)(void *data, const struct alloc *alloc); +}; + +/* + * Wraps functions needing a backing allocation. + * + * Uses 'alloc' as the starting allocation, and may extend it as necessary. + * 'alloc' is never freed, even on failure of the wrapped function. + * + * The function is expected to return ERANGE if and only if the provided + * allocation is not big enough. All other values are passed through. + */ +static int +alloc_wrap(struct alloc_wrap_data *const data, struct alloc *alloc) +{ + int error; + + /* Avoid a systematic ERANGE on first iteration. */ + if (alloc_is_empty(alloc)) + alloc_realloc(alloc); + + for (;;) { + error = data->func(data, alloc); + if (error != ERANGE) + break; + alloc_realloc(alloc); + } + + return (error); +} + +struct getpwnam_wrapper_data { + struct alloc_wrap_data wrapped; + const char *name; + struct passwd **pwdp; +}; + +static int +wrapped_getpwnam_r(void *data, const struct alloc *alloc) +{ + struct passwd *const pwd = alloc->start; + struct passwd *result; + struct getpwnam_wrapper_data *d = data; + int error; + + assert(alloc->size >= sizeof(*pwd)); + + error = getpwnam_r(d->name, pwd, (char *)(pwd + 1), + alloc->size - sizeof(*pwd), &result); + + if (error == 0) { + if (result == NULL) + error = ENOENT; + } else + assert(result == NULL); + *d->pwdp = result; + return (error); +} + +/* + * Wraps getpwnam_r(), automatically dealing with memory allocation. + * + * 'alloc' may be any allocation (even empty), and will be extended as + * necessary. It is not freed on error. + * + * On success, '*pwdp' is filled with a pointer to the returned 'struct passwd', + * and on failure, is set to NULL. + */ +static int +alloc_getpwnam(const char *name, struct passwd **pwdp, + struct alloc *const alloc) +{ + struct getpwnam_wrapper_data data; + + data.wrapped.func = wrapped_getpwnam_r; + data.name = name; + data.pwdp = pwdp; + return (alloc_wrap((struct alloc_wrap_data *)&data, alloc)); +} + +struct getgrnam_wrapper_data { + struct alloc_wrap_data wrapped; + const char *name; + struct group **grpp; +}; + +static int +wrapped_getgrnam_r(void *data, const struct alloc *alloc) +{ + struct group *grp = alloc->start; + struct group *result; + struct getgrnam_wrapper_data *d = data; + int error; + + assert(alloc->size >= sizeof(*grp)); + + error = getgrnam_r(d->name, grp, (char *)(grp + 1), + alloc->size - sizeof(*grp), &result); + + if (error == 0) { + if (result == NULL) + error = ENOENT; + } else + assert(result == NULL); + *d->grpp = result; + return (error); +} + +/* + * Wraps getgrnam_r(), automatically dealing with memory allocation. + * + * 'alloc' may be any allocation (even empty), and will be extended as + * necessary. It is not freed on error. + * + * On success, '*grpp' is filled with a pointer to the returned 'struct group', + * and on failure, is set to NULL. + */ +static int +alloc_getgrnam(const char *const name, struct group **const grpp, + struct alloc *const alloc) +{ + struct getgrnam_wrapper_data data; + + data.wrapped.func = wrapped_getgrnam_r; + data.name = name; + data.grpp = grpp; + return (alloc_wrap((struct alloc_wrap_data *)&data, alloc)); +} + +/* + * Retrieve the UID from a user string. + * + * Tries first to interpret the string as a user name, then as a numeric ID + * (this order is prescribed by POSIX for a number of utilities). + * + * 'pwdp' and 'allocp' must be NULL or non-NULL together. If non-NULL, then + * 'allocp' can be any allocation (possibly empty) and will be extended to + * contain the result if necessary. It will not be freed (even on failure). + */ +static uid_t +parse_user_pwd(const char *s, struct passwd **pwdp, struct alloc *allocp) +{ + struct passwd *pwd; + struct alloc alloc = ALLOC_INITIALIZER; + const char *errp; + uid_t uid; + int error; + + assert((pwdp == NULL && allocp == NULL) || + (pwdp != NULL && allocp != NULL)); + + if (pwdp == NULL) { + pwdp = &pwd; + allocp = &alloc; + } + + error = alloc_getpwnam(s, pwdp, allocp); + if (error == 0) { + uid = (*pwdp)->pw_uid; + goto finish; + } else if (error != ENOENT) + errc(EXIT_FAILURE, error, + "cannot access the password database"); + + uid = strtonum(s, 0, UID_MAX, &errp); + if (errp != NULL) + errx(EXIT_FAILURE, "invalid UID '%s': %s", s, errp); + +finish: + if (allocp == &alloc) + alloc_free(allocp); + return (uid); +} + +/* See parse_user_pwd() for the doc. */ +static uid_t +parse_user(const char *s) +{ + return (parse_user_pwd(s, NULL, NULL)); +} + +/* + * Retrieve the GID from a group string. + * + * Tries first to interpret the string as a group name, then as a numeric ID + * (this order is prescribed by POSIX for a number of utilities). + */ +static gid_t +parse_group(const char *s) +{ + struct group *grp; + struct alloc alloc = ALLOC_INITIALIZER; + const char *errp; + gid_t gid; + int error; + + error = alloc_getgrnam(s, &grp, &alloc); + if (error == 0) { + gid = grp->gr_gid; + goto finish; + } else if (error != ENOENT) + errc(EXIT_FAILURE, error, "cannot access the group database"); + + gid = strtonum(s, 0, GID_MAX, &errp); + if (errp != NULL) + errx(EXIT_FAILURE, "invalid GID '%s': %s", s, errp); + +finish: + alloc_free(&alloc); + return (gid); +} + +struct group_array { + u_int nb; + gid_t *groups; +}; + +static const struct group_array GROUP_ARRAY_INITIALIZER = { + .nb = 0, + .groups = NULL, +}; + +static bool +group_array_is_empty(const struct group_array *const ga) +{ + return (ga->nb == 0); +} + +static void +realloc_groups(struct group_array *const ga, const u_int diff) +{ + const u_int new_nb = ga->nb + diff; + const size_t new_size = new_nb * sizeof(*ga->groups); + + assert(new_nb >= diff && new_size >= new_nb); + ga->groups = realloc(ga->groups, new_size); + if (ga->groups == NULL) + err(EXIT_FAILURE, "realloc of groups failed"); + ga->nb = new_nb; +} + +static int +gidp_cmp(const void *p1, const void *p2) +{ + const gid_t g1 = *(const gid_t *)p1; + const gid_t g2 = *(const gid_t *)p2; + + return ((g1 > g2) - (g1 < g2)); +} + +static void +sort_uniq_groups(struct group_array *const ga) +{ + size_t j = 0; + + if (ga->nb <= 1) + return; + + qsort(ga->groups, ga->nb, sizeof(gid_t), gidp_cmp); + + for (size_t i = 1; i < ga->nb; ++i) + if (ga->groups[i] != ga->groups[j]) + ga->groups[++j] = ga->groups[i]; +} + +/* + * Remove elements in 'set' that are in 'remove'. + * + * Expects both arrays to have been treated with sort_uniq_groups(). Works in + * O(n + m), modifying 'set' in place. + */ +static void +remove_groups(struct group_array *const set, + const struct group_array *const remove) +{ + u_int from = 0, to = 0, rem = 0; + gid_t cand, to_rem; + + if (set->nb == 0 || remove->nb == 0) + /* Nothing to remove. */ + return; + + cand = set->groups[0]; + to_rem = remove->groups[0]; + + for (;;) { + if (cand < to_rem) { + /* Keep. */ + if (to != from) + set->groups[to] = cand; + ++to; + cand = set->groups[++from]; + if (from == set->nb) + break; + } else if (cand == to_rem) { + cand = set->groups[++from]; + if (from == set->nb) + break; + to_rem = remove->groups[++rem]; /* No duplicates. */ + if (rem == remove->nb) + break; + } else { + to_rem = remove->groups[++rem]; + if (rem == remove->nb) + break; + } + } + + /* All remaining groups in 'set' must be kept. */ + if (from == to) + /* Nothing was removed. 'set' will stay the same. */ + return; + memmove(set->groups + to, set->groups + from, + (set->nb - from) * sizeof(gid_t)); + set->nb = to + (set->nb - from); } int main(int argc, char **argv) { - struct passwd *pw; - const char *username = "root"; + const char *const default_user = "root"; + + const char *user_name = NULL; + const char *primary_group = NULL; + char *supp_groups_str = NULL; + char *supp_mod_str = NULL; + bool start_from_current_groups = false; + bool start_from_current_users = false; + const char *euid_str = NULL; + const char *ruid_str = NULL; + const char *svuid_str = NULL; + const char *egid_str = NULL; + const char *rgid_str = NULL; + const char *svgid_str = NULL; + bool need_user = false; /* '-u' or '-k' needed. */ + + const int go_euid = 1000; + const int go_ruid = 1001; + const int go_svuid = 1002; + const int go_egid = 1003; + const int go_rgid = 1004; + const int go_svgid = 1005; + const struct option longopts[] = { + {"euid", required_argument, NULL, go_euid}, + {"ruid", required_argument, NULL, go_ruid}, + {"svuid", required_argument, NULL, go_svuid}, + {"egid", required_argument, NULL, go_egid}, + {"rgid", required_argument, NULL, go_rgid}, + {"svgid", required_argument, NULL, go_svgid}, + {NULL, 0, NULL, 0} + }; + int ch; + struct setcred wcred = SETCRED_INITIALIZER; u_int setcred_flags = 0; - bool uidonly = false; - int ch; - while ((ch = getopt(argc, argv, "u:i")) != -1) { + struct passwd *pw = NULL; + struct alloc pw_alloc = ALLOC_INITIALIZER; + struct group_array supp_groups = GROUP_ARRAY_INITIALIZER; + struct group_array supp_rem = GROUP_ARRAY_INITIALIZER; + + + /* + * Process options. + */ + while (ch = getopt_long(argc, argv, "+G:g:hiks:u:", longopts, NULL), + ch != -1) { switch (ch) { - case 'u': - username = optarg; + case 'G': + supp_groups_str = optarg; + need_user = true; + break; + case 'g': + primary_group = optarg; + need_user = true; break; + case 'h': + usage(); case 'i': - uidonly = true; + start_from_current_groups = true; + break; + case 'k': + start_from_current_users = true; + break; + case 's': + supp_mod_str = optarg; + need_user = true; + break; + case 'u': + user_name = optarg; + break; + case go_euid: + euid_str = optarg; + need_user = true; + break; + case go_ruid: + ruid_str = optarg; + need_user = true; + break; + case go_svuid: + svuid_str = optarg; + need_user = true; + break; + case go_egid: + egid_str = optarg; + need_user = true; + break; + case go_rgid: + rgid_str = optarg; + need_user = true; + break; + case go_svgid: + svgid_str = optarg; + need_user = true; break; default: usage(); } } + argc -= optind; argv += optind; - if ((pw = getpwnam(username)) == NULL) { - if (strspn(username, "0123456789") == strlen(username)) { - const char *errp = NULL; - uid_t uid = strtonum(username, 0, UID_MAX, &errp); - if (errp != NULL) - err(EXIT_FAILURE, "invalid user ID '%s'", - username); - pw = getpwuid(uid); + /* + * Determine users. + * + * We do that first as in some cases we need to retrieve the + * corresponding password database entry to be able to set the primary + * groups. + */ + + if (start_from_current_users) { + if (user_name != NULL) + errx(EXIT_FAILURE, "-k incompatible with -u"); + + /* + * If starting from the current user(s) as a base, finding one + * of them in the password database and using its groups would + * be quite surprising, so we instead let '-k' imply '-i'. + */ + start_from_current_groups = true; + } else { + uid_t uid; + + /* + * In the case of any overrides, we impose an explicit base user + * via '-u' or '-k' instead of implicitly taking 'root' as the + * base. + */ + if (user_name == NULL) { + if (need_user) + errx(EXIT_FAILURE, + "Some overrides specified, " + "'-u' or '-k' needed."); + user_name = default_user; } + + /* + * Even if all user overrides are present as well as primary and + * supplementary groups ones, in which case the final result + * doesn't depend on '-u', we still call parse_user_pwd() to + * check that the passed username is correct. + */ + uid = parse_user_pwd(user_name, &pw, &pw_alloc); + wcred.sc_uid = wcred.sc_ruid = wcred.sc_svuid = uid; + setcred_flags |= SETCREDF_UID | SETCREDF_RUID | + SETCREDF_SVUID; + } + + if (euid_str != NULL) { + wcred.sc_uid = parse_user(euid_str); + setcred_flags |= SETCREDF_UID; + } + + if (ruid_str != NULL) { + wcred.sc_ruid = parse_user(ruid_str); + setcred_flags |= SETCREDF_RUID; + } + + if (svuid_str != NULL) { + wcred.sc_svuid = parse_user(svuid_str); + setcred_flags |= SETCREDF_SVUID; + } + + /* + * Determine primary groups. + */ + + /* + * When not starting from the current groups, we need to set all + * primary groups. If '-g' was not passed, we use the primary + * group from the password database as the "base" to which + * overrides '--egid', '--rgid' and '--svgid' apply. But if all + * overrides were specified, we in fact just don't need the + * password database at all. + * + * '-g' is treated outside of this 'if' as it can also be used + * as an override. + */ + if (!start_from_current_groups && primary_group == NULL && + (egid_str == NULL || rgid_str == NULL || svgid_str == NULL)) { if (pw == NULL) - err(EXIT_FAILURE, "invalid username '%s'", username); + errx(EXIT_FAILURE, + "must specify primary groups or a user name " + "with an entry in the password database"); + + wcred.sc_gid = wcred.sc_rgid = wcred.sc_svgid = + pw->pw_gid; + setcred_flags |= SETCREDF_GID | SETCREDF_RGID | + SETCREDF_SVGID; + } + + if (primary_group != NULL) { + /* + * We always call parse_group() even in case all overrides are + * present to check that the passed group is valid. + */ + wcred.sc_gid = wcred.sc_rgid = wcred.sc_svgid = + parse_group(primary_group); + setcred_flags |= SETCREDF_GID | SETCREDF_RGID | SETCREDF_SVGID; + } + + if (egid_str != NULL) { + wcred.sc_gid = parse_group(egid_str); + setcred_flags |= SETCREDF_GID; + } + + if (rgid_str != NULL) { + wcred.sc_rgid = parse_group(rgid_str); + setcred_flags |= SETCREDF_RGID; + } + + if (svgid_str != NULL) { + wcred.sc_svgid = parse_group(svgid_str); + setcred_flags |= SETCREDF_SVGID; + } + + /* + * Determine supplementary groups. + */ + + /* + * This makes sense to catch user's mistakes. It is not a strong + * limitation of the code below (allowing this case is just a matter of, + * in the block treating '-s' with '@' below, replacing an assert() by + * a reset of 'supp_groups'). + */ + if (supp_groups_str != NULL && supp_mod_str != NULL && + supp_mod_str[0] == '@') + errx(EXIT_FAILURE, "'-G' and '-s' with '@' are incompatible"); + + /* + * Determine the supplementary groups to start with, but only if we + * really need to operate on them later (and set them back). + */ + if (!start_from_current_groups) { + assert(!start_from_current_users); + + if (supp_groups_str == NULL && (supp_mod_str == NULL || + supp_mod_str[0] != '@')) { + /* + * If we are to replace supplementary groups (i.e., + * neither '-i' nor '-k' was specified) and they are not + * completely specified (with '-g' or '-s' with '@'), we + * start from those in the groups database if we were + * passed a user name that is in the password database + * (this is a protection against erroneous ID/name + * conflation in the groups database), else we simply + * error. + */ + + if (pw == NULL) + errx(EXIT_FAILURE, + "must specify the full supplementary " + "groups set or a user name with an entry " + "in the password database"); + + const long ngroups_alloc = sysconf(_SC_NGROUPS_MAX) + 1; + gid_t *groups; + int ngroups; + + groups = malloc(sizeof(*groups) * ngroups_alloc); + if (groups == NULL) + errx(EXIT_FAILURE, + "cannot allocate memory to retrieve " + "user groups from the groups database"); + + ngroups = ngroups_alloc; + getgrouplist(user_name, pw->pw_gid, groups, &ngroups); + + if (ngroups > ngroups_alloc) + err(EXIT_FAILURE, + "too many groups for user '%s'", + user_name); + + realloc_groups(&supp_groups, ngroups); + memcpy(supp_groups.groups + supp_groups.nb - ngroups, + groups, ngroups * sizeof(*groups)); + free(groups); + + /* + * Have to set SETCREDF_SUPP_GROUPS here since we may be + * in the case where neither '-G' nor '-s' was passed, + * but we still have to set the supplementary groups to + * those of the groups database. + */ + setcred_flags |= SETCREDF_SUPP_GROUPS; + } + } else if (supp_groups_str == NULL && (supp_mod_str == NULL || + supp_mod_str[0] != '@')) { + const int ngroups = getgroups(0, NULL); + + if (ngroups > 0) { + realloc_groups(&supp_groups, ngroups); + + if (getgroups(ngroups, supp_groups.groups + + supp_groups.nb - ngroups) < 0) + err(EXIT_FAILURE, "getgroups() failed"); + } + + /* + * Setting SETCREDF_SUPP_GROUPS here is not necessary, we will + * do it below since 'supp_mod_str' != NULL. + */ } - wcred.sc_uid = wcred.sc_ruid = wcred.sc_svuid = pw->pw_uid; - setcred_flags |= SETCREDF_UID | SETCREDF_RUID | SETCREDF_SVUID; + if (supp_groups_str != NULL) { + char *p = supp_groups_str; + char *tok; - if (!uidonly) { /* - * If there are too many groups specified for some UID, setting - * the groups will fail. We preserve this condition by - * allocating one more group slot than allowed, as - * getgrouplist() itself is just some getter function and thus - * doesn't (and shouldn't) check the limit, and to allow - * setcred() to actually check for overflow. + * We will set the supplementary groups to exactly the set + * passed with '-G', and we took care above not to retrieve + * "base" groups (current ones or those from the groups + * database) in this case. */ - const long ngroups_alloc = sysconf(_SC_NGROUPS_MAX) + 2; - gid_t *const groups = malloc(sizeof(*groups) * ngroups_alloc); - int ngroups = ngroups_alloc; + assert(group_array_is_empty(&supp_groups)); + + /* WARNING: 'supp_groups_str' going to be modified. */ + while ((tok = strsep(&p, ",")) != NULL) { + gid_t g; + + if (*tok == '\0') + continue; + + g = parse_group(tok); + realloc_groups(&supp_groups, 1); + supp_groups.groups[supp_groups.nb - 1] = g; + } + + setcred_flags |= SETCREDF_SUPP_GROUPS; + } + + if (supp_mod_str != NULL) { + char *p = supp_mod_str; + char *tok; + gid_t gid; - if (groups == NULL) - err(EXIT_FAILURE, "cannot allocate memory for groups"); + /* WARNING: 'supp_mod_str' going to be modified. */ + while ((tok = strsep(&p, ",")) != NULL) { + switch (tok[0]) { + case '\0': + break; - getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); + case '@': + if (tok != supp_mod_str) + errx(EXIT_FAILURE, "'@' must be " + "the first token in '-s' option"); + /* See same assert() above. */ + assert(group_array_is_empty(&supp_groups)); + break; + + case '+': + case '-': + gid = parse_group(tok + 1); + if (tok[0] == '+') { + realloc_groups(&supp_groups, 1); + supp_groups.groups[supp_groups.nb - 1] = gid; + } else { + realloc_groups(&supp_rem, 1); + supp_rem.groups[supp_rem.nb - 1] = gid; + } + break; + + default: + errx(EXIT_FAILURE, + "invalid '-s' token '%s' at index %zu", + tok, tok - supp_mod_str); + } + } - wcred.sc_gid = wcred.sc_rgid = wcred.sc_svgid = pw->pw_gid; - wcred.sc_supp_groups = groups + 1; - wcred.sc_supp_groups_nb = ngroups - 1; - setcred_flags |= SETCREDF_GID | SETCREDF_RGID | SETCREDF_SVGID | - SETCREDF_SUPP_GROUPS; + setcred_flags |= SETCREDF_SUPP_GROUPS; + } + + /* + * We don't need to pass the kernel a normalized representation of the + * new supplementary groups set (array sorted and without duplicates), + * so we don't do it here unless we need to remove some groups, where it + * enables more efficient algorithms (if the number of groups for some + * reason grows out of control). + */ + if (!group_array_is_empty(&supp_groups) && + !group_array_is_empty(&supp_rem)) { + sort_uniq_groups(&supp_groups); + sort_uniq_groups(&supp_rem); + remove_groups(&supp_groups, &supp_rem); *** 22 LINES SKIPPED *** From nobody Thu Oct 2 16:58:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccyfv1g1xz69YMh; Thu, 02 Oct 2025 16:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccyft6RCYz3ndJ; Thu, 02 Oct 2025 16:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9eMaeC0y9g4Fjw4jvSwDEq6Q7ol/OG7OA7O7LZ4Go1w=; b=sW6qDhT3V/Kj5ocRvf+wVTcgYfiPK9HG4tO1eZ1o2SOPOteOahlCRKvyPmFznwOMXb4JJq 39J4cP+oPzE9R4lBuOPQ0b3uvQtD7u31aIgUiVFqEbIVDz93IfjFkpNQry567kQW0z1NJa Tq6gJY787awv2m1ypB3nCfPMNp/qqeCVCgVRLcBO6Psev6dWseTr7sdJexdzaKtNIlQw6e oKIyt7hqQ8XBM5dDcWZvfv5sUspZoqpgdDWYDeUiy2N3+8x8T6EqXGSe+nxLaGythIpPVb oybTv/jXjYIdVn9zxQ5jddOQwYzRdbd8w5cmLGOzH3zkrtvlMib92hACA1u6Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759424310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9eMaeC0y9g4Fjw4jvSwDEq6Q7ol/OG7OA7O7LZ4Go1w=; b=JLhgfGyL/CBbi3FonGDFWBVcfuQXJ1k/OHSa6LhN8qvnR6Iq5mT5D05gpYUt8tVZXKKlv9 ya2d7i3U++Ppb9ekRmWyW03V5JKYEd+645VCuk1wEySkaWsYp76zFaATnYMUF5kxJos84o elEz2Xiw2WCsryS5d8pwNg6D1wIVJ+mxM1KrAk4McVsEPPAaggHiNt0QbBEHXqYdOOuHqO /CTG1ackCBrADI/zFE/GilejV46Y/1a7w987H7yCNqGMwEJXSIm7pe0roRzncRkFosCIix 3NSMcMYR7S8F65SJJmvzMs5wYVcgJarme9MqZLVxRFPusj7JV9g/+WPnulEWiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759424310; a=rsa-sha256; cv=none; b=E6X7BiOIzCpUsmSxW9sOVfP/SB5FcMgfNDIDpeAcXKApMo4Hyvt51Xg7zWfIVRhzy2RsvP 8GFjuh+3/FQ6xyzakssn/3s4ZRkPvSfwAPpnYgyL5kgFnB4ONiiotG2mau35POeJKjMv83 d557OYmipvv4avJwshrX7rdNLZPSEkk2K//oqnxO0jDeIXnL5T5ZkG36swUyeoHopdt5a2 BT8FAyR3J4OCB4QLpghive7jfGSsn4y6Nhxx+MnSRty+Da20IUjiFryRO379g/zzJwgSEi 9IGQuTpX2JIr/7ejHnbWw2zuWnC6zn+phaOtaPe8ffyQ5chhN/59QET0LJQypQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccyft62tFz2CG; Thu, 02 Oct 2025 16:58: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 592GwUW9028319; Thu, 2 Oct 2025 16:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592GwU6P028316; Thu, 2 Oct 2025 16:58:30 GMT (envelope-from git) Date: Thu, 2 Oct 2025 16:58:30 GMT Message-Id: <202510021658.592GwU6P028316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 6fcfb244e3d3 - stable/15 - namei.9: Remove duplicate WANTPARENT description List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6fcfb244e3d3c951f056f5a987bf5c5f0bd0e309 Auto-Submitted: auto-generated The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6fcfb244e3d3c951f056f5a987bf5c5f0bd0e309 commit 6fcfb244e3d3c951f056f5a987bf5c5f0bd0e309 Author: Olivier Certner AuthorDate: 2025-09-30 17:05:24 +0000 Commit: Olivier Certner CommitDate: 2025-10-02 16:57:20 +0000 namei.9: Remove duplicate WANTPARENT description Fixes: 5673462af533 ("namei.9: sort operational modifiers in numerical order") MFC after: 2 days Sponsored by: The FreeBSD Foundation (cherry picked from commit f45608124286a7e0616d1d23b9506709f10c12fc) --- share/man/man9/namei.9 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/share/man/man9/namei.9 b/share/man/man9/namei.9 index 5bdffce8c360..a42043587432 100644 --- a/share/man/man9/namei.9 +++ b/share/man/man9/namei.9 @@ -31,7 +31,7 @@ .\" If you integrate this manpage in another OS, I'd appreciate a note .\" - eivind@FreeBSD.org .\" -.Dd May 16, 2025 +.Dd September 30, 2025 .Dt NAMEI 9 .Os .Sh NAME @@ -206,12 +206,6 @@ This flag allows the function to return the parent (directory) vnode in an unlocked state. The parent vnode must be released separately by using .Xr vrele 9 . -.It Dv WANTPARENT -This flag allows the -.Fn namei -function to return the parent (directory) vnode in an unlocked state. -The parent vnode must be released separately by using -.Xr vrele 9 . .It Dv FAILIFEXISTS Makes the .Nm From nobody Thu Oct 2 17:15:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccz2W0vdqz69b3m; Thu, 02 Oct 2025 17:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccz2W0JPqz3rPr; Thu, 02 Oct 2025 17:15:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759425331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G7exXVd4IaD0G1eyTTYg4dFMwCg0MWI8B+O4CpzE0l4=; b=LDCwLLphfR3x64u/q1c7o4wqozpm32VvLHr8jWrkyA72PwpN2SWfIbEZ3bf88iPzX+6YoO S3fvAlDm2b1a8u5t6rljps/PpzsBr+ge1/bJG/0FCwoFDYzLRfKjW1wFR8z0INo3qvynue owJKyX1SL1PAKSq3XufgpsItoeWsG/iyPtR0cdytd7nab4ZYA2ibooi4veCesNrXuPmJ1V 9Ld3vIUaTMXnNRC9/wzqAOxLzXsXW5aiLoRmnX/47k7SF9/LeOfOKVmXDDSE7dJsSNOn45 E+FAv4tWRDB8/GN4gep1FjsN71Nr2Fctv3lhYBqbAKmXNPboKRjVKwUuBPneqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759425331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G7exXVd4IaD0G1eyTTYg4dFMwCg0MWI8B+O4CpzE0l4=; b=kaTpg5uL8n8V584PmzUl9KCVlN/8GqkToWt8tvekFZ0gGQbc80hHYwpCN6tCe6zV6zdrbQ ZsGSNy969YJcpDVZH+rfQjPGPp2NXU+h0tBJ3iMlfKYf6+L8pP68TvgnrgdMWr8GezAild 9F39OzmWplnfOuO67xPtRj3/l1Yd/KGHhg/Y/dQ8Xc8VBN/9QnZeTm5xnXGtJ9TicQ7pYi Z4FhQpJYyWBcP+6EMZr5BLyDhdNnQXJ5oltZAaVH6398ExYCPAGOS+4DzPts9i/d+mQ8x9 Rxf82Uoqk92tR++Irvxec0aRQTw931N7yrbcEg6qXLsjcE5NFgI1rQj6tdylxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759425331; a=rsa-sha256; cv=none; b=vI+kvwAI7RMnwylPMeDRJtlGJAYN/l8+SbNVjOu+j1FsKTLoIEMBWrIaDxlnODaOnCVpRa Gw5NtXsk+SxSlO0oNegIt73irRqsYWrap9CIZ2b5LWx2Nk5r6EzF4NMxLMgSmouqpkskGb qB1D6nYho23F0kFKGgj7UW6j4Kl9uAHkJm8I06vJ4XfAJPgSuKJXeMuoOlG61m5f7dJiSA RRBX7ZZY49Zuht2G1tZ4SsJ6RKH01/aHfh/T6XhFqdN38lDoRhNhArkwZRYEQ96x/8X3EK oFDsCFYjp2Kxi+OHRj3jOis3Dj5KSb/94XBelNu4L/yqGHfSzEYaAseUBV9zug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccz2V6yxwz2S7; Thu, 02 Oct 2025 17:15: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 592HFUbU065883; Thu, 2 Oct 2025 17:15:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592HFUcl065880; Thu, 2 Oct 2025 17:15:30 GMT (envelope-from git) Date: Thu, 2 Oct 2025 17:15:30 GMT Message-Id: <202510021715.592HFUcl065880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Krzysztof Galazka Subject: git: 772b37053bc5 - stable/15 - ixgbe: Remove unused function ixgbe_is_media_cage_present List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 772b37053bc583d52410e1432817e95bba60fa75 Auto-Submitted: auto-generated The branch stable/15 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=772b37053bc583d52410e1432817e95bba60fa75 commit 772b37053bc583d52410e1432817e95bba60fa75 Author: Yogesh Bhosale AuthorDate: 2025-09-10 07:26:09 +0000 Commit: Krzysztof Galazka CommitDate: 2025-10-02 17:14:35 +0000 ixgbe: Remove unused function ixgbe_is_media_cage_present Remove the unused function ixgbe_is_media_cage_present that generates a compiler warning. Signed-off-by: Yogesh Bhosale yogesh.bhosale@intel.com Reported by: markj Differential Revision: https://reviews.freebsd.org/D52467 (cherry picked from commit 275f7d72ff6a71bbe46b4282a88f0ea9a24be22a) --- sys/dev/ixgbe/ixgbe_e610.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_e610.c b/sys/dev/ixgbe/ixgbe_e610.c index 95c6dca416c6..18c4612446e0 100644 --- a/sys/dev/ixgbe/ixgbe_e610.c +++ b/sys/dev/ixgbe/ixgbe_e610.c @@ -1399,40 +1399,6 @@ s32 ixgbe_aci_set_link_restart_an(struct ixgbe_hw *hw, bool ena_link) return ixgbe_aci_send_cmd(hw, &desc, NULL, 0); } -/** - * ixgbe_is_media_cage_present - check if media cage is present - * @hw: pointer to the HW struct - * - * Identify presence of media cage using the ACI command (0x06E0). - * - * Return: true if media cage is present, else false. If no cage, then - * media type is backplane or BASE-T. - */ -static bool ixgbe_is_media_cage_present(struct ixgbe_hw *hw) -{ - struct ixgbe_aci_cmd_get_link_topo *cmd; - struct ixgbe_aci_desc desc; - - cmd = &desc.params.get_link_topo; - - ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_get_link_topo); - - cmd->addr.topo_params.node_type_ctx = - (IXGBE_ACI_LINK_TOPO_NODE_CTX_PORT << - IXGBE_ACI_LINK_TOPO_NODE_CTX_S); - - /* set node type */ - cmd->addr.topo_params.node_type_ctx |= - (IXGBE_ACI_LINK_TOPO_NODE_TYPE_M & - IXGBE_ACI_LINK_TOPO_NODE_TYPE_CAGE); - - /* Node type cage can be used to determine if cage is present. If AQC - * returns error (ENOENT), then no cage present. If no cage present then - * connection type is backplane or BASE-T. - */ - return ixgbe_aci_get_netlist_node(hw, cmd, NULL, NULL); -} - /** * ixgbe_get_media_type_from_phy_type - Gets media type based on phy type * @hw: pointer to the HW struct From nobody Thu Oct 2 17:19:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccz781jgnz69bqf; Thu, 02 Oct 2025 17:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccz7814mXz3t8y; Thu, 02 Oct 2025 17:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759425572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJSzsEJ92UrCfDpRP4F80lGsPSqQBf4sJklMTSHBoIM=; b=SImmQVYy4hNhF+s3dJFPtU50zEbx1YqD2iW7saTsoaVtqv+ARI78xZfPDq/BBYEo6mwIym CQzb5xCzmTishOkSIET7hM6VpIXvgJPka8sXOLFdomeN+k//b9jCqJrcHGpRGEeZH7uAt4 SNXf5LMVNRSg0BCM+AVPf6hGwoWGYSdpVvFFNTz3dY1IbUafLyLTGEaTmWFlwxNHhAcuBw dYlwR4F0J7vXZOWag0+69KfgXMyby2j0cMY7KylnOqjs+eKorHBQZ2IUHbWsGeGaXcBkVy tvnqwCgThG4/QzXWPAwlbV32mCyEX1PTenYdmHgSrM95jl6oWPFPqPbu7rWvQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759425572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJSzsEJ92UrCfDpRP4F80lGsPSqQBf4sJklMTSHBoIM=; b=BySFHpl0q6kvd2vVEzqxGjAIvuEJ42QHmFIS86h2UzzvlY5c8i13BPKZ5BJ/1T1VPyeyki Xg8GcXy+ZbIIiLoA7e67Hv5nnkQfqLmdlrAYzxHzmIxMf7XMFNDksksE3xE/+F7UL4Toly t8GkOFhP5gnAfHRFnJnbHHzG5Y7cf9ZiEmj/Djf06jjrWo8037b5kxGvLDd2uIazxtVRUw 4q5jzs01ux1TYVsIOmrPmb+/QLTD07CxWr8PS4UE8nkKgGwW8q+F9lnZ5pdvd9XfrGa+Ro CY9t9Uj12ScYrVIfPhhUewgbti5T9m+r5c2K2WiHGOXtx8LZjDt3/DnWfelVjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759425572; a=rsa-sha256; cv=none; b=KToEA2sb+Jf5O5Q9xF4qFSPtoZINGCXUOaP8iKR947deU4ze2fmsJnFgZ5RNWGyzJclVZk 0fjP8ljsHYhgG4wDib9IAyYIbo/9rjOdp3s3Atqfi25t220lgAk71Ij5TTZ7EEhrtE3PzY 5fUY099IX7orqXxml9en3ZqktTbkmaJzjRRi7zP3y8UK4LJTqEr2QqF/TsOQIx/seKKZna SDOABchEpLps5fu0aRMW7k9xN4xpED6F5e6NVQgM+kPYRJZ1qaoRrMne118kNpYfzbIYCN ACNCDDl17TZYT6Luet5Z11ek9u3oONoewAAQcudIyuveeTxT0tIKNZrMQtmhzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccz780Cx5z2S8; Thu, 02 Oct 2025 17:19: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 592HJVJQ067158; Thu, 2 Oct 2025 17:19:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592HJVAM067155; Thu, 2 Oct 2025 17:19:31 GMT (envelope-from git) Date: Thu, 2 Oct 2025 17:19:31 GMT Message-Id: <202510021719.592HJVAM067155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: cb714aa76b1f - stable/15 - wlanstat(8): Rename from wlanstats(8) to keep consistency List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cb714aa76b1febb213106fb6575b4e676ff3316b Auto-Submitted: auto-generated The branch stable/15 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=cb714aa76b1febb213106fb6575b4e676ff3316b commit cb714aa76b1febb213106fb6575b4e676ff3316b Author: Li-Wen Hsu AuthorDate: 2025-09-30 03:30:08 +0000 Commit: Li-Wen Hsu CommitDate: 2025-10-02 17:19:06 +0000 wlanstat(8): Rename from wlanstats(8) to keep consistency All the status and statistics utilties in base are ending with "stat", the only exception is mailstats(8) but that's from sendmail. Reviewed by: imp, adrian MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52724 (cherry picked from commit 89eee8ee2ce57b7884defb8f9af016cd28ef1562) --- ObsoleteFiles.inc | 4 ++++ usr.sbin/Makefile | 2 +- usr.sbin/{wlanstats => wlanstat}/Makefile | 6 +++--- usr.sbin/{wlanstats => wlanstat}/main.c | 8 ++++---- usr.sbin/{wlanstats/wlanstats.8 => wlanstat/wlanstat.8} | 4 ++-- usr.sbin/{wlanstats/wlanstats.c => wlanstat/wlanstat.c} | 10 +++++----- usr.sbin/{wlanstats/wlanstats.h => wlanstat/wlanstat.h} | 8 ++++---- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index a63b78d357c6..3aea0a6586f7 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20250930: Rename wlanstats to wlanstat +OLD_FILES+=usr/sbin/wlanstats +OLD_FILES+=usr/share/man/man8/wlanstats.8.gz + # 20250929: Remove ftpd(8) OLD_FILES+=etc/rc.d/ftpd OLD_FILES+=usr/libexec/ftpd diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index c472cadea58f..3c5fd0973a43 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -210,7 +210,7 @@ SUBDIR.${MK_UTMPX}+= ac SUBDIR.${MK_UTMPX}+= lastlogin SUBDIR.${MK_UTMPX}+= utx SUBDIR.${MK_WIRELESS}+= wlandebug -SUBDIR.${MK_WIRELESS}+= wlanstats +SUBDIR.${MK_WIRELESS}+= wlanstat SUBDIR.${MK_WIRELESS}+= wpa SUBDIR.${MK_TESTS}+= tests diff --git a/usr.sbin/wlanstats/Makefile b/usr.sbin/wlanstat/Makefile similarity index 78% rename from usr.sbin/wlanstats/Makefile rename to usr.sbin/wlanstat/Makefile index 574a9c27137f..ec1fc3206267 100644 --- a/usr.sbin/wlanstats/Makefile +++ b/usr.sbin/wlanstat/Makefile @@ -1,13 +1,13 @@ .include -PROG= wlanstats -MAN= wlanstats.8 +PROG= wlanstat +MAN= wlanstat.8 CFLAGS= -I${SRCTOP}/lib/libbsdstat LIBADD= bsdstat SRCS= main.c \ - wlanstats.c + wlanstat.c CFLAGS.clang+= -fbracket-depth=512 -Wno-cast-align diff --git a/usr.sbin/wlanstats/main.c b/usr.sbin/wlanstat/main.c similarity index 97% rename from usr.sbin/wlanstats/main.c rename to usr.sbin/wlanstat/main.c index 85d10ad9012a..fba0b01a07d0 100644 --- a/usr.sbin/wlanstats/main.c +++ b/usr.sbin/wlanstat/main.c @@ -28,7 +28,7 @@ */ /* - * wlanstats [-i interface] + * wlanstat [-i interface] * (default interface is wlan0). */ @@ -45,7 +45,7 @@ #include #include -#include "wlanstats.h" +#include "wlanstat.h" static struct { const char *tag; @@ -158,7 +158,7 @@ static void usage(void) { - printf("wlanstats: [-h] [-i ifname] [-l] [-m station_MAC_address] [-o fmt] [interval]\n"); + printf("wlanstat: [-h] [-i ifname] [-l] [-m station_MAC_address] [-o fmt] [interval]\n"); } int @@ -176,7 +176,7 @@ main(int argc, char *argv[]) ifname = getenv("WLAN"); if (ifname == NULL) ifname = "wlan0"; - wf = wlanstats_new(ifname, getfmt("default")); + wf = wlanstat_new(ifname, getfmt("default")); #if 0 while ((c = getopt(argc, argv, "ahi:lm:o:")) != -1) { #else diff --git a/usr.sbin/wlanstats/wlanstats.8 b/usr.sbin/wlanstat/wlanstat.8 similarity index 97% rename from usr.sbin/wlanstats/wlanstats.8 rename to usr.sbin/wlanstat/wlanstat.8 index a8127726dd61..6e3df1ef3e5e 100644 --- a/usr.sbin/wlanstats/wlanstats.8 +++ b/usr.sbin/wlanstat/wlanstat.8 @@ -7,10 +7,10 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd March 14, 2025 -.Dt WLANSTATS 8 +.Dt WLANSTAT 8 .Os .Sh NAME -.Nm wlanstats +.Nm wlanstat .Nd query 802.11 wireless network statistics .Sh SYNOPSIS .Nm diff --git a/usr.sbin/wlanstats/wlanstats.c b/usr.sbin/wlanstat/wlanstat.c similarity index 99% rename from usr.sbin/wlanstats/wlanstats.c rename to usr.sbin/wlanstat/wlanstat.c index 83f5010341a9..468c4848004d 100644 --- a/usr.sbin/wlanstats/wlanstats.c +++ b/usr.sbin/wlanstat/wlanstat.c @@ -52,7 +52,7 @@ #include "../../sys/net80211/ieee80211_ioctl.h" -#include "wlanstats.h" +#include "wlanstat.h" #ifndef IEEE80211_ADDR_COPY #define IEEE80211_ADDR_COPY(dst, src) memcpy(dst, src, IEEE80211_ADDR_LEN) @@ -61,7 +61,7 @@ #define AFTER(prev) ((prev)+1) -static const struct fmt wlanstats[] = { +static const struct fmt wlanstat[] = { #define S_RX_BADVERSION 0 { 5, "rx_badversion", "bvers", "rx frame with bad version" }, #define S_RX_TOOSHORT AFTER(S_RX_BADVERSION) @@ -1032,14 +1032,14 @@ wlan_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) BSDSTAT_DEFINE_BOUNCE(wlanstatfoo) struct wlanstatfoo * -wlanstats_new(const char *ifname, const char *fmtstring) +wlanstat_new(const char *ifname, const char *fmtstring) { struct wlanstatfoo_p *wf; wf = calloc(1, sizeof(struct wlanstatfoo_p)); if (wf != NULL) { - bsdstat_init(&wf->base.base, "wlanstats", wlanstats, - nitems(wlanstats)); + bsdstat_init(&wf->base.base, "wlanstat", wlanstat, + nitems(wlanstat)); /* override base methods */ wf->base.base.collect_cur = wlan_collect_cur; wf->base.base.collect_tot = wlan_collect_tot; diff --git a/usr.sbin/wlanstats/wlanstats.h b/usr.sbin/wlanstat/wlanstat.h similarity index 93% rename from usr.sbin/wlanstats/wlanstats.h rename to usr.sbin/wlanstat/wlanstat.h index 8ab3c0558fd6..ed0150e11809 100644 --- a/usr.sbin/wlanstats/wlanstats.h +++ b/usr.sbin/wlanstat/wlanstat.h @@ -27,8 +27,8 @@ * THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef _WLANSTATS_H_ -#define _WLANSTATS_H_ +#ifndef _WLANSTAT_H_ +#define _WLANSTAT_H_ #include "bsdstat.h" @@ -50,5 +50,5 @@ struct wlanstatfoo { void (*setstamac)(struct wlanstatfoo *, const uint8_t mac[]); }; -struct wlanstatfoo *wlanstats_new(const char *ifname, const char *fmtstring); -#endif /* _WLANSTATS_H_ */ +struct wlanstatfoo *wlanstat_new(const char *ifname, const char *fmtstring); +#endif /* _WLANSTAT_H_ */ From nobody Thu Oct 2 17:19:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ccz791bVbz69bfV; Thu, 02 Oct 2025 17:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ccz7900qLz3t23; Thu, 02 Oct 2025 17:19:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759425573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vf3Hm2/7rEO6kTqufWK0G74SbsNRj6qmtjv+k/Ciz+c=; b=H/k3fUaZ6IMSYhS0T2ibTf/adjjqPDxHIGM56XAHupSMB3CYpCJJ+OHHbfl6SFDr3cFe1w oKYU8l3EXOpk6hTvpU7yb4kqwqSxe8RswADhbuRN0zJH0n8moUb02ONWCLq7we3XIDjFaW 6rJul+Pu7LxfO7n49GhCPrIb2qD2ES+7EsS3ZLMtqMn9E4EcmgrpUa44MeC2Ih0Qmmd84J RZvHvhjBVjFufPK75aYMX1054JM/W532sJxDqsIGH3dh7sTjet3CvrxNsL6EB1cqmn9aJh ghwUBesDENM2rWOryaRJJebocPNFffntuq+j6lauiK11o0n0+FsK05wp6fkBPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759425573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vf3Hm2/7rEO6kTqufWK0G74SbsNRj6qmtjv+k/Ciz+c=; b=PhLKMX38d7sjg4XxemKva70gMgqFXDWWi567nYQfajLVXL98acCsyIO+1hkpPWOqRgiEFf 2Romi2BDbh0xq8kqHu/ZDVluIq03NoHZvZSd6R+gd2aba6dCpnrNPH66ZfaWeERTUEZiyn pS7cP6y+wDEiv0R4RxEaQ6GJpGpc+wqXKYxBSSRUmzFxh0ab2eEr0z0sPPtXYmxmAkvdWo nwaZmcFvf9Fl7wspK1YGPow5Ity5EHrZRfjhnVJaOsoLx+Yj7uEt518YECIgvADOV+dsQC JOyLceS+QTyFsyG2H5eNljDCDm7U0jOymmU0TW11gfA+uhU8GCRRXXT38SPU4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759425573; a=rsa-sha256; cv=none; b=eIshgFsu39dkUFMEKHgfkXEmSO0w8iGE7qDMq4Wr3TFVi5TRiKIsmdcGHSG4TjR0iaG+vT zeengfUs8Fbk7CIQTs1JOLmq9D+XWeHNZstWglVwMqlZT1U1i7bKB0N0r6umGlrGrrkIr/ IKeVNsCYbE1HBnOK7tsnOEGQWtAzZ5cWRotqZJ0GDvT+AHTQWovWMZbfCbzdJ3kvZjSKkO fTLDj6xiJxJfg1fJ3AL0Q3Tahp3WXPM8OKSSoOXoKlwfK9v9N0bPIZrfQ7Q1uchoZNZT7X DUExUkxXf8Uwg7dVt3GV62MZBcllpthUmHvJGAt//g0QP3gEvxaAYHT8XFx25w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ccz786kLPz2Kj; Thu, 02 Oct 2025 17:19: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 592HJWcl067195; Thu, 2 Oct 2025 17:19:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592HJWKe067192; Thu, 2 Oct 2025 17:19:32 GMT (envelope-from git) Date: Thu, 2 Oct 2025 17:19:32 GMT Message-Id: <202510021719.592HJWKe067192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Li-Wen Hsu Subject: git: cd790b9ca8af - stable/15 - wlanstat(8): Follow-ups after moving to /usr/sbin and renaming List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cd790b9ca8afbf79e0cb0b88aeb27e1bd703ae4f Auto-Submitted: auto-generated The branch stable/15 has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=cd790b9ca8afbf79e0cb0b88aeb27e1bd703ae4f commit cd790b9ca8afbf79e0cb0b88aeb27e1bd703ae4f Author: Li-Wen Hsu AuthorDate: 2025-09-30 03:31:12 +0000 Commit: Li-Wen Hsu CommitDate: 2025-10-02 17:19:06 +0000 wlanstat(8): Follow-ups after moving to /usr/sbin and renaming - Update related comments - Remove from tools/tools/net80211 Reviewed by: imp, adrian MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52726 (cherry picked from commit 6952bb321c5cc14168a4f2638a0ce2483cc5149c) --- lib/libbsdstat/bsdstat.h | 2 +- sys/net80211/ieee80211_var.h | 2 +- tools/tools/net80211/Makefile | 2 +- tools/tools/net80211/README | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/libbsdstat/bsdstat.h b/lib/libbsdstat/bsdstat.h index 1b0d1f24e93f..b293cd652a72 100644 --- a/lib/libbsdstat/bsdstat.h +++ b/lib/libbsdstat/bsdstat.h @@ -76,7 +76,7 @@ struct fmt { * classes derived from it are useful. */ struct bsdstat { - const char *name; /* statistics name, e.g. wlanstats */ + const char *name; /* statistics name, e.g. wlanstat */ const struct fmt *stats; /* statistics in class */ int nstats; /* number of stats */ #define FMTS_IS_STAT 0x80 /* the following two bytes are the stat id */ diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index a0293f814899..c09bb90d7ad3 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -1012,7 +1012,7 @@ ieee80211_get_node_txpower(struct ieee80211_node *ni) * Debugging facilities compiled in when IEEE80211_DEBUG is defined. * * The intent is that any problem in the net80211 layer can be - * diagnosed by inspecting the statistics (dumped by the wlanstats + * diagnosed by inspecting the statistics (dumped by the wlanstat * program) and/or the msgs generated by net80211. Messages are * broken into functional classes and can be controlled with the * wlandebug program. Certain of these msg groups are for facilities diff --git a/tools/tools/net80211/Makefile b/tools/tools/net80211/Makefile index b4b32899cd26..e87b754c4635 100644 --- a/tools/tools/net80211/Makefile +++ b/tools/tools/net80211/Makefile @@ -1,3 +1,3 @@ -SUBDIR= stumbler w00t wesside wlaninject wlanstats wlantxtime wlanwatch wlanwds +SUBDIR= stumbler w00t wesside wlaninject wlantxtime wlanwatch wlanwds .include diff --git a/tools/tools/net80211/README b/tools/tools/net80211/README index a73f086f5589..b34bcfedec73 100644 --- a/tools/tools/net80211/README +++ b/tools/tools/net80211/README @@ -8,7 +8,6 @@ stumbler view nearby networks using raw packet interface w00t variety of programs that use the raw packet interface wesside WEP frag attack tool using raw packet interface wlaninject inject 802.11 packets using the raw packet interface -wlanstats dump net80211 statistics wlanwatch monitor net80211 events via the routing socket wlanwds handling of WDS dynamic links using vaps From nobody Thu Oct 2 18:13:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd0K107wbz69hd2; Thu, 02 Oct 2025 18:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd0K06fY3z43xC; Thu, 02 Oct 2025 18:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759428788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HRUDGdZ0K23p/PtsifDYG/gd/wUnjmsdkb1334RpDdQ=; b=dIYCGr+OeqTWkNNfXQIoSM/22lg7lB3ZXlK5Wn5/te9ObsO7qxN2zr75R4SG2xxnWS+hiA ATrwpbTeSJGwjqvHNmMYwaridVnpba3AW4TDV5As4vwC0ZQMdAGuc7Xs+V7WLSz8KmY7X3 QD/fOHe5AiiUi57TPuYZ2ZGgbVXihyoD92nK6kJ0GlZBppDvTvLMh/Ppd6FDNzFa16T7uv rKgr5YXyecjjGFvzZFtCabD/LEsud99DdwaAtriSkR+T2mChXFp2ADM/5LA19t6b0TtabN 5OBqxnYMzUCgiwkuTgiyIta1iDZkmN1L1TPuMxjeIDtDbHB5NNgCUzS9FcP4OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759428788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HRUDGdZ0K23p/PtsifDYG/gd/wUnjmsdkb1334RpDdQ=; b=OPlGRwKVtRxRiU4kzwC22mu3xlxEE5KM4OBJqnHBDU/+K+KJMBQbEJfv7YaL3CPozUseYx khq/G7VFL6hMTnByxiZO4+GpT46FTzycl5khmHG353oJE468qqefRIshrqfQMsyGHixZKL RRUJ1NrQaPZmxqwls4271oZy6+4wWX5Kg1tk7yJ6+qvP96lOHxJdGfHEE9/F+q+zJ/Gzfi PkC1/8xpbPCLUWXyNCkEDJGe2/913zgmLjEEiG/AR4CBuiWcN0Zl+Fxwl2A006f1RLD8Ta UMzRMtaxtszN0kRBf1EJ6v68K2RdAEknLyEL6/6BWacA/BvHJOKGzvVVq6K4Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759428788; a=rsa-sha256; cv=none; b=aLbdpc3gjyGzZxz/2OPJ+t4FgCcMgBERh94GB4v9pI6JiamUL0gwym3pwjmXGA5tmRBdLO IVVm+qP+MejwYUN0Nr8kL5ja3G9Jy7Ae9Jq6HdlrAcc37RsPjpzU9PmdmSp3sfQREQfnGt pwRxvlA78OIqb6OEnVD4M7Gu6SgJurH3EoMJQdRmxdPX1w8KQ1Jc96SAtQghawVe/aIE/i I5FyNdiDwQ6eTFugo0BAEkOwNlr+63RxxRRp6oJTMkC9Dan38kCU9WYjQ4SyOjag0i+zrn GC3Jt4ULgQKsAAWij8wW6oY1hQH8f/xA7n11ZSm5sOYpEaxCIKUWPTrA1OFG6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd0K06BqBz3nc; Thu, 02 Oct 2025 18:13: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 592ID8fh080633; Thu, 2 Oct 2025 18:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592ID8Br080630; Thu, 2 Oct 2025 18:13:08 GMT (envelope-from git) Date: Thu, 2 Oct 2025 18:13:08 GMT Message-Id: <202510021813.592ID8Br080630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 14f4bc64b022 - stable/15 - thunderbolt.4: Remove List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 14f4bc64b022ad7c4d68b2a89667cfdc30188012 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=14f4bc64b022ad7c4d68b2a89667cfdc30188012 commit 14f4bc64b022ad7c4d68b2a89667cfdc30188012 Author: Alexander Ziaee AuthorDate: 2025-10-02 18:08:06 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 18:12:48 +0000 thunderbolt.4: Remove emaste reported that this driver did not make it into FreeBSD 15. Fixes: 3ae6c9735014f8c6f8 (thunderbolt.4: Initial manual) Fixes: 5ba4a93f9180699d6e (thunderbolt.4: Mention Thunderbolt 3) --- share/man/man4/Makefile | 1 - share/man/man4/thunderbolt.4 | 22 ---------------------- 2 files changed, 23 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 6e076722c786..f5d7a0e081fc 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -589,7 +589,6 @@ MAN= aac.4 \ tdfx.4 \ termios.4 \ textdump.4 \ - thunderbolt.4 \ ti.4 \ timecounters.4 \ tmpfs.4 \ diff --git a/share/man/man4/thunderbolt.4 b/share/man/man4/thunderbolt.4 deleted file mode 100644 index fd7cb1f3f338..000000000000 --- a/share/man/man4/thunderbolt.4 +++ /dev/null @@ -1,22 +0,0 @@ -.\" -.\" Copyright (c) 2025 Alexander Ziaee -.\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\" -.Dd October 2, 2025 -.Dt THUNDERBOLT 4 -.Os -.Sh NAME -.Nm thunderbolt -.Nd USB4 controller driver -.Sh SYNOPSIS -.Cd device thunderbolt -.Sh HARDWARE -The -.Nm -driver supports Thunderbolt 3 and USB4 controllers. -.Sh HISTORY -The -.Nm -driver appeared in -.Fx 15.0 . From nobody Thu Oct 2 18:56:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd1Gj4dv6z69nGN; Thu, 02 Oct 2025 18:56: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd1Gj3vW6z49Rq; Thu, 02 Oct 2025 18:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759431373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CG4FDep3ytb51zIGjoY2J3mmsUBnpxmz7eKGNb+3nF4=; b=uh4QQQY4xlA3foAqO0Sb/mt5VFuU2GGyLnf494mrj9cn+gLADO6HrfZpeFsmfYqRE4nw8Z Tcw9PKaUWSMuwo5pa+5tQtZeW44nGI/rnLy6GIsSxNrabzy8F3z7xh+j6nJLCtPlUSOr1p mYydw8qHM5ChzV5cP5RuTRbhiAnsGgdqz57u9Ob7jL15yipvDvJ5a21S1tNlRI8z5n/UaC clrea3X6b/849w+lrRYDznvdv+whdVr6k+3N7Z2q2uGFRrjEaaQYCSaPBwVfhDRehOofOY yAsd2xXMK72uHnd9n4/On2ETMU+7EYrHheCaX8unYF4Fv5o3vq263FMH5Y/G1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759431373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CG4FDep3ytb51zIGjoY2J3mmsUBnpxmz7eKGNb+3nF4=; b=bqJrhbYxWtnge7Eh9OdBMzzsR+Oyplp2RcgxsnD+dUiaLaGc5JvLRCC8ALC33Y245c6/3T d/PkY1kRDb+ih+ZcXeLL9ODpH/L6SalH8jw2+slxhZ4vksOJceBQiM223pWwBs7WgnScWM USg0QiPOgFlrmlR2/2GNjP+Z7BMKUzBe/ldAXhGl2erSb0B/5N3L+W5xwM3Eaeiy83X7ga HXwnt04A4eX0WmR6roqVaz+7xp3Onukzw553+0x5iPW398nZHvoiXzgcWMIwDm1I52EHaU Ol0fUuiHaoHnHociYE1gOR9JPSXlaBBgVM8+RjdJ4u3T46Q0EavGh9fuknyTjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759431373; a=rsa-sha256; cv=none; b=GomWCnYNMCDzgeDL3d1gY0Yy9OCnEhTMEsewaCmURJH2fMt8TQ4Qx1gbltSp6wH8jAtJbq y6JB7g8gJk3pWKFTG2uKP2SEJ0+vUCjL4OmOAuSM4ekrRApUdaTIjESkBnuBZpknXK/tt2 Y1GE6+3aLBQtZ9tt7ddYA/EW9bF4KLlOSvtQcKCEV3kdNK1CDikmToigGDe7qxTwsKqCBz 8KzyaMOjpbICygmtvBaCi8m683OGJAtjL3Gtusxq8UVgqVDrv1TC3Ti38EUQV8rJnaaDUj 7RI3BXKpYaid8qciM0ujK/8wHG8eK8nPE/fhyTPNm3PHw84CErIPdWk1sAXndQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd1Gj3KKkz4nB; Thu, 02 Oct 2025 18:56: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 592IuD9O058412; Thu, 2 Oct 2025 18:56:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592IuDsT058409; Thu, 2 Oct 2025 18:56:13 GMT (envelope-from git) Date: Thu, 2 Oct 2025 18:56:13 GMT Message-Id: <202510021856.592IuDsT058409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 70e9133d5427 - stable/15 - umass.4: Add HISTORY, HARDWARE, and SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 70e9133d542769b9aa70ba9f54effc74a03dbbe2 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=70e9133d542769b9aa70ba9f54effc74a03dbbe2 commit 70e9133d542769b9aa70ba9f54effc74a03dbbe2 Author: Alexander Ziaee AuthorDate: 2025-10-02 17:37:27 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 18:55:51 +0000 umass.4: Add HISTORY, HARDWARE, and SPDX While here, break a long line that agitates the linter. Fixes: cc16f1b9d9261f18 (Add umass.c) MFC after: 1 hour Discussed with: imp, ivy diff --git a/sys/dev/usb/FILES b/sys/dev/usb/FILES --- share/man/man4/umass.4 | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/share/man/man4/umass.4 b/share/man/man4/umass.4 index 03e8b6ff6ef1..9164f02b7d1e 100644 --- a/share/man/man4/umass.4 +++ b/share/man/man4/umass.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1999 .\" Nick Hibma . All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 27, 2020 +.Dd October 2, 2025 .Dt UMASS 4 .Os .Sh NAME @@ -71,6 +74,22 @@ requires and .Xr scbus 4 to be included in the kernel. +.Sh HARDWARE +The +.Nm +driver supports USB Mass Storage devices such as: +.Pp +.Bl -bullet -compact +.It +USB thumb drives +.It +USB hard disk drives +.It +USB floppy drives +.El +.Sh CACHE EFFECTS +Many direct access devices are equipped with read and/or write caches. +Parameters affecting the device's cache are stored in mode page 8, .Sh EXAMPLES .Bd -literal -offset indent device umass @@ -92,7 +111,8 @@ camcontrol rescan 0:0:3 Rescan all slots on a multi-slot flash reader, where the slots map to separate LUNs on a single SCSI ID. Typically only the first slot will be enabled at boot time. -This assumes that the flash reader is the first SCSI bus in the system and has 4 slots. +This assumes that +the flash reader is the first SCSI bus in the system and has 4 slots. .Sh SEE ALSO .Xr cfumass 4 , .Xr ehci 4 , @@ -101,7 +121,11 @@ This assumes that the flash reader is the first SCSI bus in the system and has 4 .Xr usb 4 , .Xr xhci 4 , .Xr camcontrol 8 -.\".Sh HISTORY +.Sh HISTORY +The +.Nm +driver appeared in +.Fx 4.3 . .Sh AUTHORS .An -nosplit The From nobody Thu Oct 2 18:56:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd1Gk6gHHz69n6c; Thu, 02 Oct 2025 18:56: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd1Gk5gPmz49dJ; Thu, 02 Oct 2025 18:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759431374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUNbOTpGQKNmdQ7K/NX18WsKOfoRDItoxg9xlUIS10c=; b=wWUVRbfC7hBy74kGxlYK3xnKQUKNyjuvLDTIv/iYzYEElfwUxQfJJOLwV4TwlNk7x9guTX K6rhCGIyluxBZEaQ80BRfZI45npwXQC7bgRZ7G9xtACVKywh5hQiQ1FnXFBmrjDpHDrAM+ WAlT3iZYXBBkLBp7R5l2uORJZbuuFhhrKfn/E0yBVoeJJuA/QehVs+fh6szYo/ebzozWHb g6ddtYqC/q4xakSPeC2edjmOwfp6JU5sGc1g6k1hehJbBaw0mn9SRBELOUn2Ul3QkXM20V WEvqkOQtZcBGB/RRVi/emGMzFz01dis8A3hs1e8WQcpzmx9Qa75zCRLrMGSA9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759431374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUNbOTpGQKNmdQ7K/NX18WsKOfoRDItoxg9xlUIS10c=; b=ix0yf32ohZY/0aCpnV182LQZPZipLsbKr9C/JuE5wGD2v4/7ERQNooF/SMu0H61WfbZ+c8 SAtE+JqGWzf5FIV9doxIs1wQdSFHCr2zepgZKuxDlvPJfHsvCN5C39PJL/HLHQ4vEZbkco XHV0X9Tf9wsHua6/wt8hrQSCofN1GBUInKgfq07Lg4ekndWKc4QhlhFrSzVIWeJV87+1Q7 Td8Ox9rkY7Oa6qevgCwxKUL3xl4FwLKbj803AszClpAK3lrijqdliU/nRXeeuTCt456MSf j0MzMJGTcyuGFsgrgnImaYX0dkCr6W9bpcOV/Ce++dJpAcfeIdUMmbzYpWoBtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759431374; a=rsa-sha256; cv=none; b=caEHU3OfH1srZNqiWpLboXD3t8bNSG0JN6Kt6QP8LnBz6zLLA8FawS+T0RENMlCBfVBxpD FWkaBa1RCEpmPx3SVIVVO/AyFvtYYQwq0Cc7w27ngJXPY6DyUuK8FnabnvnJCzEsWvWiWA 1mkzQ5d4HmsJAG01wUU0LmZRd7mRPHHGEIkha0okA3KSWcSypG6QiLuNeuBaEbJiInfkUL 8tfiqEwnozBuOKIunB/8F+8FPFCNtwFD5eAqiiqO1cOXl45CmZP/Slm8L1wSovDa0/j9Vz +lNgp+D0uF97Hw4Bqy39BE2C2yD3HUWxeg2tSVBmfcDGZ38jamgdwi7mPD07gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd1Gk45ygz50j; Thu, 02 Oct 2025 18:56: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 592IuEGA058451; Thu, 2 Oct 2025 18:56:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 592IuEq9058447; Thu, 2 Oct 2025 18:56:14 GMT (envelope-from git) Date: Thu, 2 Oct 2025 18:56:14 GMT Message-Id: <202510021856.592IuEq9058447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: b7418581f449 - stable/15 - umass.4: Remove some extra lines which snuck in List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: b7418581f449fc6ef54f2803836eb5b903cfa91b Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b7418581f449fc6ef54f2803836eb5b903cfa91b commit b7418581f449fc6ef54f2803836eb5b903cfa91b Author: Alexander Ziaee AuthorDate: 2025-10-02 18:02:01 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-02 18:55:51 +0000 umass.4: Remove some extra lines which snuck in Fixes: 70993c2fbe1ac (umass.4: Add HISTORY, HARDWARE, and SPDX) MFC with: 70993c2fbe1ac (umass.4: Add HISTORY, HARDWARE, and SPDX) --- share/man/man4/umass.4 | 3 --- 1 file changed, 3 deletions(-) diff --git a/share/man/man4/umass.4 b/share/man/man4/umass.4 index 9164f02b7d1e..db4e6f0890f2 100644 --- a/share/man/man4/umass.4 +++ b/share/man/man4/umass.4 @@ -87,9 +87,6 @@ USB hard disk drives .It USB floppy drives .El -.Sh CACHE EFFECTS -Many direct access devices are equipped with read and/or write caches. -Parameters affecting the device's cache are stored in mode page 8, .Sh EXAMPLES .Bd -literal -offset indent device umass From nobody Fri Oct 3 00:04:13 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd8654SqKz6BMvL; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd8652Hdgz3rx6; Fri, 03 Oct 2025 00:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t+c74AuRtz1/FxaS/S9a9Wcg0BLdA6o67b9xfG6xfC4=; b=rjRj8D13oyyg/0Bh89KusSUWCjKPsTkXqMdTf/+v1RVxG9uuEDkjp9Nm7GrVa6zJuF3UI9 6kp3REvM2Jdp+5eLMT+jIrf/A8ZAbe6NDY7mdNtSLEvKWCIz9M2lZAKD5VwoTqXC+zvw9i shdqzkvwUblbap7eNG40uBNOaXaIjMzs5fyEzml/Ut2MCUtq4uLvnNj1z/5HSJIGVs1wIz pozaLGEMJDOxkAJlxhvbBggM7ZKGazI0IWvPq8QFiPJTeey0UlEKTSBOqJTg7vsQGQztjz TiXFwzCtWmBhj9ZZPf40NhUp5YjBuOdDZZWqYeK6rp+p53yH4DMWBFltbtTH3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t+c74AuRtz1/FxaS/S9a9Wcg0BLdA6o67b9xfG6xfC4=; b=IgMAS45KNUg4eSfNtUM0JfAawwUd3HHMmTHaOggR1obgkqBnT7C1AUs5aBUXVmSYBfCoR+ 2lx0lVh3aePCXVIJ5eHNDb86Jp3BP09tTQO1LeLiVNQiJDLPXrGsMyoEVhBv2SeMB4EPKr a7XAIvg6bGEQpgDMTAxHYvQH3k5qGkclbwTV28lGDttY6FQZ8643T7h98WvNkfH5O5vacE KlR1GNxViFHGOyTXtv89hZdH3B3RqujXxvpOh9vawyOrysh419T1o7kXIVdjAVY8g3ybtV dPK7CEIVFVS1OIfWRJs++49lQVmzIBjWO+BaLSQU2y/nBWYPvSGjfaOC8ZTIPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449853; a=rsa-sha256; cv=none; b=nnAfAXByNUNIVnkFYZP7v4+kWE5Hm/aGmVnOf6PM7VD/UmzBTKvwATbeACTCi//+ZGg3RN 1Gcv4Xjj6JyDORWm+CprnR370saEv+PUln9/wBdKzVgLCPKMHyPvEQcPEuvyw8LL72iXA4 WJumaS/cvnyTOP/D42Jd6zla2sM4nGD48jntXJScVnVk1aJyXJ4t68Uiwoa2r6RK+Rp3dR 2/g3t2vVngGLNEmWayX/1nvXpOJPLlLXC85WylhL6UnbKu+vFNjbKjFIDxxmuU7jHm/ISH OwkBI+tt6eajC+yxwjpbQYKLW7j0PLz5Dq1SrmGRWiV0cY/UIefvw0MYvGOk3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd8651swkzTvS; Fri, 03 Oct 2025 00:04: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 59304Dft056490; Fri, 3 Oct 2025 00:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304DTF056487; Fri, 3 Oct 2025 00:04:13 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:13 GMT Message-Id: <202510030004.59304DTF056487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: e27bb92b6fa6 - stable/15 - cxgbe tom: Halve the size of offload transmit software descriptors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e27bb92b6fa69198c615fce52910417164dda986 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=e27bb92b6fa69198c615fce52910417164dda986 commit e27bb92b6fa69198c615fce52910417164dda986 Author: John Baldwin AuthorDate: 2025-09-11 21:10:39 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:03 +0000 cxgbe tom: Halve the size of offload transmit software descriptors Use bitfields to pack tx_credits and plen into a single 32-bit word. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47759 (cherry picked from commit 5a38857684907c52982787dbac2c5e5c8abfd4f8) --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 2 ++ sys/dev/cxgbe/iw_cxgbe/qp.c | 2 ++ sys/dev/cxgbe/tom/t4_cpl_io.c | 16 ++++++++++++++++ sys/dev/cxgbe/tom/t4_tls.c | 4 ++++ sys/dev/cxgbe/tom/t4_tom.c | 2 ++ sys/dev/cxgbe/tom/t4_tom.h | 7 +++++-- 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index c8592807f843..d805642541d3 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -1053,6 +1053,8 @@ send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_TXDATAPLEN_MAX; flowc->mnemval[0].val = htobe32(maxlen); + KASSERT(howmany(flowclen, 16) <= MAX_OFLD_TX_SDESC_CREDITS, + ("%s: tx_credits %u too large", __func__, howmany(flowclen, 16))); txsd->tx_credits = howmany(flowclen, 16); txsd->plen = 0; KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, diff --git a/sys/dev/cxgbe/iw_cxgbe/qp.c b/sys/dev/cxgbe/iw_cxgbe/qp.c index 0e374bc961c4..cbf4bae00a60 100644 --- a/sys/dev/cxgbe/iw_cxgbe/qp.c +++ b/sys/dev/cxgbe/iw_cxgbe/qp.c @@ -1326,6 +1326,8 @@ creds(struct toepcb *toep, struct inpcb *inp, size_t wrsize) return (EINVAL); } txsd = &toep->txsd[toep->txsd_pidx]; + KASSERT(howmany(wrsize, 16) <= MAX_OFLD_TX_SDESC_CREDITS, + ("%s: tx_credits %zu too large", __func__, howmany(wrsize, 16))); txsd->tx_credits = howmany(wrsize, 16); txsd->plen = 0; KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 7a6b1cbdd736..9ecb4aeee939 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -148,6 +148,8 @@ send_flowc_wr(struct toepcb *toep, struct tcpcb *tp) KASSERT(paramidx == nparams, ("nparams mismatch")); + KASSERT(howmany(flowclen, 16) <= MAX_OFLD_TX_SDESC_CREDITS, + ("%s: tx_credits %u too large", __func__, howmany(flowclen, 16))); txsd->tx_credits = howmany(flowclen, 16); txsd->plen = 0; KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, @@ -215,6 +217,8 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb *toep, u_int Bps) else flowc->mnemval[0].val = htobe32(tc_idx); + KASSERT(flowclen16 <= MAX_OFLD_TX_SDESC_CREDITS, + ("%s: tx_credits %u too large", __func__, flowclen16)); txsd->tx_credits = flowclen16; txsd->plen = 0; toep->tx_credits -= txsd->tx_credits; @@ -491,6 +495,9 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep) #define MIN_TX_CREDITS(iso) \ (MIN_OFLD_TX_CREDITS + ((iso) ? MIN_ISO_TX_CREDITS : 0)) +_Static_assert(MAX_OFLD_TX_CREDITS <= MAX_OFLD_TX_SDESC_CREDITS, + "MAX_OFLD_TX_SDESC_CREDITS too small"); + /* Maximum amount of immediate data we could stuff in a WR */ static inline int max_imm_payload(int tx_credits, int iso) @@ -705,6 +712,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) if ((m->m_flags & M_NOTREADY) != 0) break; + if (plen + m->m_len > MAX_OFLD_TX_SDESC_PLEN) + break; if (m->m_flags & M_EXTPG) { #ifdef KERN_TLS if (m->m_epg_tls != NULL) { @@ -870,6 +879,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) toep->flags |= TPF_TX_SUSPENDED; KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); + KASSERT(plen <= MAX_OFLD_TX_SDESC_PLEN, + ("%s: plen %u too large", __func__, plen)); txsd->plen = plen; txsd->tx_credits = credits; txsd++; @@ -1211,6 +1222,8 @@ t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) toep->flags |= TPF_TX_SUSPENDED; KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); + KASSERT(plen <= MAX_OFLD_TX_SDESC_PLEN, + ("%s: plen %u too large", __func__, plen)); txsd->plen = plen; txsd->tx_credits = credits; txsd++; @@ -1969,6 +1982,9 @@ t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, struct toepcb *toep, req->val = htobe64(val); if (wrq->eq.type == EQ_OFLD) { txsd = &toep->txsd[toep->txsd_pidx]; + _Static_assert(howmany(sizeof(*req), 16) <= + MAX_OFLD_TX_SDESC_CREDITS, + "MAX_OFLD_TX_SDESC_CREDITS too small"); txsd->tx_credits = howmany(sizeof(*req), 16); txsd->plen = 0; KASSERT(toep->tx_credits >= txsd->tx_credits && diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 27c16b9988ae..857832aafa5c 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -191,6 +191,8 @@ tls_program_key_id(struct toepcb *toep, struct ktls_session *tls, t4_tls_key_ctx(tls, direction, kctx); txsd = &toep->txsd[toep->txsd_pidx]; + _Static_assert(DIV_ROUND_UP(TLS_KEY_WR_SZ, 16) <= + MAX_OFLD_TX_SDESC_CREDITS, "MAX_OFLD_TX_SDESC_CREDITS too small"); txsd->tx_credits = DIV_ROUND_UP(TLS_KEY_WR_SZ, 16); txsd->plen = 0; toep->tx_credits -= txsd->tx_credits; @@ -694,6 +696,8 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) toep->flags |= TPF_TX_SUSPENDED; KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); + KASSERT(m->m_len <= MAX_OFLD_TX_SDESC_PLEN, + ("%s: plen %u too large", __func__, m->m_len)); txsd->plen = m->m_len; txsd->tx_credits = credits; txsd++; diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 9b09facd05a7..0b54fdaa5c80 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -882,6 +882,8 @@ send_mss_flowc_wr(struct adapter *sc, struct toepcb *toep) flowc->mnemval[0].val = htobe32(toep->params.emss); txsd = &toep->txsd[toep->txsd_pidx]; + _Static_assert(flowclen16 <= MAX_OFLD_TX_SDESC_CREDITS, + "MAX_OFLD_TX_SDESC_CREDITS too small"); txsd->tx_credits = flowclen16; txsd->plen = 0; toep->tx_credits -= txsd->tx_credits; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 6295a3484b9f..3b2243aeb69f 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -122,10 +122,13 @@ struct conn_params { }; struct ofld_tx_sdesc { - uint32_t plen; /* payload length */ - uint8_t tx_credits; /* firmware tx credits (unit is 16B) */ + uint32_t plen : 26; /* payload length */ + uint32_t tx_credits : 6; /* firmware tx credits (unit is 16B) */ }; +#define MAX_OFLD_TX_SDESC_PLEN ((1u << 26) - 1) +#define MAX_OFLD_TX_SDESC_CREDITS ((1u << 6) - 1) + struct ppod_region { u_int pr_start; u_int pr_len; From nobody Fri Oct 3 00:04:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd8663fFYz6BMjJ; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86625xnz3s29; Fri, 03 Oct 2025 00:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+3ISNAhwu30pT/NPD402MO4DVaAbY9YfAH5hxXxycj4=; b=ipGqiIa7IhbN9Bp+u8cwB9mNa5lJfQq1xST1na2Zfo+xbt5bvAvUdFAGGvzpZCn0SbxpCs bh+lBNtTNwO20L+GPfoSRgpSZ+dJ4XR6nvQ+AwLsO9qdDaltp/Bbhhs5yj0RTxO+MA2MBC 7r+x4Fy+n401+sq3CsuIwai4MJjMesgTYitpfhJrTdLH83Ved3mp7ZBuan2MzKdmd7uIM1 7HKqaktX7FD1c9psxeGAMPEKsackWRHOWgNRFFXXdvoVwOgAKYkG58+IIAEClfgnd8upZ6 axkXMcUKJzq6pzCcA9vrt6xqMQr9nsQZAJB6acJSsqWb0crrjJ/KxYB/DfwVNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+3ISNAhwu30pT/NPD402MO4DVaAbY9YfAH5hxXxycj4=; b=eUEcwTxW1Pp+Ljn8IbPTSwVjSH0AUriFPU120vs9YlACVZ4pyz0kzYNoY3WGzBagKb07St ATndZbWxIxTeipedBJR+9uHfnc11vEPCGBB9tpqhmgWI7tQjX7Pih31cmeYdh41bZnuW2Q cbsMse2KqOUvxcAEzeep3X1jM/I4NCk0ZCAkmyznyiY44xHPETDYiZyQmUPjlsGRkwSFWt zCmwHiZ7vNO+Wf5L1zK+Zrud7vtEqEWyu3lArd5Lgi8PWnqtASAsxyRA9DCyBv8rZ97kPT CAyguG2WqSZs3siBS2FCrxlx3zppxVlUsGdTBXlQsnhZ0Rm3BCesLx4RANZPFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449854; a=rsa-sha256; cv=none; b=fD6t1OmpiXxLC46jugqs+Zc2kB+yTh0UWLJVAuWoEO/WjDJJnV0KHWvqi9t4cRy8gMpVop 3tgdYmRsVEfGxFeiutzlqxlV2r1X7tFfBrspEWk1/RvL+gtfdOsYaK1dwNv52fX5vXIiNh 5DcsVWm9bjNdFr7hk2H5sN+27fUpiVtVQA9w7U1JbdUJLvutxYnc4Jw+8+URKei9OJaR5i KLFPjJz13xVWqVj7fMECebYoqcmZQUIMwKPKEN9I+iDjqI+Vu7S7dh54l6hbZMoUaDsvxT do8kztATNKcuo7GN5lW76BDCfCDTzCbTtFMyzTh1q6zKQHSp/msqo3Msp4Ff8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd8661hSyzVcq; Fri, 03 Oct 2025 00:04: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 59304EtN056522; Fri, 3 Oct 2025 00:04:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304EK1056519; Fri, 3 Oct 2025 00:04:14 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:14 GMT Message-Id: <202510030004.59304EK1056519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 340c4db70266 - stable/15 - cxgbe tom: Support sending "raw" WR mbufs on plain TCP and TLS sockets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 340c4db7026661a88dba2b828f1da5d4d1eef3ec Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=340c4db7026661a88dba2b828f1da5d4d1eef3ec commit 340c4db7026661a88dba2b828f1da5d4d1eef3ec Author: John Baldwin AuthorDate: 2025-09-11 21:10:39 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:03 +0000 cxgbe tom: Support sending "raw" WR mbufs on plain TCP and TLS sockets This is intended to support control work requests that manipulate connection state but do not transmit data. Raw WRs are transmitted immediately if possible, otherwise they are queued to an mbufq in the toe pcb until sufficient credits are available. Raw WRs take precendence over transmitting socket data. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47761 (cherry picked from commit e2a2a7581c9663a08b8d92a34040d6fcdfc20816) --- sys/dev/cxgbe/tom/t4_cpl_io.c | 85 +++++++++++++++++++++++++++++++++++++++++++ sys/dev/cxgbe/tom/t4_tls.c | 13 +++++++ sys/dev/cxgbe/tom/t4_tom.h | 2 + 3 files changed, 100 insertions(+) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 9ecb4aeee939..a7b4162db3b5 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -619,6 +619,48 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbuf *stop, int nsegs, int n) __func__, nsegs, start, stop)); } +bool +t4_push_raw_wr(struct adapter *sc, struct toepcb *toep, struct mbuf *m) +{ +#ifdef INVARIANTS + struct inpcb *inp = toep->inp; +#endif + struct wrqe *wr; + struct ofld_tx_sdesc *txsd; + u_int credits, plen; + + INP_WLOCK_ASSERT(inp); + MPASS(mbuf_raw_wr(m)); + plen = m->m_pkthdr.len; + credits = howmany(plen, 16); + if (credits > toep->tx_credits) + return (false); + + wr = alloc_wrqe(roundup2(plen, 16), &toep->ofld_txq->wrq); + if (wr == NULL) + return (false); + + m_copydata(m, 0, plen, wrtod(wr)); + m_freem(m); + + toep->tx_credits -= credits; + if (toep->tx_credits < MIN_OFLD_TX_CREDITS) + toep->flags |= TPF_TX_SUSPENDED; + + KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); + KASSERT(credits <= MAX_OFLD_TX_SDESC_CREDITS, + ("%s: tx_credits %u too large", __func__, credits)); + txsd = &toep->txsd[toep->txsd_pidx]; + txsd->plen = 0; + txsd->tx_credits = credits; + if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) + toep->txsd_pidx = 0; + toep->txsd_avail--; + + t4_wrq_tx(sc, wr); + return (true); +} + /* * Max number of SGL entries an offload tx work request can have. This is 41 * (1 + 40) for a full 512B work request. @@ -651,6 +693,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) struct tcpcb *tp = intotcpcb(inp); struct socket *so = inp->inp_socket; struct sockbuf *sb = &so->so_snd; + struct mbufq *pduq = &toep->ulp_pduq; int tx_credits, shove, compl, sowwakeup; struct ofld_tx_sdesc *txsd; bool nomap_mbuf_seen; @@ -695,6 +738,19 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) max_imm = max_imm_payload(tx_credits, 0); max_nsegs = max_dsgl_nsegs(tx_credits, 0); + if (__predict_false((sndptr = mbufq_first(pduq)) != NULL)) { + if (!t4_push_raw_wr(sc, toep, sndptr)) { + toep->flags |= TPF_TX_SUSPENDED; + return; + } + + m = mbufq_dequeue(pduq); + MPASS(m == sndptr); + + txsd = &toep->txsd[toep->txsd_pidx]; + continue; + } + SOCKBUF_LOCK(sb); sowwakeup = drop; if (drop) { @@ -1253,6 +1309,35 @@ t4_push_data(struct adapter *sc, struct toepcb *toep, int drop) t4_push_frames(sc, toep, drop); } +void +t4_raw_wr_tx(struct adapter *sc, struct toepcb *toep, struct mbuf *m) +{ +#ifdef INVARIANTS + struct inpcb *inp = toep->inp; +#endif + + INP_WLOCK_ASSERT(inp); + + /* + * If there are other raw WRs enqueued, enqueue to preserve + * FIFO ordering. + */ + if (!mbufq_empty(&toep->ulp_pduq)) { + mbufq_enqueue(&toep->ulp_pduq, m); + return; + } + + /* + * Cannot call t4_push_data here as that will lock so_snd and + * some callers of this run in rx handlers with so_rcv locked. + * Instead, just try to transmit this WR. + */ + if (!t4_push_raw_wr(sc, toep, m)) { + mbufq_enqueue(&toep->ulp_pduq, m); + toep->flags |= TPF_TX_SUSPENDED; + } +} + int t4_tod_output(struct toedev *tod, struct tcpcb *tp) { diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 857832aafa5c..3dd3c28e3a86 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -496,6 +496,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) struct tcpcb *tp = intotcpcb(inp); struct socket *so = inp->inp_socket; struct sockbuf *sb = &so->so_snd; + struct mbufq *pduq = &toep->ulp_pduq; int tls_size, tx_credits, shove, sowwakeup; struct ofld_tx_sdesc *txsd; char *buf; @@ -538,6 +539,18 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) for (;;) { tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); + if (__predict_false((m = mbufq_first(pduq)) != NULL)) { + if (!t4_push_raw_wr(sc, toep, m)) { + toep->flags |= TPF_TX_SUSPENDED; + return; + } + + (void)mbufq_dequeue(pduq); + + txsd = &toep->txsd[toep->txsd_pidx]; + continue; + } + SOCKBUF_LOCK(sb); sowwakeup = drop; if (drop) { diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 3b2243aeb69f..3dfa24a33f85 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -529,6 +529,8 @@ int t4_send_rst(struct toedev *, struct tcpcb *); void t4_set_tcb_field(struct adapter *, struct sge_wrq *, struct toepcb *, uint16_t, uint64_t, uint64_t, int, int); void t4_push_pdus(struct adapter *, struct toepcb *, int); +bool t4_push_raw_wr(struct adapter *, struct toepcb *, struct mbuf *); +void t4_raw_wr_tx(struct adapter *, struct toepcb *, struct mbuf *); /* t4_ddp.c */ int t4_init_ppod_region(struct ppod_region *, struct t4_range *, u_int, From nobody Fri Oct 3 00:04:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd8685HjWz6BMbB; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86843DTz3rff; Fri, 03 Oct 2025 00:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scttQgo1F5MRCDjBhqYucmtYItcgF8p/ZDwwz0OmakA=; b=kKiratnAzZciO2cR6pdX8M32nWk9VvWfDao9XDKkRrLrllH/eIfqw4X4miDkw0F1tecC84 fiFlxp2wgzUhwFHNqh2geCvaTJAZzBRXUfZbP1RFqrhEwqDHu94uzwkP39vjj2NlZyVjGE I6e8r/vK2y3cVBA7CVH8khMfLrxhHwHj4R2vGkWZGFWw/8LL/zsYbBME2YQOrDaGhDXOl/ o8egSYTl40ZBkm4mRNwNXcrqS6Jp5NCThLFx5DALg++xmAVNxaHGjlwsV2LLtEymuwyLcD 6wQbSrCGxaBTFqjbOufwz/tNI3eyZA7Vi7Xf3G6wvTpAiQHEZn2nEzA5r8dTwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scttQgo1F5MRCDjBhqYucmtYItcgF8p/ZDwwz0OmakA=; b=QQyCZyignVJur6s7kIIYzygnPORsP9wfwwx8inU8IF6Ms2qPnkA1stFOpOaTSgV3NVC1q7 zLU2SJcipOz/XXoOZoi7cy8nMRlZ9y+MyWlD9hu4OpS+oujDphen+HsRtWrhMizyy7spnb GTk1vWIu5DYciXY23hE0MA+cxmtIWWww2CStey9kUIcFoIZbBFPxsTcaFe2hXCUqURyhtF rK/RgCE4zZPDWLszit2OJcVtj/h2Eot6mTzufol66hIolfCzJl7aoILcRAJ9ijuqiGKmmG nMjTPoBBDU38lXhcjWFASU5DP0fsrmaUz2qjtMVEds4mGgsVPNRhDGybXYyEXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449856; a=rsa-sha256; cv=none; b=FzXQ5t5hL6Yyvuk0auoI1lerkf8/++xKSJ/NikYGRoJTkVcy0wP9EWYJCHvMLZzOvHewpt Jv6SZmu4NB3iSgfLx0QnpoDcmanufmjG+U38qfoM23Jp0WuwYRc2EeeVJCuX4RfJ2jTrgS hdgMX989ImFqiF/ZHc5ZIoG9mtz/eSGwCOn2cuCEN9JzeeQAs4J+EmBDP6MfpWD2LdUuAz c97asu8bStFJ8paWk8Z4an4gPXIt3kQCthz5hj0zje0spbIQ5/6SvsYEpAEKWujn0QdLNx Ut3dCxYQBJY0oU/Zz2yqNBjm8Xz7J30Of8ntaOcOdvSFnU37KLEa+JP4SkoGbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd8683cShzVjM; Fri, 03 Oct 2025 00:04: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 59304GS6056593; Fri, 3 Oct 2025 00:04:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304GA5056590; Fri, 3 Oct 2025 00:04:16 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:16 GMT Message-Id: <202510030004.59304GA5056590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: f69054d53654 - stable/15 - cxgbe tom: Send auxiliary TLS work requests as raw WR mbufs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f69054d5365447a9e71c75a9a6f5913ad63beade Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f69054d5365447a9e71c75a9a6f5913ad63beade commit f69054d5365447a9e71c75a9a6f5913ad63beade Author: John Baldwin AuthorDate: 2025-09-11 21:10:40 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:03 +0000 cxgbe tom: Send auxiliary TLS work requests as raw WR mbufs In particular, the work request to update the TCB state when switching from plain TCP to TLS is now queued on the connection's offload transmit queue rather than over the per-port control queue. This also handles an unlikely edge case that a connection does not have sufficient credits to transmit other work requests synchronously such as programming the key in on-card memory or altering TCB fields. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47763 (cherry picked from commit d869395ac4bd248da7c5bdc67afb19ca89fbeeee) --- sys/dev/cxgbe/tom/t4_cpl_io.c | 36 +++++++++++++++++----------- sys/dev/cxgbe/tom/t4_tls.c | 56 +++++++++++++++++++++---------------------- sys/dev/cxgbe/tom/t4_tom.h | 2 ++ 3 files changed, 51 insertions(+), 43 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index a7b4162db3b5..be20ea42474e 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2039,25 +2039,16 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) } void -t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, struct toepcb *toep, +write_set_tcb_field(struct adapter *sc, void *dst, struct toepcb *toep, uint16_t word, uint64_t mask, uint64_t val, int reply, int cookie) { - struct wrqe *wr; - struct cpl_set_tcb_field *req; - struct ofld_tx_sdesc *txsd; + struct cpl_set_tcb_field *req = dst; MPASS((cookie & ~M_COOKIE) == 0); if (reply) { MPASS(cookie != CPL_COOKIE_RESERVED); } - wr = alloc_wrqe(sizeof(*req), wrq); - if (wr == NULL) { - /* XXX */ - panic("%s: allocation failure.", __func__); - } - req = wrtod(wr); - INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, toep->tid); req->reply_ctrl = htobe16(V_QUEUENO(toep->ofld_rxq->iq.abs_id)); if (reply == 0) @@ -2065,12 +2056,29 @@ t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, struct toepcb *toep, req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(cookie)); req->mask = htobe64(mask); req->val = htobe64(val); +} + +void +t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, struct toepcb *toep, + uint16_t word, uint64_t mask, uint64_t val, int reply, int cookie) +{ + struct wrqe *wr; + struct ofld_tx_sdesc *txsd; + const u_int len = sizeof(struct cpl_set_tcb_field); + + wr = alloc_wrqe(len, wrq); + if (wr == NULL) { + /* XXX */ + panic("%s: allocation failure.", __func__); + } + write_set_tcb_field(sc, wrtod(wr), toep, word, mask, val, reply, + cookie); + if (wrq->eq.type == EQ_OFLD) { txsd = &toep->txsd[toep->txsd_pidx]; - _Static_assert(howmany(sizeof(*req), 16) <= - MAX_OFLD_TX_SDESC_CREDITS, + _Static_assert(howmany(len, 16) <= MAX_OFLD_TX_SDESC_CREDITS, "MAX_OFLD_TX_SDESC_CREDITS too small"); - txsd->tx_credits = howmany(sizeof(*req), 16); + txsd->tx_credits = howmany(len, 16); txsd->plen = 0; KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 3dd3c28e3a86..ad72c6a6b025 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -61,11 +61,21 @@ static void t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, - uint64_t val) + uint64_t val, int reply, int cookie) { struct adapter *sc = td_adapter(toep->td); + struct mbuf *m; - t4_set_tcb_field(sc, &toep->ofld_txq->wrq, toep, word, mask, val, 0, 0); + m = alloc_raw_wr_mbuf(sizeof(struct cpl_set_tcb_field)); + if (m == NULL) { + /* XXX */ + panic("%s: out of memory", __func__); + } + + write_set_tcb_field(sc, mtod(m, void *), toep, word, mask, val, reply, + cookie); + + t4_raw_wr_tx(sc, toep, m); } /* TLS and DTLS common routines */ @@ -88,10 +98,9 @@ tls_tx_key(struct toepcb *toep) static void t4_set_rx_quiesce(struct toepcb *toep) { - struct adapter *sc = td_adapter(toep->td); - t4_set_tcb_field(sc, &toep->ofld_txq->wrq, toep, W_TCB_T_FLAGS, - V_TF_RX_QUIESCE(1), V_TF_RX_QUIESCE(1), 1, CPL_COOKIE_TOM); + t4_set_tls_tcb_field(toep, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), + V_TF_RX_QUIESCE(1), 1, CPL_COOKIE_TOM); } /* Clear TF_RX_QUIESCE to re-enable receive. */ @@ -99,7 +108,7 @@ static void t4_clear_rx_quiesce(struct toepcb *toep) { - t4_set_tls_tcb_field(toep, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), 0); + t4_set_tls_tcb_field(toep, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), 0, 0, 0); } /* TLS/DTLS content type for CPL SFO */ @@ -145,16 +154,15 @@ get_tp_plen_max(struct ktls_session *tls) return (tls->params.max_frame_len <= 8192 ? plen : FC_TP_PLEN_MAX); } -/* Send request to get the key-id */ +/* Send request to save the key in on-card memory. */ static int tls_program_key_id(struct toepcb *toep, struct ktls_session *tls, int direction) { struct tls_ofld_info *tls_ofld = &toep->tls; struct adapter *sc = td_adapter(toep->td); - struct ofld_tx_sdesc *txsd; int keyid; - struct wrqe *wr; + struct mbuf *m; struct tls_key_req *kwr; struct tls_keyctx *kctx; @@ -173,12 +181,12 @@ tls_program_key_id(struct toepcb *toep, struct ktls_session *tls, return (ENOSPC); } - wr = alloc_wrqe(TLS_KEY_WR_SZ, &toep->ofld_txq->wrq); - if (wr == NULL) { + m = alloc_raw_wr_mbuf(TLS_KEY_WR_SZ); + if (m == NULL) { t4_free_tls_keyid(sc, keyid); return (ENOMEM); } - kwr = wrtod(wr); + kwr = mtod(m, struct tls_key_req *); memset(kwr, 0, TLS_KEY_WR_SZ); t4_write_tlskey_wr(tls, direction, toep->tid, F_FW_WR_COMPL, keyid, @@ -190,17 +198,7 @@ tls_program_key_id(struct toepcb *toep, struct ktls_session *tls, tls_ofld->rx_key_addr = keyid; t4_tls_key_ctx(tls, direction, kctx); - txsd = &toep->txsd[toep->txsd_pidx]; - _Static_assert(DIV_ROUND_UP(TLS_KEY_WR_SZ, 16) <= - MAX_OFLD_TX_SDESC_CREDITS, "MAX_OFLD_TX_SDESC_CREDITS too small"); - txsd->tx_credits = DIV_ROUND_UP(TLS_KEY_WR_SZ, 16); - txsd->plen = 0; - toep->tx_credits -= txsd->tx_credits; - if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) - toep->txsd_pidx = 0; - toep->txsd_avail--; - - t4_wrq_tx(sc, wr); + t4_raw_wr_tx(sc, toep, m); return (0); } @@ -1099,7 +1097,7 @@ out: static void tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) { - struct wrqe *wr; + struct mbuf *m; struct work_request_hdr *wrh; struct ulp_txpkt *ulpmc; int fields, key_offset, len; @@ -1128,14 +1126,14 @@ tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) KASSERT(len <= SGE_MAX_WR_LEN, ("%s: WR with %d TCB field updates too large", __func__, fields)); - wr = alloc_wrqe(len, toep->ctrlq); - if (wr == NULL) { + m = alloc_raw_wr_mbuf(len); + if (m == NULL) { /* XXX */ panic("%s: out of memory", __func__); } - wrh = wrtod(wr); - INIT_ULPTX_WRH(wrh, len, 1, 0); /* atomic */ + wrh = mtod(m, struct work_request_hdr *); + INIT_ULPTX_WRH(wrh, len, 1, toep->tid); /* atomic */ ulpmc = (struct ulp_txpkt *)(wrh + 1); /* @@ -1180,7 +1178,7 @@ tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_T_FLAGS, V_TF_RX_QUIESCE(1), 0); - t4_wrq_tx(sc, wr); + t4_raw_wr_tx(sc, toep, m); } /* diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index af6d37931b2e..4fb87d92d91e 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -531,6 +531,8 @@ void t4_set_tcb_field(struct adapter *, struct sge_wrq *, struct toepcb *, void t4_push_pdus(struct adapter *, struct toepcb *, int); bool t4_push_raw_wr(struct adapter *, struct toepcb *, struct mbuf *); void t4_raw_wr_tx(struct adapter *, struct toepcb *, struct mbuf *); +void write_set_tcb_field(struct adapter *, void *, struct toepcb *, uint16_t, + uint64_t, uint64_t, int, int); /* t4_ddp.c */ int t4_init_ppod_region(struct ppod_region *, struct t4_range *, u_int, From nobody Fri Oct 3 00:04:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd8675KBjz6BMvP; Fri, 03 Oct 2025 00:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd8672nq4z3s2B; Fri, 03 Oct 2025 00:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9EkgX8eu0xY9OO+vyTSL07WhlTgnXUvtCG/5aCxgeU=; b=MPfoyRrDhv/iZBtf4+w6sxGw4tT9zufAEvNDHGiWbS2bxQcJYXDyVZ5XrS/foB4hL5HFaJ KtW/NGYNX23Cy2eGq9wMrjNTVdn3YhVPdeIsjlWu+qmBLLPsMt9RGBlbTyD4ngd+7TjQ1Y H7jqlVGAehiUN8H8uX1Aur+NTfPAozpvFLrxq5R8ID88DgBEPthv79RO0dU4d2qGwMPQ/8 L6SeSZSOtkysZQSZ97bdsIOCP5MehG59lczQ0uIdM0ontl1WuZkpov+7HfXPQG8FnoMWNc nDIshclmdjuPAwVx1+I5TFEwO+C33tNhBzE88c8m92NGWJOdPXapZnMQNjHjAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9EkgX8eu0xY9OO+vyTSL07WhlTgnXUvtCG/5aCxgeU=; b=wp6cZrgtA4jJNvGhLaLFmXUBphT06eyOrlE1ejXrDQOMD7SAEuJLneDtvck8UeK4FI1EBC 96gXOAq+7usHU+JDWiJZdU0FfrQzYd/82+JwCKMRN6NNEDnR4LC9/25P9iHkDlZ/ehS72m Bm5CwjplhDL+h5PxL0sOwH/ruveK2i8Y17F7iSlA9zEfGf84Vw6Qe6HoOA2iteHzbnExBK XOlWK0eaaXj2JODNP0nWiOZpm4vNqa21Mo234L4rwhDvJYqxZDaVARtfmQMviUZMllvmg1 iImZmw1T+YZk2XnPaRFZJKCIJzfOoxXaaVk+LTcWbR3CvZlvenvQ0AI0JTJi3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449855; a=rsa-sha256; cv=none; b=frPML5a+aQT0M5YRJQgrgxfFcf/uXNUyDaMuD3SJkufFWweo16gbMP5sPbCZWcVyIu433e IkmH4jf/49U/rX1pPRjkQo2wYL4KuLV5ukRYrBna9rY9UDtRS+DAdL6VVEtpac8sD9Hot/ TyrXKFT5cxoJxwLEtX9bOOZvjXtpCD0/lCAiJnrKRI85tLF5WTJN5ETwRevwYQrohTJR5V c1IPBreDt453jsohy1GiuS+GD8LX5OEJobSbNRMia6fFFOwyLr4rshR8ZxX493uwn3QtZu nneZo3ApNFPRNsjjK0eTB46clrAxprNDTWETn9cDXaU9AX/E7/D48wLRrbLW9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd8672LZgzVfb; Fri, 03 Oct 2025 00:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304Fjk056557; Fri, 3 Oct 2025 00:04:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304FWV056554; Fri, 3 Oct 2025 00:04:15 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:15 GMT Message-Id: <202510030004.59304FWV056554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 846df8bc79c6 - stable/15 - cxgbe tom: Export alloc_raw_mbuf for use in other TOE drivers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 846df8bc79c6313f76282159a53af97111f08cc3 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=846df8bc79c6313f76282159a53af97111f08cc3 commit 846df8bc79c6313f76282159a53af97111f08cc3 Author: John Baldwin AuthorDate: 2025-09-11 21:10:40 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:03 +0000 cxgbe tom: Export alloc_raw_mbuf for use in other TOE drivers Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47762 (cherry picked from commit a7aab22d2bf36191baa646fc136ca020dad209f3) --- sys/dev/cxgbe/tom/t4_ddp.c | 2 +- sys/dev/cxgbe/tom/t4_tom.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index 2fee8fa91dac..da0753296532 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -1785,7 +1785,7 @@ t4_write_page_pods_for_rcvbuf(struct adapter *sc, struct sge_wrq *wrq, int tid, return (0); } -static struct mbuf * +struct mbuf * alloc_raw_wr_mbuf(int len) { struct mbuf *m; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 3dfa24a33f85..af6d37931b2e 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -556,6 +556,7 @@ int t4_aio_queue_ddp(struct socket *, struct kaiocb *); int t4_enable_ddp_rcv(struct socket *, struct toepcb *); void t4_ddp_mod_load(void); void t4_ddp_mod_unload(void); +struct mbuf *alloc_raw_wr_mbuf(int); void ddp_assert_empty(struct toepcb *); void ddp_uninit_toep(struct toepcb *); void ddp_queue_toep(struct toepcb *); From nobody Fri Oct 3 00:04:17 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd869666fz6BMh8; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd8694sMfz3s4g; Fri, 03 Oct 2025 00:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wrMoNnm+654PTLshf8yMRhNaxt7/AYC1QtYMzAdwUvw=; b=UKMHndGlNzn39IEIQVc7VbH1Ke03EfzvY1SObHP04jV7Dj17J4SZTisMe//GsMAmFIONQl mmTx3H70qxhXWHJuKPGV8jYk32WJrlL7v3sFea4ukfmfIX6q8WxWXRDhEEGppblppY3BEH FakoKsXGr/sADPaQ1pbWfqDsB9LfDAl+1AeJ1v22/aepv+1XCbKbLIMZAftnLSZa4xRiMI SftnLXavinjRwugHouN79XNT5JDa5+aRXDlt25ys6ATGUpHwq4avzWLVuJ+wf17ejaGrUl 86Ab9UvQrW69eZY78b/w9UpmJJjVT3wNEAp2PnB7JRAFSuNfYaHco4tDUpyzIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wrMoNnm+654PTLshf8yMRhNaxt7/AYC1QtYMzAdwUvw=; b=OYzxmJ3er87wXpQR/lICu6fYef92N9lgoloxz1JKO7fQJzDteNOL06cVR3JDMvHfv1Tb5q AIc8n4sIzeFsoWgjfbsaH6B7+Tws3rurlFmC1n2IpCgSQ9fZb+D4R0ZB6+WqAMtjy11sfX 00WJ0nqVUKzCiB9JE5/bpTQG4qhAmYjAXSgnGXOAnbH5QYgi0uB6CNHjmaRtKQKV9LPqQz m5yKOIlot2zTh2rsOFQCN0F+4ecWd5XQYUg9jZcmPuSrtQCxTwasCbHkGkP394879Cw17g zAH7ZqYDNfBkmDEU4NwAI3S+ggWXpmxpR4ILoMoCrXNI9nJMZjVhZjvgkixgzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449857; a=rsa-sha256; cv=none; b=G4J/j+q9r0tngLUDv6GG2sb+s5qiqi8fObJqfa8RyMH/npEV4OB7j494pbw1fC1YJpIr0x pMIjK1YHOcB+xQNRs1+zAQbC0/37Gwcw4eJ6qBdTcBaqAoRuxHcVq3r7WAos8LTcxRQorH 4b0+Oa/JSKC337PaZ7+MHbFMheo/2z9ZpM91YakdhAVLJ6kY+cMeqamJ6U0l+Od9sMTsWl llikIHCZeFO6QzRiBnx1Rr6GRTLNbGL2ebtctt8leAYbcmGzhJHgfAGeSOQzXnhqIoJi1o 9CQn8y8GurXMBbc3cTutXXtajX4Xu+vBsM7S9pCODOTNMGTT/ZFJTWUlL00GPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd8694PkgzVcp; Fri, 03 Oct 2025 00:04: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 59304H3q056627; Fri, 3 Oct 2025 00:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304HDh056624; Fri, 3 Oct 2025 00:04:17 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:17 GMT Message-Id: <202510030004.59304HDh056624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: d99e74711bc8 - stable/15 - cxgbe(4): Rename lport to hw_port. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d99e74711bc8ce5d760488ae68b60f6fe5f0d3a0 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=d99e74711bc8ce5d760488ae68b60f6fe5f0d3a0 commit d99e74711bc8ce5d760488ae68b60f6fe5f0d3a0 Author: Navdeep Parhar AuthorDate: 2025-09-29 05:40:24 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:03 +0000 cxgbe(4): Rename lport to hw_port. No functional change intended. Sponsored by: Chelsio Communications (cherry picked from commit 499ff78fb11a5868dfaeaa3fa86ca782b8f06f27) --- sys/dev/cxgbe/adapter.h | 2 +- sys/dev/cxgbe/common/t4_hw.c | 2 +- sys/dev/cxgbe/crypto/t6_kern_tls.c | 2 +- sys/dev/cxgbe/t4_l2t.c | 14 +++++++------- sys/dev/cxgbe/t4_l2t.h | 2 +- sys/dev/cxgbe/tom/t4_tom.c | 2 +- sys/dev/cxgbe/tom/t4_tom_l2t.c | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index d3820245837a..248a8e112add 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -319,7 +319,7 @@ struct port_info { char lockname[16]; unsigned long flags; - uint8_t lport; /* associated offload logical port */ + uint8_t hw_port; /* associated hardware port idx */ int8_t mdio_addr; uint8_t port_type; uint8_t mod_type; diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 07940a44f66e..01890b9598b8 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -9818,11 +9818,11 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id) } while ((adap->params.portvec & (1 << j)) == 0); } + p->hw_port = j; p->tx_chan = t4_get_tx_c_chan(adap, j); p->rx_chan = t4_get_rx_c_chan(adap, j); p->mps_bg_map = t4_get_mps_bg_map(adap, j); p->rx_e_chan_map = t4_get_rx_e_chan_map(adap, j); - p->lport = j; if (!(adap->flags & IS_VF) || adap->params.vfres.r_caps & FW_CMD_CAP_PORT) { diff --git a/sys/dev/cxgbe/crypto/t6_kern_tls.c b/sys/dev/cxgbe/crypto/t6_kern_tls.c index 04bb6c944050..454b2e264a0e 100644 --- a/sys/dev/cxgbe/crypto/t6_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t6_kern_tls.c @@ -2003,7 +2003,7 @@ t6_ktls_write_wr(struct sge_txq *txq, void *dst, struct mbuf *m, if (tlsp->l2te) t4_l2t_release(tlsp->l2te); tlsp->l2te = t4_l2t_alloc_tls(tlsp->sc, txq, dst, &ndesc, - vlan_tag, tlsp->vi->pi->lport, eh->ether_dhost); + vlan_tag, tlsp->vi->pi->hw_port, eh->ether_dhost); if (tlsp->l2te == NULL) CXGBE_UNIMPLEMENTED("failed to allocate TLS L2TE"); if (ndesc != 0) { diff --git a/sys/dev/cxgbe/t4_l2t.c b/sys/dev/cxgbe/t4_l2t.c index b1307bf2ace5..5f9c26a0f720 100644 --- a/sys/dev/cxgbe/t4_l2t.c +++ b/sys/dev/cxgbe/t4_l2t.c @@ -119,7 +119,7 @@ find_or_alloc_l2e(struct l2t_data *d, uint16_t vlan, uint8_t port, uint8_t *dmac first_free = e; } else if (e->state == L2T_STATE_SWITCHING && memcmp(e->dmac, dmac, ETHER_ADDR_LEN) == 0 && - e->vlan == vlan && e->lport == port) + e->vlan == vlan && e->hw_port == port) return (e); /* Found existing entry that matches. */ } @@ -156,7 +156,7 @@ mk_write_l2e(struct adapter *sc, struct l2t_entry *e, int sync, int reply, INIT_TP_WR(req, 0); OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, idx | V_SYNC_WR(sync) | V_TID_QID(e->iqid))); - req->params = htons(V_L2T_W_PORT(e->lport) | V_L2T_W_NOREPLY(!reply)); + req->params = htons(V_L2T_W_PORT(e->hw_port) | V_L2T_W_NOREPLY(!reply)); req->l2t_idx = htons(idx); req->vlan = htons(e->vlan); memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); @@ -227,7 +227,7 @@ t4_l2t_alloc_tls(struct adapter *sc, struct sge_txq *txq, void *dst, e = &d->l2tab[i]; if (e->state != L2T_STATE_TLS) continue; - if (e->vlan == vlan && e->lport == port && + if (e->vlan == vlan && e->hw_port == port && e->wrq == (struct sge_wrq *)txq && memcmp(e->dmac, eth_addr, ETHER_ADDR_LEN) == 0) { if (atomic_fetchadd_int(&e->refcnt, 1) == 0) { @@ -263,7 +263,7 @@ t4_l2t_alloc_tls(struct adapter *sc, struct sge_txq *txq, void *dst, /* Initialize the entry. */ e->state = L2T_STATE_TLS; e->vlan = vlan; - e->lport = port; + e->hw_port = port; e->iqid = sc->sge.fwq.abs_id; e->wrq = (struct sge_wrq *)txq; memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN); @@ -303,7 +303,7 @@ t4_l2t_alloc_switching(struct adapter *sc, uint16_t vlan, uint8_t port, e->iqid = sc->sge.fwq.abs_id; e->state = L2T_STATE_SWITCHING; e->vlan = vlan; - e->lport = port; + e->hw_port = port; memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN); atomic_store_rel_int(&e->refcnt, 1); atomic_subtract_int(&d->nfree, 1); @@ -313,7 +313,7 @@ t4_l2t_alloc_switching(struct adapter *sc, uint16_t vlan, uint8_t port, e = NULL; } else { MPASS(e->vlan == vlan); - MPASS(e->lport == port); + MPASS(e->hw_port == port); atomic_add_int(&e->refcnt, 1); } } @@ -488,7 +488,7 @@ sysctl_l2t(SYSCTL_HANDLER_ARGS) " %u %2u %c %5u %s", e->idx, ip, e->dmac[0], e->dmac[1], e->dmac[2], e->dmac[3], e->dmac[4], e->dmac[5], - e->vlan & 0xfff, vlan_prio(e), e->lport, + e->vlan & 0xfff, vlan_prio(e), e->hw_port, l2e_state(e), atomic_load_acq_int(&e->refcnt), e->ifp ? if_name(e->ifp) : "-"); skip: diff --git a/sys/dev/cxgbe/t4_l2t.h b/sys/dev/cxgbe/t4_l2t.h index 13e085bb7467..989d2d5ec8f3 100644 --- a/sys/dev/cxgbe/t4_l2t.h +++ b/sys/dev/cxgbe/t4_l2t.h @@ -71,7 +71,7 @@ struct l2t_entry { volatile int refcnt; /* entry reference count */ uint16_t hash; /* hash bucket the entry is on */ uint8_t ipv6; /* entry is for an IPv6 address */ - uint8_t lport; /* associated offload logical port */ + uint8_t hw_port; /* associated hardware port idx */ uint8_t dmac[ETHER_ADDR_LEN]; /* next hop's MAC address */ }; diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 0b54fdaa5c80..238078817d99 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1221,7 +1221,7 @@ select_ntuple(struct vi_info *vi, struct l2t_entry *e) ntuple |= (uint64_t)(F_FT_VLAN_VLD | e->vlan) << tp->vlan_shift; if (tp->port_shift >= 0) - ntuple |= (uint64_t)e->lport << tp->port_shift; + ntuple |= (uint64_t)e->hw_port << tp->port_shift; if (tp->protocol_shift >= 0) ntuple |= (uint64_t)IPPROTO_TCP << tp->protocol_shift; diff --git a/sys/dev/cxgbe/tom/t4_tom_l2t.c b/sys/dev/cxgbe/tom/t4_tom_l2t.c index 3fd0d5ca41d4..e245c2b6fd5b 100644 --- a/sys/dev/cxgbe/tom/t4_tom_l2t.c +++ b/sys/dev/cxgbe/tom/t4_tom_l2t.c @@ -403,7 +403,7 @@ t4_l2t_get(struct port_info *pi, if_t ifp, struct sockaddr *sa) l2_store(sa, e); e->ifp = ifp; e->hash = hash; - e->lport = pi->lport; + e->hw_port = pi->hw_port; e->wrq = &sc->sge.ctrlq[pi->port_id]; e->iqid = sc->sge.ofld_rxq[pi->vi[0].first_ofld_rxq].iq.abs_id; atomic_store_rel_int(&e->refcnt, 1); From nobody Fri Oct 3 00:04:18 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86C0Z8Cz6BMh9; Fri, 03 Oct 2025 00:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86B5hvtz3s4k; Fri, 03 Oct 2025 00:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1vSFZ7uGLiacLMYBlnEyMHvTJytSQE/AO+KEkwB2aIo=; b=nN2YLuslIEFoSH6SgT7fNUkd4x9NZtFcfflm2U54IQQG6olDX4ZXsJr6w7+oR4rpQG2QQZ t3LsGQ5EgvtIAWJZtKLC8CmVe37kUcfKkH2NeYbsQcrtJkza2XGo1k+Qh1co8/VpyGSspF rm6EFSn6HYGhDL5JSQXzmmFb0BLx4lzT7Iutx5CU0pLNrk6OnkF6N7uNUhVL9qd3VQ7soU w+ZzkMlJ8X0HGYyeA3j8zJ00EMUpITUBPst9NJggRO3+NIKDWkSoaz5/qEaKV6nZmNrm2C mW31Hm96oaaOINslgk6//wXr8vONp4uOJTXYgmwxhvKz1hXd8orLH9fZO52uPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1vSFZ7uGLiacLMYBlnEyMHvTJytSQE/AO+KEkwB2aIo=; b=B9kLKgfFWMpb8chq3JqOx0U7Y6qnMvMNotfxirfqOMiT6IdWsEHv6U0G5zJEAg4xBauvh0 PSLbDIOM130smOv2WABztY4jm78gb+SeDNy0VOI/a152J5Pjd3L7sGJCC8aFgPXmxqRWDd fpqwYH0kkPlVyt1VphDXJ7AP01jxWOfLkgR3sfR9JxYU4LaLQDIxaLx0hSrpaBKxb0/zqd a19sEWS/MnHdpt16UAL8UigQlx0SGtROIPm9kVMf6yj95pK/AHtkfjy4gB+nzgbzmsYZeN 1u1mrgRLUOZzqhTnfGNr7nrYa1guUpba/OznuUFn4s9NeTm747Qs2AV7OCoblQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449858; a=rsa-sha256; cv=none; b=f6A/a9dWv+6F+0gEsoLuHgU4lTOcDZwLuMX9Ea0Z4beg+0KrKkQ/Pww8WXe6/OxWB3+K9t mP6aCrq2vt1eh/CR71zNruK3WE2VameK7K5xc1oFmxFEe2l8QB6lnat7yOihmH+vDlRzWb w6OQXCacEfJ7aTz7Z44rMuGCx8fS6EgNZ/llzK3hiYDo5mruqbyO3U7oXcC32aGj3Ua+Nw h8CmHngQ2/l9JKZ3FVW11fS2H+gcZm3H6Efe2qtmptqmM4HbAZX09rP6dqNMeUXkZQzpIY peJOtBrJ4YjEf8uiQ7L7R66nNndIlSQRxYO3hU2FdzU7UJOmi/VnB7WnNdmr1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86B5CHqzTlH; Fri, 03 Oct 2025 00:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304IK6056669; Fri, 3 Oct 2025 00:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304Ih5056666; Fri, 3 Oct 2025 00:04:18 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:18 GMT Message-Id: <202510030004.59304Ih5056666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: a51b2733c7e9 - stable/15 - cxgbe(4): Use hw_port and tx_chan correctly all over the driver List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a51b2733c7e93e9a69d08b3b14f03349c6a8ce01 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=a51b2733c7e93e9a69d08b3b14f03349c6a8ce01 commit a51b2733c7e93e9a69d08b3b14f03349c6a8ce01 Author: Navdeep Parhar AuthorDate: 2025-09-29 05:45:01 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:03 +0000 cxgbe(4): Use hw_port and tx_chan correctly all over the driver The port's tx channel and its hardware index are different things that happen to have the same value on NICs using T4 through T6. This is going to change so use the correct spelling all over the driver. Specifically, the firmware expects the hw port index in all of these: * PCIe channel for queues * TX interface for TX CPLs * PORTID in FW_PORT commands * PORTID in t4_alloc_vi * flowid in all the firmware flowc WRs * mbox commands that deal with the tx scheduler Also, create a port_id lookup table for hw_port, just like the one for tx_chan. Use it to lookup the port softc in the port_info handler. Sponsored by: Chelsio Communications (cherry picked from commit 6d29d22a9e0c33d1e3e70b8c458982c59b76eb29) --- sys/dev/cxgbe/adapter.h | 6 ++++-- sys/dev/cxgbe/common/t4_hw.c | 16 ++++++---------- sys/dev/cxgbe/t4_main.c | 14 ++++++++------ sys/dev/cxgbe/t4_netmap.c | 6 +++--- sys/dev/cxgbe/t4_sched.c | 6 +++--- sys/dev/cxgbe/t4_sge.c | 22 ++++++++++++---------- sys/dev/cxgbe/tom/t4_cpl_io.c | 5 +++-- sys/dev/cxgbe/tom/t4_listen.c | 5 +++-- 8 files changed, 42 insertions(+), 38 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 248a8e112add..5abe0de7664f 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -477,6 +477,7 @@ struct sge_eq { uint8_t doorbells; uint8_t port_id; /* port_id of the port associated with the eq */ uint8_t tx_chan; /* tx channel used by the eq */ + uint8_t hw_port; /* hw port used by the eq */ struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ @@ -937,7 +938,8 @@ struct adapter { struct taskqueue *tq[MAX_NPORTS]; /* General purpose taskqueues */ struct port_info *port[MAX_NPORTS]; - uint8_t chan_map[MAX_NCHAN]; /* channel -> port */ + uint8_t chan_map[MAX_NCHAN]; /* tx_chan -> port_id */ + uint8_t port_map[MAX_NPORTS]; /* hw_port -> port_id */ CXGBE_LIST_HEAD(, clip_entry) *clip_table; TAILQ_HEAD(, clip_entry) clip_pending; /* these need hw update. */ @@ -961,7 +963,7 @@ struct adapter { uint8_t doorbells; int offload_map; /* port_id's with IFCAP_TOE enabled */ - int bt_map; /* tx_chan's with BASE-T */ + int bt_map; /* hw_port's that are BASE-T */ int active_ulds; /* ULDs activated on this adapter */ int flags; int debug_flags; diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 01890b9598b8..f90ad3010626 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -8964,7 +8964,7 @@ static void handle_port_info(struct port_info *pi, const struct fw_port_cmd *p, memset(&cmd, 0, sizeof(cmd)); cmd.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_READ | - V_FW_PORT_CMD_PORTID(pi->tx_chan)); + V_FW_PORT_CMD_PORTID(pi->hw_port)); action = sc->params.port_caps32 ? FW_PORT_ACTION_GET_PORT_INFO32 : FW_PORT_ACTION_GET_PORT_INFO; cmd.action_to_len16 = cpu_to_be32(V_FW_PORT_CMD_ACTION(action) | @@ -8996,16 +8996,12 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl) (action == FW_PORT_ACTION_GET_PORT_INFO || action == FW_PORT_ACTION_GET_PORT_INFO32)) { /* link/module state change message */ - int i; - int chan = G_FW_PORT_CMD_PORTID(be32_to_cpu(p->op_to_portid)); - struct port_info *pi = NULL; - - for_each_port(adap, i) { - pi = adap2pinfo(adap, i); - if (pi->tx_chan == chan) - break; - } + int hw_port = G_FW_PORT_CMD_PORTID(be32_to_cpu(p->op_to_portid)); + int port_id = adap->port_map[hw_port]; + struct port_info *pi; + MPASS(port_id >= 0 && port_id < adap->params.nports); + pi = adap->port[port_id]; PORT_LOCK(pi); handle_port_info(pi, p, action, &mod_changed, &link_changed); PORT_UNLOCK(pi); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9756a6945384..9f6162133d05 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1277,6 +1277,7 @@ t4_attach(device_t dev) goto done; /* error message displayed already */ memset(sc->chan_map, 0xff, sizeof(sc->chan_map)); + memset(sc->port_map, 0xff, sizeof(sc->port_map)); /* Prepare the adapter for operation. */ buf = malloc(PAGE_SIZE, M_CXGBE, M_ZERO | M_WAITOK); @@ -1407,14 +1408,15 @@ t4_attach(device_t dev) } if (is_bt(pi->port_type)) - setbit(&sc->bt_map, pi->tx_chan); + setbit(&sc->bt_map, pi->hw_port); else - MPASS(!isset(&sc->bt_map, pi->tx_chan)); + MPASS(!isset(&sc->bt_map, pi->hw_port)); snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d", device_get_nameunit(dev), i); mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); sc->chan_map[pi->tx_chan] = i; + sc->port_map[pi->hw_port] = i; /* * The MPS counter for FCS errors doesn't work correctly on the @@ -3684,7 +3686,7 @@ alloc_extra_vi(struct adapter *sc, struct port_info *pi, struct vi_info *vi) ("%s: VI %s doesn't have a MAC func", __func__, device_get_nameunit(vi->dev))); func = vi_mac_funcs[index]; - rc = t4_alloc_vi_func(sc, sc->mbox, pi->tx_chan, sc->pf, 0, 1, + rc = t4_alloc_vi_func(sc, sc->mbox, pi->hw_port, sc->pf, 0, 1, vi->hw_addr, &vi->rss_size, &vi->vfvld, &vi->vin, func, 0); if (rc < 0) { CH_ERR(vi, "failed to allocate virtual interface %d" @@ -6220,7 +6222,7 @@ apply_link_config(struct port_info *pi) MPASS(lc->pcaps & FW_PORT_CAP32_FEC_BASER_RS); #endif if (!(sc->flags & IS_VF)) { - rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); + rc = -t4_link_l1cfg(sc, sc->mbox, pi->hw_port, lc); if (rc != 0) { device_printf(pi->dev, "l1cfg failed: %d\n", rc); return (rc); @@ -8452,14 +8454,14 @@ sysctl_tx_vm_wr(SYSCTL_HANDLER_ARGS) vi->flags |= TX_USES_VM_WR; if_sethwtsomaxsegcount(vi->ifp, TX_SGL_SEGS_VM_TSO); ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | - V_TXPKT_INTF(pi->tx_chan)); + V_TXPKT_INTF(pi->hw_port)); if (!(sc->flags & IS_VF)) npkt--; } else { vi->flags &= ~TX_USES_VM_WR; if_sethwtsomaxsegcount(vi->ifp, TX_SGL_SEGS_TSO); ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | + V_TXPKT_INTF(pi->hw_port) | V_TXPKT_PF(sc->pf) | V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); } for_each_txq(vi, i, txq) { diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index e53fb5054316..ddd7d974aa48 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -232,7 +232,7 @@ alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq, int iqidx, int idx) nm_txq->nid = idx; nm_txq->iqidx = iqidx; nm_txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | + V_TXPKT_INTF(pi->hw_port) | V_TXPKT_PF(sc->pf) | V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); if (sc->params.fw_vers >= FW_VERSION32(1, 24, 11, 0)) nm_txq->op_pkd = htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS2_WR)); @@ -314,7 +314,7 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq) V_FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) | V_FW_IQ_CMD_VIID(vi->viid) | V_FW_IQ_CMD_IQANUD(X_UPDATEDELIVERY_INTERRUPT)); - c.iqdroprss_to_iqesize = htobe16(V_FW_IQ_CMD_IQPCIECH(pi->tx_chan) | + c.iqdroprss_to_iqesize = htobe16(V_FW_IQ_CMD_IQPCIECH(pi->hw_port) | F_FW_IQ_CMD_IQGTSMODE | V_FW_IQ_CMD_IQINTCNTTHRESH(0) | V_FW_IQ_CMD_IQESIZE(ilog2(IQ_ESIZE) - 4)); @@ -429,7 +429,7 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq *nm_txq) F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(vi->viid)); c.fetchszm_to_iqid = htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | - V_FW_EQ_ETH_CMD_PCIECHN(vi->pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | + V_FW_EQ_ETH_CMD_PCIECHN(vi->pi->hw_port) | F_FW_EQ_ETH_CMD_FETCHRO | V_FW_EQ_ETH_CMD_IQID(sc->sge.nm_rxq[nm_txq->iqidx].iq_cntxt_id)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? diff --git a/sys/dev/cxgbe/t4_sched.c b/sys/dev/cxgbe/t4_sched.c index 2186c8aa2ac0..65c2720d692c 100644 --- a/sys/dev/cxgbe/t4_sched.c +++ b/sys/dev/cxgbe/t4_sched.c @@ -272,7 +272,7 @@ update_tx_sched(void *context, int pending) } rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, FW_SCHED_PARAMS_LEVEL_CL_RL, tc->mode, tc->rateunit, - tc->ratemode, pi->tx_chan, j, 0, tc->maxrate, 0, + tc->ratemode, pi->hw_port, j, 0, tc->maxrate, 0, tc->pktsize, tc->burstsize, 1); end_synchronized_op(sc, 0); @@ -291,7 +291,7 @@ update_tx_sched(void *context, int pending) "params: mode %d, rateunit %d, ratemode %d, " "channel %d, minrate %d, maxrate %d, pktsize %d, " "burstsize %d\n", j, rc, tc->mode, tc->rateunit, - tc->ratemode, pi->tx_chan, 0, tc->maxrate, + tc->ratemode, pi->hw_port, 0, tc->maxrate, tc->pktsize, tc->burstsize); } } @@ -839,7 +839,7 @@ failed: cst->tx_total = cst->tx_credits; cst->plen = 0; cst->ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | + V_TXPKT_INTF(pi->hw_port) | V_TXPKT_PF(sc->pf) | V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); /* diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 86454bc4fe10..4998f27603db 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -3414,6 +3414,7 @@ init_eq(struct adapter *sc, struct sge_eq *eq, int eqtype, int qsize, eq->type = eqtype; eq->port_id = port_id; eq->tx_chan = sc->port[port_id]->tx_chan; + eq->hw_port = sc->port[port_id]->hw_port; eq->iq = iq; eq->sidx = qsize - sc->params.sge.spg_len / EQ_ESIZE; strlcpy(eq->lockname, name, sizeof(eq->lockname)); @@ -3577,7 +3578,7 @@ alloc_iq_fl_hwq(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl) V_FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) | V_FW_IQ_CMD_VIID(vi->viid) | V_FW_IQ_CMD_IQANUD(X_UPDATEDELIVERY_INTERRUPT)); - c.iqdroprss_to_iqesize = htobe16(V_FW_IQ_CMD_IQPCIECH(pi->tx_chan) | + c.iqdroprss_to_iqesize = htobe16(V_FW_IQ_CMD_IQPCIECH(pi->hw_port) | F_FW_IQ_CMD_IQGTSMODE | V_FW_IQ_CMD_IQINTCNTTHRESH(iq->intr_pktc_idx) | V_FW_IQ_CMD_IQESIZE(ilog2(IQ_ESIZE) - 4)); @@ -4270,7 +4271,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) c.physeqid_pkd = htobe32(0); c.fetchszm_to_iqid = htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | - V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) | + V_FW_EQ_CTRL_CMD_PCIECHN(eq->hw_port) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? @@ -4282,8 +4283,8 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) rc = -t4_wr_mbox(sc, sc->mbox, &c, sizeof(c), &c); if (rc != 0) { - CH_ERR(sc, "failed to create hw ctrlq for tx_chan %d: %d\n", - eq->tx_chan, rc); + CH_ERR(sc, "failed to create hw ctrlq for port %d: %d\n", + eq->port_id, rc); return (rc); } @@ -4316,7 +4317,7 @@ eth_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq) F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(vi->viid)); c.fetchszm_to_iqid = htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | - V_FW_EQ_ETH_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | + V_FW_EQ_ETH_CMD_PCIECHN(eq->hw_port) | F_FW_EQ_ETH_CMD_FETCHRO | V_FW_EQ_ETH_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? @@ -4360,7 +4361,7 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq) F_FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c)); c.fetchszm_to_iqid = htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | - V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) | + V_FW_EQ_OFLD_CMD_PCIECHN(eq->hw_port) | F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_OFLD_CMD_FBMIN(chip_id(sc) <= CHELSIO_T5 ? @@ -4678,10 +4679,10 @@ failed: if (vi->flags & TX_USES_VM_WR) txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | - V_TXPKT_INTF(pi->tx_chan)); + V_TXPKT_INTF(pi->hw_port)); else txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | + V_TXPKT_INTF(pi->hw_port) | V_TXPKT_PF(sc->pf) | V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); txq->tc_idx = -1; @@ -6583,10 +6584,11 @@ send_etid_flowc_wr(struct cxgbe_rate_tag *cst, struct port_info *pi, V_FW_WR_FLOWID(cst->etid)); flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; flowc->mnemval[0].val = htobe32(pfvf); + /* Firmware expects hw port and will translate to channel itself. */ flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; - flowc->mnemval[1].val = htobe32(pi->tx_chan); + flowc->mnemval[1].val = htobe32(pi->hw_port); flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; - flowc->mnemval[2].val = htobe32(pi->tx_chan); + flowc->mnemval[2].val = htobe32(pi->hw_port); flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; flowc->mnemval[3].val = htobe32(cst->iqid); flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_EOSTATE; diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index be20ea42474e..402aa29c05cb 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -127,8 +127,9 @@ send_flowc_wr(struct toepcb *toep, struct tcpcb *tp) paramidx = 0; FLOWC_PARAM(PFNVFN, pfvf); - FLOWC_PARAM(CH, pi->tx_chan); - FLOWC_PARAM(PORT, pi->tx_chan); + /* Firmware expects hw port and will translate to channel itself. */ + FLOWC_PARAM(CH, pi->hw_port); + FLOWC_PARAM(PORT, pi->hw_port); FLOWC_PARAM(IQID, toep->ofld_rxq->iq.abs_id); FLOWC_PARAM(SNDBUF, toep->params.sndbuf); if (tp) { diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index 06c495dcafc3..ad835eafdc56 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -508,10 +508,11 @@ send_flowc_wr_synqe(struct adapter *sc, struct synq_entry *synqe) V_FW_WR_FLOWID(synqe->tid)); flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; flowc->mnemval[0].val = htobe32(pfvf); + /* Firmware expects hw port and will translate to channel itself. */ flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; - flowc->mnemval[1].val = htobe32(pi->tx_chan); + flowc->mnemval[1].val = htobe32(pi->hw_port); flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; - flowc->mnemval[2].val = htobe32(pi->tx_chan); + flowc->mnemval[2].val = htobe32(pi->hw_port); flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID; flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id); flowc->mnemval[4].mnemonic = FW_FLOWC_MNEM_SNDBUF; From nobody Fri Oct 3 00:04:19 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86F4fycz6BMXc; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86D3V2qz3s9l; Fri, 03 Oct 2025 00:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vzTOmcfrz5hM+KlNwiuZarjEjzCJFJa328DdY6Nn+Rs=; b=f+pE3yspmH8+2A2/f2eILsTtQY3LFexBVdf1ED2/Leyn/Qu0z4ehKhDgcPJabfSrqEBm78 YCEMFPA+l0TTA32RjPhUnPlgrYYJJzsYy1m0VVGMC6vhsmjOB+wHBHAownBd+HKGbkDzqd keQRAeTnpwBWckyVvXWEtKikOKCKI51rhVj6TolACqzzZyFOe3MsnOsvwKvi+3CAe52asz QD+dCqxN/rrl8+LgxPI+q1p4nhRhB2vlJMwS5fx/pU4qb1hlcZocXwypim05KB5dqZydTY hGHwzl3t6JmYZjgkKLhTrsBCLzE60iVGayHsGp6dw2x6M37nt2aiXnEruiuehw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vzTOmcfrz5hM+KlNwiuZarjEjzCJFJa328DdY6Nn+Rs=; b=DbfuhWHkh0VSuKeNkWXntwDBGGRzMI60ZbaJBybKaYvnaG66iMOpakgcvgcrT78JB3x5Oj UgZD+lZ/6EJYHtUXbC4XTCNFoDl472YnphVeneLZgXMhRlipT2kThQLRVzWQuCxvrZ/03x 1wV5N2P0NAsB/Do8KXevN5g3+kfCuc1Zdy/wwuyifL6eKSapfzU9LYsoWmRCHUkNt3fpBj dfmkFzz0U683dXzNiAVOWAeWkxpTiN/yc5Mezu0ML0WeJ3+LPOU1tRvdIM/emGs5iJ5FHi 8A3WHL4nvn/psdYNb9BhVknPuMJuzui/DtCnfP7K19rrbMsEwassQM8L+kvy4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449860; a=rsa-sha256; cv=none; b=kY0YnQqAIRE2XA0NrI5MbEQwcrjFQ0L1K370evOSV81+AagFd5LKCXBWDDumSJsFz9LG2r AFy7nXDtrwLYY4CrfdlfGd/fH+3ZJj17GlPD0zWRzuEveZCUM0VUT/bwSAPDX5qtAbA6qV flKBBAy5KI1gKkj+pWlQhwB3/14Nns//GapVBd3XnZ92IQ3BSXz7NEot5Yrutnso6TAv41 9AcLlppcKx6R4H4An6A5TItk4g2BL25kp4hAC5j3O4dXMCUobtsgE0+hZa9RWltbwZ9N+w OgTuMPjEOuWXnOsKcAHtyUdI0hGtuZDIKfDbfwB+vw0ixqP21+xgnEUs1rNaEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86D2yBQzVcC; Fri, 03 Oct 2025 00:04: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 59304Kcw056704; Fri, 3 Oct 2025 00:04:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304JgM056698; Fri, 3 Oct 2025 00:04:19 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:19 GMT Message-Id: <202510030004.59304JgM056698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 1a4dfc97c481 - stable/15 - cxgbe(4): hw/fw headers and shared code for the Terminator 7 ASIC List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1a4dfc97c48142e38a07b53749b3124ac0b08949 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=1a4dfc97c48142e38a07b53749b3124ac0b08949 commit 1a4dfc97c48142e38a07b53749b3124ac0b08949 Author: Navdeep Parhar AuthorDate: 2025-09-29 06:21:02 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:04 +0000 cxgbe(4): hw/fw headers and shared code for the Terminator 7 ASIC This is the first of a series of commits that will add T7 support to cxgbe. The ASIC is gen5x16 on the PCIe side and has a 400Gbps MAC on the Ethernet side. NICs using the T7 will come in the following variants: * 1 x 400Gbps with QSFP-DD connector * 2 x 200/100/40Gbps with QSFP56/QSFP28/QSFP+ connectors * 4 x 50/25/10/1Gbps with SFP28/SFP+/SFP connectors There are 8 general purpose ARM A72 cores available on select SmartNIC/DPU boards. Obtained from: Chelsio Communications Sponsored by: Chelsio Communications (cherry picked from commit c7b2e390de43bb2b1a5918a23310ec5464ee3787) --- sys/conf/files | 24 + sys/dev/cxgbe/common/common.h | 177 +- sys/dev/cxgbe/common/t4_hw.c | 1949 +- sys/dev/cxgbe/common/t4_hw.h | 135 +- sys/dev/cxgbe/common/t4_msg.h | 3011 ++- sys/dev/cxgbe/common/t4_regs.h | 27273 ++++++++++++++++++++++++++-- sys/dev/cxgbe/common/t4_regs_values.h | 24 +- sys/dev/cxgbe/common/t4_tcb.h | 182 +- sys/dev/cxgbe/cudbg/cudbg_flash_utils.c | 90 +- sys/dev/cxgbe/cudbg/cudbg_lib.c | 10 +- sys/dev/cxgbe/cudbg/cudbg_lib_common.h | 7 +- sys/dev/cxgbe/firmware/t4fw_interface.h | 1320 +- sys/dev/cxgbe/firmware/t7fw_cfg.txt | 644 + sys/dev/cxgbe/firmware/t7fw_cfg_fpga.txt | 530 + sys/dev/cxgbe/firmware/t7fw_cfg_uwire.txt | 644 + sys/dev/cxgbe/t4_main.c | 16 +- sys/dev/cxgbe/t4_sge.c | 3 +- sys/dev/cxgbe/tom/t4_tls.c | 4 +- sys/modules/cxgbe/Makefile | 4 +- sys/modules/cxgbe/t7_firmware/Makefile | 23 + 20 files changed, 33901 insertions(+), 2169 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index db05a1424f00..63bf5c3fd724 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1519,6 +1519,30 @@ t6fw.fw optional cxgbe \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" +t7fw_cfg.c optional cxgbe \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t7fw_cfg.fw:t7fw_cfg t7fw_cfg_uwire.fw:t7fw_cfg_uwire -mt7fw_cfg -c${.TARGET}" \ + no-ctfconvert no-implicit-rule before-depend local \ + clean "t7fw_cfg.c" +t7fw_cfg.fwo optional cxgbe \ + dependency "t7fw_cfg.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t7fw_cfg.fwo" +t7fw_cfg.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t7fw_cfg.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t7fw_cfg.fw" +t7fw_cfg_uwire.fwo optional cxgbe \ + dependency "t7fw_cfg_uwire.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t7fw_cfg_uwire.fwo" +t7fw_cfg_uwire.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t7fw_cfg_uwire.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t7fw_cfg_uwire.fw" dev/cxgbe/crypto/t4_crypto.c optional ccr \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cyapa/cyapa.c optional cyapa iicbus diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 6e80ce40648b..6b36832a7464 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2011 Chelsio Communications, Inc. - * All rights reserved. + * Copyright (c) 2011, 2025 Chelsio Communications. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +31,15 @@ #include "t4_hw.h" +#define GLBL_INTR_MASK (F_CIM | F_MPS | F_PL | F_PCIE | F_MC0 | F_EDC0 | \ + F_EDC1 | F_LE | F_TP | F_MA | F_PM_TX | F_PM_RX | F_ULP_RX | \ + F_CPL_SWITCH | F_SGE | F_ULP_TX | F_SF) + +#define GLBL_T7_INTR_MASK (F_CIM | F_MPS | F_PL | F_T7_PCIE | F_T7_MC0 | \ + F_T7_EDC0 | F_T7_EDC1 | F_T7_LE | F_T7_TP | \ + F_T7_MA | F_T7_PM_TX | F_T7_PM_RX | F_T7_ULP_RX | \ + F_T7_CPL_SWITCH | F_T7_SGE | F_T7_ULP_TX | F_SF) + enum { MAX_NPORTS = 4, /* max # of ports */ SERNUM_LEN = 24, /* Serial # length */ @@ -77,6 +85,18 @@ enum { FEC_MODULE = 1 << 6, /* FEC suggested by the cable/transceiver. */ }; +enum { + ULP_T10DIF_ISCSI = 1 << 0, + ULP_T10DIF_FCOE = 1 << 1 +}; + +enum { + ULP_CRYPTO_LOOKASIDE = 1 << 0, + ULP_CRYPTO_INLINE_TLS = 1 << 1, + ULP_CRYPTO_INLINE_IPSEC = 1 << 2, + ULP_CRYPTO_OFLD_OVER_IPSEC_INLINE = 1 << 4 +}; + enum t4_bar2_qtype { T4_BAR2_QTYPE_EGRESS, T4_BAR2_QTYPE_INGRESS }; struct port_stats { @@ -230,6 +250,15 @@ struct tp_cpl_stats { struct tp_rdma_stats { u32 rqe_dfr_pkt; u32 rqe_dfr_mod; + u32 pkts_in[MAX_NCHAN]; + u64 bytes_in[MAX_NCHAN]; + /* + * When reading rdma stats, the address difference b/w RDMA_IN and + * RDMA_OUT is 4*u32, to read both at once, added padding + */ + u32 padding[4]; + u32 pkts_out[MAX_NCHAN]; + u64 bytes_out[MAX_NCHAN]; }; struct sge_params { @@ -259,7 +288,10 @@ struct tp_params { uint32_t max_rx_pdu; uint32_t max_tx_pdu; bool rx_pkt_encap; + uint8_t lb_mode; + uint8_t lb_nchan; + int8_t ipsecidx_shift; int8_t fcoe_shift; int8_t port_shift; int8_t vnic_shift; @@ -270,6 +302,9 @@ struct tp_params { int8_t macmatch_shift; int8_t matchtype_shift; int8_t frag_shift; + int8_t roce_shift; + int8_t synonly_shift; + int8_t tcpflags_shift; }; /* Use same modulation queue as the tx channel. */ @@ -285,6 +320,22 @@ struct vpd_params { u8 md[MD_LEN + 1]; }; +/* + * Maximum resources provisioned for a PCI PF. + */ +struct pf_resources { + unsigned int nvi; /* N virtual interfaces */ + unsigned int neq; /* N egress Qs */ + unsigned int nethctrl; /* N egress ETH or CTRL Qs */ + unsigned int niqflint; /* N ingress Qs/w free list(s) & intr */ + unsigned int niq; /* N ingress Qs */ + unsigned int tc; /* PCI-E traffic class */ + unsigned int pmask; /* port access rights mask */ + unsigned int nexactf; /* N exact MPS filters */ + unsigned int r_caps; /* read capabilities */ + unsigned int wx_caps; /* write/execute capabilities */ +}; + struct pci_params { unsigned int vpd_cap_addr; unsigned int mps; @@ -308,8 +359,11 @@ struct chip_params { u8 pm_stats_cnt; u8 cng_ch_bits_log; /* congestion channel map bits width */ u8 nsched_cls; + u8 cim_num_ibq; u8 cim_num_obq; - u8 filter_opt_len; + u8 filter_opt_len; /* number of bits for optional fields */ + u8 filter_num_opt; /* number of optional fields */ + u8 sge_ctxt_size; u16 mps_rplc_size; u16 vfcount; u32 sge_fl_db; @@ -360,6 +414,7 @@ struct adapter_params { struct sge_params sge; struct tp_params tp; /* PF-only */ struct vpd_params vpd; + struct pf_resources pfres; /* PF-only */ struct pci_params pci; struct devlog_params devlog; /* PF-only */ struct rss_params rss; /* VF-only */ @@ -399,12 +454,13 @@ struct adapter_params { unsigned int ofldq_wr_cred; unsigned int eo_wr_cred; - unsigned int max_ordird_qp; - unsigned int max_ird_adapter; + unsigned int max_ordird_qp; /* Max read depth per RDMA QP */ + unsigned int max_ird_adapter; /* Max read depth per adapter */ /* These values are for all ports (8b/port, upto 4 ports) */ uint32_t mps_bg_map; /* MPS rx buffer group map */ uint32_t tp_ch_map; /* TPCHMAP from firmware */ + uint32_t tx_tp_ch_map; /* TX_TPCHMAP from firmware */ bool ulptx_memwrite_dsgl; /* use of T5 DSGL allowed */ bool fr_nsmr_tpte_wr_support; /* FW support for FR_NSMR_TPTE_WR */ @@ -412,11 +468,15 @@ struct adapter_params { bool viid_smt_extn_support; /* FW returns vin, vfvld & smt index? */ unsigned int max_pkts_per_eth_tx_pkts_wr; uint8_t nsched_cls; /* # of usable sched classes per port */ + + uint8_t ncores; + uint32_t tid_qid_sel_mask; /* TID based QID selection mask */ }; #define CHELSIO_T4 0x4 #define CHELSIO_T5 0x5 #define CHELSIO_T6 0x6 +#define CHELSIO_T7 0x7 /* * State needed to monitor the forward progress of SGE Ingress DMA activities @@ -509,10 +569,11 @@ static inline int is_hashfilter(const struct adapter *adap) static inline int is_ktls(const struct adapter *adap) { - return adap->cryptocaps & FW_CAPS_CONFIG_TLS_HW; + return adap->cryptocaps & FW_CAPS_CONFIG_TLS_HW || + adap->params.chipid == CHELSIO_T7; } -static inline int chip_id(struct adapter *adap) +static inline int chip_id(const struct adapter *adap) { return adap->params.chipid; } @@ -537,6 +598,11 @@ static inline int is_t6(struct adapter *adap) return adap->params.chipid == CHELSIO_T6; } +static inline int is_t7(struct adapter *adap) +{ + return adap->params.chipid == CHELSIO_T7; +} + static inline int is_fpga(struct adapter *adap) { return adap->params.fpga; @@ -641,7 +707,7 @@ int t4_load_bootcfg(struct adapter *adapter, const u8 *cfg_data, unsigned int si int t4_load_boot(struct adapter *adap, u8 *boot_data, unsigned int boot_addr, unsigned int size); int t4_flash_erase_sectors(struct adapter *adapter, int start, int end); -int t4_flash_cfg_addr(struct adapter *adapter); +int t4_flash_cfg_addr(struct adapter *adapter, unsigned int *lenp); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_fw_hdr(struct adapter *adapter, struct fw_hdr *hdr); @@ -655,9 +721,10 @@ int t4_init_hw(struct adapter *adapter, u32 fw_params); const struct chip_params *t4_get_chip_params(int chipid); int t4_prep_adapter(struct adapter *adapter, u32 *buf); int t4_shutdown_adapter(struct adapter *adapter); -int t4_init_devlog_params(struct adapter *adapter, int fw_attach); +int t4_init_devlog_ncores_params(struct adapter *adapter, int fw_attach); int t4_init_sge_params(struct adapter *adapter); int t4_init_tp_params(struct adapter *adap); +int t4_filter_field_width(const struct adapter *adap, int filter_field); int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id); void t4_fatal_err(struct adapter *adapter, bool fw_error); @@ -665,6 +732,7 @@ int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp, int filter_index, int enable); void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp, int filter_index, int *enabled); +void t4_set_trace_rss_control(struct adapter *adap, u8 chan, u16 qid); int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid, int start, int n, const u16 *rspq, unsigned int nrspq); int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode, @@ -691,19 +759,60 @@ void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok); int t4_mps_set_active_ports(struct adapter *adap, unsigned int port_mask); void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); -void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres); -int t4_read_cim_ibq(struct adapter *adap, unsigned int qid, u32 *data, size_t n); -int t4_read_cim_obq(struct adapter *adap, unsigned int qid, u32 *data, size_t n); -int t4_cim_read(struct adapter *adap, unsigned int addr, unsigned int n, - unsigned int *valp); -int t4_cim_write(struct adapter *adap, unsigned int addr, unsigned int n, - const unsigned int *valp); -int t4_cim_ctl_read(struct adapter *adap, unsigned int addr, unsigned int n, - unsigned int *valp); -int t4_cim_read_la(struct adapter *adap, u32 *la_buf, unsigned int *wrptr); +void t4_pmrx_cache_get_stats(struct adapter *adap, u32 stats[]); +void t4_read_cimq_cfg_core(struct adapter *adap, u8 coreid, u16 *base, + u16 *size, u16 *thres); +int t4_read_cim_ibq_core(struct adapter *adap, u8 coreid, u32 qid, u32 *data, + size_t n); +int t4_read_cim_obq_core(struct adapter *adap, u8 coreid, u32 qid, u32 *data, + size_t n); +int t4_cim_read_core(struct adapter *adap, u8 group, u8 coreid, + unsigned int addr, unsigned int n, + unsigned int *valp); +int t4_cim_write_core(struct adapter *adap, u8 group, u8 coreid, + unsigned int addr, unsigned int n, + const unsigned int *valp); +int t4_cim_read_la_core(struct adapter *adap, u8 coreid, u32 *la_buf, + u32 *wrptr); void t4_cim_read_pif_la(struct adapter *adap, u32 *pif_req, u32 *pif_rsp, unsigned int *pif_req_wrptr, unsigned int *pif_rsp_wrptr); void t4_cim_read_ma_la(struct adapter *adap, u32 *ma_req, u32 *ma_rsp); + +static inline void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, + u16 *thres) +{ + t4_read_cimq_cfg_core(adap, 0, base, size, thres); +} + +static inline int t4_read_cim_ibq(struct adapter *adap, u32 qid, u32 *data, + size_t n) +{ + return t4_read_cim_ibq_core(adap, 0, qid, data, n); +} + +static inline int t4_read_cim_obq(struct adapter *adap, u32 qid, u32 *data, + size_t n) +{ + return t4_read_cim_obq_core(adap, 0, qid, data, n); +} + +static inline int t4_cim_read(struct adapter *adap, unsigned int addr, + unsigned int n, unsigned int *valp) +{ + return t4_cim_read_core(adap, 0, 0, addr, n, valp); +} + +static inline int t4_cim_write(struct adapter *adap, unsigned int addr, + unsigned int n, unsigned int *valp) +{ + return t4_cim_write_core(adap, 0, 0, addr, n, valp); +} + +static inline int t4_cim_read_la(struct adapter *adap, u32 *la_buf, u32 *wrptr) +{ + return t4_cim_read_la_core(adap, 0, la_buf, wrptr); +} + int t4_get_flash_params(struct adapter *adapter); u32 t4_read_pcie_cfg4(struct adapter *adap, int reg, int drv_fw_attach); @@ -919,6 +1028,8 @@ int t4_configure_ringbb(struct adapter *adap); int t4_configure_add_smac(struct adapter *adap); int t4_set_vlan_acl(struct adapter *adap, unsigned int mbox, unsigned int vf, u16 vlan); +int t4_flash_loc_start(struct adapter *adap, enum t4_flash_loc loc, + unsigned int *lenp); static inline int t4vf_query_params(struct adapter *adapter, unsigned int nparams, const u32 *params, @@ -969,8 +1080,8 @@ port_top_speed(const struct port_info *pi) sizeof(struct ulptx_idata) + sizeof(struct cpl_set_tcb_field_core)) static inline void * -mk_set_tcb_field_ulp(struct adapter *sc, void *cur, int tid, uint16_t word, - uint64_t mask, uint64_t val) +mk_set_tcb_field_ulp_with_rpl(struct adapter *sc, void *cur, int tid, + uint16_t word, uint64_t mask, uint64_t val, const int qid) { struct ulp_txpkt *ulpmc; struct ulptx_idata *ulpsc; @@ -989,8 +1100,21 @@ mk_set_tcb_field_ulp(struct adapter *sc, void *cur, int tid, uint16_t word, req = (struct cpl_set_tcb_field_core *)(ulpsc + 1); OPCODE_TID(req) = htobe32(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); - req->reply_ctrl = htobe16(F_NO_REPLY); - req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); + + if (qid == -1) { + req->reply_ctrl = htobe16(F_NO_REPLY); + req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); + } else { + if (chip_id(sc) >= CHELSIO_T7) { + req->reply_ctrl = htobe16(V_T7_QUEUENO(qid) | + V_T7_REPLY_CHAN(0) | V_NO_REPLY(0)); + } else { + req->reply_ctrl = htobe16(V_QUEUENO(qid) | + V_REPLY_CHAN(0) | V_NO_REPLY(0)); + } + req->word_cookie = htobe16(V_WORD(word) | + V_COOKIE(CPL_COOKIE_TOM)); + } req->mask = htobe64(mask); req->val = htobe64(val); @@ -1006,4 +1130,11 @@ mk_set_tcb_field_ulp(struct adapter *sc, void *cur, int tid, uint16_t word, return (ulpsc + 1); } + +static inline void * +mk_set_tcb_field_ulp(struct adapter *sc, void *cur, int tid, uint16_t word, + uint64_t mask, uint64_t val) +{ + return (mk_set_tcb_field_ulp_with_rpl(sc, cur, tid, word, mask, val, -1)); +} #endif /* __CHELSIO_COMMON_H */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index f90ad3010626..eb7ea9acc108 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2012, 2016 Chelsio Communications, Inc. - * All rights reserved. + * Copyright (c) 2012, 2016, 2025 Chelsio Communications. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -246,6 +245,8 @@ struct port_tx_state { u32 t4_port_reg(struct adapter *adap, u8 port, u32 reg) { + if (chip_id(adap) > CHELSIO_T6) + return T7_PORT_REG(port, reg); if (chip_id(adap) > CHELSIO_T4) return T5_PORT_REG(port, reg); return PORT_REG(port, reg); @@ -268,8 +269,10 @@ read_tx_state(struct adapter *sc, struct port_tx_state *tx_state) { int i; - for_each_port(sc, i) - read_tx_state_one(sc, i, &tx_state[i]); + for (i = 0; i < MAX_NCHAN; i++) { + if (sc->chan_map[i] != 0xff) + read_tx_state_one(sc, i, &tx_state[i]); + } } static void @@ -279,7 +282,9 @@ check_tx_state(struct adapter *sc, struct port_tx_state *tx_state) uint64_t tx_frames, rx_pause; int i; - for_each_port(sc, i) { + for (i = 0; i < MAX_NCHAN; i++) { + if (sc->chan_map[i] == 0xff) + continue; rx_pause = tx_state[i].rx_pause; tx_frames = tx_state[i].tx_frames; read_tx_state_one(sc, i, &tx_state[i]); /* update */ @@ -351,7 +356,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd, return -EINVAL; if (adap->flags & IS_VF) { - if (is_t6(adap)) + if (chip_id(adap) >= CHELSIO_T6) data_reg = FW_T6VF_MBDATA_BASE_ADDR; else data_reg = FW_T4VF_MBDATA_BASE_ADDR; @@ -508,9 +513,8 @@ failed: int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size, void *rpl, bool sleep_ok) { - return t4_wr_mbox_meat_timeout(adap, mbox, cmd, size, rpl, - sleep_ok, FW_CMD_MAX_TIMEOUT); - + return t4_wr_mbox_meat_timeout(adap, mbox, cmd, size, rpl, + sleep_ok, FW_CMD_MAX_TIMEOUT); } static int t4_edc_err_read(struct adapter *adap, int idx) @@ -799,6 +803,7 @@ unsigned int t4_get_regs_len(struct adapter *adapter) case CHELSIO_T5: case CHELSIO_T6: + case CHELSIO_T7: if (adapter->flags & IS_VF) return FW_T4VF_REGMAP_SIZE; return T5_REGMAP_SIZE; @@ -2639,6 +2644,638 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size) ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), }; + static const unsigned int t7_reg_ranges[] = { + 0x1008, 0x101c, + 0x1024, 0x10a8, + 0x10b4, 0x10f8, + 0x1100, 0x1114, + 0x111c, 0x112c, + 0x1138, 0x113c, + 0x1144, 0x115c, + 0x1180, 0x1184, + 0x1190, 0x1194, + 0x11a0, 0x11a4, + 0x11b0, 0x11d0, + 0x11fc, 0x1278, + 0x1280, 0x1368, + 0x1700, 0x172c, + 0x173c, 0x1760, + 0x1800, 0x18fc, + 0x3000, 0x3044, + 0x3060, 0x3064, + 0x30a4, 0x30b0, + 0x30b8, 0x30d8, + 0x30e0, 0x30fc, + 0x3140, 0x357c, + 0x35a8, 0x35cc, + 0x35e0, 0x35ec, + 0x3600, 0x37fc, + 0x3804, 0x3818, + 0x3880, 0x388c, + 0x3900, 0x3904, + 0x3910, 0x3978, + 0x3980, 0x399c, + 0x4700, 0x4720, + 0x4728, 0x475c, + 0x480c, 0x4814, + 0x4890, 0x489c, + 0x48a4, 0x48ac, + 0x48b8, 0x48c4, + 0x4900, 0x4924, + 0x4ffc, 0x4ffc, + 0x5500, 0x5624, + 0x56c4, 0x56ec, + 0x56f4, 0x5720, + 0x5728, 0x575c, + 0x580c, 0x5814, + 0x5890, 0x589c, + 0x58a4, 0x58ac, + 0x58b8, 0x58bc, + 0x5940, 0x598c, + 0x59b0, 0x59c8, + 0x59d0, 0x59dc, + 0x59fc, 0x5a18, + 0x5a60, 0x5a6c, + 0x5a80, 0x5a8c, + 0x5a94, 0x5a9c, + 0x5b94, 0x5bfc, + 0x5c10, 0x5e48, + 0x5e50, 0x5e94, + 0x5ea0, 0x5eb0, + 0x5ec0, 0x5ec0, + 0x5ec8, 0x5ed0, + 0x5ee0, 0x5ee0, + 0x5ef0, 0x5ef0, + 0x5f00, 0x5f04, + 0x5f0c, 0x5f10, + 0x5f20, 0x5f88, + 0x5f90, 0x5fd8, + 0x6000, 0x6020, + 0x6028, 0x6030, + 0x6044, 0x609c, + 0x60a8, 0x60ac, + 0x60b8, 0x60ec, + 0x6100, 0x6104, + 0x6118, 0x611c, + 0x6150, 0x6150, + 0x6180, 0x61b8, + 0x7700, 0x77a8, + 0x77b0, 0x7888, + 0x78cc, 0x7970, + 0x7b00, 0x7b00, + 0x7b08, 0x7b0c, + 0x7b24, 0x7b84, + 0x7b8c, 0x7c2c, + 0x7c34, 0x7c40, + 0x7c48, 0x7c68, + 0x7c70, 0x7c7c, + 0x7d00, 0x7ddc, + 0x7de4, 0x7e38, + 0x7e40, 0x7e44, + 0x7e4c, 0x7e74, + 0x7e80, 0x7ee0, + 0x7ee8, 0x7f0c, + 0x7f20, 0x7f5c, + 0x8dc0, 0x8de8, + 0x8df8, 0x8e04, + 0x8e10, 0x8e30, + 0x8e7c, 0x8ee8, + 0x8f88, 0x8f88, + 0x8f90, 0x8fb0, + 0x8fb8, 0x9058, + 0x9074, 0x90f8, + 0x9100, 0x912c, + 0x9138, 0x9188, + 0x9400, 0x9414, + 0x9430, 0x9440, + 0x9454, 0x9454, + 0x945c, 0x947c, + 0x9498, 0x94b8, + 0x9600, 0x9600, + 0x9608, 0x9638, + 0x9640, 0x9704, + 0x9710, 0x971c, + 0x9800, 0x9804, + 0x9854, 0x9854, + 0x9c00, 0x9c6c, + 0x9c80, 0x9cec, + 0x9d00, 0x9d6c, + 0x9d80, 0x9dec, + 0x9e00, 0x9e6c, + 0x9e80, 0x9eec, + 0x9f00, 0x9f6c, + 0x9f80, 0x9fec, + 0xa000, 0xa06c, + 0xa080, 0xa0ec, + 0xa100, 0xa16c, + 0xa180, 0xa1ec, + 0xa200, 0xa26c, + 0xa280, 0xa2ec, + 0xa300, 0xa36c, + 0xa380, 0xa458, + 0xa460, 0xa4f8, + 0xd000, 0xd03c, + 0xd100, 0xd134, + 0xd200, 0xd214, + 0xd220, 0xd234, + 0xd240, 0xd254, + 0xd260, 0xd274, + 0xd280, 0xd294, + 0xd2a0, 0xd2b4, + 0xd2c0, 0xd2d4, + 0xd2e0, 0xd2f4, + 0xd300, 0xd31c, + 0xdfc0, 0xdfe0, + 0xe000, 0xe00c, + 0xf000, 0xf008, + 0xf010, 0xf06c, + 0x11000, 0x11014, + 0x11048, 0x11120, + 0x11130, 0x11144, + 0x11174, 0x11178, + 0x11190, 0x111a0, + 0x111e4, 0x112f0, + 0x11300, 0x1133c, + 0x11408, 0x1146c, + 0x12000, 0x12004, + 0x12060, 0x122c4, + 0x19040, 0x1906c, + 0x19078, 0x19080, + 0x1908c, 0x190e8, + 0x190f0, 0x190f8, + 0x19100, 0x19110, + 0x19120, 0x19124, + 0x19150, 0x19194, + 0x1919c, 0x191a0, + 0x191ac, 0x191c8, + 0x191d0, 0x191e4, + 0x19250, 0x19250, + 0x19258, 0x19268, + 0x19278, 0x19278, + 0x19280, 0x192b0, + 0x192bc, 0x192f0, + 0x19300, 0x19308, + 0x19310, 0x19318, + 0x19320, 0x19328, + 0x19330, 0x19330, + 0x19348, 0x1934c, + 0x193f8, 0x19428, + 0x19430, 0x19444, + 0x1944c, 0x1946c, + 0x19474, 0x1947c, + 0x19488, 0x194cc, + 0x194f0, 0x194f8, + 0x19c00, 0x19c48, + 0x19c50, 0x19c80, + 0x19c94, 0x19c98, + 0x19ca0, 0x19cdc, + 0x19ce4, 0x19cf8, + 0x19d00, 0x19d30, + 0x19d50, 0x19d80, + 0x19d94, 0x19d98, + 0x19da0, 0x19de0, + 0x19df0, 0x19e10, + 0x19e50, 0x19e6c, + 0x19ea0, 0x19ebc, + 0x19ec4, 0x19ef4, + 0x19f04, 0x19f2c, + 0x19f34, 0x19f34, + 0x19f40, 0x19f50, + 0x19f90, 0x19fb4, + 0x19fbc, 0x19fbc, + 0x19fc4, 0x19fc8, + 0x19fd0, 0x19fe4, + 0x1a000, 0x1a004, + 0x1a010, 0x1a06c, + 0x1a0b0, 0x1a0e4, + 0x1a0ec, 0x1a108, + 0x1a114, 0x1a130, + 0x1a138, 0x1a1c4, + 0x1a1fc, 0x1a29c, + 0x1a2a8, 0x1a2b8, + 0x1a2c0, 0x1a388, + 0x1a398, 0x1a3ac, + 0x1e008, 0x1e00c, + 0x1e040, 0x1e044, + 0x1e04c, 0x1e04c, + 0x1e284, 0x1e290, + 0x1e2c0, 0x1e2c0, + 0x1e2e0, 0x1e2e4, + 0x1e300, 0x1e384, + 0x1e3c0, 0x1e3c8, + 0x1e408, 0x1e40c, + 0x1e440, 0x1e444, + 0x1e44c, 0x1e44c, + 0x1e684, 0x1e690, + 0x1e6c0, 0x1e6c0, + 0x1e6e0, 0x1e6e4, + 0x1e700, 0x1e784, + 0x1e7c0, 0x1e7c8, + 0x1e808, 0x1e80c, + 0x1e840, 0x1e844, + 0x1e84c, 0x1e84c, + 0x1ea84, 0x1ea90, + 0x1eac0, 0x1eac0, + 0x1eae0, 0x1eae4, + 0x1eb00, 0x1eb84, + 0x1ebc0, 0x1ebc8, + 0x1ec08, 0x1ec0c, + 0x1ec40, 0x1ec44, + 0x1ec4c, 0x1ec4c, + 0x1ee84, 0x1ee90, + 0x1eec0, 0x1eec0, + 0x1eee0, 0x1eee4, + 0x1ef00, 0x1ef84, + 0x1efc0, 0x1efc8, + 0x1f008, 0x1f00c, + 0x1f040, 0x1f044, + 0x1f04c, 0x1f04c, + 0x1f284, 0x1f290, + 0x1f2c0, 0x1f2c0, + 0x1f2e0, 0x1f2e4, + 0x1f300, 0x1f384, + 0x1f3c0, 0x1f3c8, + 0x1f408, 0x1f40c, + 0x1f440, 0x1f444, + 0x1f44c, 0x1f44c, + 0x1f684, 0x1f690, + 0x1f6c0, 0x1f6c0, + 0x1f6e0, 0x1f6e4, + 0x1f700, 0x1f784, + 0x1f7c0, 0x1f7c8, + 0x1f808, 0x1f80c, + 0x1f840, 0x1f844, + 0x1f84c, 0x1f84c, + 0x1fa84, 0x1fa90, + 0x1fac0, 0x1fac0, + 0x1fae0, 0x1fae4, + 0x1fb00, 0x1fb84, + 0x1fbc0, 0x1fbc8, + 0x1fc08, 0x1fc0c, + 0x1fc40, 0x1fc44, + 0x1fc4c, 0x1fc4c, + 0x1fe84, 0x1fe90, + 0x1fec0, 0x1fec0, + 0x1fee0, 0x1fee4, + 0x1ff00, 0x1ff84, + 0x1ffc0, 0x1ffc8, + 0x30000, 0x30038, + 0x30100, 0x3017c, + 0x30190, 0x301a0, + 0x301a8, 0x301b8, + 0x301c4, 0x301c8, + 0x301d0, 0x301e0, + 0x30200, 0x30344, + 0x30400, 0x304b4, + 0x304c0, 0x3052c, + 0x30540, 0x3065c, + 0x30800, 0x30848, + 0x30850, 0x308a8, + 0x308b8, 0x308c0, + 0x308cc, 0x308dc, + 0x30900, 0x30904, + 0x3090c, 0x30914, + 0x3091c, 0x30928, + 0x30930, 0x3093c, + 0x30944, 0x30948, + 0x30954, 0x30974, + 0x3097c, 0x30980, + 0x30a00, 0x30a20, + 0x30a38, 0x30a3c, + 0x30a50, 0x30a50, + 0x30a80, 0x30a80, + 0x30a88, 0x30aa8, + 0x30ab0, 0x30ab4, + 0x30ac8, 0x30ad4, + 0x30b28, 0x30b84, + 0x30b98, 0x30bb8, + 0x30c98, 0x30d14, + 0x31000, 0x31020, + 0x31038, 0x3103c, + 0x31050, 0x31050, + 0x31080, 0x31080, + 0x31088, 0x310a8, + 0x310b0, 0x310b4, + 0x310c8, 0x310d4, + 0x31128, 0x31184, + 0x31198, 0x311b8, + 0x32000, 0x32038, + 0x32100, 0x3217c, + 0x32190, 0x321a0, + 0x321a8, 0x321b8, + 0x321c4, 0x321c8, + 0x321d0, 0x321e0, + 0x32200, 0x32344, + 0x32400, 0x324b4, + 0x324c0, 0x3252c, + 0x32540, 0x3265c, + 0x32800, 0x32848, + 0x32850, 0x328a8, + 0x328b8, 0x328c0, + 0x328cc, 0x328dc, + 0x32900, 0x32904, + 0x3290c, 0x32914, + 0x3291c, 0x32928, + 0x32930, 0x3293c, + 0x32944, 0x32948, + 0x32954, 0x32974, + 0x3297c, 0x32980, + 0x32a00, 0x32a20, + 0x32a38, 0x32a3c, + 0x32a50, 0x32a50, + 0x32a80, 0x32a80, + 0x32a88, 0x32aa8, + 0x32ab0, 0x32ab4, + 0x32ac8, 0x32ad4, + 0x32b28, 0x32b84, + 0x32b98, 0x32bb8, + 0x32c98, 0x32d14, + 0x33000, 0x33020, + 0x33038, 0x3303c, + 0x33050, 0x33050, + 0x33080, 0x33080, + 0x33088, 0x330a8, + 0x330b0, 0x330b4, + 0x330c8, 0x330d4, + 0x33128, 0x33184, + 0x33198, 0x331b8, + 0x34000, 0x34038, + 0x34100, 0x3417c, + 0x34190, 0x341a0, + 0x341a8, 0x341b8, + 0x341c4, 0x341c8, + 0x341d0, 0x341e0, + 0x34200, 0x34344, + 0x34400, 0x344b4, + 0x344c0, 0x3452c, + 0x34540, 0x3465c, + 0x34800, 0x34848, + 0x34850, 0x348a8, + 0x348b8, 0x348c0, + 0x348cc, 0x348dc, + 0x34900, 0x34904, + 0x3490c, 0x34914, + 0x3491c, 0x34928, + 0x34930, 0x3493c, + 0x34944, 0x34948, + 0x34954, 0x34974, + 0x3497c, 0x34980, + 0x34a00, 0x34a20, + 0x34a38, 0x34a3c, + 0x34a50, 0x34a50, + 0x34a80, 0x34a80, + 0x34a88, 0x34aa8, + 0x34ab0, 0x34ab4, + 0x34ac8, 0x34ad4, + 0x34b28, 0x34b84, + 0x34b98, 0x34bb8, + 0x34c98, 0x34d14, + 0x35000, 0x35020, + 0x35038, 0x3503c, + 0x35050, 0x35050, + 0x35080, 0x35080, + 0x35088, 0x350a8, + 0x350b0, 0x350b4, + 0x350c8, 0x350d4, + 0x35128, 0x35184, + 0x35198, 0x351b8, + 0x36000, 0x36038, + 0x36100, 0x3617c, + 0x36190, 0x361a0, + 0x361a8, 0x361b8, + 0x361c4, 0x361c8, + 0x361d0, 0x361e0, + 0x36200, 0x36344, + 0x36400, 0x364b4, + 0x364c0, 0x3652c, + 0x36540, 0x3665c, + 0x36800, 0x36848, + 0x36850, 0x368a8, + 0x368b8, 0x368c0, + 0x368cc, 0x368dc, + 0x36900, 0x36904, + 0x3690c, 0x36914, + 0x3691c, 0x36928, + 0x36930, 0x3693c, + 0x36944, 0x36948, + 0x36954, 0x36974, + 0x3697c, 0x36980, + 0x36a00, 0x36a20, + 0x36a38, 0x36a3c, + 0x36a50, 0x36a50, + 0x36a80, 0x36a80, + 0x36a88, 0x36aa8, + 0x36ab0, 0x36ab4, + 0x36ac8, 0x36ad4, + 0x36b28, 0x36b84, + 0x36b98, 0x36bb8, + 0x36c98, 0x36d14, + 0x37000, 0x37020, + 0x37038, 0x3703c, + 0x37050, 0x37050, + 0x37080, 0x37080, + 0x37088, 0x370a8, + 0x370b0, 0x370b4, + 0x370c8, 0x370d4, + 0x37128, 0x37184, + 0x37198, 0x371b8, + 0x38000, 0x380b0, + 0x380b8, 0x38130, + 0x38140, 0x38140, + 0x38150, 0x38154, + 0x38160, 0x381c4, + 0x381f0, 0x38204, + 0x3820c, 0x38214, + 0x3821c, 0x3822c, + 0x38244, 0x38244, + 0x38254, 0x38274, + 0x3827c, 0x38280, + 0x38300, 0x38304, + 0x3830c, 0x38314, + 0x3831c, 0x3832c, + 0x38344, 0x38344, + 0x38354, 0x38374, + 0x3837c, 0x38380, + 0x38400, 0x38424, + 0x38438, 0x3843c, + 0x38480, 0x38480, + 0x384a8, 0x384a8, + 0x384b0, 0x384b4, + 0x384c8, 0x38514, + 0x38600, 0x3860c, + 0x3861c, 0x38624, + 0x38900, 0x38924, + 0x38938, 0x3893c, + 0x38980, 0x38980, + 0x389a8, 0x389a8, + 0x389b0, 0x389b4, + 0x389c8, 0x38a14, + 0x38b00, 0x38b0c, + 0x38b1c, 0x38b24, + 0x38e00, 0x38e00, + 0x38e18, 0x38e20, + 0x38e38, 0x38e40, + 0x38e58, 0x38e60, + 0x38e78, 0x38e80, + 0x38e98, 0x38ea0, + 0x38eb8, 0x38ec0, + 0x38ed8, 0x38ee0, *** 40525 LINES SKIPPED *** From nobody Fri Oct 3 00:04:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86G3w6Dz6BMbD; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86F439Qz3sJs; Fri, 03 Oct 2025 00:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SyRTcXSNgTXreu2tDqrf6XSayIfRY+OVIhT6txqetQE=; b=fUXUIKDwfvy2LyEyf+A+vew2uJ1NbkobrhC9YyP14UOmttFs4aFDK+0+5RnQQ4zy2niwpj S3i5UV3qYK4T1scsqGrQ+2UQrvO1/TEx3+U/XGXs2QpMtLBNEZgRoCSVdpVIKoV2e/LCgA AIophWrQlRNijGy5k2Zqh/tP8xhlX9rwdRxzDvLP+mIhdRdwhZOOmcjsjyxV//RHZJ02m1 zLCSJxJJcylPsDWBMou8AP+J24d6mVZANkOuYBFfKRNBqH2zabUUnAWx0GEKrtrvLD2zMg REuyB9/PVjpIq412E1r1+iXq5+M3kr4oVSxdwScSXmTzT+UYoadLAOukKSJ+EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SyRTcXSNgTXreu2tDqrf6XSayIfRY+OVIhT6txqetQE=; b=VTN7HkVTnDK3BKeEfCNLP9j3jvoZ29izDYYCOVhDe6ZcI0cAVgrH3LDNFXn36NJLmPeArD pqTl76PD0tNR4PdQ+db22d5U7V2tIttq5b9QXKxxijCswg3QorzI9o5RguDNlf5n7820SE 59JFwKcsPUWrt2OM+zU2uwskmk0IDbSW8Qsp95hzlo6kI/Mr0E84NjdIzQy/pJxiRRI/0Z nzjX6ZYxvGc7dMiApqXaMFrxw52RXdDL54iWkNRNVbpmjZqHlrlahRngoOwTxovjPG/aQR Um+Gx+JCViavSpQ6IDWILB/JVYK3bakrH33y5IGHDQmUH1W8u27qL6W7GomvbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449861; a=rsa-sha256; cv=none; b=Gdm8ItUB0/EfBqZcHpExJfouez43BrTRt0g+i3UYYMpO2esbKuhI0mvBk2HUwukOr83UkH CbZ+xLDMJsHUw8Y1Ouu7S2klOfENySJehAW1rz6lU7+WP74hj6/dGH2FYzt4n+fvAfBn57 k92hAtNsde5oiBHnWVuVWW+6+m6sVoMP+wgNvIHyV+b7je5/7RGx15vkOQkCRTHMxMW+fD G5rflCgIwQQviDxvp5ySxJsHoUnb0HPJZddASfss09Mz4O6bO4jJYwzWCjDVOOs6Ar+YNa qkY++cEdoFjnObDcgoCqBrf59uBqIHcS20XcjiTBFuVg2ePXFAFvldLxJfmMdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86F3QvgzTvT; Fri, 03 Oct 2025 00:04: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 59304LYt056737; Fri, 3 Oct 2025 00:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304LRJ056734; Fri, 3 Oct 2025 00:04:21 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:21 GMT Message-Id: <202510030004.59304LRJ056734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 39ef0c38800b - stable/15 - cxgbe(4): Claim T7 based devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 39ef0c38800bb06b84f6f788bbab2062ca25662e Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=39ef0c38800bb06b84f6f788bbab2062ca25662e commit 39ef0c38800bb06b84f6f788bbab2062ca25662e Author: Navdeep Parhar AuthorDate: 2025-09-29 07:54:13 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:04 +0000 cxgbe(4): Claim T7 based devices The nexus/ifnet names are chnex/che respectively. Sponsored by: Chelsio Communications (cherry picked from commit 1ba1c783296bc651e1af3174a1643dff39edf05a) --- share/man/man4/cxgbe.4 | 5 +- sys/dev/cxgbe/t4_iov.c | 67 ++++++++++++++++++++++++ sys/dev/cxgbe/t4_main.c | 133 ++++++++++++++++++++++++++++++++++++++++++++++-- sys/dev/cxgbe/t4_vf.c | 65 +++++++++++++++++++++++ 4 files changed, 265 insertions(+), 5 deletions(-) diff --git a/share/man/man4/cxgbe.4 b/share/man/man4/cxgbe.4 index bfba202d1fec..77465a3ae590 100644 --- a/share/man/man4/cxgbe.4 +++ b/share/man/man4/cxgbe.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd November 10, 2022 +.Dd September 29, 2025 .Dt CXGBE 4 .Os .Sh NAME @@ -73,6 +73,7 @@ driver uses different names for devices based on the associated ASIC: .It T4 Ta cxgbe Ta t4nex Ta vcxgbe .It T5 Ta cxl Ta t5nex Ta vcxl .It T6 Ta cc Ta t6nex Ta vcc +.It T7 Ta che Ta chnex Ta vche .El .Pp Loader tunables with the hw.cxgbe prefix apply to all cards. @@ -416,6 +417,8 @@ Support for T6 cards first appeared in .Fx 11.1 and .Fx 12.0 . +Support for T7 cards first appeared in +.Fx 15.0 . .Sh AUTHORS .An -nosplit The diff --git a/sys/dev/cxgbe/t4_iov.c b/sys/dev/cxgbe/t4_iov.c index bfd1613e9795..452ebaaf0172 100644 --- a/sys/dev/cxgbe/t4_iov.c +++ b/sys/dev/cxgbe/t4_iov.c @@ -119,6 +119,28 @@ struct { {0x6085, "Chelsio T6240-SO 85"}, {0x6086, "Chelsio T6225-SO-CR 86"}, {0x6087, "Chelsio T6225-CR 87"}, +}, t7iov_pciids[] = { + {0xd000, "Chelsio Terminator 7 FPGA"}, /* T7 PE12K FPGA */ + {0x7000, "Chelsio T72200-DBG"}, /* 2 x 200G, debug */ + {0x7001, "Chelsio T7250"}, /* 2 x 10/25/50G, 1 mem */ + {0x7002, "Chelsio S7250"}, /* 2 x 10/25/50G, nomem */ + {0x7003, "Chelsio T7450"}, /* 4 x 10/25/50G, 1 mem */ + {0x7004, "Chelsio S7450"}, /* 4 x 10/25/50G, nomem */ + {0x7005, "Chelsio T72200"}, /* 2 x 40/100/200G, 1 mem */ + {0x7006, "Chelsio S72200"}, /* 2 x 40/100/200G, nomem */ + {0x7007, "Chelsio T72200-FH"}, /* 2 x 40/100/200G, 2 mem */ + {0x7008, "Chelsio T71400"}, /* 1 x 400G, nomem */ + {0x7009, "Chelsio S7210-BT"}, /* 2 x 10GBASE-T, nomem */ + {0x700a, "Chelsio T7450-RC"}, /* 4 x 10/25/50G, 1 mem, RC */ + {0x700b, "Chelsio T72200-RC"}, /* 2 x 40/100/200G, 1 mem, RC */ + {0x700c, "Chelsio T72200-FH-RC"}, /* 2 x 40/100/200G, 2 mem, RC */ + {0x700d, "Chelsio S72200-OCP3"}, /* 2 x 40/100/200G OCP3 */ + {0x700e, "Chelsio S7450-OCP3"}, /* 4 x 1/20/25/50G OCP3 */ + {0x700f, "Chelsio S7410-BT-OCP3"}, /* 4 x 10GBASE-T OCP3 */ + {0x7010, "Chelsio S7210-BT-A"}, /* 2 x 10GBASE-T */ + {0x7011, "Chelsio T7_MAYRA_7"}, /* Motherboard */ + + {0x7080, "Custom T7"}, }; static inline uint32_t @@ -190,6 +212,26 @@ t6iov_probe(device_t dev) return (ENXIO); } +static int +chiov_probe(device_t dev) +{ + uint16_t d; + size_t i; + + if (pci_get_vendor(dev) != PCI_VENDOR_ID_CHELSIO) + return (ENXIO); + + d = pci_get_device(dev); + for (i = 0; i < nitems(t7iov_pciids); i++) { + if (d == t7iov_pciids[i].device) { + device_set_desc(dev, t7iov_pciids[i].desc); + device_quiet(dev); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + static int t4iov_attach(device_t dev) { @@ -460,6 +502,28 @@ static driver_t t6iov_driver = { sizeof(struct t4iov_softc) }; +static device_method_t chiov_methods[] = { + DEVMETHOD(device_probe, chiov_probe), + DEVMETHOD(device_attach, t4iov_attach), + DEVMETHOD(device_detach, t4iov_detach), + +#ifdef PCI_IOV + DEVMETHOD(pci_iov_init, t4iov_iov_init), + DEVMETHOD(pci_iov_uninit, t4iov_iov_uninit), + DEVMETHOD(pci_iov_add_vf, t4iov_add_vf), +#endif + + DEVMETHOD(t4_attach_child, t4iov_attach_child), + DEVMETHOD(t4_detach_child, t4iov_detach_child), + + DEVMETHOD_END +}; + +static driver_t chiov_driver = { + "chiov", + chiov_methods, + sizeof(struct t4iov_softc) +}; DRIVER_MODULE(t4iov, pci, t4iov_driver, 0, 0); MODULE_VERSION(t4iov, 1); @@ -468,3 +532,6 @@ MODULE_VERSION(t5iov, 1); DRIVER_MODULE(t6iov, pci, t6iov_driver, 0, 0); MODULE_VERSION(t6iov, 1); + +DRIVER_MODULE(chiov, pci, chiov_driver, 0, 0); +MODULE_VERSION(chiov, 1); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 42f56179845c..6a52810c5d8d 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -241,6 +241,45 @@ static driver_t vcc_driver = { sizeof(struct vi_info) }; +/* T7+ bus driver interface */ +static int ch_probe(device_t); +static device_method_t ch_methods[] = { + DEVMETHOD(device_probe, ch_probe), + DEVMETHOD(device_attach, t4_attach), + DEVMETHOD(device_detach, t4_detach), + DEVMETHOD(device_suspend, t4_suspend), + DEVMETHOD(device_resume, t4_resume), + + DEVMETHOD(bus_child_location, t4_child_location), + DEVMETHOD(bus_reset_prepare, t4_reset_prepare), + DEVMETHOD(bus_reset_post, t4_reset_post), + + DEVMETHOD(t4_is_main_ready, t4_ready), + DEVMETHOD(t4_read_port_device, t4_read_port_device), + + DEVMETHOD_END +}; +static driver_t ch_driver = { + "chnex", + ch_methods, + sizeof(struct adapter) +}; + + +/* T7+ port (che) interface */ +static driver_t che_driver = { + "che", + cxgbe_methods, + sizeof(struct port_info) +}; + +/* T7+ VI (vche) interface */ +static driver_t vche_driver = { + "vche", + vcxgbe_methods, + sizeof(struct vi_info) +}; + /* ifnet interface */ static void cxgbe_init(void *); static int cxgbe_ioctl(if_t, unsigned long, caddr_t); @@ -960,6 +999,29 @@ struct { {0x6485, "Custom T6240-SO"}, {0x6486, "Custom T6225-SO-CR"}, {0x6487, "Custom T6225-CR"}, +}, t7_pciids[] = { + {0xd000, "Chelsio Terminator 7 FPGA"}, /* T7 PE12K FPGA */ + {0x7400, "Chelsio T72200-DBG"}, /* 2 x 200G, debug */ + {0x7401, "Chelsio T7250"}, /* 2 x 10/25/50G, 1 mem */ + {0x7402, "Chelsio S7250"}, /* 2 x 10/25/50G, nomem */ + {0x7403, "Chelsio T7450"}, /* 4 x 10/25/50G, 1 mem */ + {0x7404, "Chelsio S7450"}, /* 4 x 10/25/50G, nomem */ + {0x7405, "Chelsio T72200"}, /* 2 x 40/100/200G, 1 mem */ + {0x7406, "Chelsio S72200"}, /* 2 x 40/100/200G, nomem */ + {0x7407, "Chelsio T72200-FH"}, /* 2 x 40/100/200G, 2 mem */ + {0x7408, "Chelsio S71400"}, /* 1 x 400G, nomem */ + {0x7409, "Chelsio S7210-BT"}, /* 2 x 10GBASE-T, nomem */ + {0x740a, "Chelsio T7450-RC"}, /* 4 x 10/25/50G, 1 mem, RC */ + {0x740b, "Chelsio T72200-RC"}, /* 2 x 40/100/200G, 1 mem, RC */ + {0x740c, "Chelsio T72200-FH-RC"}, /* 2 x 40/100/200G, 2 mem, RC */ + {0x740d, "Chelsio S72200-OCP3"}, /* 2 x 40/100/200G OCP3 */ + {0x740e, "Chelsio S7450-OCP3"}, /* 4 x 1/20/25/50G OCP3 */ + {0x740f, "Chelsio S7410-BT-OCP3"}, /* 4 x 10GBASE-T OCP3 */ + {0x7410, "Chelsio S7210-BT-A"}, /* 2 x 10GBASE-T */ + {0x7411, "Chelsio T7_MAYRA_7"}, /* Motherboard */ + + /* Custom */ + {0x7480, "Custom T7"}, }; #ifdef TCP_OFFLOAD @@ -1042,6 +1104,31 @@ t6_probe(device_t dev) return (ENXIO); } +static int +ch_probe(device_t dev) +{ + int i; + uint16_t v = pci_get_vendor(dev); + uint16_t d = pci_get_device(dev); + uint8_t f = pci_get_function(dev); + + if (v != PCI_VENDOR_ID_CHELSIO) + return (ENXIO); + + /* Attach only to PF0 of the FPGA */ + if (d == 0xd000 && f != 0) + return (ENXIO); + + for (i = 0; i < nitems(t7_pciids); i++) { + if (d == t7_pciids[i].device) { + device_set_desc(dev, t7_pciids[i].desc); + return (BUS_PROBE_DEFAULT); + } + } + + return (ENXIO); +} + static void t5_attribute_workaround(device_t dev) { @@ -1091,6 +1178,13 @@ static const struct devnames devnames[] = { .pf03_drv_name = "t6iov", .vf_nexus_name = "t6vf", .vf_ifnet_name = "ccv" + }, { + .nexus_name = "chnex", + .ifnet_name = "che", + .vi_ifnet_name = "vche", + .pf03_drv_name = "chiov", + .vf_nexus_name = "chvf", + .vf_ifnet_name = "chev" } }; @@ -1100,12 +1194,13 @@ t4_init_devnames(struct adapter *sc) int id; id = chip_id(sc); - if (id >= CHELSIO_T4 && id - CHELSIO_T4 < nitems(devnames)) - sc->names = &devnames[id - CHELSIO_T4]; - else { + if (id < CHELSIO_T4) { device_printf(sc->dev, "chip id %d is not supported.\n", id); sc->names = NULL; - } + } else if (id - CHELSIO_T4 < nitems(devnames)) + sc->names = &devnames[id - CHELSIO_T4]; + else + sc->names = &devnames[nitems(devnames) - 1]; } static int @@ -4713,6 +4808,22 @@ struct fw_info { .intfver_fcoepdu = FW_INTFVER(T6, FCOEPDU), .intfver_fcoe = FW_INTFVER(T6, FCOE), }, + }, { + .chip = CHELSIO_T7, + .kld_name = "t7fw_cfg", + .fw_mod_name = "t7fw", + .fw_h = { + .chip = FW_HDR_CHIP_T7, + .fw_ver = htobe32(FW_VERSION(T7)), + .intfver_nic = FW_INTFVER(T7, NIC), + .intfver_vnic = FW_INTFVER(T7, VNIC), + .intfver_ofld = FW_INTFVER(T7, OFLD), + .intfver_ri = FW_INTFVER(T7, RI), + .intfver_iscsipdu = FW_INTFVER(T7, ISCSIPDU), + .intfver_iscsi = FW_INTFVER(T7, ISCSI), + .intfver_fcoepdu = FW_INTFVER(T7, FCOEPDU), + .intfver_fcoe = FW_INTFVER(T7, FCOE), + }, } }; @@ -13387,6 +13498,14 @@ MODULE_DEPEND(t6nex, firmware, 1, 1, 1); MODULE_DEPEND(t6nex, netmap, 1, 1, 1); #endif /* DEV_NETMAP */ +DRIVER_MODULE(chnex, pci, ch_driver, mod_event, 0); +MODULE_VERSION(chnex, 1); +MODULE_DEPEND(chnex, crypto, 1, 1, 1); +MODULE_DEPEND(chnex, firmware, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(chnex, netmap, 1, 1, 1); +#endif /* DEV_NETMAP */ + DRIVER_MODULE(cxgbe, t4nex, cxgbe_driver, 0, 0); MODULE_VERSION(cxgbe, 1); @@ -13396,6 +13515,9 @@ MODULE_VERSION(cxl, 1); DRIVER_MODULE(cc, t6nex, cc_driver, 0, 0); MODULE_VERSION(cc, 1); +DRIVER_MODULE(che, chnex, che_driver, 0, 0); +MODULE_VERSION(che, 1); + DRIVER_MODULE(vcxgbe, cxgbe, vcxgbe_driver, 0, 0); MODULE_VERSION(vcxgbe, 1); @@ -13404,3 +13526,6 @@ MODULE_VERSION(vcxl, 1); DRIVER_MODULE(vcc, cc, vcc_driver, 0, 0); MODULE_VERSION(vcc, 1); + +DRIVER_MODULE(vche, che, vche_driver, 0, 0); +MODULE_VERSION(vche, 1); diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c index b7b08e226a57..89dae02e9332 100644 --- a/sys/dev/cxgbe/t4_vf.c +++ b/sys/dev/cxgbe/t4_vf.c @@ -125,6 +125,28 @@ struct { {0x6885, "Chelsio T6240-SO 85 VF"}, {0x6886, "Chelsio T6225-SO-CR 86 VF"}, {0x6887, "Chelsio T6225-CR 87 VF"}, +}, t7vf_pciids[] = { + {0xd800, "Chelsio T7 FPGA VF"}, /* T7 PE12K FPGA */ + {0x7800, "Chelsio T72200-DBG VF"}, /* 2 x 200G, debug */ + {0x7801, "Chelsio T7250 VF"}, /* 2 x 10/25/50G, 1 mem */ + {0x7802, "Chelsio S7250 VF"}, /* 2 x 10/25/50G, nomem */ + {0x7803, "Chelsio T7450 VF"}, /* 4 x 10/25/50G, 1 mem */ + {0x7804, "Chelsio S7450 VF"}, /* 4 x 10/25/50G, nomem */ + {0x7805, "Chelsio T72200 VF"}, /* 2 x 40/100/200G, 1 mem */ + {0x7806, "Chelsio S72200 VF"}, /* 2 x 40/100/200G, nomem */ + {0x7807, "Chelsio T72200-FH VF"}, /* 2 x 40/100/200G, 2 mem */ + {0x7808, "Chelsio T71400 VF"}, /* 1 x 400G, nomem */ + {0x7809, "Chelsio S7210-BT VF"}, /* 2 x 10GBASE-T, nomem */ + {0x780a, "Chelsio T7450-RC VF"}, /* 4 x 10/25/50G, 1 mem, RC */ + {0x780b, "Chelsio T72200-RC VF"}, /* 2 x 40/100/200G, 1 mem, RC */ + {0x780c, "Chelsio T72200-FH-RC VF"}, /* 2 x 40/100/200G, 2 mem, RC */ + {0x780d, "Chelsio S72200-OCP3 VF"}, /* 2 x 40/100/200G OCP3 */ + {0x780e, "Chelsio S7450-OCP3 VF"}, /* 4 x 1/20/25/50G OCP3 */ + {0x780f, "Chelsio S7410-BT-OCP3 VF"}, /* 4 x 10GBASE-T OCP3 */ + {0x7810, "Chelsio S7210-BT-A VF"}, /* 2 x 10GBASE-T */ + {0x7811, "Chelsio T7_MAYRA_7 VF"}, /* Motherboard */ + + {0x7880, "Custom T7 VF"}, }; static d_ioctl_t t4vf_ioctl; @@ -183,6 +205,22 @@ t6vf_probe(device_t dev) return (ENXIO); } +static int +chvf_probe(device_t dev) +{ + uint16_t d; + size_t i; + + d = pci_get_device(dev); + for (i = 0; i < nitems(t7vf_pciids); i++) { + if (d == t7vf_pciids[i].device) { + device_set_desc(dev, t7vf_pciids[i].desc); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + #define FW_PARAM_DEV(param) \ (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | \ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param)) @@ -956,6 +994,20 @@ static driver_t t6vf_driver = { sizeof(struct adapter) }; +static device_method_t chvf_methods[] = { + DEVMETHOD(device_probe, chvf_probe), + DEVMETHOD(device_attach, t4vf_attach), + DEVMETHOD(device_detach, t4_detach_common), + + DEVMETHOD_END +}; + +static driver_t chvf_driver = { + "chvf", + chvf_methods, + sizeof(struct adapter) +}; + static driver_t cxgbev_driver = { "cxgbev", cxgbe_methods, @@ -974,6 +1026,12 @@ static driver_t ccv_driver = { sizeof(struct port_info) }; +static driver_t chev_driver = { + "chev", + cxgbe_methods, + sizeof(struct port_info) +}; + DRIVER_MODULE(t4vf, pci, t4vf_driver, 0, 0); MODULE_VERSION(t4vf, 1); MODULE_DEPEND(t4vf, t4nex, 1, 1, 1); @@ -986,6 +1044,10 @@ DRIVER_MODULE(t6vf, pci, t6vf_driver, 0, 0); MODULE_VERSION(t6vf, 1); MODULE_DEPEND(t6vf, t6nex, 1, 1, 1); +DRIVER_MODULE(chvf, pci, chvf_driver, 0, 0); +MODULE_VERSION(chvf, 1); +MODULE_DEPEND(chvf, chnex, 1, 1, 1); + DRIVER_MODULE(cxgbev, t4vf, cxgbev_driver, 0, 0); MODULE_VERSION(cxgbev, 1); @@ -994,3 +1056,6 @@ MODULE_VERSION(cxlv, 1); DRIVER_MODULE(ccv, t6vf, ccv_driver, 0, 0); MODULE_VERSION(ccv, 1); + +DRIVER_MODULE(chev, chvf, chev_driver, 0, 0); +MODULE_VERSION(chev, 1); From nobody Fri Oct 3 00:04:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86H0T3Dz6BN1F; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86G4zfdz3s11; Fri, 03 Oct 2025 00:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9SxBAr0Tw+U5HwvldrwMw5HU1gE7cjqk+dAyfoVNowU=; b=pMr5UtdHdiZL3r5OeVR6Z9yU6eG5qQ0CAPagBXhSDKC4nF/aBhmxtxeu+TE/Jm1X2wWLsO Vrag3hPkgylJz0+l+oYx97VYR9UOoR2R+w3CMtWDd8RvGnDZ1qScqsX9k41J+N08DGwh6u F70ZeD2ao3INTg/tgFMV5TGZniND4/lp07tVia4V8KA1Wt4LdlurSLVFaDswVBW3akvmm2 jSBaaJZuIRg5Ifyo61CeuIEGYJ9TbrV3M8BcHhcIRyQkp6lPG98EBZ0bEAAvrP/5hwEpxL iCr6oM7NGoXjdVuullvNt0P2x+E8/CWYi6Qd7y/awfclKGsMNZ8BkrVJybXleQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9SxBAr0Tw+U5HwvldrwMw5HU1gE7cjqk+dAyfoVNowU=; b=nRG4JSders8UXESl3bSpa7rcmNdwTFzc9iUecvIiY5oDaLb+OLmp1HC7zlonp69vMzoCWR xKWXX3+S8yU+0eyLCu0B3AgqNwKe9F2Cy/2Lw9JlfR6HDL5sVa175W4s8B1i2CyFHFGAnV VUoSZcWppHm8j8ieebakogE4lKlzU+TrRVLvkTRdURPFORbvhXo5RRx8v/Ggf7CoURxLzn yey3502MbUlKT6CTJnLz3Zg8jwMPLws1VuqRmpVyntbHZIbqK3Md2LcgphD4f04fvlBIEZ sid9cXk72kTIn1xO37kcuomalYqe1KF6KQmqyAUihRAHMmwaC/1qb9YTLGm1fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449862; a=rsa-sha256; cv=none; b=kASLgGJcZO2WqAUT2Hzkpp2dJqFNRnbjtoGuv9O2G8xzlcvwLdG4qfooeVOUCShphxHDNZ 9FZimKHStMkgidDs1Hz61/M2VE/e8dqTNGH0Z8gsuMdFcBDazYDRrR6JM1wCUD20IwOezE WVjgdpZFwVFd4ngABAio1N0qMKB8d7BcsYu9sy+cb/FywX0a1hft5xB7lfGPpGTcD+w7oJ R0NEf80ADUU7PmHc3D1FOA49XW1MuGFQN0xKzQv2Lx/9FftzjOYdtlieRfaoPnazD8oNs9 8Z4RIZggI2R/shuEVhneVVD+tW57I7bYTNRSSYBodhNA0IwIlr5XJMO7cGgoRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86G4KQSzVcr; Fri, 03 Oct 2025 00:04: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 59304MYZ056777; Fri, 3 Oct 2025 00:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304Mtb056774; Fri, 3 Oct 2025 00:04:22 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:22 GMT Message-Id: <202510030004.59304Mtb056774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 3a5c5aabdf71 - stable/15 - cxgbe(4): Add T7 support to routines that deal with memory windows List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3a5c5aabdf71b1eececa35524d1d2c4c09b42845 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=3a5c5aabdf71b1eececa35524d1d2c4c09b42845 commit 3a5c5aabdf71b1eececa35524d1d2c4c09b42845 Author: Navdeep Parhar AuthorDate: 2025-09-29 08:17:17 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:04 +0000 cxgbe(4): Add T7 support to routines that deal with memory windows Sponsored by: Chelsio Communications (cherry picked from commit 87d3ee5d14ba2e912010531e5bb601180bd5803d) --- sys/dev/cxgbe/t4_main.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 6a52810c5d8d..01899bda0216 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -4051,7 +4051,7 @@ setup_memwin(struct adapter *sc) const struct memwin_init *mw_init; struct memwin *mw; int i; - uint32_t bar0; + uint32_t bar0, reg; if (is_t4(sc)) { /* @@ -4079,9 +4079,10 @@ setup_memwin(struct adapter *sc) mw->mw_aperture = mw_init->aperture; mw->mw_curpos = 0; } - t4_write_reg(sc, - PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_BASE_WIN, i), - (mw->mw_base + bar0) | V_BIR(0) | + reg = chip_id(sc) > CHELSIO_T6 ? + PCIE_MEM_ACCESS_T7_REG(A_T7_PCIE_MEM_ACCESS_BASE_WIN, i) : + PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_BASE_WIN, i); + t4_write_reg(sc, reg, (mw->mw_base + bar0) | V_BIR(0) | V_WINDOW(ilog2(mw->mw_aperture) - 10)); rw_wlock(&mw->mw_lock); position_memwin(sc, i, mw->mw_curpos); @@ -4089,7 +4090,7 @@ setup_memwin(struct adapter *sc) } /* flush */ - t4_read_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_BASE_WIN, 2)); + t4_read_reg(sc, reg); } /* @@ -4102,8 +4103,7 @@ static void position_memwin(struct adapter *sc, int idx, uint32_t addr) { struct memwin *mw; - uint32_t pf; - uint32_t reg; + uint32_t pf, reg, val; MPASS(idx >= 0 && idx < NUM_MEMWIN); mw = &sc->memwin[idx]; @@ -4116,8 +4116,14 @@ position_memwin(struct adapter *sc, int idx, uint32_t addr) pf = V_PFNUM(sc->pf); mw->mw_curpos = addr & ~0x7f; /* start must be 128B aligned */ } - reg = PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, idx); - t4_write_reg(sc, reg, mw->mw_curpos | pf); + if (chip_id(sc) > CHELSIO_T6) { + reg = PCIE_MEM_ACCESS_T7_REG(A_PCIE_MEM_ACCESS_OFFSET0, idx); + val = (mw->mw_curpos >> X_T7_MEMOFST_SHIFT) | pf; + } else { + reg = PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, idx); + val = mw->mw_curpos | pf; + } + t4_write_reg(sc, reg, val); t4_read_reg(sc, reg); /* flush */ } @@ -13013,7 +13019,9 @@ t4_dump_mem(struct adapter *sc, u_int addr, u_int len) { uint32_t base, j, off, pf, reg, save, win_pos; - reg = PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2); + reg = chip_id(sc) > CHELSIO_T6 ? + PCIE_MEM_ACCESS_T7_REG(A_PCIE_MEM_ACCESS_OFFSET0, 2) : + PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2); save = t4_read_reg(sc, reg); base = sc->memwin[2].mw_base; @@ -13025,6 +13033,8 @@ t4_dump_mem(struct adapter *sc, u_int addr, u_int len) win_pos = addr & ~0x7f; /* start must be 128B aligned */ } off = addr - win_pos; + if (chip_id(sc) > CHELSIO_T6) + win_pos >>= X_T7_MEMOFST_SHIFT; t4_write_reg(sc, reg, win_pos | pf); t4_read_reg(sc, reg); From nobody Fri Oct 3 00:04:23 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86J4yBdz6BMbF; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86H5nDpz3sGg; Fri, 03 Oct 2025 00:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xsy+ZxsrJBoCT8S7k0CplPFZn9GT2TM/vUxBT0civHA=; b=ljzk0ysJzUDWWN3Qz9KGWxFm87eLstfwlUYmUjgH6A7SWOglYQLG7V/p4MHk7zo39FQSf5 eGEO41Xl2MhJC9rVEYLvYksBu9ArXWBeHyYunUmJm1HrRMUSYsZc36tqgGNL1th2qHqvzj EZ6/gB1SDAWTMBp6B1rkokpMG6eh1CNjB5h3iYOwjuvaeCrKuFcuwrZU4wvFVETlFJGAQx rT5OIUlffpAP6386H7k4Lhmzr/rUqd512MTOxbjpuvjx9P3s1WH2Q7+g5n//y5NqDw6paE mM546Q5jmw1upUf2FgroUch+pt86B4Rfd37XvTK8nc7jSFgjO0QrEdW6YVvN3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xsy+ZxsrJBoCT8S7k0CplPFZn9GT2TM/vUxBT0civHA=; b=B8L4IDSBV5XU/jdWE+WsRCsrT4UEzqpdtUqu4m5T0RVWRVBlM6PPpKgd8eJS8Ier8irOJz zbSuxP8DmdogjGIyWIiBZYXnr4qPT73DLGHaHmGHs0W+NwHs3TwQJkvYyA7tm/iLqZtkqS JQREPv9cEKwNXU7duRTphzyZV9ZbjTOWpSlFlqxLAUk9Flyrbwigqw5k6lErvKz/yvwDvW BLJdhS8j6ckjLGuwv+Nfrj8EpdO7rs39omZZ3fDnB7iIuVNCCkNBaDJdshkTAaMqaAna92 0eRuHCKg55AZualjeJW1gioXWKQGnCo3AuHPhS7YpRIkVRcVrruizzxHupWCYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449863; a=rsa-sha256; cv=none; b=VjdcutDZTG9XKQ01orjii9ERJn8tGOTYq6nEmuVfJCwG6Nqg3g7T/MG8CpzMCiNU6+MPdx IA/Ggf6r2BZkpgr+F1Gorw1PrcuMaELUtNDJQdjIVzcUe0rr0QpuQ6NGhOk/ScBOlPqd0O Kact2IgalCHZwKIWNgjNhCZZ919uQ0suIO/MQkBaOcVrOkWcis+RQhBVc748XkZvzlvaig vwCgVhtU63AI3LC7AVD/1AkhlIHh/pX6srjm8BxSdYy1gh30++gu+fr1IT2G0OxiSFyY6v qR0QjH7/zs7mf+HE8vUCNoTREJtdF77Pv/tjp/NzksiZUQczdpqTtJ1L1XDNeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86H5KlDzVcs; Fri, 03 Oct 2025 00:04: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 59304NAM056811; Fri, 3 Oct 2025 00:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304N13056808; Fri, 3 Oct 2025 00:04:23 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:23 GMT Message-Id: <202510030004.59304N13056808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 14e524cd2ea2 - stable/15 - cxgbe(4): Update meminfo for T7 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 14e524cd2ea24ccdaad169c610253461d5e8c4cd Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=14e524cd2ea24ccdaad169c610253461d5e8c4cd commit 14e524cd2ea24ccdaad169c610253461d5e8c4cd Author: Navdeep Parhar AuthorDate: 2025-09-29 08:24:05 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:04 +0000 cxgbe(4): Update meminfo for T7 There are new regions in the T7 and internal addresses are not limited to 32b. Sponsored by: Chelsio Communications (cherry picked from commit f487e4778bb7154bec5057f5a6f9ca2a0230d4ae) --- sys/dev/cxgbe/t4_main.c | 196 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 153 insertions(+), 43 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 01899bda0216..101215073385 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -10030,16 +10030,16 @@ sysctl_linkdnrc(SYSCTL_HANDLER_ARGS) } struct mem_desc { - u_int base; - u_int limit; + uint64_t base; + uint64_t limit; u_int idx; }; static int mem_desc_cmp(const void *a, const void *b) { - const u_int v1 = ((const struct mem_desc *)a)->base; - const u_int v2 = ((const struct mem_desc *)b)->base; + const uint64_t v1 = ((const struct mem_desc *)a)->base; + const uint64_t v2 = ((const struct mem_desc *)b)->base; if (v1 < v2) return (-1); @@ -10050,10 +10050,9 @@ mem_desc_cmp(const void *a, const void *b) } static void -mem_region_show(struct sbuf *sb, const char *name, unsigned int from, - unsigned int to) +mem_region_show(struct sbuf *sb, const char *name, uint64_t from, uint64_t to) { - unsigned int size; + uintmax_t size; if (from == to) return; @@ -10062,8 +10061,12 @@ mem_region_show(struct sbuf *sb, const char *name, unsigned int from, if (size == 0) return; - /* XXX: need humanize_number(3) in libkern for a more readable 'size' */ - sbuf_printf(sb, "%-15s %#x-%#x [%u]\n", name, from, to, size); + if (from > UINT32_MAX || to > UINT32_MAX) + sbuf_printf(sb, "%-18s 0x%012jx-0x%012jx [%ju]\n", name, + (uintmax_t)from, (uintmax_t)to, size); + else + sbuf_printf(sb, "%-18s 0x%08jx-0x%08jx [%ju]\n", name, + (uintmax_t)from, (uintmax_t)to, size); } static int @@ -10071,7 +10074,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; struct sbuf *sb; - int rc, i, n; + int rc, i, n, nchan; uint32_t lo, hi, used, free, alloc; static const char *memory[] = { "EDC0:", "EDC1:", "MC:", "MC0:", "MC1:", "HMA:" @@ -10082,12 +10085,14 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) "Tx payload:", "Rx payload:", "LE hash:", "iSCSI region:", "TDDP region:", "TPT region:", "STAG region:", "RQ region:", "RQUDP region:", "PBL region:", "TXPBL region:", - "TLSKey region:", "DBVFIFO region:", "ULPRX state:", - "ULPTX state:", "On-chip queues:", + "TLSKey region:", "RRQ region:", "NVMe STAG region:", + "NVMe RQ region:", "NVMe RXPBL region:", "NVMe TPT region:", + "NVMe TXPBL region:", "DBVFIFO region:", "ULPRX state:", + "ULPTX state:", "RoCE RRQ region:", "On-chip queues:", }; struct mem_desc avail[4]; struct mem_desc mem[nitems(region) + 3]; /* up to 3 holes */ - struct mem_desc *md = mem; + struct mem_desc *md; rc = sysctl_wire_old_buffer(req, 0); if (rc != 0) @@ -10113,36 +10118,91 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) lo = t4_read_reg(sc, A_MA_TARGET_MEM_ENABLE); if (lo & F_EDRAM0_ENABLE) { hi = t4_read_reg(sc, A_MA_EDRAM0_BAR); - avail[i].base = G_EDRAM0_BASE(hi) << 20; - avail[i].limit = avail[i].base + (G_EDRAM0_SIZE(hi) << 20); + if (chip_id(sc) >= CHELSIO_T7) { + avail[i].base = (uint64_t)G_T7_EDRAM0_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_T7_EDRAM0_SIZE(hi) << 20); + } else { + avail[i].base = (uint64_t)G_EDRAM0_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_EDRAM0_SIZE(hi) << 20); + } avail[i].idx = 0; i++; } if (lo & F_EDRAM1_ENABLE) { hi = t4_read_reg(sc, A_MA_EDRAM1_BAR); - avail[i].base = G_EDRAM1_BASE(hi) << 20; - avail[i].limit = avail[i].base + (G_EDRAM1_SIZE(hi) << 20); + if (chip_id(sc) >= CHELSIO_T7) { + avail[i].base = (uint64_t)G_T7_EDRAM1_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_T7_EDRAM1_SIZE(hi) << 20); + } else { + avail[i].base = (uint64_t)G_EDRAM1_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_EDRAM1_SIZE(hi) << 20); + } avail[i].idx = 1; i++; } if (lo & F_EXT_MEM_ENABLE) { - hi = t4_read_reg(sc, A_MA_EXT_MEMORY_BAR); - avail[i].base = G_EXT_MEM_BASE(hi) << 20; - avail[i].limit = avail[i].base + (G_EXT_MEM_SIZE(hi) << 20); - avail[i].idx = is_t5(sc) ? 3 : 2; /* Call it MC0 for T5 */ + switch (chip_id(sc)) { + case CHELSIO_T4: + case CHELSIO_T6: + hi = t4_read_reg(sc, A_MA_EXT_MEMORY_BAR); + avail[i].base = (uint64_t)G_EXT_MEM_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_EXT_MEM_SIZE(hi) << 20); + avail[i].idx = 2; + break; + case CHELSIO_T5: + hi = t4_read_reg(sc, A_MA_EXT_MEMORY0_BAR); + avail[i].base = (uint64_t)G_EXT_MEM0_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_EXT_MEM0_SIZE(hi) << 20); + avail[i].idx = 3; /* Call it MC0 for T5 */ + break; + default: + hi = t4_read_reg(sc, A_MA_EXT_MEMORY0_BAR); + avail[i].base = (uint64_t)G_T7_EXT_MEM0_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_T7_EXT_MEM0_SIZE(hi) << 20); + avail[i].idx = 3; /* Call it MC0 for T7+ */ + break; + } i++; } - if (is_t5(sc) && lo & F_EXT_MEM1_ENABLE) { + if (lo & F_EXT_MEM1_ENABLE && !(lo & F_MC_SPLIT)) { + /* Only T5 and T7+ have 2 MCs. */ + MPASS(is_t5(sc) || chip_id(sc) >= CHELSIO_T7); + hi = t4_read_reg(sc, A_MA_EXT_MEMORY1_BAR); - avail[i].base = G_EXT_MEM1_BASE(hi) << 20; - avail[i].limit = avail[i].base + (G_EXT_MEM1_SIZE(hi) << 20); + if (chip_id(sc) >= CHELSIO_T7) { + avail[i].base = (uint64_t)G_T7_EXT_MEM1_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_T7_EXT_MEM1_SIZE(hi) << 20); + } else { + avail[i].base = (uint64_t)G_EXT_MEM1_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_EXT_MEM1_SIZE(hi) << 20); + } avail[i].idx = 4; i++; } - if (is_t6(sc) && lo & F_HMA_MUX) { - hi = t4_read_reg(sc, A_MA_EXT_MEMORY1_BAR); - avail[i].base = G_EXT_MEM1_BASE(hi) << 20; - avail[i].limit = avail[i].base + (G_EXT_MEM1_SIZE(hi) << 20); + if (lo & F_HMA_MUX) { + /* Only T6+ have HMA. */ + MPASS(chip_id(sc) >= CHELSIO_T6); + + if (chip_id(sc) >= CHELSIO_T7) { + hi = t4_read_reg(sc, A_MA_HOST_MEMORY_BAR); + avail[i].base = (uint64_t)G_HMATARGETBASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_T7_HMA_SIZE(hi) << 20); + } else { + hi = t4_read_reg(sc, A_MA_EXT_MEMORY1_BAR); + avail[i].base = G_EXT_MEM1_BASE(hi) << 20; + avail[i].limit = avail[i].base + + (G_EXT_MEM1_SIZE(hi) << 20); + } avail[i].idx = 5; i++; } @@ -10151,6 +10211,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) goto done; qsort(avail, i, sizeof(struct mem_desc), mem_desc_cmp); + md = &mem[0]; (md++)->base = t4_read_reg(sc, A_SGE_DBQ_CTXT_BADDR); (md++)->base = t4_read_reg(sc, A_SGE_IMSG_CTXT_BADDR); (md++)->base = t4_read_reg(sc, A_SGE_FLM_CACHE_BADDR); @@ -10186,22 +10247,52 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) } md++; -#define ulp_region(reg) \ - md->base = t4_read_reg(sc, A_ULP_ ## reg ## _LLIMIT);\ - (md++)->limit = t4_read_reg(sc, A_ULP_ ## reg ## _ULIMIT) +#define ulp_region(reg) do {\ + const u_int shift = chip_id(sc) >= CHELSIO_T7 ? 4 : 0; \ + md->base = (uint64_t)t4_read_reg(sc, A_ULP_ ## reg ## _LLIMIT) << shift; \ + md->limit = (uint64_t)t4_read_reg(sc, A_ULP_ ## reg ## _ULIMIT) << shift; \ + md->limit += (1 << shift) - 1; \ + md++; \ + } while (0) + +#define hide_ulp_region() do { \ + md->base = 0; \ + md->idx = nitems(region); \ + md++; \ + } while (0) ulp_region(RX_ISCSI); ulp_region(RX_TDDP); ulp_region(TX_TPT); ulp_region(RX_STAG); ulp_region(RX_RQ); - ulp_region(RX_RQUDP); + if (chip_id(sc) < CHELSIO_T7) + ulp_region(RX_RQUDP); + else + hide_ulp_region(); ulp_region(RX_PBL); ulp_region(TX_PBL); - if (sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS) { + if (chip_id(sc) >= CHELSIO_T6) ulp_region(RX_TLS_KEY); + else + hide_ulp_region(); + if (chip_id(sc) >= CHELSIO_T7) { + ulp_region(RX_RRQ); + ulp_region(RX_NVME_TCP_STAG); + ulp_region(RX_NVME_TCP_RQ); + ulp_region(RX_NVME_TCP_PBL); + ulp_region(TX_NVME_TCP_TPT); + ulp_region(TX_NVME_TCP_PBL); + } else { + hide_ulp_region(); + hide_ulp_region(); + hide_ulp_region(); + hide_ulp_region(); + hide_ulp_region(); + hide_ulp_region(); } #undef ulp_region +#undef hide_ulp_region md->base = 0; if (is_t4(sc)) @@ -10232,6 +10323,15 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) md->limit = 0; md++; + if (chip_id(sc) >= CHELSIO_T7) { + t4_tp_pio_read(sc, &lo, 1, A_TP_ROCE_RRQ_BASE, false); + md->base = lo; + } else { + md->base = 0; + md->idx = nitems(region); + } + md++; + md->base = sc->vres.ocq.start; if (sc->vres.ocq.size) md->limit = md->base + sc->vres.ocq.size - 1; @@ -10264,31 +10364,41 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) mem[i].limit); } - sbuf_printf(sb, "\n"); lo = t4_read_reg(sc, A_CIM_SDRAM_BASE_ADDR); hi = t4_read_reg(sc, A_CIM_SDRAM_ADDR_SIZE) + lo - 1; - mem_region_show(sb, "uP RAM:", lo, hi); + if (hi != lo - 1) { + sbuf_printf(sb, "\n"); + mem_region_show(sb, "uP RAM:", lo, hi); + } lo = t4_read_reg(sc, A_CIM_EXTMEM2_BASE_ADDR); hi = t4_read_reg(sc, A_CIM_EXTMEM2_ADDR_SIZE) + lo - 1; - mem_region_show(sb, "uP Extmem2:", lo, hi); + if (hi != lo - 1) + mem_region_show(sb, "uP Extmem2:", lo, hi); lo = t4_read_reg(sc, A_TP_PMM_RX_MAX_PAGE); - for (i = 0, free = 0; i < 2; i++) + if (chip_id(sc) >= CHELSIO_T7) + nchan = 1 << G_T7_PMRXNUMCHN(lo); + else + nchan = lo & F_PMRXNUMCHN ? 2 : 1; + for (i = 0, free = 0; i < nchan; i++) free += G_FREERXPAGECOUNT(t4_read_reg(sc, A_TP_FLM_FREE_RX_CNT)); sbuf_printf(sb, "\n%u Rx pages (%u free) of size %uKiB for %u channels\n", G_PMRXMAXPAGE(lo), free, - t4_read_reg(sc, A_TP_PMM_RX_PAGE_SIZE) >> 10, - (lo & F_PMRXNUMCHN) ? 2 : 1); + t4_read_reg(sc, A_TP_PMM_RX_PAGE_SIZE) >> 10, nchan); lo = t4_read_reg(sc, A_TP_PMM_TX_MAX_PAGE); hi = t4_read_reg(sc, A_TP_PMM_TX_PAGE_SIZE); - for (i = 0, free = 0; i < 4; i++) + if (chip_id(sc) >= CHELSIO_T7) + nchan = 1 << G_T7_PMTXNUMCHN(lo); + else + nchan = 1 << G_PMTXNUMCHN(lo); + for (i = 0, free = 0; i < nchan; i++) free += G_FREETXPAGECOUNT(t4_read_reg(sc, A_TP_FLM_FREE_TX_CNT)); sbuf_printf(sb, "%u Tx pages (%u free) of size %u%ciB for %u channels\n", G_PMTXMAXPAGE(lo), free, hi >= (1 << 20) ? (hi >> 20) : (hi >> 10), - hi >= (1 << 20) ? 'M' : 'K', 1 << G_PMTXNUMCHN(lo)); + hi >= (1 << 20) ? 'M' : 'K', nchan); sbuf_printf(sb, "%u p-structs (%u free)\n", t4_read_reg(sc, A_TP_CMM_MM_MAX_PSTRUCT), G_FREEPSTRUCTCOUNT(t4_read_reg(sc, A_TP_FLM_FREE_PS_CNT))); @@ -10305,7 +10415,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) used = G_USED(lo); alloc = G_ALLOC(lo); } - /* For T6 these are MAC buffer groups */ + /* For T6+ these are MAC buffer groups */ sbuf_printf(sb, "\nPort %d using %u pages out of %u allocated", i, used, alloc); } @@ -10321,7 +10431,7 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) used = G_USED(lo); alloc = G_ALLOC(lo); } - /* For T6 these are MAC buffer groups */ + /* For T6+ these are MAC buffer groups */ sbuf_printf(sb, "\nLoopback %d using %u pages out of %u allocated", i, used, alloc); From nobody Fri Oct 3 00:04:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86L3QDjz6BMy4; Fri, 03 Oct 2025 00:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86L0gJkz3s8c; Fri, 03 Oct 2025 00:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bkv4+spi4TRzx4dkU86PDK0GYbQL71E/uA2K0rhDGHg=; b=p9gmmVCh9l3EwtMG1QMDhJBlWte9T/eBKQLDFewgnvA1sL5+YrztpaepSKC4MRZEgRPSGk sVW0l3qRFaiBNVBfpJvhp6nWSEZP6bKD4+ZvVaqsRRrQJSmhDuNkZ/YRVU8f/ZR3e8cCjM 7Hn0jKTkH3Ma/fsYg9kmQsl3lfBQ0M7yJ+ZZgIWb6ZXKgo6hRhu6Ds33VtoEZEf7a6vRxb KeZhA5XkHPYaRnZy2XnWGk+Lu/awSDccysnqNOzgTFoqbZxsm8ZrNUUe3MDC4LaB7DTf0C Yh6XqX4JG/QcJuvlIOR9xJBN8nlo/+uxdfcZ/TyKErR4+BVnqdHOSKdkjxty6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bkv4+spi4TRzx4dkU86PDK0GYbQL71E/uA2K0rhDGHg=; b=P0lKAB8fdr38vBKj/J1kHA4yMH9UcEn8sJaF7gqrgv06cVcaKvjqoy1wSz/6HmmcocRpoE lQvfwdx+kDutZcXtX2Y6FCMI7LgHoGGFjs7iT/GuASizEDU8czxsmd40kLy9wMaJ82qItD CSkMAFaSPBCwlHJ/Gtlz+X3TyM8nUm01uCxDFLEIn3sNXa7tSakUDGzCZxyaNieb/I0gpV k1MKxpFtPZuGHRr3+8PMQiHCy9v+MO9RoGkBfBNQdSKj3gqgbqmLvrLupKDFmyhd3W/h8a RMCTmz/mI8EuivUIFoixvdyWi7rVgOit/YSCHPejkrTt5d9pbVjTYnEKk/WpQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449866; a=rsa-sha256; cv=none; b=wL4JMxFmQJiKf6Hp9zEwacL5QKxxkaoPAS7ytDbxBQmMcXQHKmiuZsE9B8CQIpkf0O5jfN 2FWUv2qwwItQSQuHaThKpzOD1x9hbOKdfNiVUNRfwdJMSgncn/n2oAubfBkG6C0pggmdBn haL3vveHlvwvEFjQ8SthUMyXjC6/RupFCMz7Jm4huWFl3N6XYtFoDTdO76jWmRMP3eT6ex 6kRHIVN/0gUCRck+ZQNTxBwQmj0ozAGeyE1usXOrWvj7y28IQ3KNf84R/QFAcT7R3oRGJe pzLrMuncrrdYVJba3lJBKu46gHabg73uC4U344M49jlhO3OsFHuYR6mPNbdfcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86L0FV9zVjP; Fri, 03 Oct 2025 00:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304P5C056880; Fri, 3 Oct 2025 00:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304PtZ056877; Fri, 3 Oct 2025 00:04:25 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:25 GMT Message-Id: <202510030004.59304PtZ056877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: bc81546ebb36 - stable/15 - cxgbe(4): Include T7 PMRX cache stats in the sysctl that shows PM stats List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: bc81546ebb3611873013b836b0a26f87e4219329 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=bc81546ebb3611873013b836b0a26f87e4219329 commit bc81546ebb3611873013b836b0a26f87e4219329 Author: Navdeep Parhar AuthorDate: 2025-09-29 08:32:08 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:05 +0000 cxgbe(4): Include T7 PMRX cache stats in the sysctl that shows PM stats Sponsored by: Chelsio Communications (cherry picked from commit fc7f27c31eee81c46f20991343799f017aa79948) --- sys/dev/cxgbe/t4_main.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index db7ed38b1f9f..f4366c9d6093 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -10976,6 +10976,7 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) int rc, i; uint32_t tx_cnt[MAX_PM_NSTATS], rx_cnt[MAX_PM_NSTATS]; uint64_t tx_cyc[MAX_PM_NSTATS], rx_cyc[MAX_PM_NSTATS]; + uint32_t stats[T7_PM_RX_CACHE_NSTATS]; static const char *tx_stats[MAX_PM_NSTATS] = { "Read:", "Write bypass:", "Write mem:", "Bypass + mem:", "Tx FIFO wait", NULL, "Tx latency" @@ -10992,12 +10993,14 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) else { t4_pmtx_get_stats(sc, tx_cnt, tx_cyc); t4_pmrx_get_stats(sc, rx_cnt, rx_cyc); + if (chip_id(sc) >= CHELSIO_T7) + t4_pmrx_cache_get_stats(sc, stats); } mtx_unlock(&sc->reg_lock); if (rc != 0) return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 256, req); + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -11032,6 +11035,61 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) rx_cyc[i]); } + if (chip_id(sc) >= CHELSIO_T7) { + i = 0; + sbuf_printf(sb, "\n\nPM RX Cache Stats\n"); + sbuf_printf(sb, "%-40s %u\n", "ReqWrite", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "ReqReadInv", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "ReqReadNoInv", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Write Split Request", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "Normal Read Split (Read Invalidate)", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "Feedback Read Split (Read NoInvalidate)", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Write Hit", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Normal Read Hit", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Feedback Read Hit", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Normal Read Hit Full Avail", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Normal Read Hit Full UnAvail", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "Normal Read Hit Partial Avail", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "FB Read Hit Full Avail", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "FB Read Hit Full UnAvail", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "FB Read Hit Partial Avail", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Normal Read Full Free", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "Normal Read Part-avail Mul-Regions", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "FB Read Part-avail Mul-Regions", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Write Miss FL Used", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Write Miss LRU Used", + stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "Write Miss LRU-Multiple Evict", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "Write Hit Increasing Islands", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", + "Normal Read Island Read split", stats[i++]); + sbuf_printf(sb, "%-40s %u\n", "Write Overflow Eviction", + stats[i++]); + sbuf_printf(sb, "%-40s %u", "Read Overflow Eviction", + stats[i++]); + } + rc = sbuf_finish(sb); sbuf_delete(sb); From nobody Fri Oct 3 00:04:24 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86K3pppz6BMy3; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86J6nwpz3s1N; Fri, 03 Oct 2025 00:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5+HsUT3AyFAegPSNbbU0VRFN5giX7WTbDnGWgfDRlhI=; b=sH74o+EpPm54Qnx5qcE5p2+gQFxlCCazrkq48XxKae822Z6S97wc6HylDdV8Imn0QFKmkr C8LdwGS45VBGCb270wtrHU6smqzU3uTt2M8gfOwZrTHw10UFej/5YEMLbjmE9EzveA4Yus h6kBnA3k7rwkHqfDOj8m5CGg5er9f18HVwnCAviqRw7EtMry/kVwncnV2UgvjqnCA6xtvJ TPtdyoD8ZxqMiORH+zxftZ4lLoE+N7f8e5t5XEYc2qZlXUc+opxf9VWzZvrpi5KAgRuDOh OEy3WK2Vz7rQ1wkVboilZRnysXLQfRCePgc/3QMKwVkMPCOUqaicW4sSBLSDyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5+HsUT3AyFAegPSNbbU0VRFN5giX7WTbDnGWgfDRlhI=; b=vJd/tNBQIjmOT041r97Wd1Z8Aa0054N0Tl1AuvQDZq2OM8nrNCoj2Ddk6Spx82RqrrhHxG oqfPYRL5sd7DdwnrVsoOzzxDj79n2kRGaxwa2C301siwqg86pQB8YIwLXIZBPzru6ETvnd ma3U6yBK8CU+9SPnvXmU9D/bEF/cWBTziUAJaqgoY8/wnIGeDXVNkDerARbqSWpYTQutGX S28Yg9TAyy0RhYc5Q6n4t6m6UVrH74uJ1oeIpLK+5ItT1hdsY8Mmdz38vk2Xa8I+SE72ks GYM3wWV1jbwnpXX4ActcYFvD+J0RRAfgAWbWq6Y8BXrA6v8SLGhsaOmO8RlrlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449865; a=rsa-sha256; cv=none; b=xjBsS9TgFkHitl0wfKJX3ZsY7gkeS2it8AMNBDJAZB8IgAihNUQqLSlgJhTr5oK34Uck2K bLtZWdMgbXb5kGS3SZa4D8CufuGiSprh/I6QPqIj5ehWkYFHCnU31v4sbH219/MFZ/VWjJ C5lSeOhjxyQIDkjEahgdU3BZ4Xby8AdYxBRG2eFbSN3mv8+z6CtcfBAgSEt8cyC6Vgzn2M P6nwzObs90k6yqNZ5NWFHO9cMYrFHAtgKhkn+S+EkpQKUuCLDTIOmnibYgv90csQIJQR3d 1auZIGSAknNih9TgjSVrwGrqf+WC5iVwTDg4a+0sasc9teLxaozZrT2UwfjINw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86J6L1VzVjN; Fri, 03 Oct 2025 00:04: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 59304Oow056847; Fri, 3 Oct 2025 00:04:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304OvV056844; Fri, 3 Oct 2025 00:04:24 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:24 GMT Message-Id: <202510030004.59304OvV056844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: bf23542a79c2 - stable/15 - cxgbe(4): Support for displaying T7 MPS TCAM entries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: bf23542a79c26f40d7abeec829cd96719d0edd70 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=bf23542a79c26f40d7abeec829cd96719d0edd70 commit bf23542a79c26f40d7abeec829cd96719d0edd70 Author: Navdeep Parhar AuthorDate: 2025-09-29 08:30:14 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:05 +0000 cxgbe(4): Support for displaying T7 MPS TCAM entries Sponsored by: Chelsio Communications (cherry picked from commit 6fa85bf1222672681f6f6bd1502cba752d7c5d5f) --- sys/dev/cxgbe/t4_main.c | 208 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 205 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 101215073385..db7ed38b1f9f 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -870,6 +870,7 @@ static int sysctl_linkdnrc(SYSCTL_HANDLER_ARGS); static int sysctl_meminfo(SYSCTL_HANDLER_ARGS); static int sysctl_mps_tcam(SYSCTL_HANDLER_ARGS); static int sysctl_mps_tcam_t6(SYSCTL_HANDLER_ARGS); +static int sysctl_mps_tcam_t7(SYSCTL_HANDLER_ARGS); static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS); static int sysctl_pm_stats(SYSCTL_HANDLER_ARGS); static int sysctl_rdma_stats(SYSCTL_HANDLER_ARGS); @@ -7904,7 +7905,8 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mps_tcam", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - chip_id(sc) <= CHELSIO_T5 ? sysctl_mps_tcam : sysctl_mps_tcam_t6, + chip_id(sc) >= CHELSIO_T7 ? sysctl_mps_tcam_t7 : + (chip_id(sc) >= CHELSIO_T6 ? sysctl_mps_tcam_t6 : sysctl_mps_tcam), "A", "MPS TCAM entries"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "path_mtus", @@ -10560,7 +10562,7 @@ sysctl_mps_tcam_t6(SYSCTL_HANDLER_ARGS) struct sbuf *sb; int rc, i; - MPASS(chip_id(sc) > CHELSIO_T5); + MPASS(chip_id(sc) == CHELSIO_T6); sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) @@ -10569,7 +10571,7 @@ sysctl_mps_tcam_t6(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, "Idx Ethernet address Mask VNI Mask" " IVLAN Vld DIP_Hit Lookup Port Vld Ports PF VF" " Replication" - " P0 P1 P2 P3 ML\n"); + " P0 P1 P2 P3 ML"); rc = 0; for (i = 0; i < sc->chip_params->mps_tcam_size; i++) { @@ -10733,6 +10735,206 @@ sysctl_mps_tcam_t6(SYSCTL_HANDLER_ARGS) return (rc); } +static int +sysctl_mps_tcam_t7(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + int rc, i; + + MPASS(chip_id(sc) >= CHELSIO_T7); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, "Idx Ethernet address Mask VNI Mask" + " IVLAN Vld DIP_Hit Lookup Port Vld Ports PF VF" + " Replication" + " P0 P1 P2 P3 ML"); + + rc = 0; + for (i = 0; i < sc->chip_params->mps_tcam_size; i++) { + uint8_t dip_hit, vlan_vld, lookup_type, port_num; + uint16_t ivlan; + uint64_t tcamx, tcamy, val, mask; + uint32_t cls_lo, cls_hi, ctl, data2, vnix, vniy; + uint8_t addr[ETHER_ADDR_LEN]; + + /* Read tcamy */ + ctl = (V_CTLREQID(1) | V_CTLCMDTYPE(0) | V_CTLXYBITSEL(0)); + if (chip_rev(sc) == 0) { + if (i < 256) + ctl |= V_CTLTCAMINDEX(i) | V_T7_CTLTCAMSEL(0); + else + ctl |= V_CTLTCAMINDEX(i - 256) | V_T7_CTLTCAMSEL(1); + } else { +#if 0 + ctl = (V_CTLREQID(1) | V_CTLCMDTYPE(0) | V_CTLXYBITSEL(0)); +#endif + if (i < 512) + ctl |= V_CTLTCAMINDEX(i) | V_T7_CTLTCAMSEL(0); + else if (i < 1024) + ctl |= V_CTLTCAMINDEX(i - 512) | V_T7_CTLTCAMSEL(1); + else + ctl |= V_CTLTCAMINDEX(i - 1024) | V_T7_CTLTCAMSEL(2); + } + + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + rc = ENXIO; + else { + t4_write_reg(sc, A_MPS_CLS_TCAM_DATA2_CTL, ctl); + val = t4_read_reg(sc, A_MPS_CLS_TCAM0_RDATA1_REQ_ID1); + tcamy = G_DMACH(val) << 32; + tcamy |= t4_read_reg(sc, A_MPS_CLS_TCAM0_RDATA0_REQ_ID1); + data2 = t4_read_reg(sc, A_MPS_CLS_TCAM0_RDATA2_REQ_ID1); + } + mtx_unlock(&sc->reg_lock); + if (rc != 0) + break; + + lookup_type = G_DATALKPTYPE(data2); + port_num = G_DATAPORTNUM(data2); + if (lookup_type && lookup_type != M_DATALKPTYPE) { + /* Inner header VNI */ + vniy = (((data2 & F_DATAVIDH2) | + G_DATAVIDH1(data2)) << 16) | G_VIDL(val); + dip_hit = data2 & F_DATADIPHIT; + vlan_vld = 0; + } else { + vniy = 0; + dip_hit = 0; + vlan_vld = data2 & F_DATAVIDH2; + ivlan = G_VIDL(val); + } + + ctl |= V_CTLXYBITSEL(1); + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + rc = ENXIO; + else { + t4_write_reg(sc, A_MPS_CLS_TCAM_DATA2_CTL, ctl); + val = t4_read_reg(sc, A_MPS_CLS_TCAM0_RDATA1_REQ_ID1); + tcamx = G_DMACH(val) << 32; + tcamx |= t4_read_reg(sc, A_MPS_CLS_TCAM0_RDATA0_REQ_ID1); + data2 = t4_read_reg(sc, A_MPS_CLS_TCAM0_RDATA2_REQ_ID1); + } + mtx_unlock(&sc->reg_lock); + if (rc != 0) + break; + + if (lookup_type && lookup_type != M_DATALKPTYPE) { + /* Inner header VNI mask */ + vnix = (((data2 & F_DATAVIDH2) | + G_DATAVIDH1(data2)) << 16) | G_VIDL(val); + } else + vnix = 0; + + if (tcamx & tcamy) + continue; + tcamxy2valmask(tcamx, tcamy, addr, &mask); + + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + rc = ENXIO; + else { + if (chip_rev(sc) == 0) { + cls_lo = t4_read_reg(sc, MPS_CLS_SRAM_L(i)); + cls_hi = t4_read_reg(sc, MPS_CLS_SRAM_H(i)); + } else { + t4_write_reg(sc, A_MPS_CLS_SRAM_H, + V_SRAMWRN(0) | V_SRAMINDEX(i)); + cls_lo = t4_read_reg(sc, A_MPS_CLS_SRAM_L); + cls_hi = t4_read_reg(sc, A_MPS_CLS_SRAM_H); + } + } + mtx_unlock(&sc->reg_lock); + if (rc != 0) + break; + + if (lookup_type && lookup_type != M_DATALKPTYPE) { + sbuf_printf(sb, "\n%3u %02x:%02x:%02x:%02x:%02x:%02x " + "%012jx %06x %06x - - %3c" + " I %4x %3c %#x%4u%4d", i, addr[0], + addr[1], addr[2], addr[3], addr[4], addr[5], + (uintmax_t)mask, vniy, vnix, dip_hit ? 'Y' : 'N', + port_num, cls_lo & F_T6_SRAM_VLD ? 'Y' : 'N', + G_PORTMAP(cls_hi), G_T6_PF(cls_lo), + cls_lo & F_T6_VF_VALID ? G_T6_VF(cls_lo) : -1); + } else { + sbuf_printf(sb, "\n%3u %02x:%02x:%02x:%02x:%02x:%02x " + "%012jx - - ", i, addr[0], addr[1], + addr[2], addr[3], addr[4], addr[5], + (uintmax_t)mask); + + if (vlan_vld) + sbuf_printf(sb, "%4u Y ", ivlan); + else + sbuf_printf(sb, " - N "); + + sbuf_printf(sb, "- %3c %4x %3c %#x%4u%4d", + lookup_type ? 'I' : 'O', port_num, + cls_lo & F_T6_SRAM_VLD ? 'Y' : 'N', + G_PORTMAP(cls_hi), G_T6_PF(cls_lo), + cls_lo & F_T6_VF_VALID ? G_T6_VF(cls_lo) : -1); + } + + if (cls_lo & F_T6_REPLICATE) { + struct fw_ldst_cmd ldst_cmd; + + memset(&ldst_cmd, 0, sizeof(ldst_cmd)); + ldst_cmd.op_to_addrspace = + htobe32(V_FW_CMD_OP(FW_LDST_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ | + V_FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_MPS)); + ldst_cmd.cycles_to_len16 = htobe32(FW_LEN16(ldst_cmd)); + ldst_cmd.u.mps.rplc.fid_idx = + htobe16(V_FW_LDST_CMD_FID(FW_LDST_MPS_RPLC) | + V_FW_LDST_CMD_IDX(i)); + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, + "t6mps"); + if (rc) + break; + if (hw_off_limits(sc)) + rc = ENXIO; + else + rc = -t4_wr_mbox(sc, sc->mbox, &ldst_cmd, + sizeof(ldst_cmd), &ldst_cmd); + end_synchronized_op(sc, 0); + if (rc != 0) + break; + else { + sbuf_printf(sb, " %08x %08x %08x %08x" + " %08x %08x %08x %08x", + be32toh(ldst_cmd.u.mps.rplc.rplc255_224), + be32toh(ldst_cmd.u.mps.rplc.rplc223_192), + be32toh(ldst_cmd.u.mps.rplc.rplc191_160), + be32toh(ldst_cmd.u.mps.rplc.rplc159_128), + be32toh(ldst_cmd.u.mps.rplc.rplc127_96), + be32toh(ldst_cmd.u.mps.rplc.rplc95_64), + be32toh(ldst_cmd.u.mps.rplc.rplc63_32), + be32toh(ldst_cmd.u.mps.rplc.rplc31_0)); + } + } else + sbuf_printf(sb, "%72s", ""); + + sbuf_printf(sb, "%4u%3u%3u%3u %#x", + G_T6_SRAM_PRIO0(cls_lo), G_T6_SRAM_PRIO1(cls_lo), + G_T6_SRAM_PRIO2(cls_lo), G_T6_SRAM_PRIO3(cls_lo), + (cls_lo >> S_T6_MULTILISTEN0) & 0xf); + } + + if (rc) + (void) sbuf_finish(sb); + else + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + static int sysctl_path_mtus(SYSCTL_HANDLER_ARGS) { From nobody Fri Oct 3 00:04:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86N66ycz6BMvW; Fri, 03 Oct 2025 00:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86N2TKdz3sLl; Fri, 03 Oct 2025 00:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ssHry5bvxPl0B+6FoIehiAlsLg05g0sw38vFOthBBjU=; b=EKqD2LNSBPk2YuImRSW1NwYs3PKYxaee2e9yoF0tgOZ1LWx84lQm2rf5T7Fp5iRwAQ0UNS NuY/oHQ5lFrA+OdDsQBkgIw5ayCUvMSjQvLl/UFrga56Vm3FW6Khb4ov3jzbi9iIJAIqyY R9yFVmLHxqMohMxl2GABfjmi3wkPUW8TkKr80IGHDv78PhcN3DodkNzA+E4eHBKBhQE2Rx PLr9uqi6c+K/ipBAjnsi63geM8RY67Kx50GIumlc6e6/wNnpwpT/GF/k5HvsEEAb1BAepi JcqXEHjM6Cuc0o/Snw5TTFRPzFucjh9KYmjD6BFYD6Am96htcW70vq6NCNeN+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ssHry5bvxPl0B+6FoIehiAlsLg05g0sw38vFOthBBjU=; b=eFcFFhZfPu1TeD1sv7owOfvSs+q3yfQe4MusNmAx0wOKTEHjnEtluAUtKJdADuyKCmLaYx K/2iwpEeac8m+NPj5JrghFXdUf8d0Bt9eV2eW2wY3vIRWZm5nhV7XP8S5yqDIoE4eoZBn6 DDi1yzPstbUOPfykpZJG7mDqLQa91VWxWIx8t3SVQc88uM5bi4GSNu47BuJa8zeg9V5hP6 TC6eIy9s5p1H+MfeoqO6PNusvwYRabhE2IJxbfPvA7hpmiXyUiwZ+drIPZGLr3E4TMNh5c Aa5dlaVg5WaBJlQLcAGlgnFRV5b7yfdN7q7amREuKhIt4DgwgTVri1OnF++Y3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449868; a=rsa-sha256; cv=none; b=lNRYplBR0rucivszVx1Iq4kiYI5YzqhVqAGnEWQ/bQUiix//GLdy6Yy7wa/XmmX2Ek8npS HUTyIPqWjEn91yc4d2hAA3YZ0wLzCEvwLYI8AlV+0OcTRWiYxai2C4jcxEZ8tZO4Kem0oE NM2St90RS2ShOHcCiGS25eIC6YK1rCPdQ1NhkVA6YKm9jGlUm2JpN54+7ivT6MQRx93mj8 7McAVgjbyyIB5QVBn5Aw3M7Ya04gFCEqx8cJlv/7V9QDAlftIRrgxvWYV7P5n+P2khLIdX R4K//bfP8b0VrINNDw24C7as5fbo8q0EJP4RHv/Lmrja25jAQZKJDWsXViJvHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86N1wqYzVcq; Fri, 03 Oct 2025 00:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304Svk056951; Fri, 3 Oct 2025 00:04:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304Stw056948; Fri, 3 Oct 2025 00:04:28 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:28 GMT Message-Id: <202510030004.59304Stw056948@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: c99a025159a0 - stable/15 - cxgbe(4): Congestion manager context settings for T7 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c99a025159a0aa2d5ac9a1785e3fc7e92a4f6b89 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c99a025159a0aa2d5ac9a1785e3fc7e92a4f6b89 commit c99a025159a0aa2d5ac9a1785e3fc7e92a4f6b89 Author: Navdeep Parhar AuthorDate: 2025-09-29 08:43:28 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:05 +0000 cxgbe(4): Congestion manager context settings for T7 Sponsored by: Chelsio Communications (cherry picked from commit c392b5a9e44b9c8a0173a4e2c1fb87ee88f4aa3f) --- sys/dev/cxgbe/t4_netmap.c | 7 +++++-- sys/dev/cxgbe/t4_sge.c | 27 +++++++++++++++++++-------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index ddd7d974aa48..12aaca6ee77a 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -276,7 +276,7 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq) static int alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq) { - int rc, cntxt_id; + int rc, cntxt_id, cong_map; __be32 v; struct adapter *sc = vi->adapter; struct port_info *pi = vi->pi; @@ -284,7 +284,6 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq) struct netmap_adapter *na = NA(vi->ifp); struct fw_iq_cmd c; const int cong_drop = nm_cong_drop; - const int cong_map = pi->rx_e_chan_map; MPASS(na != NULL); MPASS(nm_rxq->iq_desc != NULL); @@ -321,6 +320,10 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq) c.iqsize = htobe16(vi->qsize_rxq); c.iqaddr = htobe64(nm_rxq->iq_ba); if (cong_drop != -1) { + if (chip_id(sc) >= CHELSIO_T7) + cong_map = 1 << pi->hw_port; + else + cong_map = pi->rx_e_chan_map; c.iqns_to_fl0congen = htobe32(F_FW_IQ_CMD_IQFLINTCONGEN | V_FW_IQ_CMD_FL0CNGCHMAP(cong_map) | F_FW_IQ_CMD_FL0CONGCIF | F_FW_IQ_CMD_FL0CONGEN); diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 4aa2b7236979..ce506f6c9192 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -3586,7 +3586,13 @@ alloc_iq_fl_hwq(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl) c.iqaddr = htobe64(iq->ba); c.iqns_to_fl0congen = htobe32(V_FW_IQ_CMD_IQTYPE(iq->qtype)); if (iq->cong_drop != -1) { - cong_map = iq->qtype == IQ_ETH ? pi->rx_e_chan_map : 0; + if (iq->qtype == IQ_ETH) { + if (chip_id(sc) >= CHELSIO_T7) + cong_map = 1 << pi->hw_port; + else + cong_map = pi->rx_e_chan_map; + } else + cong_map = 0; c.iqns_to_fl0congen |= htobe32(F_FW_IQ_CMD_IQFLINTCONGEN); } @@ -3939,14 +3945,19 @@ t4_sge_set_conm_context(struct adapter *sc, int cntxt_id, int cong_drop, param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_CONM_CTXT) | V_FW_PARAMS_PARAM_YZ(cntxt_id); - val = V_CONMCTXT_CNGTPMODE(cong_mode); - if (cong_mode == X_CONMCTXT_CNGTPMODE_CHANNEL || - cong_mode == X_CONMCTXT_CNGTPMODE_BOTH) { - for (i = 0, ch_map = 0; i < 4; i++) { - if (cong_map & (1 << i)) - ch_map |= 1 << (i << cng_ch_bits_log); + if (chip_id(sc) >= CHELSIO_T7) { + val = V_T7_DMAQ_CONM_CTXT_CNGTPMODE(cong_mode) | + V_T7_DMAQ_CONM_CTXT_CH_VEC(cong_map); + } else { + val = V_CONMCTXT_CNGTPMODE(cong_mode); + if (cong_mode == X_CONMCTXT_CNGTPMODE_CHANNEL || + cong_mode == X_CONMCTXT_CNGTPMODE_BOTH) { + for (i = 0, ch_map = 0; i < 4; i++) { + if (cong_map & (1 << i)) + ch_map |= 1 << (i << cng_ch_bits_log); + } + val |= V_CONMCTXT_CNGCHMAP(ch_map); } - val |= V_CONMCTXT_CNGCHMAP(ch_map); } rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); if (rc != 0) { From nobody Fri Oct 3 00:04:27 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86M5bQ2z6BMf1; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86M1vPJz3s8v; Fri, 03 Oct 2025 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P0fDIjcnmJEOrdBQPxFB+8nNQyzIO3qG0iYaqIUO7L4=; b=S3pLUSzNysymcaTHT3KkzEhx+7k8U8jRdQKbu8up6Qb1HoNPA3eylx8nuE3Z16006+of0n fZ4X7YQHmmZIdtordEmWWMmvqtY7pXfjsu2ZGDnPZm+AnH4Vy3L67PJaGtj6rDghtNAJwU 4+SuBCh98KRvyc9q/wkmem4SjlIE4roCH7Dy7lByb6w4qE+vjPvOYRYYYww/+LczmW0xsI nooqS7+PmgWzJMLR9ho58nh3J42kcsnh6xbGgbuD0oDK3fCSPtLHwWOAUz9SDjYqD6/02e OUN3L4Y+Jh7xX4d8vzFzfZYg6SyDSU3QCUAyTKhyjjjV2OjG1tc2eh7GkduYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P0fDIjcnmJEOrdBQPxFB+8nNQyzIO3qG0iYaqIUO7L4=; b=G3XPtvrzTP6hErltACNlcDbbpsKug3cs15SpEl3nNHlrvs1cw3quzAueA7IpBUW5x0+HR8 Cm3/75LRpg37wADdt+ZjrZc9j4m40ImBe0dIEbvFgy1qJ3Fwn9nmGrs91FhtrbJj6ro9ZD kCWw+MyVL58sffp+f2hcS22wMaKaiyevWIrm4eU3h+nHPEDn0WyzV8VQ+KQuurGj4dRw4k vvh/KPngc3wNRQ4CZaEmStPgiSYIBAsZ45eWQhLv48y1h6AFd2C0eGEwxIonid+5NwEEva IMM+eBBbKM1x/xZK2tWMF9LF9r0OZfYwQidAvqCuuDuzBNE0H0GRcnRgZmlX9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449867; a=rsa-sha256; cv=none; b=WAiFaVHzwmAawThCKcUVIKfg5tMUkYCLUC8wHpgfQvbWx//RzCdF5jq+uc7uLIWClX66M1 bixCnZHTe46Ux77Ny92HqIT660Oe2PSlSzhXOy5J3xFseE96ZLdz/JrwBrEbEwUATQp7Pc vZ0XEDFZ8dhKLulnP9SjcspMU1d0vf6vFPH8cW15a4u12VeXCSpoKGcrVttbh1dp+vV7RY VuNyeRl5RcwbLJgUb6BJXBIYTL7Yl11u2Q4aoohFR5oflOmFioWv16v6MqDcHw2vylH281 NS+BLt4sr0y6Y5Y6EpI66yQ2gyl9864VsWaqYNmgtv5ptw1JmN4cEBo7IPCHkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86M1Gs2zVfc; Fri, 03 Oct 2025 00:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304RIN056913; Fri, 3 Oct 2025 00:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304Roc056910; Fri, 3 Oct 2025 00:04:27 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:27 GMT Message-Id: <202510030004.59304Roc056910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: ddc8cd405318 - stable/15 - cxgbe(4): T7's SGE context has 4 more bytes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ddc8cd405318d784450d2b0fca012186299e963f Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=ddc8cd405318d784450d2b0fca012186299e963f commit ddc8cd405318d784450d2b0fca012186299e963f Author: Navdeep Parhar AuthorDate: 2025-09-29 08:36:34 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:05 +0000 cxgbe(4): T7's SGE context has 4 more bytes Sponsored by: Chelsio Communications (cherry picked from commit d4fb12583adc0690ae102c47d08598b3dbb06384) --- sys/dev/cxgbe/t4_ioctl.h | 9 +++++++++ sys/dev/cxgbe/t4_main.c | 34 +++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/t4_ioctl.h b/sys/dev/cxgbe/t4_ioctl.h index ba9a17dbaddf..4698986c0a0e 100644 --- a/sys/dev/cxgbe/t4_ioctl.h +++ b/sys/dev/cxgbe/t4_ioctl.h @@ -64,6 +64,7 @@ enum { T4_SET_FILTER_MASK, /* set filter mask (hashfilter mode) */ T4_HOLD_CLIP_ADDR, /* add ref on an IP in the CLIP */ T4_RELEASE_CLIP_ADDR, /* remove ref from an IP in the CLIP */ + T4_GET_SGE_CTXT, /* get SGE context for a queue */ }; struct t4_reg { @@ -322,6 +323,7 @@ struct t4_sched_queue { }; #define T4_SGE_CONTEXT_SIZE 24 +#define T7_SGE_CONTEXT_SIZE 28 enum { SGE_CONTEXT_EGRESS, SGE_CONTEXT_INGRESS, @@ -335,6 +337,12 @@ struct t4_sge_context { uint32_t data[T4_SGE_CONTEXT_SIZE / 4]; }; +struct t4_sge_ctxt { + uint32_t mem_id; + uint32_t cid; + uint32_t data[T7_SGE_CONTEXT_SIZE / 4]; +}; + struct t4_mem_range { uint32_t addr; uint32_t len; @@ -444,4 +452,5 @@ struct t4_clip_addr { #define CHELSIO_T4_SET_FILTER_MASK _IOW('f', T4_SET_FILTER_MASK, uint32_t) #define CHELSIO_T4_HOLD_CLIP_ADDR _IOW('f', T4_HOLD_CLIP_ADDR, struct t4_clip_addr) #define CHELSIO_T4_RELEASE_CLIP_ADDR _IOW('f', T4_RELEASE_CLIP_ADDR, struct t4_clip_addr) +#define CHELSIO_T4_GET_SGE_CTXT _IOWR('f', T4_GET_SGE_CTXT, struct t4_sge_ctxt) #endif diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index f4366c9d6093..47d72175b3fa 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -895,7 +895,7 @@ static int sysctl_tp_backoff(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx_ofld(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_pktc_idx_ofld(SYSCTL_HANDLER_ARGS); #endif -static int get_sge_context(struct adapter *, struct t4_sge_context *); +static int get_sge_context(struct adapter *, int, uint32_t, int, uint32_t *); static int load_fw(struct adapter *, struct t4_data *); static int load_cfg(struct adapter *, struct t4_data *); static int load_boot(struct adapter *, struct t4_bootrom *); @@ -12100,15 +12100,17 @@ sysctl_holdoff_pktc_idx_ofld(SYSCTL_HANDLER_ARGS) #endif static int -get_sge_context(struct adapter *sc, struct t4_sge_context *cntxt) +get_sge_context(struct adapter *sc, int mem_id, uint32_t cid, int len, + uint32_t *data) { int rc; - if (cntxt->cid > M_CTXTQID) + if (len < sc->chip_params->sge_ctxt_size) + return (ENOBUFS); + if (cid > M_CTXTQID) return (EINVAL); - - if (cntxt->mem_id != CTXT_EGRESS && cntxt->mem_id != CTXT_INGRESS && - cntxt->mem_id != CTXT_FLM && cntxt->mem_id != CTXT_CNM) + if (mem_id != CTXT_EGRESS && mem_id != CTXT_INGRESS && + mem_id != CTXT_FLM && mem_id != CTXT_CNM) return (EINVAL); rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4ctxt"); @@ -12121,8 +12123,7 @@ get_sge_context(struct adapter *sc, struct t4_sge_context *cntxt) } if (sc->flags & FW_OK) { - rc = -t4_sge_ctxt_rd(sc, sc->mbox, cntxt->cid, cntxt->mem_id, - &cntxt->data[0]); + rc = -t4_sge_ctxt_rd(sc, sc->mbox, cid, mem_id, data); if (rc == 0) goto done; } @@ -12131,7 +12132,7 @@ get_sge_context(struct adapter *sc, struct t4_sge_context *cntxt) * Read via firmware failed or wasn't even attempted. Read directly via * the backdoor. */ - rc = -t4_sge_ctxt_rd_bd(sc, cntxt->cid, cntxt->mem_id, &cntxt->data[0]); + rc = -t4_sge_ctxt_rd_bd(sc, cid, mem_id, data); done: end_synchronized_op(sc, 0); return (rc); @@ -12895,9 +12896,13 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, case CHELSIO_T4_DEL_FILTER: rc = del_filter(sc, (struct t4_filter *)data); break; - case CHELSIO_T4_GET_SGE_CONTEXT: - rc = get_sge_context(sc, (struct t4_sge_context *)data); + case CHELSIO_T4_GET_SGE_CONTEXT: { + struct t4_sge_context *ctxt = (struct t4_sge_context *)data; + + rc = get_sge_context(sc, ctxt->mem_id, ctxt->cid, + sizeof(ctxt->data), &ctxt->data[0]); break; + } case CHELSIO_T4_LOAD_FW: rc = load_fw(sc, (struct t4_data *)data); break; @@ -12943,6 +12948,13 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, case CHELSIO_T4_RELEASE_CLIP_ADDR: rc = release_clip_addr(sc, (struct t4_clip_addr *)data); break; + case CHELSIO_T4_GET_SGE_CTXT: { + struct t4_sge_ctxt *ctxt = (struct t4_sge_ctxt *)data; + + rc = get_sge_context(sc, ctxt->mem_id, ctxt->cid, + sizeof(ctxt->data), &ctxt->data[0]); + break; + } default: rc = ENOTTY; } From nobody Fri Oct 3 00:04:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86Q1NnCz6BN1Q; Fri, 03 Oct 2025 00:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86P3RR1z3sQ0; Fri, 03 Oct 2025 00:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xrnFusm0ExLH31jqJQYJzRL5DWc5fSjILpGo4rlE7F4=; b=k0wE0CqKb7f14YUxWDZEE18sx7IRTsv5i7agpZds1LjD2Opyn/tdrLH2zD27MCMVhW54L+ XZHZyq6rTHIRjY/xRq4uZ3qs+lKccuW68gmbP71hrf+387hlTdUGVe1NmRlfA2gsYNkSct KfCJKeXp3lCgMRICRgUYMU9jw9qkL7E9mg42dzsUcrTSM8Hp+4VRxXrfVAmCAIT4XsdrVk pCTVUg79B04gBaEBhJgKn8K8UKb+UPNnps+khU9feNuEr9DDkBY8snztUx5erNpjI51SwI xtCO5KqdznfBryjPd9oo6/lO4eniuWrJdv58MwJoNrF5W4mPqGpvqJnjQUvCWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xrnFusm0ExLH31jqJQYJzRL5DWc5fSjILpGo4rlE7F4=; b=x9pLfU0v9EON+Hmg6axmMw7mSXs28bNF6CRlxjCfC6Oul4MCQg4URw/9jEieqtVzokinim jK1CuO37j8EQietgcsjOR4F5RA1vwlDLvooT2aTyv5koCYMa7v+ZbJ50kqO0xabwsbi3G3 V7IZ7PeVM3FtoqJljze2m+6DMVHJKqa1OvL13QaAGo1jdHbGaTT9WKZ/3qWP1vgnDWProF xwoew1xCQiIwMt8kX3StJR9u1obE9Jqor5wsb7Tc1dX758nEJXkakEExlVivvlhLlta8k6 wGq8fFY+UJwesAO3FLBd4FFeFI8xnbNrtdCA7N5bq8a80fynmPmjL62LuqJOjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449869; a=rsa-sha256; cv=none; b=Pu7/G5WKf3Xeu8vbnbA2Ih9AKZwIODW7nxP5bpCZ30uOz4E6OBQ7Dw0YeXxbXfywiyYG9m G/CmoKciIjNZtbi9/JYTdPqIJRf72nbTGIDHrk9OBqhUwTNsoYZEDb23J2XktZFM6GpPAC qz6gAnRz2LLlClozFCPoKVXRVipK2EW4zWZ3rP6qOubdJzVf+6i1Dl+5Nso1BVSHQ8xVwD hi2+HNRFA7/fHssQQog9jysy14ooxRYjwzDdx4fVufprGixgTTEOr9vQ+1l5+eHXge1frz DWeEvno8kJNjKmhHTIKc1/NvwI+CoJX+isM2fu7zNVlIjP7MJBwgOjxDDSaFJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86P2psbzVjQ; Fri, 03 Oct 2025 00:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304TKF056987; Fri, 3 Oct 2025 00:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304TLU056984; Fri, 3 Oct 2025 00:04:29 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:29 GMT Message-Id: <202510030004.59304TLU056984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 5d7656a4db58 - stable/15 - cxgbe(4): Recognize the new capabilities reported by T7 firmwares List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 5d7656a4db586fb3dbb353f2ccc852eb0f2e9ac8 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=5d7656a4db586fb3dbb353f2ccc852eb0f2e9ac8 commit 5d7656a4db586fb3dbb353f2ccc852eb0f2e9ac8 Author: Navdeep Parhar AuthorDate: 2025-09-29 08:51:20 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:05 +0000 cxgbe(4): Recognize the new capabilities reported by T7 firmwares Sponsored by: Chelsio Communications (cherry picked from commit cfcf1394efb90ff05cd8acce7805145ff93ecac5) --- sys/dev/cxgbe/adapter.h | 1 + sys/dev/cxgbe/t4_main.c | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 5abe0de7664f..36c3b48cccbd 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -990,6 +990,7 @@ struct adapter { uint16_t nbmcaps; uint16_t linkcaps; uint16_t switchcaps; + uint16_t nvmecaps; uint16_t niccaps; uint16_t toecaps; uint16_t rdmacaps; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 47d72175b3fa..f094fd8f1de9 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -609,6 +609,10 @@ static int t4_switchcaps_allowed = FW_CAPS_CONFIG_SWITCH_INGRESS | SYSCTL_INT(_hw_cxgbe, OID_AUTO, switchcaps_allowed, CTLFLAG_RDTUN, &t4_switchcaps_allowed, 0, "Default switch capabilities"); +static int t4_nvmecaps_allowed = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, nvmecaps_allowed, CTLFLAG_RDTUN, + &t4_nvmecaps_allowed, 0, "Default NVMe capabilities"); + #ifdef RATELIMIT static int t4_niccaps_allowed = FW_CAPS_CONFIG_NIC | FW_CAPS_CONFIG_NIC_HASHFILTER | FW_CAPS_CONFIG_NIC_ETHOFLD; @@ -2254,6 +2258,7 @@ struct adapter_pre_reset_state { uint16_t nbmcaps; uint16_t linkcaps; uint16_t switchcaps; + uint16_t nvmecaps; uint16_t niccaps; uint16_t toecaps; uint16_t rdmacaps; @@ -2285,6 +2290,7 @@ save_caps_and_params(struct adapter *sc, struct adapter_pre_reset_state *o) o->nbmcaps = sc->nbmcaps; o->linkcaps = sc->linkcaps; o->switchcaps = sc->switchcaps; + o->nvmecaps = sc->nvmecaps; o->niccaps = sc->niccaps; o->toecaps = sc->toecaps; o->rdmacaps = sc->rdmacaps; @@ -2323,6 +2329,7 @@ compare_caps_and_params(struct adapter *sc, struct adapter_pre_reset_state *o) COMPARE_CAPS(nbm); COMPARE_CAPS(link); COMPARE_CAPS(switch); + COMPARE_CAPS(nvme); COMPARE_CAPS(nic); COMPARE_CAPS(toe); COMPARE_CAPS(rdma); @@ -5232,6 +5239,7 @@ struct caps_allowed { uint16_t nbmcaps; uint16_t linkcaps; uint16_t switchcaps; + uint16_t nvmecaps; uint16_t niccaps; uint16_t toecaps; uint16_t rdmacaps; @@ -5335,6 +5343,7 @@ apply_cfg_and_initialize(struct adapter *sc, char *cfg_file, LIMIT_CAPS(nbm); LIMIT_CAPS(link); LIMIT_CAPS(switch); + LIMIT_CAPS(nvme); LIMIT_CAPS(nic); LIMIT_CAPS(toe); LIMIT_CAPS(rdma); @@ -5400,6 +5409,7 @@ partition_resources(struct adapter *sc) COPY_CAPS(nbm); COPY_CAPS(link); COPY_CAPS(switch); + COPY_CAPS(nvme); COPY_CAPS(nic); COPY_CAPS(toe); COPY_CAPS(rdma); @@ -5726,6 +5736,7 @@ get_params__post_init(struct adapter *sc) READ_CAPS(nbmcaps); READ_CAPS(linkcaps); READ_CAPS(switchcaps); + READ_CAPS(nvmecaps); READ_CAPS(niccaps); READ_CAPS(toecaps); READ_CAPS(rdmacaps); @@ -7612,17 +7623,18 @@ static char *caps_decoder[] = { "\20\001INGRESS\002EGRESS", /* 2: switch */ "\20\001NIC\002VM\003IDS\004UM\005UM_ISGL" /* 3: NIC */ "\006HASHFILTER\007ETHOFLD", - "\20\001TOE", /* 4: TOE */ - "\20\001RDDP\002RDMAC", /* 5: RDMA */ + "\20\001TOE\002SENDPATH", /* 4: TOE */ + "\20\001RDDP\002RDMAC\003ROCEv2", /* 5: RDMA */ "\20\001INITIATOR_PDU\002TARGET_PDU" /* 6: iSCSI */ "\003INITIATOR_CNXOFLD\004TARGET_CNXOFLD" "\005INITIATOR_SSNOFLD\006TARGET_SSNOFLD" "\007T10DIF" "\010INITIATOR_CMDOFLD\011TARGET_CMDOFLD", "\20\001LOOKASIDE\002TLSKEYS\003IPSEC_INLINE" /* 7: Crypto */ - "\004TLS_HW", + "\004TLS_HW,\005TOE_IPSEC", "\20\001INITIATOR\002TARGET\003CTRL_OFLD" /* 8: FCoE */ "\004PO_INITIATOR\005PO_TARGET", + "\20\001NVMe_TCP", /* 9: NVMe */ }; void @@ -7727,6 +7739,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); SYSCTL_CAP(switchcaps, 2, "switch"); + SYSCTL_CAP(nvmecaps, 9, "NVMe"); SYSCTL_CAP(niccaps, 3, "NIC"); SYSCTL_CAP(toecaps, 4, "TCP offload"); SYSCTL_CAP(rdmacaps, 5, "RDMA"); From nobody Fri Oct 3 00:04:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86R2N98z6BMhY; Fri, 03 Oct 2025 00:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86Q4N0Sz3sW6; Fri, 03 Oct 2025 00:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yUd+lPpBr6PobeuLNSuu9E+1Qti7vEknqsaEGsnvEio=; b=OagN9FX817765ye+q+iVRvl/Tv47t3V0BNJkB/NKg/TsGaPXozbLegYSQJQd4keZgUBoz+ mFJl/rppSaJHETosEMf9jdOox2MVknKPT/9M0mNQiJceSrcm7ojFPUj+6pjtPWUAuZn5H1 e5PO5Y5zBL6O73zE8qGuOKjx/vbnijuxIV/NM+Ds8xXSSLDxKoYetxUnmc+NOgV4mlYrMw av54vRR1ScMBYG3ybOW/eE0Oz8rGQEOP9nBjkJXn6PogAEzNusATCL0vydEohCsA4LW4RA 2MhG+yBnxvpmAntte+ulkZUVNax1U7AxioNWqtMVns44JJyOLUO6jaek35sWuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yUd+lPpBr6PobeuLNSuu9E+1Qti7vEknqsaEGsnvEio=; b=cOFyErOx6EMkJ0AbpcRglKSHBYhwSqgeQrp9bm0+lt7LvVz+MSCM9VbWYvo4jN1sQhochC dhmWLLb36Rvb2vQtn8sA2X/RZuiC0i/H+3xPOtF+YESO3EOyNBZ1UMQ6dgyIzzDQ8VPH7V 6Rby0SJd+jh2ZsSteH5okC1PP7emCiKwdxEWdmZc5JCSasA547wVB8nl6Y9on97OLfXTnW xcjTwIqKgGnmGtnv3ZJHzWKnI05T85WEiNoxQ1MojhVcOTnRjtxLaHanQDq4IFi8kB/r6G 8BtysgNH2MePE/9k28zzk+RPur4qNciKLIsH0eUumNu4izLqhoHcnouaW6EFGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449870; a=rsa-sha256; cv=none; b=Fi2u/xkn/zQ0Bzp06xJ9S5d5P2lDuyn6he4WNlGj2qhaYC3keaz2JBLTVRtLaOQYJZ6rXt 73IdMlBXWaxmDmtg+XtIPLFe7/Pa0AlZkm+zv8AMgNx4ljs5OgM2qOxe1tLsqQ1hCccTEr JqoLOSA7u7VXzUskMMmno8yr1Pxh3VU61OF370DdrJiXRP+PrL3Ki6PMHUwjjntY9qA1eP QkFOMoo2Q1ahxFSCK8wAa+7YXA/KaOuO3uiEh1DYU+uE5AB+XKIIJ5H6CICv7z9pi8ud9W zfKzYbReeWzwzoMQOaYSEy62yrRfPnj0YTql4JhpyxRdPADzumjK59HvLzuWsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86Q3v2qzVjR; Fri, 03 Oct 2025 00:04:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304UQn057021; Fri, 3 Oct 2025 00:04:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304UfP057017; Fri, 3 Oct 2025 00:04:30 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:30 GMT Message-Id: <202510030004.59304UfP057017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: cac2046f1e1b - stable/15 - cxgbe(4): T7 LB mode support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cac2046f1e1b49c85dbaec6f1288146839f2cdc2 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=cac2046f1e1b49c85dbaec6f1288146839f2cdc2 commit cac2046f1e1b49c85dbaec6f1288146839f2cdc2 Author: Navdeep Parhar AuthorDate: 2025-09-29 09:03:02 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:05 +0000 cxgbe(4): T7 LB mode support This is the new mode where multiple internal channels are used to service 1 port. LB = Load Balancing. * Ask for tx_tpchmap from the firmware and update sc->chan_map. * Statistics for a port should include all its channels. Sponsored by: Chelsio Communications (cherry picked from commit a16423b7a48c61370d4eeb542e3ca6c1b4c9579a) --- sys/dev/cxgbe/cudbg/cudbg_lib.c | 1 + sys/dev/cxgbe/t4_main.c | 236 +++++++++++++++++++++++++--------------- 2 files changed, 148 insertions(+), 89 deletions(-) diff --git a/sys/dev/cxgbe/cudbg/cudbg_lib.c b/sys/dev/cxgbe/cudbg/cudbg_lib.c index 068e16e27a13..f0273349263a 100644 --- a/sys/dev/cxgbe/cudbg/cudbg_lib.c +++ b/sys/dev/cxgbe/cudbg/cudbg_lib.c @@ -1294,6 +1294,7 @@ static int collect_macstats(struct cudbg_init *pdbg_init, mac_stats_buff->port_count = n; for (i = 0; i < mac_stats_buff->port_count; i++) + /* Incorrect, should use hport instead of i */ t4_get_port_stats(padap, i, &mac_stats_buff->stats[i]); rc = write_compression_hdr(&scratch_buff, dbg_buff); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index f094fd8f1de9..588d59418a71 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -852,6 +852,7 @@ static int sysctl_requested_fec(SYSCTL_HANDLER_ARGS); static int sysctl_module_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_force_fec(SYSCTL_HANDLER_ARGS); +static int sysctl_handle_t4_portstat64(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); static int sysctl_vdd(SYSCTL_HANDLER_ARGS); @@ -1515,7 +1516,8 @@ t4_attach(device_t dev) snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d", device_get_nameunit(dev), i); mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); - sc->chan_map[pi->tx_chan] = i; + for (j = 0; j < sc->params.tp.lb_nchan; j++) + sc->chan_map[pi->tx_chan + j] = i; sc->port_map[pi->hw_port] = i; /* @@ -1526,10 +1528,8 @@ t4_attach(device_t dev) */ if (is_t6(sc)) pi->fcs_reg = -1; - else { - pi->fcs_reg = t4_port_reg(sc, pi->tx_chan, - A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L); - } + else + pi->fcs_reg = A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L; pi->fcs_base = 0; /* All VIs on this port share this media. */ @@ -5665,6 +5665,14 @@ get_params__post_init(struct adapter *sc) else sc->params.tp_ch_map = UINT32_MAX; /* Not a legal value. */ + param[0] = FW_PARAM_DEV(TX_TPCHMAP); + val[0] = 0; + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + if (rc == 0) + sc->params.tx_tp_ch_map = val[0]; + else + sc->params.tx_tp_ch_map = UINT32_MAX; /* Not a legal value. */ + /* * Determine whether the firmware supports the filter2 work request. */ @@ -7576,7 +7584,7 @@ cxgbe_refresh_stats(struct vi_info *vi) pi = vi->pi; sc = vi->adapter; tnl_cong_drops = 0; - t4_get_port_stats(sc, pi->port_id, &pi->stats); + t4_get_port_stats(sc, pi->hw_port, &pi->stats); chan_map = pi->rx_e_chan_map; while (chan_map) { i = ffs(chan_map) - 1; @@ -8366,86 +8374,112 @@ cxgbe_sysctls(struct port_info *pi) &pi->tx_parse_error, 0, "# of tx packets with invalid length or # of segments"); -#define T4_REGSTAT(name, stat, desc) \ - SYSCTL_ADD_OID(ctx, children, OID_AUTO, #name, \ - CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, \ - t4_port_reg(sc, pi->tx_chan, A_MPS_PORT_STAT_##stat##_L), \ - sysctl_handle_t4_reg64, "QU", desc) - -/* We get these from port_stats and they may be stale by up to 1s */ -#define T4_PORTSTAT(name, desc) \ - SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, #name, CTLFLAG_RD, \ - &pi->stats.name, desc) - - T4_REGSTAT(tx_octets, TX_PORT_BYTES, "# of octets in good frames"); - T4_REGSTAT(tx_frames, TX_PORT_FRAMES, "total # of good frames"); - T4_REGSTAT(tx_bcast_frames, TX_PORT_BCAST, "# of broadcast frames"); - T4_REGSTAT(tx_mcast_frames, TX_PORT_MCAST, "# of multicast frames"); - T4_REGSTAT(tx_ucast_frames, TX_PORT_UCAST, "# of unicast frames"); - T4_REGSTAT(tx_error_frames, TX_PORT_ERROR, "# of error frames"); - T4_REGSTAT(tx_frames_64, TX_PORT_64B, "# of tx frames in this range"); - T4_REGSTAT(tx_frames_65_127, TX_PORT_65B_127B, "# of tx frames in this range"); - T4_REGSTAT(tx_frames_128_255, TX_PORT_128B_255B, "# of tx frames in this range"); - T4_REGSTAT(tx_frames_256_511, TX_PORT_256B_511B, "# of tx frames in this range"); - T4_REGSTAT(tx_frames_512_1023, TX_PORT_512B_1023B, "# of tx frames in this range"); - T4_REGSTAT(tx_frames_1024_1518, TX_PORT_1024B_1518B, "# of tx frames in this range"); - T4_REGSTAT(tx_frames_1519_max, TX_PORT_1519B_MAX, "# of tx frames in this range"); - T4_REGSTAT(tx_drop, TX_PORT_DROP, "# of dropped tx frames"); - T4_REGSTAT(tx_pause, TX_PORT_PAUSE, "# of pause frames transmitted"); - T4_REGSTAT(tx_ppp0, TX_PORT_PPP0, "# of PPP prio 0 frames transmitted"); - T4_REGSTAT(tx_ppp1, TX_PORT_PPP1, "# of PPP prio 1 frames transmitted"); - T4_REGSTAT(tx_ppp2, TX_PORT_PPP2, "# of PPP prio 2 frames transmitted"); - T4_REGSTAT(tx_ppp3, TX_PORT_PPP3, "# of PPP prio 3 frames transmitted"); - T4_REGSTAT(tx_ppp4, TX_PORT_PPP4, "# of PPP prio 4 frames transmitted"); - T4_REGSTAT(tx_ppp5, TX_PORT_PPP5, "# of PPP prio 5 frames transmitted"); - T4_REGSTAT(tx_ppp6, TX_PORT_PPP6, "# of PPP prio 6 frames transmitted"); - T4_REGSTAT(tx_ppp7, TX_PORT_PPP7, "# of PPP prio 7 frames transmitted"); - - T4_REGSTAT(rx_octets, RX_PORT_BYTES, "# of octets in good frames"); - T4_REGSTAT(rx_frames, RX_PORT_FRAMES, "total # of good frames"); - T4_REGSTAT(rx_bcast_frames, RX_PORT_BCAST, "# of broadcast frames"); - T4_REGSTAT(rx_mcast_frames, RX_PORT_MCAST, "# of multicast frames"); - T4_REGSTAT(rx_ucast_frames, RX_PORT_UCAST, "# of unicast frames"); - T4_REGSTAT(rx_too_long, RX_PORT_MTU_ERROR, "# of frames exceeding MTU"); - T4_REGSTAT(rx_jabber, RX_PORT_MTU_CRC_ERROR, "# of jabber frames"); +#define T4_LBSTAT(name, stat, desc) do { \ + if (sc->params.tp.lb_mode) { \ + SYSCTL_ADD_OID(ctx, children, OID_AUTO, #name, \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, pi, \ + A_MPS_PORT_STAT_##stat##_L, \ + sysctl_handle_t4_portstat64, "QU", desc); \ + } else { \ + SYSCTL_ADD_OID(ctx, children, OID_AUTO, #name, \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, \ + t4_port_reg(sc, pi->tx_chan, A_MPS_PORT_STAT_##stat##_L), \ + sysctl_handle_t4_reg64, "QU", desc); \ + } \ +} while (0) + + T4_LBSTAT(tx_octets, TX_PORT_BYTES, "# of octets in good frames"); + T4_LBSTAT(tx_frames, TX_PORT_FRAMES, "total # of good frames"); + T4_LBSTAT(tx_bcast_frames, TX_PORT_BCAST, "# of broadcast frames"); + T4_LBSTAT(tx_mcast_frames, TX_PORT_MCAST, "# of multicast frames"); + T4_LBSTAT(tx_ucast_frames, TX_PORT_UCAST, "# of unicast frames"); + T4_LBSTAT(tx_error_frames, TX_PORT_ERROR, "# of error frames"); + T4_LBSTAT(tx_frames_64, TX_PORT_64B, "# of tx frames in this range"); + T4_LBSTAT(tx_frames_65_127, TX_PORT_65B_127B, "# of tx frames in this range"); + T4_LBSTAT(tx_frames_128_255, TX_PORT_128B_255B, "# of tx frames in this range"); + T4_LBSTAT(tx_frames_256_511, TX_PORT_256B_511B, "# of tx frames in this range"); + T4_LBSTAT(tx_frames_512_1023, TX_PORT_512B_1023B, "# of tx frames in this range"); + T4_LBSTAT(tx_frames_1024_1518, TX_PORT_1024B_1518B, "# of tx frames in this range"); + T4_LBSTAT(tx_frames_1519_max, TX_PORT_1519B_MAX, "# of tx frames in this range"); + T4_LBSTAT(tx_drop, TX_PORT_DROP, "# of dropped tx frames"); + T4_LBSTAT(tx_pause, TX_PORT_PAUSE, "# of pause frames transmitted"); + T4_LBSTAT(tx_ppp0, TX_PORT_PPP0, "# of PPP prio 0 frames transmitted"); + T4_LBSTAT(tx_ppp1, TX_PORT_PPP1, "# of PPP prio 1 frames transmitted"); + T4_LBSTAT(tx_ppp2, TX_PORT_PPP2, "# of PPP prio 2 frames transmitted"); + T4_LBSTAT(tx_ppp3, TX_PORT_PPP3, "# of PPP prio 3 frames transmitted"); + T4_LBSTAT(tx_ppp4, TX_PORT_PPP4, "# of PPP prio 4 frames transmitted"); + T4_LBSTAT(tx_ppp5, TX_PORT_PPP5, "# of PPP prio 5 frames transmitted"); + T4_LBSTAT(tx_ppp6, TX_PORT_PPP6, "# of PPP prio 6 frames transmitted"); + T4_LBSTAT(tx_ppp7, TX_PORT_PPP7, "# of PPP prio 7 frames transmitted"); + + T4_LBSTAT(rx_octets, RX_PORT_BYTES, "# of octets in good frames"); + T4_LBSTAT(rx_frames, RX_PORT_FRAMES, "total # of good frames"); + T4_LBSTAT(rx_bcast_frames, RX_PORT_BCAST, "# of broadcast frames"); + T4_LBSTAT(rx_mcast_frames, RX_PORT_MCAST, "# of multicast frames"); + T4_LBSTAT(rx_ucast_frames, RX_PORT_UCAST, "# of unicast frames"); + T4_LBSTAT(rx_too_long, RX_PORT_MTU_ERROR, "# of frames exceeding MTU"); + T4_LBSTAT(rx_jabber, RX_PORT_MTU_CRC_ERROR, "# of jabber frames"); if (is_t6(sc)) { - T4_PORTSTAT(rx_fcs_err, + /* Read from port_stats and may be stale by up to 1s */ + SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "rx_fcs_err", + CTLFLAG_RD, &pi->stats.rx_fcs_err, "# of frames received with bad FCS since last link up"); } else { - T4_REGSTAT(rx_fcs_err, RX_PORT_CRC_ERROR, + T4_LBSTAT(rx_fcs_err, RX_PORT_CRC_ERROR, "# of frames received with bad FCS"); } - T4_REGSTAT(rx_len_err, RX_PORT_LEN_ERROR, "# of frames received with length error"); - T4_REGSTAT(rx_symbol_err, RX_PORT_SYM_ERROR, "symbol errors"); - T4_REGSTAT(rx_runt, RX_PORT_LESS_64B, "# of short frames received"); - T4_REGSTAT(rx_frames_64, RX_PORT_64B, "# of rx frames in this range"); - T4_REGSTAT(rx_frames_65_127, RX_PORT_65B_127B, "# of rx frames in this range"); - T4_REGSTAT(rx_frames_128_255, RX_PORT_128B_255B, "# of rx frames in this range"); - T4_REGSTAT(rx_frames_256_511, RX_PORT_256B_511B, "# of rx frames in this range"); - T4_REGSTAT(rx_frames_512_1023, RX_PORT_512B_1023B, "# of rx frames in this range"); - T4_REGSTAT(rx_frames_1024_1518, RX_PORT_1024B_1518B, "# of rx frames in this range"); - T4_REGSTAT(rx_frames_1519_max, RX_PORT_1519B_MAX, "# of rx frames in this range"); - T4_REGSTAT(rx_pause, RX_PORT_PAUSE, "# of pause frames received"); - T4_REGSTAT(rx_ppp0, RX_PORT_PPP0, "# of PPP prio 0 frames received"); - T4_REGSTAT(rx_ppp1, RX_PORT_PPP1, "# of PPP prio 1 frames received"); - T4_REGSTAT(rx_ppp2, RX_PORT_PPP2, "# of PPP prio 2 frames received"); - T4_REGSTAT(rx_ppp3, RX_PORT_PPP3, "# of PPP prio 3 frames received"); - T4_REGSTAT(rx_ppp4, RX_PORT_PPP4, "# of PPP prio 4 frames received"); - T4_REGSTAT(rx_ppp5, RX_PORT_PPP5, "# of PPP prio 5 frames received"); - T4_REGSTAT(rx_ppp6, RX_PORT_PPP6, "# of PPP prio 6 frames received"); - T4_REGSTAT(rx_ppp7, RX_PORT_PPP7, "# of PPP prio 7 frames received"); - - T4_PORTSTAT(rx_ovflow0, "# drops due to buffer-group 0 overflows"); - T4_PORTSTAT(rx_ovflow1, "# drops due to buffer-group 1 overflows"); - T4_PORTSTAT(rx_ovflow2, "# drops due to buffer-group 2 overflows"); - T4_PORTSTAT(rx_ovflow3, "# drops due to buffer-group 3 overflows"); - T4_PORTSTAT(rx_trunc0, "# of buffer-group 0 truncated packets"); - T4_PORTSTAT(rx_trunc1, "# of buffer-group 1 truncated packets"); - T4_PORTSTAT(rx_trunc2, "# of buffer-group 2 truncated packets"); - T4_PORTSTAT(rx_trunc3, "# of buffer-group 3 truncated packets"); + T4_LBSTAT(rx_len_err, RX_PORT_LEN_ERROR, "# of frames received with length error"); + T4_LBSTAT(rx_symbol_err, RX_PORT_SYM_ERROR, "symbol errors"); + T4_LBSTAT(rx_runt, RX_PORT_LESS_64B, "# of short frames received"); + T4_LBSTAT(rx_frames_64, RX_PORT_64B, "# of rx frames in this range"); + T4_LBSTAT(rx_frames_65_127, RX_PORT_65B_127B, "# of rx frames in this range"); + T4_LBSTAT(rx_frames_128_255, RX_PORT_128B_255B, "# of rx frames in this range"); + T4_LBSTAT(rx_frames_256_511, RX_PORT_256B_511B, "# of rx frames in this range"); + T4_LBSTAT(rx_frames_512_1023, RX_PORT_512B_1023B, "# of rx frames in this range"); + T4_LBSTAT(rx_frames_1024_1518, RX_PORT_1024B_1518B, "# of rx frames in this range"); + T4_LBSTAT(rx_frames_1519_max, RX_PORT_1519B_MAX, "# of rx frames in this range"); + T4_LBSTAT(rx_pause, RX_PORT_PAUSE, "# of pause frames received"); + T4_LBSTAT(rx_ppp0, RX_PORT_PPP0, "# of PPP prio 0 frames received"); + T4_LBSTAT(rx_ppp1, RX_PORT_PPP1, "# of PPP prio 1 frames received"); + T4_LBSTAT(rx_ppp2, RX_PORT_PPP2, "# of PPP prio 2 frames received"); + T4_LBSTAT(rx_ppp3, RX_PORT_PPP3, "# of PPP prio 3 frames received"); + T4_LBSTAT(rx_ppp4, RX_PORT_PPP4, "# of PPP prio 4 frames received"); + T4_LBSTAT(rx_ppp5, RX_PORT_PPP5, "# of PPP prio 5 frames received"); + T4_LBSTAT(rx_ppp6, RX_PORT_PPP6, "# of PPP prio 6 frames received"); + T4_LBSTAT(rx_ppp7, RX_PORT_PPP7, "# of PPP prio 7 frames received"); +#undef T4_LBSTAT + +#define T4_REGSTAT(name, stat, desc) do { \ + SYSCTL_ADD_OID(ctx, children, OID_AUTO, #name, \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, \ + A_MPS_STAT_##stat##_L, sysctl_handle_t4_reg64, "QU", desc); \ +} while (0) + if (pi->mps_bg_map & 1) { + T4_REGSTAT(rx_ovflow0, RX_BG_0_MAC_DROP_FRAME, + "# drops due to buffer-group 0 overflows"); + T4_REGSTAT(rx_trunc0, RX_BG_0_MAC_TRUNC_FRAME, + "# of buffer-group 0 truncated packets"); + } + if (pi->mps_bg_map & 2) { + T4_REGSTAT(rx_ovflow1, RX_BG_1_MAC_DROP_FRAME, + "# drops due to buffer-group 1 overflows"); + T4_REGSTAT(rx_trunc1, RX_BG_1_MAC_TRUNC_FRAME, + "# of buffer-group 1 truncated packets"); + } + if (pi->mps_bg_map & 4) { + T4_REGSTAT(rx_ovflow2, RX_BG_2_MAC_DROP_FRAME, + "# drops due to buffer-group 2 overflows"); + T4_REGSTAT(rx_trunc2, RX_BG_2_MAC_TRUNC_FRAME, + "# of buffer-group 2 truncated packets"); + } + if (pi->mps_bg_map & 8) { + T4_REGSTAT(rx_ovflow3, RX_BG_3_MAC_DROP_FRAME, + "# drops due to buffer-group 3 overflows"); + T4_REGSTAT(rx_trunc3, RX_BG_3_MAC_TRUNC_FRAME, + "# of buffer-group 3 truncated packets"); + } #undef T4_REGSTAT -#undef T4_PORTSTAT } static int @@ -9048,6 +9082,31 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS) return (rc); } +static int +sysctl_handle_t4_portstat64(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + struct adapter *sc = pi->adapter; + int rc, i, reg = arg2; + uint64_t val; + + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + rc = ENXIO; + else { + val = 0; + for (i = 0; i < sc->params.tp.lb_nchan; i++) { + val += t4_read_reg64(sc, + t4_port_reg(sc, pi->tx_chan + i, reg)); + } + rc = 0; + } + mtx_unlock(&sc->reg_lock); + if (rc == 0) + rc = sysctl_handle_64(oidp, &val, 0, req); + return (rc); +} + static int sysctl_temperature(SYSCTL_HANDLER_ARGS) { @@ -12553,10 +12612,11 @@ clear_stats(struct adapter *sc, u_int port_id) mtx_lock(&sc->reg_lock); if (!hw_off_limits(sc)) { /* MAC stats */ - t4_clr_port_stats(sc, pi->tx_chan); + t4_clr_port_stats(sc, pi->hw_port); if (is_t6(sc)) { if (pi->fcs_reg != -1) - pi->fcs_base = t4_read_reg64(sc, pi->fcs_reg); + pi->fcs_base = t4_read_reg64(sc, + t4_port_reg(sc, pi->tx_chan, pi->fcs_reg)); else pi->stats.rx_fcs_err = 0; } @@ -12769,14 +12829,12 @@ t4_os_link_changed(struct port_info *pi) if (is_t6(sc)) { if (lc->link_ok) { if (lc->speed > 25000 || - (lc->speed == 25000 && lc->fec == FEC_RS)) { - pi->fcs_reg = T5_PORT_REG(pi->tx_chan, - A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS); - } else { - pi->fcs_reg = T5_PORT_REG(pi->tx_chan, - A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS); - } - pi->fcs_base = t4_read_reg64(sc, pi->fcs_reg); + (lc->speed == 25000 && lc->fec == FEC_RS)) + pi->fcs_reg = A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS; + else + pi->fcs_reg = A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS; + pi->fcs_base = t4_read_reg64(sc, + t4_port_reg(sc, pi->tx_chan, pi->fcs_reg)); pi->stats.rx_fcs_err = 0; } else { pi->fcs_reg = -1; From nobody Fri Oct 3 00:04:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86S1b90z6BMf8; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86R5K0Tz3sT1; Fri, 03 Oct 2025 00:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWADUr+Egp3UttYcApx6NFu8KltPp35m3Z06rKtDcpw=; b=ma44kIfWkKsc/k8+LKyh6YncY4Jzu6P+htiF8KBs+h8LS8WA9x7qpI1A+kEdLiAhCaeAmK Vn20Ml1DmPEaZ/zYizMwes+yKjJFTB+Z+iOkbKlczj5oA0shmVkj/DVadPwnZ9HUh1JiYd vY6MdXToCSNiEPNfU2iJU0bLtphsriotgmQO/8UoK67wH6M5m02PfZA4RHc3jgeLdNI+wl WwxvjByt4hL5hHqVGDrSYrUTXT9GceX01ah93uEiBcoKYqX7h0Z8uc4VIFyWIIxpK5FjWL IOazumvbk/UcZhu8Du8xThDBgrY19A5qaMbHCZ2T0YvyVk/RTStGxOZGjT9Gwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWADUr+Egp3UttYcApx6NFu8KltPp35m3Z06rKtDcpw=; b=Ksn12ejG5BagdC7sSZqombZY9VRZQVA8opbnKxXlBOjwsejjpltAUrBxsORt/kLpkoLih6 3+ePwCn6WO7Vw/D6tvlSYMKE1p4qBwFBtHfBFIAHSPzCCMv+kurQbN1UJb3Hm2Z5PC43IZ 0AMy9s/ZVjE9c9ccjlnBPqnQLWdhXRhEnATYUly0xOsN9Xwy/P998rffkdwT4ef6yTAonL qSkoSV5lgOafg1nWGFUMp7k7J1n/TzJd3PwVkXT1Ny9h2PIv6Og07mqFrT55xWdTt5CmTL qpaHnXvsKLOa8w8reyIQtuvr23p2ftPYDmev017DRakYEBUhiNiWTw93dux3Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449871; a=rsa-sha256; cv=none; b=FlsyNtY9Ii19jfvcw5Z1XGveh2+/ELDIeXdOdbM0d75Z8TU39U7wibIawkyHU/7pJDCBd0 luj6Ltj31QQ7UAMpboMjWjpLF0yp38hvbF7c9PYwgHOVTvjWXa9xY2pFrZzjc154pfZAay UG12+TiCvv+wmGrIylCXWOx1nurS+4U9ocCsieid5a3auaq7KMGjBy7KRZMQoj4XhQ/Y7c yBp7muQhn6rqiKZNyvoBqyf5A0saptt4ymw38hvHIiFcMkiWLxsrDWlpQ8nwienC2Gg6lU IhZ+0pmw341qD0yjlEqqpIMUMQ4aFtWkDDxmyP5wumH9WlEnb/XxyvkmYBvH6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86R4SfszTlJ; Fri, 03 Oct 2025 00:04: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 59304Vev057057; Fri, 3 Oct 2025 00:04:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304V5b057053; Fri, 3 Oct 2025 00:04:31 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:31 GMT Message-Id: <202510030004.59304V5b057053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 8e73528872f7 - stable/15 - cxgbe(4): Updates for T7 CIM multicore operation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8e73528872f79b8a8370dd5105a076599f5a230e Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=8e73528872f79b8a8370dd5105a076599f5a230e commit 8e73528872f79b8a8370dd5105a076599f5a230e Author: Navdeep Parhar AuthorDate: 2025-09-29 09:17:51 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:06 +0000 cxgbe(4): Updates for T7 CIM multicore operation T7 has a multicore microprocessor and each core has its own queue configuration, inbound/outbound queues, and logic analyzer. A work request involving a tid can only be handled on queues where (tid & tid_qid_sel_mask) == (eq->cntxt_id & tid_qid_sel_mask). Sponsored by: Chelsio Communications (cherry picked from commit 3d76a4feeead2bbda7792a3c4ca534fd4c159721) --- sys/dev/cxgbe/adapter.h | 14 +- sys/dev/cxgbe/t4_main.c | 553 ++++++++++++++++++++++++++++++----------- sys/dev/cxgbe/t4_netmap.c | 10 +- sys/dev/cxgbe/t4_sge.c | 77 ++++-- sys/dev/cxgbe/tom/t4_connect.c | 6 + sys/dev/cxgbe/tom/t4_listen.c | 2 + sys/dev/cxgbe/tom/t4_tom.c | 31 ++- sys/dev/cxgbe/tom/t4_tom.h | 2 + 8 files changed, 515 insertions(+), 180 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 36c3b48cccbd..e3906f8058a7 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2011 Chelsio Communications, Inc. - * All rights reserved. + * Copyright (c) 2011, 2025 Chelsio Communications. * Written by: Navdeep Parhar * * Redistribution and use in source and binary forms, with or without @@ -770,6 +769,16 @@ struct sge_ofld_txq { counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); +static inline int +ofld_txq_group(int val, int mask) +{ + const uint32_t ngroup = 1 << bitcount32(mask); + const int mshift = ffs(mask) - 1; + const uint32_t gmask = ngroup - 1; + + return (val >> mshift & gmask); +} + #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) struct sge_nm_rxq { /* Items used by the driver rx ithread are in this cacheline. */ @@ -837,6 +846,7 @@ struct sge_nm_txq { } __aligned(CACHE_LINE_SIZE); struct sge { + int nctrlq; /* total # of control queues */ int nrxq; /* total # of Ethernet rx queues */ int ntxq; /* total # of Ethernet tx queues */ int nofldrxq; /* total # of TOE rx queues */ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 588d59418a71..df6314ca6e18 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2011 Chelsio Communications, Inc. - * All rights reserved. + * Copyright (c) 2011, 2025 Chelsio Communications. * Written by: Navdeep Parhar * * Redistribution and use in source and binary forms, with or without @@ -859,11 +858,13 @@ static int sysctl_vdd(SYSCTL_HANDLER_ARGS); static int sysctl_reset_sensor(SYSCTL_HANDLER_ARGS); static int sysctl_loadavg(SYSCTL_HANDLER_ARGS); static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); -static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_ibq(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_obq(SYSCTL_HANDLER_ARGS); static int sysctl_cim_la(SYSCTL_HANDLER_ARGS); static int sysctl_cim_ma_la(SYSCTL_HANDLER_ARGS); static int sysctl_cim_pif_la(SYSCTL_HANDLER_ARGS); static int sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS); +static int sysctl_cim_qcfg_t7(SYSCTL_HANDLER_ARGS); static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS); static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tid_stats(SYSCTL_HANDLER_ARGS); @@ -1569,6 +1570,7 @@ t4_attach(device_t dev) sc->intr_count = iaq.nirq; s = &sc->sge; + s->nctrlq = max(sc->params.nports, sc->params.ncores); s->nrxq = nports * iaq.nrxq; s->ntxq = nports * iaq.ntxq; if (num_vis > 1) { @@ -1623,7 +1625,7 @@ t4_attach(device_t dev) MPASS(s->niq <= s->iqmap_sz); MPASS(s->neq <= s->eqmap_sz); - s->ctrlq = malloc(nports * sizeof(struct sge_wrq), M_CXGBE, + s->ctrlq = malloc(s->nctrlq * sizeof(struct sge_wrq), M_CXGBE, M_ZERO | M_WAITOK); s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE, M_ZERO | M_WAITOK); @@ -4564,8 +4566,27 @@ calculate_iaq(struct adapter *sc, struct intrs_and_queues *iaq, int itype, iaq->nrxq_vi = t4_nrxq_vi; #if defined(TCP_OFFLOAD) || defined(RATELIMIT) if (is_offload(sc) || is_ethoffload(sc)) { - iaq->nofldtxq = t4_nofldtxq; - iaq->nofldtxq_vi = t4_nofldtxq_vi; + if (sc->params.tid_qid_sel_mask == 0) { + iaq->nofldtxq = t4_nofldtxq; + iaq->nofldtxq_vi = t4_nofldtxq_vi; + } else { + iaq->nofldtxq = roundup(t4_nofldtxq, sc->params.ncores); + iaq->nofldtxq_vi = roundup(t4_nofldtxq_vi, + sc->params.ncores); + if (iaq->nofldtxq != t4_nofldtxq) + device_printf(sc->dev, + "nofldtxq updated (%d -> %d) for correct" + " operation with %d firmware cores.\n", + t4_nofldtxq, iaq->nofldtxq, + sc->params.ncores); + if (iaq->num_vis > 1 && + iaq->nofldtxq_vi != t4_nofldtxq_vi) + device_printf(sc->dev, + "nofldtxq_vi updated (%d -> %d) for correct" + " operation with %d firmware cores.\n", + t4_nofldtxq_vi, iaq->nofldtxq_vi, + sc->params.ncores); + } } #endif #ifdef TCP_OFFLOAD @@ -4666,6 +4687,10 @@ calculate_iaq(struct adapter *sc, struct intrs_and_queues *iaq, int itype, if (iaq->nofldrxq > 0) { iaq->nofldrxq = 1; iaq->nofldtxq = 1; + if (sc->params.tid_qid_sel_mask == 0) + iaq->nofldtxq = 1; + else + iaq->nofldtxq = sc->params.ncores; } iaq->nnmtxq = 0; iaq->nnmrxq = 0; @@ -4678,9 +4703,10 @@ done: MPASS(iaq->nirq > 0); MPASS(iaq->nrxq > 0); MPASS(iaq->ntxq > 0); - if (itype == INTR_MSI) { + if (itype == INTR_MSI) MPASS(powerof2(iaq->nirq)); - } + if (sc->params.tid_qid_sel_mask != 0) + MPASS(iaq->nofldtxq % sc->params.ncores == 0); } static int @@ -5640,6 +5666,14 @@ get_params__post_init(struct adapter *sc) } } + if (sc->params.ncores > 1) { + MPASS(chip_id(sc) >= CHELSIO_T7); + + param[0] = FW_PARAM_DEV(TID_QID_SEL_MASK); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + sc->params.tid_qid_sel_mask = rc == 0 ? val[0] : 0; + } + /* * The parameters that follow may not be available on all firmwares. We * query them individually rather than in a compound query because old @@ -7622,6 +7656,150 @@ vi_tick(void *arg) callout_schedule(&vi->tick, hz); } +/* CIM inbound queues */ +static const char *t4_ibq[CIM_NUM_IBQ] = { + "ibq_tp0", "ibq_tp1", "ibq_ulp", "ibq_sge0", "ibq_sge1", "ibq_ncsi" +}; +static const char *t7_ibq[CIM_NUM_IBQ_T7] = { + "ibq_tp0", "ibq_tp1", "ibq_tp2", "ibq_tp3", "ibq_ulp", "ibq_sge0", + "ibq_sge1", "ibq_ncsi", NULL, "ibq_ipc1", "ibq_ipc2", "ibq_ipc3", + "ibq_ipc4", "ibq_ipc5", "ibq_ipc6", "ibq_ipc7" +}; +static const char *t7_ibq_sec[] = { + "ibq_tp0", "ibq_tp1", "ibq_tp2", "ibq_tp3", "ibq_ulp", "ibq_sge0", + NULL, NULL, NULL, "ibq_ipc0" +}; + +/* CIM outbound queues */ +static const char *t4_obq[CIM_NUM_OBQ_T5] = { + "obq_ulp0", "obq_ulp1", "obq_ulp2", "obq_ulp3", "obq_sge", "obq_ncsi", + "obq_sge_rx_q0", "obq_sge_rx_q1" /* These two are T5/T6 only */ +}; +static const char *t7_obq[CIM_NUM_OBQ_T7] = { + "obq_ulp0", "obq_ulp1", "obq_ulp2", "obq_ulp3", "obq_sge", "obq_ncsi", + "obq_sge_rx_q0", NULL, NULL, "obq_ipc1", "obq_ipc2", "obq_ipc3", + "obq_ipc4", "obq_ipc5", "obq_ipc6", "obq_ipc7" +}; +static const char *t7_obq_sec[] = { + "obq_ulp0", "obq_ulp1", "obq_ulp2", "obq_ulp3", "obq_sge", NULL, + "obq_sge_rx_q0", NULL, NULL, "obq_ipc0" +}; + +static void +cim_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx, + struct sysctl_oid_list *c0) +{ + struct sysctl_oid *oid; + struct sysctl_oid_list *children1; + int i, j, qcount; + char s[16]; + const char **qname; + + oid = SYSCTL_ADD_NODE(ctx, c0, OID_AUTO, "cim", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "CIM block"); + c0 = SYSCTL_CHILDREN(oid); + + SYSCTL_ADD_U8(ctx, c0, OID_AUTO, "ncores", CTLFLAG_RD, NULL, + sc->params.ncores, "# of active CIM cores"); + + for (i = 0; i < sc->params.ncores; i++) { + snprintf(s, sizeof(s), "%u", i); + oid = SYSCTL_ADD_NODE(ctx, c0, OID_AUTO, s, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "CIM core"); + children1 = SYSCTL_CHILDREN(oid); + + /* + * CTLFLAG_SKIP because the misc.devlog sysctl already displays + * the log for all cores. Use this sysctl to get the log for a + * particular core only. + */ + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, "devlog", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_SKIP, + sc, i, sysctl_devlog, "A", "firmware's device log"); + + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, "loadavg", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, i, + sysctl_loadavg, "A", + "microprocessor load averages (select firmwares only)"); + + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, "qcfg", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, i, + chip_id(sc) > CHELSIO_T6 ? sysctl_cim_qcfg_t7 : sysctl_cim_qcfg, + "A", "Queue configuration"); + + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, "la", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, i, + sysctl_cim_la, "A", "Logic analyzer"); + + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, "ma_la", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, i, + sysctl_cim_ma_la, "A", "CIM MA logic analyzer"); + + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, "pif_la", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, i, + sysctl_cim_pif_la, "A", "CIM PIF logic analyzer"); + + /* IBQs */ + switch (chip_id(sc)) { + case CHELSIO_T4: + case CHELSIO_T5: + case CHELSIO_T6: + qname = &t4_ibq[0]; + qcount = nitems(t4_ibq); + break; + case CHELSIO_T7: + default: + if (i == 0) { + qname = &t7_ibq[0]; + qcount = nitems(t7_ibq); + } else { + qname = &t7_ibq_sec[0]; + qcount = nitems(t7_ibq_sec); + } + break; + } + MPASS(qcount <= sc->chip_params->cim_num_ibq); + for (j = 0; j < qcount; j++) { + if (qname[j] == NULL) + continue; + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, qname[j], + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, + (i << 16) | j, sysctl_cim_ibq, "A", NULL); + } + + /* OBQs */ + switch (chip_id(sc)) { + case CHELSIO_T4: + qname = t4_obq; + qcount = CIM_NUM_OBQ; + break; + case CHELSIO_T5: + case CHELSIO_T6: + qname = t4_obq; + qcount = nitems(t4_obq); + break; + case CHELSIO_T7: + default: + if (i == 0) { + qname = t7_obq; + qcount = nitems(t7_obq); + } else { + qname = t7_obq_sec; + qcount = nitems(t7_obq_sec); + } + break; + } + MPASS(qcount <= sc->chip_params->cim_num_obq); + for (j = 0; j < qcount; j++) { + if (qname[j] == NULL) + continue; + SYSCTL_ADD_PROC(ctx, children1, OID_AUTO, qname[j], + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, + (i << 16) | j, sysctl_cim_obq, "A", NULL); + } + } +} + /* * Should match fw_caps_config_ enums in t4fw_interface.h */ @@ -7766,11 +7944,6 @@ t4_sysctls(struct adapter *sc) CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sysctl_reset_sensor, "I", "reset the chip's temperature sensor."); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "loadavg", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - sysctl_loadavg, "A", - "microprocessor load averages (debug firmwares only)"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_vdd, "I", "core Vdd (in mV)"); @@ -7802,81 +7975,7 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cctrl, "A", "congestion control"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp0", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - sysctl_cim_ibq_obq, "A", "CIM IBQ 0 (TP0)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp1", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 1, - sysctl_cim_ibq_obq, "A", "CIM IBQ 1 (TP1)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ulp", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 2, - sysctl_cim_ibq_obq, "A", "CIM IBQ 2 (ULP)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge0", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 3, - sysctl_cim_ibq_obq, "A", "CIM IBQ 3 (SGE0)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge1", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 4, - sysctl_cim_ibq_obq, "A", "CIM IBQ 4 (SGE1)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ncsi", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 5, - sysctl_cim_ibq_obq, "A", "CIM IBQ 5 (NCSI)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - sysctl_cim_la, "A", "CIM logic analyzer"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ma_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - sysctl_cim_ma_la, "A", "CIM MA logic analyzer"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp0", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 0 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 0 (ULP0)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp1", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 1 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 1 (ULP1)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp2", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 2 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 2 (ULP2)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp3", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 3 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 3 (ULP3)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 4 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 4 (SGE)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ncsi", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 5 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 5 (NCSI)"); - - if (chip_id(sc) > CHELSIO_T4) { - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge0_rx", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 6 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", - "CIM OBQ 6 (SGE0-RX)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge1_rx", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, - 7 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", - "CIM OBQ 7 (SGE1-RX)"); - } - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_pif_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - sysctl_cim_pif_la, "A", "CIM PIF logic analyzer"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_qcfg", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - sysctl_cim_qcfg, "A", "CIM queue configuration"); + cim_sysctls(sc, ctx, children); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cpl_stats", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, @@ -7891,8 +7990,8 @@ t4_sysctls(struct adapter *sc) sysctl_tid_stats, "A", "tid stats"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "devlog", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, - sysctl_devlog, "A", "firmware's device log"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, -1, + sysctl_devlog, "A", "firmware's device log (all cores)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fcoe_stats", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, @@ -9207,6 +9306,10 @@ sysctl_loadavg(SYSCTL_HANDLER_ARGS) struct sbuf *sb; int rc; uint32_t param, val; + uint8_t coreid = (uint8_t)arg2; + + KASSERT(coreid < sc->params.ncores, + ("%s: bad coreid %u\n", __func__, coreid)); rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4lavg"); if (rc) @@ -9215,7 +9318,8 @@ sysctl_loadavg(SYSCTL_HANDLER_ARGS) rc = ENXIO; else { param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_LOAD); + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_LOAD) | + V_FW_PARAMS_PARAM_Y(coreid); rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); } end_synchronized_op(sc, 0); @@ -9281,50 +9385,30 @@ done: return (rc); } -static const char *qname[CIM_NUM_IBQ + CIM_NUM_OBQ_T5] = { - "TP0", "TP1", "ULP", "SGE0", "SGE1", "NC-SI", /* ibq's */ - "ULP0", "ULP1", "ULP2", "ULP3", "SGE", "NC-SI", /* obq's */ - "SGE0-RX", "SGE1-RX" /* additional obq's (T5 onwards) */ -}; - static int -sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS) +sysctl_cim_ibq(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; struct sbuf *sb; - int rc, i, n, qid = arg2; + int rc, i, n, qid, coreid; uint32_t *buf, *p; - char *qtype; - u_int cim_num_obq = sc->chip_params->cim_num_obq; - KASSERT(qid >= 0 && qid < CIM_NUM_IBQ + cim_num_obq, - ("%s: bad qid %d\n", __func__, qid)); + qid = arg2 & 0xffff; + coreid = arg2 >> 16; - if (qid < CIM_NUM_IBQ) { - /* inbound queue */ - qtype = "IBQ"; - n = 4 * CIM_IBQ_SIZE; - buf = malloc(n * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); - mtx_lock(&sc->reg_lock); - if (hw_off_limits(sc)) - rc = -ENXIO; - else - rc = t4_read_cim_ibq(sc, qid, buf, n); - mtx_unlock(&sc->reg_lock); - } else { - /* outbound queue */ - qtype = "OBQ"; - qid -= CIM_NUM_IBQ; - n = 4 * cim_num_obq * CIM_OBQ_SIZE; - buf = malloc(n * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); - mtx_lock(&sc->reg_lock); - if (hw_off_limits(sc)) - rc = -ENXIO; - else - rc = t4_read_cim_obq(sc, qid, buf, n); - mtx_unlock(&sc->reg_lock); - } + KASSERT(qid >= 0 && qid < sc->chip_params->cim_num_ibq, + ("%s: bad ibq qid %d\n", __func__, qid)); + KASSERT(coreid >= 0 && coreid < sc->params.ncores, + ("%s: bad coreid %d\n", __func__, coreid)); + n = 4 * CIM_IBQ_SIZE; + buf = malloc(n * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + rc = -ENXIO; + else + rc = t4_read_cim_ibq_core(sc, coreid, qid, buf, n); + mtx_unlock(&sc->reg_lock); if (rc < 0) { rc = -rc; goto done; @@ -9336,12 +9420,58 @@ sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS) rc = ENOMEM; goto done; } - - sbuf_printf(sb, "%s%d %s", qtype , qid, qname[arg2]); for (i = 0, p = buf; i < n; i += 16, p += 4) sbuf_printf(sb, "\n%#06x: %08x %08x %08x %08x", i, p[0], p[1], p[2], p[3]); + rc = sbuf_finish(sb); + sbuf_delete(sb); +done: + free(buf, M_CXGBE); + return (rc); +} + +static int +sysctl_cim_obq(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct sbuf *sb; + int rc, i, n, qid, coreid; + uint32_t *buf, *p; + + qid = arg2 & 0xffff; + coreid = arg2 >> 16; + + KASSERT(qid >= 0 && qid < sc->chip_params->cim_num_obq, + ("%s: bad obq qid %d\n", __func__, qid)); + KASSERT(coreid >= 0 && coreid < sc->params.ncores, + ("%s: bad coreid %d\n", __func__, coreid)); + + n = 6 * CIM_OBQ_SIZE * 4; + buf = malloc(n * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + rc = -ENXIO; + else + rc = t4_read_cim_obq_core(sc, coreid, qid, buf, n); + mtx_unlock(&sc->reg_lock); + if (rc < 0) { + rc = -rc; + goto done; + } + n = rc * sizeof(uint32_t); /* rc has # of words actually read */ + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + goto done; + + sb = sbuf_new_for_sysctl(NULL, NULL, PAGE_SIZE, req); + if (sb == NULL) { + rc = ENOMEM; + goto done; + } + for (i = 0, p = buf; i < n; i += 16, p += 4) + sbuf_printf(sb, "\n%#06x: %08x %08x %08x %08x", i, p[0], p[1], + p[2], p[3]); rc = sbuf_finish(sb); sbuf_delete(sb); done: @@ -9412,7 +9542,7 @@ sbuf_cim_la6(struct adapter *sc, struct sbuf *sb, uint32_t *buf, uint32_t cfg) } static int -sbuf_cim_la(struct adapter *sc, struct sbuf *sb, int flags) +sbuf_cim_la(struct adapter *sc, int coreid, struct sbuf *sb, int flags) { uint32_t cfg, *buf; int rc; @@ -9427,9 +9557,10 @@ sbuf_cim_la(struct adapter *sc, struct sbuf *sb, int flags) if (hw_off_limits(sc)) rc = ENXIO; else { - rc = -t4_cim_read(sc, A_UP_UP_DBG_LA_CFG, 1, &cfg); + rc = -t4_cim_read_core(sc, 1, coreid, A_UP_UP_DBG_LA_CFG, 1, + &cfg); if (rc == 0) - rc = -t4_cim_read_la(sc, buf, NULL); + rc = -t4_cim_read_la_core(sc, coreid, buf, NULL); } mtx_unlock(&sc->reg_lock); if (rc == 0) { @@ -9446,6 +9577,7 @@ static int sysctl_cim_la(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; + int coreid = arg2; struct sbuf *sb; int rc; @@ -9453,7 +9585,7 @@ sysctl_cim_la(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - rc = sbuf_cim_la(sc, sb, M_WAITOK); + rc = sbuf_cim_la(sc, coreid, sb, M_WAITOK); if (rc == 0) rc = sbuf_finish(sb); sbuf_delete(sb); @@ -9490,7 +9622,7 @@ dump_cimla(struct adapter *sc) device_get_nameunit(sc->dev)); return; } - rc = sbuf_cim_la(sc, &sb, M_WAITOK); + rc = sbuf_cim_la(sc, 0, &sb, M_WAITOK); if (rc == 0) { rc = sbuf_finish(&sb); if (rc == 0) { @@ -9614,6 +9746,13 @@ sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) uint32_t obq_wr[2 * CIM_NUM_OBQ_T5], *wr = obq_wr; uint32_t stat[4 * (CIM_NUM_IBQ + CIM_NUM_OBQ_T5)], *p = stat; u_int cim_num_obq, ibq_rdaddr, obq_rdaddr, nq; + static const char *qname[CIM_NUM_IBQ + CIM_NUM_OBQ_T5] = { + "TP0", "TP1", "ULP", "SGE0", "SGE1", "NC-SI", /* ibq's */ + "ULP0", "ULP1", "ULP2", "ULP3", "SGE", "NC-SI", /* obq's */ + "SGE0-RX", "SGE1-RX" /* additional obq's (T5 onwards) */ + }; + + MPASS(chip_id(sc) < CHELSIO_T7); cim_num_obq = sc->chip_params->cim_num_obq; if (is_t4(sc)) { @@ -9665,6 +9804,104 @@ sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) return (rc); } +static int +sysctl_cim_qcfg_t7(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + u_int coreid = arg2; + struct sbuf *sb; + int rc, i; + u_int addr; + uint16_t base[CIM_NUM_IBQ_T7 + CIM_NUM_OBQ_T7]; + uint16_t size[CIM_NUM_IBQ_T7 + CIM_NUM_OBQ_T7]; + uint16_t thres[CIM_NUM_IBQ_T7]; + uint32_t obq_wr[2 * CIM_NUM_OBQ_T7], *wr = obq_wr; + uint32_t stat[4 * (CIM_NUM_IBQ_T7 + CIM_NUM_OBQ_T7)], *p = stat; + static const char * const qname_ibq_t7[] = { + "TP0", "TP1", "TP2", "TP3", "ULP", "SGE0", "SGE1", "NC-SI", + "RSVD", "IPC1", "IPC2", "IPC3", "IPC4", "IPC5", "IPC6", "IPC7", + }; + static const char * const qname_obq_t7[] = { + "ULP0", "ULP1", "ULP2", "ULP3", "SGE", "NC-SI", "SGE0-RX", + "RSVD", "RSVD", "IPC1", "IPC2", "IPC3", "IPC4", "IPC5", + "IPC6", "IPC7" + }; + static const char * const qname_ibq_sec_t7[] = { + "TP0", "TP1", "TP2", "TP3", "ULP", "SGE0", "RSVD", "RSVD", + "RSVD", "IPC0", "RSVD", "RSVD", "RSVD", "RSVD", "RSVD", "RSVD", + }; + static const char * const qname_obq_sec_t7[] = { + "ULP0", "ULP1", "ULP2", "ULP3", "SGE", "RSVD", "SGE0-RX", + "RSVD", "RSVD", "IPC0", "RSVD", "RSVD", "RSVD", "RSVD", + "RSVD", "RSVD", + }; + + MPASS(chip_id(sc) >= CHELSIO_T7); + + mtx_lock(&sc->reg_lock); + if (hw_off_limits(sc)) + rc = ENXIO; + else { + rc = -t4_cim_read_core(sc, 1, coreid, + A_T7_UP_IBQ_0_SHADOW_RDADDR, 4 * CIM_NUM_IBQ_T7, stat); + if (rc != 0) + goto unlock; + + rc = -t4_cim_read_core(sc, 1, coreid, + A_T7_UP_OBQ_0_SHADOW_RDADDR, 4 * CIM_NUM_OBQ_T7, + &stat[4 * CIM_NUM_IBQ_T7]); + if (rc != 0) + goto unlock; + + addr = A_T7_UP_OBQ_0_SHADOW_REALADDR; + for (i = 0; i < CIM_NUM_OBQ_T7 * 2; i++, addr += 8) { + rc = -t4_cim_read_core(sc, 1, coreid, addr, 1, + &obq_wr[i]); + if (rc != 0) + goto unlock; + } + t4_read_cimq_cfg_core(sc, coreid, base, size, thres); + } +unlock: + mtx_unlock(&sc->reg_lock); + if (rc) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, PAGE_SIZE, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, + " Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); + + for (i = 0; i < CIM_NUM_IBQ_T7; i++, p += 4) { + if (!size[i]) + continue; + + sbuf_printf(sb, "\n%7s %5x %5u %5u %6x %4x %4u %4u %5u", + coreid == 0 ? qname_ibq_t7[i] : qname_ibq_sec_t7[i], + base[i], size[i], thres[i], G_IBQRDADDR(p[0]) & 0xfff, + G_IBQWRADDR(p[1]) & 0xfff, G_QUESOPCNT(p[3]), + G_QUEEOPCNT(p[3]), G_T7_QUEREMFLITS(p[2]) * 16); + } + + for ( ; i < CIM_NUM_IBQ_T7 + CIM_NUM_OBQ_T7; i++, p += 4, wr += 2) { + if (!size[i]) + continue; + + sbuf_printf(sb, "\n%7s %5x %5u %12x %4x %4u %4u %5u", + coreid == 0 ? qname_obq_t7[i - CIM_NUM_IBQ_T7] : + qname_obq_sec_t7[i - CIM_NUM_IBQ_T7], + base[i], size[i], G_QUERDADDR(p[0]) & 0xfff, + wr[0] << 1, G_QUESOPCNT(p[3]), G_QUEEOPCNT(p[3]), + G_T7_QUEREMFLITS(p[2]) * 16); + } + + rc = sbuf_finish(sb); + sbuf_delete(sb); + return (rc); +} + static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS) { @@ -9807,18 +10044,25 @@ static const char * const devlog_facility_strings[] = { }; static int -sbuf_devlog(struct adapter *sc, struct sbuf *sb, int flags) +sbuf_devlog(struct adapter *sc, int coreid, struct sbuf *sb, int flags) { int i, j, rc, nentries, first = 0; struct devlog_params *dparams = &sc->params.devlog; struct fw_devlog_e *buf, *e; + uint32_t addr, size; uint64_t ftstamp = UINT64_MAX; + KASSERT(coreid >= 0 && coreid < sc->params.ncores, + ("%s: bad coreid %d\n", __func__, coreid)); + if (dparams->addr == 0) return (ENXIO); + size = dparams->size / sc->params.ncores; + addr = dparams->addr + coreid * size; + MPASS(flags == M_WAITOK || flags == M_NOWAIT); - buf = malloc(dparams->size, M_CXGBE, M_ZERO | flags); + buf = malloc(size, M_CXGBE, M_ZERO | flags); if (buf == NULL) return (ENOMEM); @@ -9826,13 +10070,12 @@ sbuf_devlog(struct adapter *sc, struct sbuf *sb, int flags) if (hw_off_limits(sc)) rc = ENXIO; else - rc = read_via_memwin(sc, 1, dparams->addr, (void *)buf, - dparams->size); + rc = read_via_memwin(sc, 1, addr, (void *)buf, size); mtx_unlock(&sc->reg_lock); if (rc != 0) goto done; - nentries = dparams->size / sizeof(struct fw_devlog_e); + nentries = size / sizeof(struct fw_devlog_e); for (i = 0; i < nentries; i++) { e = &buf[i]; @@ -9884,14 +10127,24 @@ static int sysctl_devlog(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; - int rc; + int rc, i, coreid = arg2; struct sbuf *sb; sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); - - rc = sbuf_devlog(sc, sb, M_WAITOK); + if (coreid == -1) { + /* -1 means all cores */ + for (i = rc = 0; i < sc->params.ncores && rc == 0; i++) { + if (sc->params.ncores > 0) + sbuf_printf(sb, "=== CIM core %u ===\n", i); + rc = sbuf_devlog(sc, i, sb, M_WAITOK); + } + } else { + KASSERT(coreid >= 0 && coreid < sc->params.ncores, + ("%s: bad coreid %d\n", __func__, coreid)); + rc = sbuf_devlog(sc, coreid, sb, M_WAITOK); + } if (rc == 0) rc = sbuf_finish(sb); sbuf_delete(sb); @@ -9901,7 +10154,7 @@ sysctl_devlog(SYSCTL_HANDLER_ARGS) static void dump_devlog(struct adapter *sc) { - int rc; + int rc, i; struct sbuf sb; if (sbuf_new(&sb, NULL, 4096, SBUF_AUTOEXTEND) != &sb) { @@ -9909,13 +10162,15 @@ dump_devlog(struct adapter *sc) device_get_nameunit(sc->dev)); return; } - rc = sbuf_devlog(sc, &sb, M_WAITOK); + for (i = rc = 0; i < sc->params.ncores && rc == 0; i++) { + if (sc->params.ncores > 0) + sbuf_printf(&sb, "=== CIM core %u ===\n", i); + rc = sbuf_devlog(sc, i, &sb, M_WAITOK); + } if (rc == 0) { - rc = sbuf_finish(&sb); - if (rc == 0) { - log(LOG_DEBUG, "%s: device log follows.\n%s", - device_get_nameunit(sc->dev), sbuf_data(&sb)); - } + sbuf_finish(&sb); + log(LOG_DEBUG, "%s: device log follows.\n%s", + device_get_nameunit(sc->dev), sbuf_data(&sb)); } sbuf_delete(&sb); } diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index 12aaca6ee77a..0135bec6e2c1 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -424,9 +424,13 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq *nm_txq) F_FW_CMD_WRITE | F_FW_CMD_EXEC | V_FW_EQ_ETH_CMD_PFN(sc->pf) | V_FW_EQ_ETH_CMD_VFN(0)); c.alloc_to_len16 = htobe32(F_FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c)); - if (nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID) - c.alloc_to_len16 |= htobe32(F_FW_EQ_ETH_CMD_ALLOC); - else + if (nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID) { + const int core = sc->params.ncores > 1 ? + nm_txq->nid % sc->params.ncores : 0; + + c.alloc_to_len16 |= htobe32(F_FW_EQ_ETH_CMD_ALLOC | + V_FW_EQ_ETH_CMD_COREGROUP(core)); + } else c.eqid_pkd = htobe32(V_FW_EQ_ETH_CMD_EQID(nm_txq->cntxt_id)); c.autoequiqe_to_viid = htobe32(F_FW_EQ_ETH_CMD_AUTOEQUIQE | F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(vi->viid)); diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index ce506f6c9192..46f95606743c 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1,8 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2011 Chelsio Communications, Inc. - * All rights reserved. + * Copyright (c) 2011, 2025 Chelsio Communications. * Written by: Navdeep Parhar * * Redistribution and use in source and binary forms, with or without @@ -259,17 +258,20 @@ static void free_ofld_rxq(struct vi_info *, struct sge_ofld_rxq *); static void add_ofld_rxq_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_ofld_rxq *); #endif -static int ctrl_eq_alloc(struct adapter *, struct sge_eq *); -static int eth_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *); +static int ctrl_eq_alloc(struct adapter *, struct sge_eq *, int); +static int eth_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *, + int); #if defined(TCP_OFFLOAD) || defined(RATELIMIT) -static int ofld_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *); +static int ofld_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *, + int); #endif static int alloc_eq(struct adapter *, struct sge_eq *, struct sysctl_ctx_list *, struct sysctl_oid *); static void free_eq(struct adapter *, struct sge_eq *); static void add_eq_sysctls(struct adapter *, struct sysctl_ctx_list *, struct sysctl_oid *, struct sge_eq *); -static int alloc_eq_hwq(struct adapter *, struct vi_info *, struct sge_eq *); +static int alloc_eq_hwq(struct adapter *, struct vi_info *, struct sge_eq *, + int); static int free_eq_hwq(struct adapter *, struct vi_info *, struct sge_eq *); static int alloc_wrq(struct adapter *, struct vi_info *, struct sge_wrq *, struct sysctl_ctx_list *, struct sysctl_oid *); @@ -1064,9 +1066,9 @@ t4_setup_adapter_queues(struct adapter *sc) */ /* - * Control queues, one per port. + * Control queues. At least one per port and per internal core. */ - for_each_port(sc, i) { + for (i = 0; i < sc->sge.nctrlq; i++) { rc = alloc_ctrlq(sc, i); if (rc != 0) return (rc); @@ -1087,7 +1089,7 @@ t4_teardown_adapter_queues(struct adapter *sc) if (sc->sge.ctrlq != NULL) { MPASS(!(sc->flags & IS_VF)); /* VFs don't allocate ctrlq. */ - for_each_port(sc, i) + for (i = 0; i < sc->sge.nctrlq; i++) free_ctrlq(sc, i); } free_fwq(sc); @@ -3849,7 +3851,7 @@ alloc_ctrlq(struct adapter *sc, int idx) struct sysctl_oid *oid; struct sge_wrq *ctrlq = &sc->sge.ctrlq[idx]; - MPASS(idx < sc->params.nports); + MPASS(idx < sc->sge.nctrlq); if (!(ctrlq->eq.flags & EQ_SW_ALLOCATED)) { MPASS(!(ctrlq->eq.flags & EQ_HW_ALLOCATED)); @@ -3861,8 +3863,8 @@ alloc_ctrlq(struct adapter *sc, int idx) snprintf(name, sizeof(name), "%s ctrlq%d", device_get_nameunit(sc->dev), idx); - init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, idx, - &sc->sge.fwq, name); + init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, + idx % sc->params.nports, &sc->sge.fwq, name); rc = alloc_wrq(sc, NULL, ctrlq, &sc->ctx, oid); if (rc != 0) { CH_ERR(sc, "failed to allocate ctrlq%d: %d\n", idx, rc); @@ -3877,7 +3879,7 @@ alloc_ctrlq(struct adapter *sc, int idx) MPASS(ctrlq->nwr_pending == 0); MPASS(ctrlq->ndesc_needed == 0); - rc = alloc_eq_hwq(sc, NULL, &ctrlq->eq); + rc = alloc_eq_hwq(sc, NULL, &ctrlq->eq, idx); if (rc != 0) { CH_ERR(sc, "failed to create hw ctrlq%d: %d\n", idx, rc); return (rc); @@ -4265,18 +4267,20 @@ qsize_to_fthresh(int qsize) } static int -ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) +ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq, int idx) { - int rc, cntxt_id; + int rc, cntxt_id, core; struct fw_eq_ctrl_cmd c; int qsize = eq->sidx + sc->params.sge.spg_len / EQ_ESIZE; + core = sc->params.tid_qid_sel_mask != 0 ? idx % sc->params.ncores : 0; bzero(&c, sizeof(c)); *** 227 LINES SKIPPED *** From nobody Fri Oct 3 00:04:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86V23TLz6BMY3; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86T5vP8z3sJG; Fri, 03 Oct 2025 00:04:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QiCTPsY+1FnR65a8wH440bQ6SOJ/9FpIc1Y+Bnz6Q3U=; b=QxtJTHZEST/RjB3EYFlZgjrBve79NbBO3m9w22YAUP/ks1qtw/f8Ged1JeykxJDPykcIzs ShPzVwHuiRXUHcItuweG6wwxNKFmfjLxZQuGg05qokWy96mM7bSSy4173k9kbKIDr08HsZ w3y0mS8adMU7iFY2veVCgZUqDlNExa4JAiqBKxkfCG4OMHeAgdIDGW3jYI8Pr3jeKJLmgk K5rKkVFGSACSjV9ED92n9I8bQJ9jj8GReL4bR3YW8uZ/RaPxEc7F5BBP3F8yi9xcWf+c6f JdpagQUN9xg16V42ERw2RhGQkQh2vamHag33RPx0m3VVPEzb5Vn1ySOV/gZo9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QiCTPsY+1FnR65a8wH440bQ6SOJ/9FpIc1Y+Bnz6Q3U=; b=Adms0ssBpT8eRMl/JCZ0I2QYEmrV0xpvfbDzWKGKiL+Nb1gnVIoKka2b93h0LF9YKc1K9y +QnUWHT6C7w7lIitTFuSLx3uid56xAMI0OWEwr8kMJ72mtaljrS5bw2sg33wZ5fQE9J4vu +tC4y4VLTyTZ4blIbXon975v76v6ONvkcHz28QxeZxa6AW0mxOB6gu7wNNRrfblkNKT+7a ioTDUWBHy7W5GYXKSmANcIrlOi41UNGcYwtd0PpEVEc6LtPjPs2SPXDSjinphou2Du9fAc MGBsfprRk13HeVqa3HlNgN0dkmeltKFY5fYSFZ+Pg4lh6vPNH2Wcb1ZP/M4PzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449873; a=rsa-sha256; cv=none; b=obNa98Ih3zuf9xEPKRudAJlqNFaoKH7UFHUgJh0oACWuQswMY2s+qVSQWSztJErUJjiS2I Ro+PEMmx5ALuyjhw1HAe6heDg01ti1iNgL9VNDjP5Pmb+wJhwvvLURjQ+7l7++8P2WTUxJ aTQySyhRfvN+RYXmfywujI4QdbTliW2kf5khUTzZZcN7N11T41dyIiFqWmqqb6kyuxhS96 uFEn3LfK4IIcrwgKVUTEoyP2qLiFWqkNib0g7Fb50lhANL9paPtENQVir/3prUw5iuQmdi cYpZJhXH/h8sT7yfhMwl0Kn5fSgxrXNuVTEE46U5ujJbukqH2Q5O8QTiuQZF8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86T5TRFzVfd; Fri, 03 Oct 2025 00:04: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 59304XNa057127; Fri, 3 Oct 2025 00:04:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304XxN057123; Fri, 3 Oct 2025 00:04:33 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:33 GMT Message-Id: <202510030004.59304XxN057123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: c42d37ec215f - stable/15 - cxgbe(4): T7 TCB CPLs have queue and channel in different location List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c42d37ec215f0ebbe4832a1f78cfb0808af4d1f3 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c42d37ec215f0ebbe4832a1f78cfb0808af4d1f3 commit c42d37ec215f0ebbe4832a1f78cfb0808af4d1f3 Author: Navdeep Parhar AuthorDate: 2025-09-29 09:52:55 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:06 +0000 cxgbe(4): T7 TCB CPLs have queue and channel in different location Sponsored by: Chelsio Communications (cherry picked from commit 721033a7d96f24e80ec18ec9cc17712be55a52b7) --- sys/dev/cxgbe/t4_filter.c | 18 +++++++++++++----- sys/dev/cxgbe/tom/t4_cpl_io.c | 15 ++++++++++++--- sys/dev/cxgbe/tom/t4_tom.c | 11 +++++++++-- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_filter.c b/sys/dev/cxgbe/t4_filter.c index 92f882dd38cf..4b583b67ba07 100644 --- a/sys/dev/cxgbe/t4_filter.c +++ b/sys/dev/cxgbe/t4_filter.c @@ -1397,11 +1397,19 @@ set_tcb_field(struct adapter *sc, u_int tid, uint16_t word, uint64_t mask, return (ENOMEM); bzero(req, sizeof(*req)); INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, tid); - if (no_reply == 0) { - req->reply_ctrl = htobe16(V_QUEUENO(sc->sge.fwq.abs_id) | - V_NO_REPLY(0)); - } else - req->reply_ctrl = htobe16(V_NO_REPLY(1)); + if (no_reply) { + req->reply_ctrl = htobe16(F_NO_REPLY); + } else { + const int qid = sc->sge.fwq.abs_id; + + if (chip_id(sc) >= CHELSIO_T7) { + req->reply_ctrl = htobe16(V_T7_QUEUENO(qid) | + V_T7_REPLY_CHAN(0) | V_NO_REPLY(0)); + } else { + req->reply_ctrl = htobe16(V_QUEUENO(qid) | + V_REPLY_CHAN(0) | V_NO_REPLY(0)); + } + } req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(CPL_COOKIE_HASHFILTER)); req->mask = htobe64(mask); req->val = htobe64(val); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 402aa29c05cb..84e31efa8b58 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2051,9 +2051,18 @@ write_set_tcb_field(struct adapter *sc, void *dst, struct toepcb *toep, } INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, toep->tid); - req->reply_ctrl = htobe16(V_QUEUENO(toep->ofld_rxq->iq.abs_id)); - if (reply == 0) - req->reply_ctrl |= htobe16(F_NO_REPLY); + if (reply == 0) { + req->reply_ctrl = htobe16(F_NO_REPLY); + } else { + const int qid = toep->ofld_rxq->iq.abs_id; + if (chip_id(sc) >= CHELSIO_T7) { + req->reply_ctrl = htobe16(V_T7_QUEUENO(qid) | + V_T7_REPLY_CHAN(0) | V_NO_REPLY(0)); + } else { + req->reply_ctrl = htobe16(V_QUEUENO(qid) | + V_REPLY_CHAN(0) | V_NO_REPLY(0)); + } + } req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(cookie)); req->mask = htobe64(mask); req->val = htobe64(val); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 82d8f724b382..18d73afc47c5 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -494,8 +494,15 @@ send_get_tcb(struct adapter *sc, u_int tid) bzero(cpl, sizeof(*cpl)); INIT_TP_WR(cpl, tid); OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_GET_TCB, tid)); - cpl->reply_ctrl = htobe16(V_REPLY_CHAN(0) | - V_QUEUENO(sc->sge.ofld_rxq[0].iq.cntxt_id)); + if (chip_id(sc) >= CHELSIO_T7) { + cpl->reply_ctrl = + htobe16(V_T7_QUEUENO(sc->sge.ofld_rxq[0].iq.cntxt_id) | + V_T7_REPLY_CHAN(0) | V_NO_REPLY(0)); + } else { + cpl->reply_ctrl = + htobe16(V_QUEUENO(sc->sge.ofld_rxq[0].iq.cntxt_id) | + V_REPLY_CHAN(0) | V_NO_REPLY(0)); + } cpl->cookie = 0xff; commit_wrq_wr(&sc->sge.ctrlq[0], cpl, &cookie); From nobody Fri Oct 3 00:04:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86T1bTkz6BN1S; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86S5Mmdz3sZ4; Fri, 03 Oct 2025 00:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ydssBMGYrS8tDHvlcO+zLjafxzkJgE2bFz53XrmXUtg=; b=slelbP+lBpE3e9AlcJJl3Ca2EhlQ+d4SociT/2FxE3EmzhW9xFuJ12IjbYvSw/5X8YsuXq KeEzQ4ljmtd8UaXXohMKVWLkE9VIaRbQzwZAjFgUn+YC0CcdMHERmuPQAvuCIpA1Hjlyr8 0ZRYWH0ton/B8lWerJ2UwxY8uee3VI32j3+21T28zrSJ/w/52vxJGX88+DcOS9XynsSn+S v00+g8vNemfzUmNUVYPF8JPMn4cawXlafbrFOQHp5LY6huEgzmP1Kvkls4Zopz0gkk/WKK MjM5jPXGOAx/6JR0vbdHenhcIFZiGgrgs0TZCuAg1USPtxqcBV7LTvOK4WHhWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ydssBMGYrS8tDHvlcO+zLjafxzkJgE2bFz53XrmXUtg=; b=NT7t8KY0utdzSLjhhwKo8CAklarsO3OWXuKXaK6RDoFqKS+7FTJjGaTKPWMrBvv+DrwhKL XPI15ceLDtx7Fy3vBg55+9m2IKk3RKhep7ScPY4ZjKYzTJhgjOCnwEjazJ8C3hKT7VXLgz 38gBmvj3zgBkOA8DNK7iLbpWJwbq4EGeUgZABno8x6Y+crE/V1wrM604Lcv6KGXDghkB1z nva48m8c54sspkFbmeMZ9gW4sXAOm5yq9TDFAc28hIk8sPW95iQ0MX+1VQ7gsUW4qI6+Te hDm3YWly5RHGRaoQPBCv0I9DNuZj3aFWsn04KTutWJAS4uG+B2iC7Pz3rD1uKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449872; a=rsa-sha256; cv=none; b=k2uV35NHfpNNGlIqxuLv+g7Him64oQ+tiSTEB26F75vxVD/60yxN7Z8dKKjqUSf2T5INNm OuD/H4N6vsHv68q2AjYi6xJDpPh6h9mxiMVsHQzKgSLSlxVyW1V007uWFe3cTm3/c50zH4 410zGAEkHtcfceIdGRBvT3KkWRXISyBF/9bS84+pFYHfUKPjOGpp8sNxoiEpLL9SykVbcJ P3UUDTW2kZVfO24pzwetRv4enk3qyyaleoJjmIaKaJXTpPEE/p5o779EqJvEgjFrsI3ZVX qEGDbhnDnuXo8bxTv+9wMWNn80w+0dvzbmuKoSkj9NIvTZvbPQWKKthFN743Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86S4hBBzVct; Fri, 03 Oct 2025 00:04: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 59304WF0057092; Fri, 3 Oct 2025 00:04:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304Wk7057089; Fri, 3 Oct 2025 00:04:32 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:32 GMT Message-Id: <202510030004.59304Wk7057089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: eee6854c33c7 - stable/15 - cxgbe(4): Update the filtering code for T7 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: eee6854c33c70579ea17453c3490b890da57628d Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=eee6854c33c70579ea17453c3490b890da57628d commit eee6854c33c70579ea17453c3490b890da57628d Author: Navdeep Parhar AuthorDate: 2025-09-29 09:48:18 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:06 +0000 cxgbe(4): Update the filtering code for T7 There are new fields available and the width of the optional part has changed. This affects the ntuples used by TOE/filters/hashfilters. Sponsored by: Chelsio Communications (cherry picked from commit c231e86ce388a0d0fb64e0fd2ff736c990ec97bb) --- sys/dev/cxgbe/t4_filter.c | 458 +++++++++++++++++++++++++++++------------ sys/dev/cxgbe/t4_ioctl.h | 8 + sys/dev/cxgbe/tom/t4_connect.c | 37 +++- sys/dev/cxgbe/tom/t4_tom.c | 5 +- 4 files changed, 368 insertions(+), 140 deletions(-) diff --git a/sys/dev/cxgbe/t4_filter.c b/sys/dev/cxgbe/t4_filter.c index 8d4552116d96..92f882dd38cf 100644 --- a/sys/dev/cxgbe/t4_filter.c +++ b/sys/dev/cxgbe/t4_filter.c @@ -322,48 +322,85 @@ remove_hftid(struct adapter *sc, struct filter_entry *f) LIST_REMOVE(f, link_tid); } -/* - * Input: driver's 32b filter mode. - * Returns: hardware filter mode (bits to set in vlan_pri_map) for the input. - */ static uint16_t -mode_to_fconf(uint32_t mode) +mode_to_fconf_t4(uint32_t mode) { uint32_t fconf = 0; if (mode & T4_FILTER_IP_FRAGMENT) fconf |= F_FRAGMENTATION; - if (mode & T4_FILTER_MPS_HIT_TYPE) fconf |= F_MPSHITTYPE; - if (mode & T4_FILTER_MAC_IDX) fconf |= F_MACMATCH; - if (mode & T4_FILTER_ETH_TYPE) fconf |= F_ETHERTYPE; - if (mode & T4_FILTER_IP_PROTO) fconf |= F_PROTOCOL; - if (mode & T4_FILTER_IP_TOS) fconf |= F_TOS; - if (mode & T4_FILTER_VLAN) fconf |= F_VLAN; - if (mode & T4_FILTER_VNIC) fconf |= F_VNIC_ID; - if (mode & T4_FILTER_PORT) fconf |= F_PORT; - if (mode & T4_FILTER_FCoE) fconf |= F_FCOE; return (fconf); } +static uint16_t +mode_to_fconf_t7(uint32_t mode) +{ + uint32_t fconf = 0; + + if (mode & T4_FILTER_TCPFLAGS) + fconf |= F_TCPFLAGS; + if (mode & T4_FILTER_SYNONLY) + fconf |= F_SYNONLY; + if (mode & T4_FILTER_ROCE) + fconf |= F_ROCE; + if (mode & T4_FILTER_IP_FRAGMENT) + fconf |= F_T7_FRAGMENTATION; + if (mode & T4_FILTER_MPS_HIT_TYPE) + fconf |= F_T7_MPSHITTYPE; + if (mode & T4_FILTER_MAC_IDX) + fconf |= F_T7_MACMATCH; + if (mode & T4_FILTER_ETH_TYPE) + fconf |= F_T7_ETHERTYPE; + if (mode & T4_FILTER_IP_PROTO) + fconf |= F_T7_PROTOCOL; + if (mode & T4_FILTER_IP_TOS) + fconf |= F_T7_TOS; + if (mode & T4_FILTER_VLAN) + fconf |= F_T7_VLAN; + if (mode & T4_FILTER_VNIC) + fconf |= F_T7_VNIC_ID; + if (mode & T4_FILTER_PORT) + fconf |= F_T7_PORT; + if (mode & T4_FILTER_FCoE) + fconf |= F_T7_FCOE; + if (mode & T4_FILTER_IPSECIDX) + fconf |= F_IPSECIDX; + + return (fconf); +} + +/* + * Input: driver's 32b filter mode. + * Returns: hardware filter mode (bits to set in vlan_pri_map) for the input. + */ +static uint16_t +mode_to_fconf(struct adapter *sc, uint32_t mode) +{ + if (chip_id(sc) >= CHELSIO_T7) + return (mode_to_fconf_t7(mode)); + else + return (mode_to_fconf_t4(mode)); +} + /* * Input: driver's 32b filter mode. * Returns: hardware vnic mode (ingress config) matching the input. @@ -389,65 +426,100 @@ check_fspec_against_fconf_iconf(struct adapter *sc, struct tp_params *tpp = &sc->params.tp; uint32_t fconf = 0; - if (fs->val.frag || fs->mask.frag) - fconf |= F_FRAGMENTATION; - - if (fs->val.matchtype || fs->mask.matchtype) - fconf |= F_MPSHITTYPE; - - if (fs->val.macidx || fs->mask.macidx) - fconf |= F_MACMATCH; - - if (fs->val.ethtype || fs->mask.ethtype) - fconf |= F_ETHERTYPE; - - if (fs->val.proto || fs->mask.proto) - fconf |= F_PROTOCOL; - - if (fs->val.tos || fs->mask.tos) - fconf |= F_TOS; - - if (fs->val.vlan_vld || fs->mask.vlan_vld) - fconf |= F_VLAN; - - if (fs->val.ovlan_vld || fs->mask.ovlan_vld) { - if (tpp->vnic_mode != FW_VNIC_MODE_OUTER_VLAN) - return (EINVAL); - fconf |= F_VNIC_ID; - } - - if (fs->val.pfvf_vld || fs->mask.pfvf_vld) { - if (tpp->vnic_mode != FW_VNIC_MODE_PF_VF) - return (EINVAL); - fconf |= F_VNIC_ID; - } - + if (chip_id(sc) >= CHELSIO_T7) { + if (fs->val.tcpflags || fs->mask.tcpflags) + fconf |= F_TCPFLAGS; + if (fs->val.synonly || fs->mask.synonly) + fconf |= F_SYNONLY; + if (fs->val.roce || fs->mask.roce) + fconf |= F_ROCE; + if (fs->val.frag || fs->mask.frag) + fconf |= F_T7_FRAGMENTATION; + if (fs->val.matchtype || fs->mask.matchtype) + fconf |= F_T7_MPSHITTYPE; + if (fs->val.macidx || fs->mask.macidx) + fconf |= F_T7_MACMATCH; + if (fs->val.ethtype || fs->mask.ethtype) + fconf |= F_T7_ETHERTYPE; + if (fs->val.proto || fs->mask.proto) + fconf |= F_T7_PROTOCOL; + if (fs->val.tos || fs->mask.tos) + fconf |= F_T7_TOS; + if (fs->val.vlan_vld || fs->mask.vlan_vld) + fconf |= F_T7_VLAN; + if (fs->val.ovlan_vld || fs->mask.ovlan_vld) { + if (tpp->vnic_mode != FW_VNIC_MODE_OUTER_VLAN) + return (EINVAL); + fconf |= F_T7_VNIC_ID; + } + if (fs->val.pfvf_vld || fs->mask.pfvf_vld) { + if (tpp->vnic_mode != FW_VNIC_MODE_PF_VF) + return (EINVAL); + fconf |= F_T7_VNIC_ID; + } #ifdef notyet - if (fs->val.encap_vld || fs->mask.encap_vld) { - if (tpp->vnic_mode != FW_VNIC_MODE_ENCAP_EN); + if (fs->val.encap_vld || fs->mask.encap_vld) { + if (tpp->vnic_mode != FW_VNIC_MODE_ENCAP_EN); + return (EINVAL); + fconf |= F_T7_VNIC_ID; + } +#endif + if (fs->val.iport || fs->mask.iport) + fconf |= F_T7_PORT; + if (fs->val.fcoe || fs->mask.fcoe) + fconf |= F_T7_FCOE; + if (fs->val.ipsecidx || fs->mask.ipsecidx) + fconf |= F_IPSECIDX; + } else { + if (fs->val.tcpflags || fs->mask.tcpflags || + fs->val.synonly || fs->mask.synonly || + fs->val.roce || fs->mask.roce || + fs->val.ipsecidx || fs->mask.ipsecidx) return (EINVAL); - fconf |= F_VNIC_ID; - } + if (fs->val.frag || fs->mask.frag) + fconf |= F_FRAGMENTATION; + if (fs->val.matchtype || fs->mask.matchtype) + fconf |= F_MPSHITTYPE; + if (fs->val.macidx || fs->mask.macidx) + fconf |= F_MACMATCH; + if (fs->val.ethtype || fs->mask.ethtype) + fconf |= F_ETHERTYPE; + if (fs->val.proto || fs->mask.proto) + fconf |= F_PROTOCOL; + if (fs->val.tos || fs->mask.tos) + fconf |= F_TOS; + if (fs->val.vlan_vld || fs->mask.vlan_vld) + fconf |= F_VLAN; + if (fs->val.ovlan_vld || fs->mask.ovlan_vld) { + if (tpp->vnic_mode != FW_VNIC_MODE_OUTER_VLAN) + return (EINVAL); + fconf |= F_VNIC_ID; + } + if (fs->val.pfvf_vld || fs->mask.pfvf_vld) { + if (tpp->vnic_mode != FW_VNIC_MODE_PF_VF) + return (EINVAL); + fconf |= F_VNIC_ID; + } +#ifdef notyet + if (fs->val.encap_vld || fs->mask.encap_vld) { + if (tpp->vnic_mode != FW_VNIC_MODE_ENCAP_EN); + return (EINVAL); + fconf |= F_VNIC_ID; + } #endif - - if (fs->val.iport || fs->mask.iport) - fconf |= F_PORT; - - if (fs->val.fcoe || fs->mask.fcoe) - fconf |= F_FCOE; - + if (fs->val.iport || fs->mask.iport) + fconf |= F_PORT; + if (fs->val.fcoe || fs->mask.fcoe) + fconf |= F_FCOE; + } if ((tpp->filter_mode | fconf) != tpp->filter_mode) return (E2BIG); return (0); } -/* - * Input: hardware filter configuration (filter mode/mask, ingress config). - * Input: driver's 32b filter mode matching the input. - */ static uint32_t -fconf_to_mode(uint16_t hwmode, int vnic_mode) +fconf_to_mode_t4(uint16_t hwmode, int vnic_mode) { uint32_t mode = T4_FILTER_IPv4 | T4_FILTER_IPv6 | T4_FILTER_IP_SADDR | T4_FILTER_IP_DADDR | T4_FILTER_IP_SPORT | T4_FILTER_IP_DPORT; @@ -488,6 +560,69 @@ fconf_to_mode(uint16_t hwmode, int vnic_mode) return (mode); } +static uint32_t +fconf_to_mode_t7(uint16_t hwmode, int vnic_mode) +{ + uint32_t mode = T4_FILTER_IPv4 | T4_FILTER_IPv6 | T4_FILTER_IP_SADDR | + T4_FILTER_IP_DADDR | T4_FILTER_IP_SPORT | T4_FILTER_IP_DPORT; + + if (hwmode & F_TCPFLAGS) + mode |= T4_FILTER_TCPFLAGS; + if (hwmode & F_SYNONLY) + mode |= T4_FILTER_SYNONLY; + if (hwmode & F_ROCE) + mode |= T4_FILTER_ROCE; + if (hwmode & F_T7_FRAGMENTATION) + mode |= T4_FILTER_IP_FRAGMENT; + if (hwmode & F_T7_MPSHITTYPE) + mode |= T4_FILTER_MPS_HIT_TYPE; + if (hwmode & F_T7_MACMATCH) + mode |= T4_FILTER_MAC_IDX; + if (hwmode & F_T7_ETHERTYPE) + mode |= T4_FILTER_ETH_TYPE; + if (hwmode & F_T7_PROTOCOL) + mode |= T4_FILTER_IP_PROTO; + if (hwmode & F_T7_TOS) + mode |= T4_FILTER_IP_TOS; + if (hwmode & F_T7_VLAN) + mode |= T4_FILTER_VLAN; + if (hwmode & F_T7_VNIC_ID) + mode |= T4_FILTER_VNIC; /* real meaning depends on vnic_mode. */ + if (hwmode & F_T7_PORT) + mode |= T4_FILTER_PORT; + if (hwmode & F_T7_FCOE) + mode |= T4_FILTER_FCoE; + if (hwmode & F_IPSECIDX) + mode |= T4_FILTER_IPSECIDX; + + switch (vnic_mode) { + case FW_VNIC_MODE_PF_VF: + mode |= T4_FILTER_IC_VNIC; + break; + case FW_VNIC_MODE_ENCAP_EN: + mode |= T4_FILTER_IC_ENCAP; + break; + case FW_VNIC_MODE_OUTER_VLAN: + default: + break; + } + + return (mode); +} + +/* + * Input: hardware filter configuration (filter mode/mask, ingress config). + * Output: driver's 32b filter mode matching the input. + */ +static inline uint32_t +fconf_to_mode(struct adapter *sc, uint16_t hwmode, int vnic_mode) +{ + if (chip_id(sc) >= CHELSIO_T7) + return (fconf_to_mode_t7(hwmode, vnic_mode)); + else + return (fconf_to_mode_t4(hwmode, vnic_mode)); +} + int get_filter_mode(struct adapter *sc, uint32_t *mode) { @@ -499,7 +634,7 @@ get_filter_mode(struct adapter *sc, uint32_t *mode) /* Non-zero incoming value in mode means "hashfilter mode". */ filter_mode = *mode ? tp->filter_mask : tp->filter_mode; - *mode = fconf_to_mode(filter_mode, tp->vnic_mode); + *mode = fconf_to_mode(sc, filter_mode, tp->vnic_mode); return (0); } @@ -512,7 +647,7 @@ set_filter_mode(struct adapter *sc, uint32_t mode) uint16_t fconf; iconf = mode_to_iconf(mode); - fconf = mode_to_fconf(mode); + fconf = mode_to_fconf(sc, mode); if ((iconf == -1 || iconf == tp->vnic_mode) && fconf == tp->filter_mode) return (0); /* Nothing to do */ @@ -554,7 +689,7 @@ set_filter_mask(struct adapter *sc, uint32_t mode) uint16_t fmask; iconf = mode_to_iconf(mode); - fmask = mode_to_fconf(mode); + fmask = mode_to_fconf(sc, mode); if ((iconf == -1 || iconf == tp->vnic_mode) && fmask == tp->filter_mask) return (0); /* Nothing to do */ @@ -811,71 +946,138 @@ hashfilter_ntuple(struct adapter *sc, const struct t4_filter_specification *fs, struct tp_params *tp = &sc->params.tp; uint16_t fmask; - *ftuple = fmask = 0; - /* * Initialize each of the fields which we care about which are present * in the Compressed Filter Tuple. */ - if (tp->vlan_shift >= 0 && fs->mask.vlan) { - *ftuple |= (uint64_t)(F_FT_VLAN_VLD | fs->val.vlan) << - tp->vlan_shift; - fmask |= F_VLAN; - } - - if (tp->port_shift >= 0 && fs->mask.iport) { - *ftuple |= (uint64_t)fs->val.iport << tp->port_shift; - fmask |= F_PORT; - } - - if (tp->protocol_shift >= 0 && fs->mask.proto) { - *ftuple |= (uint64_t)fs->val.proto << tp->protocol_shift; - fmask |= F_PROTOCOL; - } - - if (tp->tos_shift >= 0 && fs->mask.tos) { - *ftuple |= (uint64_t)(fs->val.tos) << tp->tos_shift; - fmask |= F_TOS; - } - - if (tp->vnic_shift >= 0 && fs->mask.vnic) { - /* vnic_mode was already validated. */ - if (tp->vnic_mode == FW_VNIC_MODE_PF_VF) - MPASS(fs->mask.pfvf_vld); - else if (tp->vnic_mode == FW_VNIC_MODE_OUTER_VLAN) - MPASS(fs->mask.ovlan_vld); +#define SFF(V, S) ((uint64_t)(V) << S) /* Shifted Filter Field. */ + *ftuple = fmask = 0; + if (chip_id(sc) >= CHELSIO_T7) { + if (tp->ipsecidx_shift >= 0 && fs->mask.ipsecidx) { + *ftuple |= SFF(fs->val.ipsecidx, tp->ipsecidx_shift); + fmask |= F_IPSECIDX; + } + if (tp->fcoe_shift >= 0 && fs->mask.fcoe) { + *ftuple |= SFF(fs->val.fcoe, tp->fcoe_shift); + fmask |= F_T7_FCOE; + } + if (tp->port_shift >= 0 && fs->mask.iport) { + *ftuple |= (uint64_t)fs->val.iport << tp->port_shift; + fmask |= F_T7_PORT; + } + if (tp->vnic_shift >= 0 && fs->mask.vnic) { + /* vnic_mode was already validated. */ + if (tp->vnic_mode == FW_VNIC_MODE_PF_VF) + MPASS(fs->mask.pfvf_vld); + else if (tp->vnic_mode == FW_VNIC_MODE_OUTER_VLAN) + MPASS(fs->mask.ovlan_vld); #ifdef notyet - else if (tp->vnic_mode == FW_VNIC_MODE_ENCAP_EN) - MPASS(fs->mask.encap_vld); + else if (tp->vnic_mode == FW_VNIC_MODE_ENCAP_EN) + MPASS(fs->mask.encap_vld); #endif - *ftuple |= ((1ULL << 16) | fs->val.vnic) << tp->vnic_shift; - fmask |= F_VNIC_ID; - } - - if (tp->macmatch_shift >= 0 && fs->mask.macidx) { - *ftuple |= (uint64_t)(fs->val.macidx) << tp->macmatch_shift; - fmask |= F_MACMATCH; - } - - if (tp->ethertype_shift >= 0 && fs->mask.ethtype) { - *ftuple |= (uint64_t)(fs->val.ethtype) << tp->ethertype_shift; - fmask |= F_ETHERTYPE; - } - - if (tp->matchtype_shift >= 0 && fs->mask.matchtype) { - *ftuple |= (uint64_t)(fs->val.matchtype) << tp->matchtype_shift; - fmask |= F_MPSHITTYPE; - } - - if (tp->frag_shift >= 0 && fs->mask.frag) { - *ftuple |= (uint64_t)(fs->val.frag) << tp->frag_shift; - fmask |= F_FRAGMENTATION; - } - - if (tp->fcoe_shift >= 0 && fs->mask.fcoe) { - *ftuple |= (uint64_t)(fs->val.fcoe) << tp->fcoe_shift; - fmask |= F_FCOE; + *ftuple |= SFF(F_FT_VNID_ID_VLD | fs->val.vnic, tp->vnic_shift); + fmask |= F_T7_VNIC_ID; + } + if (tp->vlan_shift >= 0 && fs->mask.vlan) { + *ftuple |= SFF(F_FT_VLAN_VLD | fs->val.vlan, tp->vlan_shift); + fmask |= F_T7_VLAN; + } + if (tp->tos_shift >= 0 && fs->mask.tos) { + *ftuple |= SFF(fs->val.tos, tp->tos_shift); + fmask |= F_T7_TOS; + } + if (tp->protocol_shift >= 0 && fs->mask.proto) { + *ftuple |= SFF(fs->val.proto, tp->protocol_shift); + fmask |= F_T7_PROTOCOL; + } + if (tp->ethertype_shift >= 0 && fs->mask.ethtype) { + *ftuple |= SFF(fs->val.ethtype, tp->ethertype_shift); + fmask |= F_T7_ETHERTYPE; + } + if (tp->macmatch_shift >= 0 && fs->mask.macidx) { + *ftuple |= SFF(fs->val.macidx, tp->macmatch_shift); + fmask |= F_T7_MACMATCH; + } + if (tp->matchtype_shift >= 0 && fs->mask.matchtype) { + *ftuple |= SFF(fs->val.matchtype, tp->matchtype_shift); + fmask |= F_T7_MPSHITTYPE; + } + if (tp->frag_shift >= 0 && fs->mask.frag) { + *ftuple |= SFF(fs->val.frag, tp->frag_shift); + fmask |= F_T7_FRAGMENTATION; + } + if (tp->roce_shift >= 0 && fs->mask.roce) { + *ftuple |= SFF(fs->val.roce, tp->roce_shift); + fmask |= F_ROCE; + } + if (tp->synonly_shift >= 0 && fs->mask.synonly) { + *ftuple |= SFF(fs->val.synonly, tp->synonly_shift); + fmask |= F_SYNONLY; + } + if (tp->tcpflags_shift >= 0 && fs->mask.tcpflags) { + *ftuple |= SFF(fs->val.tcpflags, tp->synonly_shift); + fmask |= F_TCPFLAGS; + } + } else { + if (fs->mask.ipsecidx || fs->mask.roce || fs->mask.synonly || + fs->mask.tcpflags) { + MPASS(tp->ipsecidx_shift == -1); + MPASS(tp->roce_shift == -1); + MPASS(tp->synonly_shift == -1); + MPASS(tp->tcpflags_shift == -1); + return (EINVAL); + } + if (tp->fcoe_shift >= 0 && fs->mask.fcoe) { + *ftuple |= SFF(fs->val.fcoe, tp->fcoe_shift); + fmask |= F_FCOE; + } + if (tp->port_shift >= 0 && fs->mask.iport) { + *ftuple |= (uint64_t)fs->val.iport << tp->port_shift; + fmask |= F_PORT; + } + if (tp->vnic_shift >= 0 && fs->mask.vnic) { + /* vnic_mode was already validated. */ + if (tp->vnic_mode == FW_VNIC_MODE_PF_VF) + MPASS(fs->mask.pfvf_vld); + else if (tp->vnic_mode == FW_VNIC_MODE_OUTER_VLAN) + MPASS(fs->mask.ovlan_vld); +#ifdef notyet + else if (tp->vnic_mode == FW_VNIC_MODE_ENCAP_EN) + MPASS(fs->mask.encap_vld); +#endif + *ftuple |= SFF(F_FT_VNID_ID_VLD | fs->val.vnic, tp->vnic_shift); + fmask |= F_VNIC_ID; + } + if (tp->vlan_shift >= 0 && fs->mask.vlan) { + *ftuple |= SFF(F_FT_VLAN_VLD | fs->val.vlan, tp->vlan_shift); + fmask |= F_VLAN; + } + if (tp->tos_shift >= 0 && fs->mask.tos) { + *ftuple |= SFF(fs->val.tos, tp->tos_shift); + fmask |= F_TOS; + } + if (tp->protocol_shift >= 0 && fs->mask.proto) { + *ftuple |= SFF(fs->val.proto, tp->protocol_shift); + fmask |= F_PROTOCOL; + } + if (tp->ethertype_shift >= 0 && fs->mask.ethtype) { + *ftuple |= SFF(fs->val.ethtype, tp->ethertype_shift); + fmask |= F_ETHERTYPE; + } + if (tp->macmatch_shift >= 0 && fs->mask.macidx) { + *ftuple |= SFF(fs->val.macidx, tp->macmatch_shift); + fmask |= F_MACMATCH; + } + if (tp->matchtype_shift >= 0 && fs->mask.matchtype) { + *ftuple |= SFF(fs->val.matchtype, tp->matchtype_shift); + fmask |= F_MPSHITTYPE; + } + if (tp->frag_shift >= 0 && fs->mask.frag) { + *ftuple |= SFF(fs->val.frag, tp->frag_shift); + fmask |= F_FRAGMENTATION; + } } +#undef SFF /* A hashfilter must conform to the hardware filter mask. */ if (fmask != tp->filter_mask) @@ -1594,7 +1796,7 @@ static int act_open_cpl_len16(struct adapter *sc, int isipv6) { int idx; - static const int sz_table[3][2] = { + static const int sz_table[4][2] = { { howmany(sizeof (struct cpl_act_open_req), 16), howmany(sizeof (struct cpl_act_open_req6), 16) @@ -1607,10 +1809,14 @@ act_open_cpl_len16(struct adapter *sc, int isipv6) howmany(sizeof (struct cpl_t6_act_open_req), 16), howmany(sizeof (struct cpl_t6_act_open_req6), 16) }, + { + howmany(sizeof (struct cpl_t7_act_open_req), 16), + howmany(sizeof (struct cpl_t7_act_open_req6), 16) + }, }; MPASS(chip_id(sc) >= CHELSIO_T4); - idx = min(chip_id(sc) - CHELSIO_T4, 2); + idx = min(chip_id(sc) - CHELSIO_T4, 3); return (sz_table[idx][!!isipv6]); } diff --git a/sys/dev/cxgbe/t4_ioctl.h b/sys/dev/cxgbe/t4_ioctl.h index 4698986c0a0e..f7c8ee24d596 100644 --- a/sys/dev/cxgbe/t4_ioctl.h +++ b/sys/dev/cxgbe/t4_ioctl.h @@ -120,6 +120,10 @@ struct t4_i2c_data { #define T4_FILTER_MAC_IDX 0x2000 /* MPS MAC address match index */ #define T4_FILTER_MPS_HIT_TYPE 0x4000 /* MPS match type */ #define T4_FILTER_IP_FRAGMENT 0x8000 /* IP fragment */ +#define T4_FILTER_IPSECIDX 0x10000 +#define T4_FILTER_ROCE 0x20000 +#define T4_FILTER_SYNONLY 0x40000 +#define T4_FILTER_TCPFLAGS 0x80000 /* * T4_FILTER_VNIC's real meaning depends on the ingress config. */ @@ -200,6 +204,10 @@ struct t4_filter_tuple { uint32_t vlan_vld:1; /* VLAN valid */ uint32_t ovlan_vld:1; /* outer VLAN tag valid, value in "vnic" */ uint32_t pfvf_vld:1; /* VNIC id (PF/VF) valid, value in "vnic" */ + uint32_t roce:1; + uint32_t synonly:1; + uint32_t tcpflags:6; + uint32_t ipsecidx:12; }; struct t4_filter_specification { diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c index fc092eab3223..c236ee060bc2 100644 --- a/sys/dev/cxgbe/tom/t4_connect.c +++ b/sys/dev/cxgbe/tom/t4_connect.c @@ -211,7 +211,7 @@ static inline int act_open_cpl_size(struct adapter *sc, int isipv6) { int idx; - static const int sz_table[3][2] = { + static const int sz_table[4][2] = { { sizeof (struct cpl_act_open_req), sizeof (struct cpl_act_open_req6) @@ -224,10 +224,14 @@ act_open_cpl_size(struct adapter *sc, int isipv6) sizeof (struct cpl_t6_act_open_req), sizeof (struct cpl_t6_act_open_req6) }, + { + sizeof (struct cpl_t7_act_open_req), + sizeof (struct cpl_t7_act_open_req6) + }, }; MPASS(chip_id(sc) >= CHELSIO_T4); - idx = min(chip_id(sc) - CHELSIO_T4, 2); + idx = min(chip_id(sc) - CHELSIO_T4, 3); return (sz_table[idx][!!isipv6]); } @@ -261,6 +265,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct nhop_object *nh, struct offload_settings settings; struct epoch_tracker et; uint16_t vid = 0xfff, pcp = 0; + uint64_t ntuple; INP_WLOCK_ASSERT(inp); KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6, @@ -314,10 +319,12 @@ t4_connect(struct toedev *tod, struct socket *so, struct nhop_object *nh, qid_atid = V_TID_QID(toep->ofld_rxq->iq.abs_id) | V_TID_TID(toep->tid) | V_TID_COOKIE(CPL_COOKIE_TOM); + ntuple = select_ntuple(vi, toep->l2te); if (isipv6) { struct cpl_act_open_req6 *cpl = wrtod(wr); struct cpl_t5_act_open_req6 *cpl5 = (void *)cpl; struct cpl_t6_act_open_req6 *cpl6 = (void *)cpl; + struct cpl_t7_act_open_req6 *cpl7 = (void *)cpl; if ((inp->inp_vflag & INP_IPV6) == 0) DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); @@ -329,18 +336,23 @@ t4_connect(struct toedev *tod, struct socket *so, struct nhop_object *nh, switch (chip_id(sc)) { case CHELSIO_T4: INIT_TP_WR(cpl, 0); - cpl->params = select_ntuple(vi, toep->l2te); + cpl->params = htobe32((uint32_t)ntuple); break; case CHELSIO_T5: INIT_TP_WR(cpl5, 0); cpl5->iss = htobe32(tp->iss); - cpl5->params = select_ntuple(vi, toep->l2te); + cpl5->params = htobe64(V_FILTER_TUPLE(ntuple)); break; case CHELSIO_T6: - default: INIT_TP_WR(cpl6, 0); cpl6->iss = htobe32(tp->iss); - cpl6->params = select_ntuple(vi, toep->l2te); + cpl6->params = htobe64(V_FILTER_TUPLE(ntuple)); + break; + case CHELSIO_T7: + default: + INIT_TP_WR(cpl7, 0); + cpl7->iss = htobe32(tp->iss); + cpl7->params = htobe64(V_T7_FILTER_TUPLE(ntuple)); break; } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6, @@ -362,23 +374,28 @@ t4_connect(struct toedev *tod, struct socket *so, struct nhop_object *nh, struct cpl_act_open_req *cpl = wrtod(wr); struct cpl_t5_act_open_req *cpl5 = (void *)cpl; struct cpl_t6_act_open_req *cpl6 = (void *)cpl; + struct cpl_t7_act_open_req *cpl7 = (void *)cpl; switch (chip_id(sc)) { case CHELSIO_T4: INIT_TP_WR(cpl, 0); - cpl->params = select_ntuple(vi, toep->l2te); + cpl->params = htobe32((uint32_t)ntuple); break; case CHELSIO_T5: INIT_TP_WR(cpl5, 0); cpl5->iss = htobe32(tp->iss); - cpl5->params = select_ntuple(vi, toep->l2te); + cpl5->params = htobe64(V_FILTER_TUPLE(ntuple)); break; case CHELSIO_T6: - default: INIT_TP_WR(cpl6, 0); cpl6->iss = htobe32(tp->iss); - cpl6->params = select_ntuple(vi, toep->l2te); + cpl6->params = htobe64(V_FILTER_TUPLE(ntuple)); break; + case CHELSIO_T7: + default: + INIT_TP_WR(cpl7, 0); + cpl7->iss = htobe32(tp->iss); + cpl7->params = htobe64(V_T7_FILTER_TUPLE(ntuple)); } OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ, qid_atid)); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 024164ef4c51..82d8f724b382 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1232,10 +1232,7 @@ select_ntuple(struct vi_info *vi, struct l2t_entry *e) tp->vnic_shift; } - if (is_t4(sc)) - return (htobe32((uint32_t)ntuple)); - else - return (htobe64(V_FILTER_TUPLE(ntuple))); + return (ntuple); } /* From nobody Fri Oct 3 00:04:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86X3DqRz6BMjh; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86X03zZz3sR8; Fri, 03 Oct 2025 00:04:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gf+mJQ3HKfGHTzoITDedPpBdtvRqpxzeI8YpM08fscw=; b=Nrm9325GHFVrq12Yx3EWRTitzGARrV5KGyi6eVak2EMLnZqmTX4PvGEF6nKKlUIzGPPddl poNi/oZDteXTNa8toqTbG7ouk8r1wKuY0G3L+DYXTlh0ZeKRXh+7WfsKFMLzKvqAsdI43R 3SWqugFod+mI2pxnbK8vKqIMMMX4f6Y20TbC0XwymFNF0rPoy/xwn39y11VpZSmAQVexPx wzqhhgfn8ZX/C2eLGT2IUDvZUigCPNAg9ZlwnZH95AKt2Y/JVqF5tF/fgJJC9XGWba2wgF yX7mkvxPi4pUcb31Prh4ZM1kYSzzQzR7PqS/CsXsEez9zhe6EUkmDsqybyz6Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gf+mJQ3HKfGHTzoITDedPpBdtvRqpxzeI8YpM08fscw=; b=FdrkmlKlzqFC5IeV0aJ3qvxtmgDy6Y83H8ogJv2ULLk3Nu800ZwtFzetjENCPxJF0HWzV6 cuSjcCn55KrCHwjLhqDESaBDetnFsbpKzchCVF/kI0DsTJnkes3xT+wbzzfFVhA9JFdJY6 m+wRcX06dysUjF2hpoIqgnD+12ymrOz+xxbDFb8Drd49ewKRvbXgg7XmS/z+JgYLVXXVpF BQR6UWMR62Y7QpCegEntmWu2coYlje47dJKGH/m5lA3qVjLzPJJEFxQ7TwK7g3xvkd6Wzv gTqMDsA9Hk/duKEZMVTYUfXWQPnxJ5dWRqFK1Dr8BiT2HcVfZSGKAbxmwZ7oww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449876; a=rsa-sha256; cv=none; b=VUFW5EfLnOjcy3JdP31utEMwZyW7YxXtAhm49bj+udl15X4qM425cKCU1aaLBxNNsaJL9v +FJYsNydpkzyxVlKtHzyZCvZlMBfRDl2b9QV/np/qvPKmcRhL+et33Iu/dz0g3nUJARjsH upvqzo9EUFELyYSeIu7P2d2WzK/r7sMIEltjhadD6IKyrvqWmOh+/lSa+xPgcbtp+UKOxs wkpCgQS4VDFr2jXXIUWX3d2mhv2nHSuJdYfdAhpv2p+cCt3amqTzKTLUPygeKw5NLOSdNn fdl7kAJZaAlhyAkIQwAXt2WbHDXQzhUAulO4ax5+N5XwBoJiHNqAMEAQuyB38g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86W6gjWzV1M; Fri, 03 Oct 2025 00:04: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 59304ZmM057201; Fri, 3 Oct 2025 00:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304Z38057198; Fri, 3 Oct 2025 00:04:35 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:35 GMT Message-Id: <202510030004.59304Z38057198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 9d5e555fc26c - stable/15 - cxgbe(4): Support for T7 tracing filters List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9d5e555fc26c31a4a88b80ebcfdc9e3af9de213d Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=9d5e555fc26c31a4a88b80ebcfdc9e3af9de213d commit 9d5e555fc26c31a4a88b80ebcfdc9e3af9de213d Author: Navdeep Parhar AuthorDate: 2025-09-29 13:54:10 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:06 +0000 cxgbe(4): Support for T7 tracing filters These are the filters that can be used to sniff wire traffic after all hw offloads. Sponsored by: Chelsio Communications (cherry picked from commit 3203b1a110c890e7b407a83fa3d65b4ba711e59d) --- sys/dev/cxgbe/t4_main.c | 10 ++-------- sys/dev/cxgbe/t4_tracer.c | 5 ++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index df6314ca6e18..0ad162cf2231 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2524,11 +2524,7 @@ restart_lld(struct adapter *sc) } if (sc->traceq < 0 && IS_MAIN_VI(vi)) { sc->traceq = sc->sge.rxq[vi->first_rxq].iq.abs_id; - t4_write_reg(sc, is_t4(sc) ? - A_MPS_TRC_RSS_CONTROL : - A_MPS_T5_TRC_RSS_CONTROL, - V_RSSCONTROL(pi->tx_chan) | - V_QUEUENUMBER(sc->traceq)); + t4_set_trace_rss_control(sc, pi->tx_chan, sc->traceq); pi->flags |= HAS_TRACEQ; } @@ -6756,9 +6752,7 @@ cxgbe_init_synchronized(struct vi_info *vi) */ if (sc->traceq < 0 && IS_MAIN_VI(vi)) { sc->traceq = sc->sge.rxq[vi->first_rxq].iq.abs_id; - t4_write_reg(sc, is_t4(sc) ? A_MPS_TRC_RSS_CONTROL : - A_MPS_T5_TRC_RSS_CONTROL, V_RSSCONTROL(pi->tx_chan) | - V_QUEUENUMBER(sc->traceq)); + t4_set_trace_rss_control(sc, pi->tx_chan, sc->traceq); pi->flags |= HAS_TRACEQ; } diff --git a/sys/dev/cxgbe/t4_tracer.c b/sys/dev/cxgbe/t4_tracer.c index 80689a543e83..4f8d28626bc9 100644 --- a/sys/dev/cxgbe/t4_tracer.c +++ b/sys/dev/cxgbe/t4_tracer.c @@ -123,9 +123,8 @@ static int t4_cloner_match(struct if_clone *ifc, const char *name) { - if (strncmp(name, "t4nex", 5) != 0 && - strncmp(name, "t5nex", 5) != 0 && - strncmp(name, "t6nex", 5) != 0) + if (strncmp(name, "t4nex", 5) != 0 && strncmp(name, "t5nex", 5) != 0 && + strncmp(name, "t6nex", 5) != 0 && strncmp(name, "chnex", 5) != 0) return (0); if (name[5] < '0' || name[5] > '9') return (0); From nobody Fri Oct 3 00:04:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86W2NJ6z6BMbQ; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86V6fNBz3shf; Fri, 03 Oct 2025 00:04:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvoF91Qt8wBGcxJoWQHbe0+eXpWzN5c+tDMkQzAKvlM=; b=W3uNIdkMN2jp4gBldnhP+aar5uGnxdP31GrM1gXihV/x0bric027S/Vg3d51V4XQ51YKFI YjoJKvX1JcMIR6NM7osaM0sH5XdSlFjuCuc++O40p0mqVGUCcbbZQcmq/11QPR06gBah7H J1bNkxcj3s4bsBx+IIYD7Gw2ACpzB1o58sanPqSNKAbvwQlN58P2wZOdj/NMY8cr3ClXFN qmpPIJ26dsZiOgMwOHt4bcyR6C8Fpi8P/KJxQXSXb73UgRWrfEVrKOVE59xSNYLi1XaJ2Y ub0eRH4b7cZuK6cWoVDOR7JdQrR5sZzrww5bW6htXBP1EW8nvtGp9o15S7bYyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvoF91Qt8wBGcxJoWQHbe0+eXpWzN5c+tDMkQzAKvlM=; b=wNNaDEDcsSKlC5Zap9CjqdYU0tp1BeMKrKdeFj8Opf0+RVx1gm3HTdL6jIYdH4FrT/wxxg a6hPJ5viU7UXxnh1QlWxjCC6wSFWMtxvgHyBGh6P+1y/ZgZevTkLJVfB1KfJMp/+kNE/0T eYT5D1TxKku2iRLVlTQtnKe9+1665gEYug+bHhWbRvKFDDFO+drGWnOYbKLoUGARiEPgxV /qZbQbprDa36ZBu/uVELUamdQ6UideVx5stvdpBY8a9EswoI+SQmNLlNM4wZArmA+D5Wm0 GSLuMiuzak2cfNeYAW4W3FuM5KwZi5lJLZkyEEp3mGV1OLMy7iHoIOxqLZtzVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449875; a=rsa-sha256; cv=none; b=esyUZv+fS8v7Mmz3y0pzVZb4iGUdVQGcJRzjFDE4npwZ2dRXiTVzdbMNXKcJWBz1rS298B NxCk4W99DaZFYqJM8N+ziy7Wohg1PruwniW61SOYu/k8VNRM5SLFCz0xowmCce8kyBym/E i7ryc0OGoYmhK0yrTyVDpXoOX46wEcUVkfPCa1HrwYOwHXQ6ycfhay915CV9//CCYgw7+4 3RQD0PMYFXC1Hme8tYEkfWivibMyjgnbA8lwHoCqhT6Uxlf6f+fRqmM8tCN3xtA7hXoVv8 cfdGaHyXEHA0gEAImoFP911e0fIgiSSuvXw8HLsQlZU4BfFExFrfd6chQyFNFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86V6CV0zVff; Fri, 03 Oct 2025 00:04: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 59304YRr057167; Fri, 3 Oct 2025 00:04:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304YUE057164; Fri, 3 Oct 2025 00:04:34 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:34 GMT Message-Id: <202510030004.59304YUE057164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 9d66e94f4e5f - stable/15 - cxgbe(4): T7 ULPTX supports larger data length with MEMIO commands List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9d66e94f4e5f23b03288311be75c8b18526a0fe8 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=9d66e94f4e5f23b03288311be75c8b18526a0fe8 commit 9d66e94f4e5f23b03288311be75c8b18526a0fe8 Author: Navdeep Parhar AuthorDate: 2025-09-29 13:18:07 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:06 +0000 cxgbe(4): T7 ULPTX supports larger data length with MEMIO commands Sponsored by: Chelsio Communications (cherry picked from commit 77098268dc397ea86f157f6e66540cd6618e0a05) --- sys/dev/cxgbe/crypto/t4_keyctx.c | 4 ++++ sys/dev/cxgbe/iw_cxgbe/mem.c | 13 ++++++++++--- sys/dev/cxgbe/tom/t4_ddp.c | 20 ++++++++++++++++---- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_keyctx.c b/sys/dev/cxgbe/crypto/t4_keyctx.c index 50e339ac2e05..52a75666c3aa 100644 --- a/sys/dev/cxgbe/crypto/t4_keyctx.c +++ b/sys/dev/cxgbe/crypto/t4_keyctx.c @@ -665,6 +665,10 @@ t4_write_tlskey_wr(const struct ktls_session *tls, int direction, int tid, kwr->reneg_to_write_rx = V_KEY_GET_LOC(direction == KTLS_TX ? KEY_WRITE_TX : KEY_WRITE_RX); + /* We don't need to use V_T7_ULP_MEMIO_DATA_LEN in this routine. */ + _Static_assert(V_T7_ULP_MEMIO_DATA_LEN(TLS_KEY_CONTEXT_SZ >> 5) == + V_ULP_MEMIO_DATA_LEN(TLS_KEY_CONTEXT_SZ >> 5), "datalen mismatch"); + /* master command */ kwr->cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | V_T5_ULP_MEMIO_ORDER(1) | V_T5_ULP_MEMIO_IMM(1)); diff --git a/sys/dev/cxgbe/iw_cxgbe/mem.c b/sys/dev/cxgbe/iw_cxgbe/mem.c index 4a1adc118b7c..9e879bde6169 100644 --- a/sys/dev/cxgbe/iw_cxgbe/mem.c +++ b/sys/dev/cxgbe/iw_cxgbe/mem.c @@ -86,7 +86,10 @@ _c4iw_write_mem_dma_aligned(struct c4iw_rdev *rdev, u32 addr, u32 len, ulpmc->cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | V_T5_ULP_MEMIO_ORDER(1) | V_T5_ULP_MEMIO_FID(sc->sge.ofld_rxq[0].iq.abs_id)); - ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN(len>>5)); + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = cpu_to_be32(V_T7_ULP_MEMIO_DATA_LEN(len>>5)); + else + ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN(len>>5)); ulpmc->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = cpu_to_be32(V_ULP_MEMIO_ADDR(addr)); @@ -149,8 +152,12 @@ _c4iw_write_mem_inline(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) V_FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16))); ulpmc->cmd = cmd; - ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN( - DIV_ROUND_UP(copy_len, T4_ULPTX_MIN_IO))); + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = cpu_to_be32(V_T7_ULP_MEMIO_DATA_LEN( + DIV_ROUND_UP(copy_len, T4_ULPTX_MIN_IO))); + else + ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN( + DIV_ROUND_UP(copy_len, T4_ULPTX_MIN_IO))); ulpmc->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = cpu_to_be32(V_ULP_MEMIO_ADDR(addr + i * 3)); diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index da0753296532..35fb1061d867 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -1655,7 +1655,10 @@ t4_write_page_pods_for_ps(struct adapter *sc, struct sge_wrq *wrq, int tid, INIT_ULPTX_WR(ulpmc, len, 0, 0); ulpmc->cmd = cmd; - ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = htobe32(V_T7_ULP_MEMIO_DATA_LEN(chunk >> 5)); + else + ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk >> 5)); ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); @@ -1842,7 +1845,10 @@ t4_write_page_pods_for_bio(struct adapter *sc, struct toepcb *toep, ulpmc = mtod(m, struct ulp_mem_io *); INIT_ULPTX_WR(ulpmc, len, 0, toep->tid); ulpmc->cmd = cmd; - ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = htobe32(V_T7_ULP_MEMIO_DATA_LEN(chunk >> 5)); + else + ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk >> 5)); ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); @@ -1922,7 +1928,10 @@ t4_write_page_pods_for_buf(struct adapter *sc, struct toepcb *toep, INIT_ULPTX_WR(ulpmc, len, 0, toep->tid); ulpmc->cmd = cmd; - ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = htobe32(V_T7_ULP_MEMIO_DATA_LEN(chunk >> 5)); + else + ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk >> 5)); ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); @@ -2013,7 +2022,10 @@ t4_write_page_pods_for_sgl(struct adapter *sc, struct toepcb *toep, INIT_ULPTX_WR(ulpmc, len, 0, toep->tid); ulpmc->cmd = cmd; - ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk / 32)); + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = htobe32(V_T7_ULP_MEMIO_DATA_LEN(chunk >> 5)); + else + ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(chunk >> 5)); ulpmc->len16 = htobe32(howmany(len - sizeof(ulpmc->wr), 16)); ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(ppod_addr >> 5)); From nobody Fri Oct 3 00:04:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86Y6sdZz6BN1Y; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86Y1LnSz3sg7; Fri, 03 Oct 2025 00:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SSu0t45MWbl9m43P1ollER79gg6TyDC947Fpr/HG68w=; b=f1LHLQpeWkcBXM6+bZrRCZqDoe1J7VfjpzWo/3xPPwp8MZcZlZSSKhyrp29yTNUDgvNUGF t9bSnFWykgZ3TTz42usUoftO/JtVg1trcvke+L54Z97NJUw/kllYbo3YuhmeR1IjcAVUME 0/eXQVQ6Fmg5J3CX11P5GEmD6nGhnF4tAp07y0X6StC0c/a8+2sIhKKqoVp4msTF7yPu9m r6Rwm7ep3C0uaNLn0bDnlV2g4QK8o42eXmYJPzzOh+s3+DfLTrM8jsmoOvCc0EnL2Folc9 luEH/sjcjXMgsVGMrlxYd8AJrpqJ86WJprYMBW3UVP4O4aNDL86205c+WROOuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SSu0t45MWbl9m43P1ollER79gg6TyDC947Fpr/HG68w=; b=DoH6/0MlU921NNhzOvuUKslrLPQntbNo4ak6EuySM+5X/8Wtcc3036BTQL2PqrENM2swnm qckOZnEoxOowzr0ElM/qxOxJxuY20fJ62GIX/7qXk2bHBmH/6/JDCIUvzEagJDp6pD0Yiw 8My0S1j0OOe/0V1j5VuV2qVRuksvdN6XGEsBgBEtC1+oiESZ38UoOlnQArGfAi74rnm/ZJ L82vpI9cRMoRljvT1XNzDIlK0GK3fC01V7/A6zXhPCJh/qilApFviOzQYfAPqeMusF8C0C fKTVD52qbBSkBGdH+YslI6UxzRLgCEAkkbyBj7lNniP43yJPKhsZ77Tvlvcs5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449877; a=rsa-sha256; cv=none; b=aZ+6UwGE+1aDHzQ//ZcnOGljK1JEl5UFqLPugxkVVTJARegHirNpWAFhvZZGsnVy2EASDT J3xd5PWdvqoG4TJcUOXRO6Bhn3vAKZp58NPfjzLI9xKff1s3zcXBQcb84FzC1wXuy15izv QiGpnbKID+0WAnOqEu0m4TPXG4xPd9YmEAXvCIDMc1bagWZFRkEfdrCCklFXnIqQ7Ohqh6 2CvIy48D2z5zCM6u7vcnyyH8LpdAISZDe/YxFW706YXiCAGc9wh4RA1fXo0rR/Otvb2RmZ erxzYPypzCadKXzdjcj4EBKTgJvOfUfHBi6NT1QHI5EmEo+ojFzsWvx2ji7Vxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86Y0yCTzVfh; Fri, 03 Oct 2025 00:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304bgt057238; Fri, 3 Oct 2025 00:04:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304b3l057235; Fri, 3 Oct 2025 00:04:37 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:37 GMT Message-Id: <202510030004.59304b3l057235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 9fb993778d3f - stable/15 - cxgbe(4): Add support for port types SFP56 and QSFP56 and speed 200Gbps List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9fb993778d3fc37eacdec14f5d987f3d43b25896 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=9fb993778d3fc37eacdec14f5d987f3d43b25896 commit 9fb993778d3fc37eacdec14f5d987f3d43b25896 Author: Navdeep Parhar AuthorDate: 2025-09-29 14:20:07 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:06 +0000 cxgbe(4): Add support for port types SFP56 and QSFP56 and speed 200Gbps This enables the 2x200/100/40Gbps and 4x50/25/10/1Gbps boards. Sponsored by: Chelsio Communications (cherry picked from commit a02f38ccedc2c648d57fb6e575723b0b31b67ea0) --- sys/dev/cxgbe/t4_main.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 0ad162cf2231..e9cb56562abe 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -557,6 +557,9 @@ static int t4_fec = -1; SYSCTL_INT(_hw_cxgbe, OID_AUTO, fec, CTLFLAG_RDTUN, &t4_fec, 0, "Forward Error Correction (bit 0 = RS, bit 1 = BASER_RS)"); +static const char * +t4_fec_bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD1\5RSVD2\6auto\7module"; + /* * Controls when the driver sets the FORCE_FEC bit in the L1_CFG32 that it * issues to the firmware. If the firmware doesn't support FORCE_FEC then the @@ -3637,6 +3640,8 @@ port_mword(struct port_info *pi, uint32_t speed) case FW_PORT_TYPE_CR_QSFP: case FW_PORT_TYPE_CR2_QSFP: case FW_PORT_TYPE_SFP28: + case FW_PORT_TYPE_SFP56: + case FW_PORT_TYPE_QSFP56: /* Pluggable transceiver */ switch (pi->mod_type) { case FW_PORT_MOD_TYPE_LR: @@ -3654,6 +3659,8 @@ port_mword(struct port_info *pi, uint32_t speed) return (IFM_50G_LR2); case FW_PORT_CAP32_SPEED_100G: return (IFM_100G_LR4); + case FW_PORT_CAP32_SPEED_200G: + return (IFM_200G_LR4); } break; case FW_PORT_MOD_TYPE_SR: @@ -3670,6 +3677,8 @@ port_mword(struct port_info *pi, uint32_t speed) return (IFM_50G_SR2); case FW_PORT_CAP32_SPEED_100G: return (IFM_100G_SR4); + case FW_PORT_CAP32_SPEED_200G: + return (IFM_200G_SR4); } break; case FW_PORT_MOD_TYPE_ER: @@ -3691,6 +3700,8 @@ port_mword(struct port_info *pi, uint32_t speed) return (IFM_50G_CR2); case FW_PORT_CAP32_SPEED_100G: return (IFM_100G_CR4); + case FW_PORT_CAP32_SPEED_200G: + return (IFM_200G_CR4_PAM4); } break; case FW_PORT_MOD_TYPE_LRM: @@ -3700,6 +3711,8 @@ port_mword(struct port_info *pi, uint32_t speed) case FW_PORT_MOD_TYPE_DR: if (speed == FW_PORT_CAP32_SPEED_100G) return (IFM_100G_DR); + if (speed == FW_PORT_CAP32_SPEED_200G) + return (IFM_200G_DR4); break; case FW_PORT_MOD_TYPE_NA: MPASS(0); /* Not pluggable? */ @@ -8932,13 +8945,12 @@ sysctl_link_fec(SYSCTL_HANDLER_ARGS) struct link_config *lc = &pi->link_cfg; int rc; struct sbuf *sb; - static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD1\5RSVD2"; sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); if (lc->link_ok) - sbuf_printf(sb, "%b", lc->fec, bits); + sbuf_printf(sb, "%b", lc->fec, t4_fec_bits); else sbuf_printf(sb, "no link"); rc = sbuf_finish(sb); @@ -8958,14 +8970,12 @@ sysctl_requested_fec(SYSCTL_HANDLER_ARGS) if (req->newptr == NULL) { struct sbuf *sb; - static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2" - "\5RSVD3\6auto\7module"; sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); - sbuf_printf(sb, "%b", lc->requested_fec, bits); + sbuf_printf(sb, "%b", lc->requested_fec, t4_fec_bits); rc = sbuf_finish(sb); sbuf_delete(sb); } else { @@ -9034,7 +9044,6 @@ sysctl_module_fec(SYSCTL_HANDLER_ARGS) int rc; int8_t fec; struct sbuf *sb; - static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2\5RSVD3"; sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) @@ -9068,7 +9077,7 @@ sysctl_module_fec(SYSCTL_HANDLER_ARGS) if (fec == 0) fec = FEC_NONE; PORT_UNLOCK(pi); - sbuf_printf(sb, "%b", fec & M_FW_PORT_CAP32_FEC, bits); + sbuf_printf(sb, "%b", fec & M_FW_PORT_CAP32_FEC, t4_fec_bits); } rc = sbuf_finish(sb); done: From nobody Fri Oct 3 00:04:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86b5DPCz6BMY6; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86b1pz3z3snn; Fri, 03 Oct 2025 00:04:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjBI46m1iVxR2V2xHnOjsv+08i5oeXjIp03PwbIf8x0=; b=nzLAViSic8tfjdL0riHlTV9FRtsCqOI/Nk0HsGjj462fK4At96iQsoBJegqGA+tNSJKlzZ lwK97pGT1luMhLX47hAk0cSA/UjkzvezQwhrlsHtn1h5d7e63BlqHUOjibNFl5PDbB5UwK q/BN3pLd6cb8yt77dsPajG6TMvlGsbq8/NwtJ9J1TALup+ZzCWoRxsN9N1MlIMzOGO1PG4 8sMX0ioWn+3FonkxiHqnYUVLnUmdQX+FXvRPOKSqIMV3E5gEzZwsgJSH8BkPMBabgL9YAS BAm3VRE6Hl9CutxfsypKD/rV92WmPqnE5+cIPdXYc1fmkBFIlgRrpkeFogRPvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjBI46m1iVxR2V2xHnOjsv+08i5oeXjIp03PwbIf8x0=; b=Uk9P8brHnmXouc9EBV6K27YgU2fesHFIFG8LrbYvJLFKKQPgIKMBavnO5nKraSfI70sb+E Y3J1n4QiUfKusJcxhBCAmgIYnc+YrXSEkOlF2rZyBmgyF3BcmBPzhHy5sB35GYYdkPrqJH ki28quScWKp+G2s3UgkF+rZRgMQ9uwPFvw+b6H5tAZ+LnXw35x/bVPjyHSp2GdUKra9XbR WQN6OWWFgYmz9bX8MZzLZi3phL/PdpADz46RnCENjsKwl2yv+uQ4KfuzssaFzDWzxVUMQp UbHp9PiXHzrL8gdxIn1kihuSi6xrsvFALXSlOuSAGmnanlRNFPiQo8xqtIGYoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449879; a=rsa-sha256; cv=none; b=JXppXsD5hq32jrWOq3dcHUwvJp1zLxxEAc1UUu2jNp7RJLXcc0unihNlbUiHSzbhYP7Vi/ MZ8AfrTJ7v+WF4tie0KJyD28MO8j3Y3IJ7wm1ofoHeroTP20yo5QnpXAx5dHf5Kd28ajcU xnra4bDDrhs6ezm4mCHPHLVvCO87n29DNK8n6wPhdFhXXiOpTJF8CnN4QwT4a5aK75SKI1 GHDQZNXWcO7VDoWeuI45Iwn0hlV6mne+9wO7V5r2k7PToib+DcjJzIkv19AqhpIsX68QGv 8vbXY06jl2GSPdgJ4aiSfJPpptkzQ1J+Zh+DSkW2YWG2oIodlgtGaF94nKlbTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86Z1xVZzVcr; Fri, 03 Oct 2025 00:04: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 59304cHo057273; Fri, 3 Oct 2025 00:04:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304csa057270; Fri, 3 Oct 2025 00:04:38 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:38 GMT Message-Id: <202510030004.59304csa057270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: ab2da6915f1d - stable/15 - cxgbe: Refactor find_offload_adapter and move to t4_tom from cxgbei List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ab2da6915f1d48507397f0c565c0bcd36b536406 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=ab2da6915f1d48507397f0c565c0bcd36b536406 commit ab2da6915f1d48507397f0c565c0bcd36b536406 Author: John Baldwin AuthorDate: 2025-09-29 14:50:34 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:07 +0000 cxgbe: Refactor find_offload_adapter and move to t4_tom from cxgbei This allows it to be used for other offload drivers. Sponsored by: Chelsio Communications (cherry picked from commit c341048373ac6d4bad6dccc63880ff3f326ba15f) --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 54 +++------------------------------------ sys/dev/cxgbe/tom/t4_tom.c | 48 ++++++++++++++++++++++++++++++++++ sys/dev/cxgbe/tom/t4_tom.h | 1 + 3 files changed, 53 insertions(+), 50 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index d805642541d3..a79cc58b870c 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -976,42 +976,6 @@ icl_cxgbei_setsockopt(struct icl_conn *ic, struct socket *so, int sspace, return (0); } -/* - * Request/response structure used to find out the adapter offloading a socket. - */ -struct find_ofld_adapter_rr { - struct socket *so; - struct adapter *sc; /* result */ -}; - -static void -find_offload_adapter(struct adapter *sc, void *arg) -{ - struct find_ofld_adapter_rr *fa = arg; - struct socket *so = fa->so; - struct tom_data *td = sc->tom_softc; - struct tcpcb *tp; - struct inpcb *inp; - - /* Non-TCP were filtered out earlier. */ - MPASS(so->so_proto->pr_protocol == IPPROTO_TCP); - - if (fa->sc != NULL) - return; /* Found already. */ - - if (td == NULL) - return; /* TOE not enabled on this adapter. */ - - inp = sotoinpcb(so); - INP_WLOCK(inp); - if ((inp->inp_flags & INP_DROPPED) == 0) { - tp = intotcpcb(inp); - if (tp->t_flags & TF_TOE && tp->tod == &td->tod) - fa->sc = sc; /* Found. */ - } - INP_WUNLOCK(inp); -} - static bool is_memfree(struct adapter *sc) { @@ -1095,7 +1059,6 @@ int icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) { struct icl_cxgbei_conn *icc = ic_to_icc(ic); - struct find_ofld_adapter_rr fa; struct file *fp; struct socket *so; struct inpcb *inp; @@ -1139,15 +1102,11 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) fdrop(fp, curthread); ICL_CONN_UNLOCK(ic); - /* Find the adapter offloading this socket. */ - fa.sc = NULL; - fa.so = so; - t4_iterate(find_offload_adapter, &fa); - if (fa.sc == NULL) { + icc->sc = find_offload_adapter(so); + if (icc->sc == NULL) { error = EINVAL; goto out; } - icc->sc = fa.sc; max_rx_pdu_len = ISCSI_BHS_SIZE + ic->ic_max_recv_data_segment_length; max_tx_pdu_len = ISCSI_BHS_SIZE + ic->ic_max_send_data_segment_length; @@ -1778,7 +1737,6 @@ cxgbei_limits(struct adapter *sc, void *arg) static int cxgbei_limits_fd(struct icl_drv_limits *idl, int fd) { - struct find_ofld_adapter_rr fa; struct file *fp; struct socket *so; struct adapter *sc; @@ -1801,17 +1759,13 @@ cxgbei_limits_fd(struct icl_drv_limits *idl, int fd) return (EINVAL); } - /* Find the adapter offloading this socket. */ - fa.sc = NULL; - fa.so = so; - t4_iterate(find_offload_adapter, &fa); - if (fa.sc == NULL) { + sc = find_offload_adapter(so); + if (sc == NULL) { fdrop(fp, curthread); return (ENXIO); } fdrop(fp, curthread); - sc = fa.sc; error = begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4lims"); if (error != 0) return (error); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 18d73afc47c5..f6d3a31667fb 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -2266,6 +2266,54 @@ t4_aio_queue_tom(struct socket *so, struct kaiocb *job) return (0); } +/* + * Request/response structure used to find out the adapter offloading + * a socket. + */ +struct find_offload_adapter_data { + struct socket *so; + struct adapter *sc; /* result */ +}; + +static void +find_offload_adapter_cb(struct adapter *sc, void *arg) +{ + struct find_offload_adapter_data *fa = arg; + struct socket *so = fa->so; + struct tom_data *td = sc->tom_softc; + struct tcpcb *tp; + struct inpcb *inp; + + /* Non-TCP were filtered out earlier. */ + MPASS(so->so_proto->pr_protocol == IPPROTO_TCP); + + if (fa->sc != NULL) + return; /* Found already. */ + + if (td == NULL) + return; /* TOE not enabled on this adapter. */ + + inp = sotoinpcb(so); + INP_WLOCK(inp); + if ((inp->inp_flags & INP_DROPPED) == 0) { + tp = intotcpcb(inp); + if (tp->t_flags & TF_TOE && tp->tod == &td->tod) + fa->sc = sc; /* Found. */ + } + INP_WUNLOCK(inp); +} + +struct adapter * +find_offload_adapter(struct socket *so) +{ + struct find_offload_adapter_data fa; + + fa.sc = NULL; + fa.so = so; + t4_iterate(find_offload_adapter_cb, &fa); + return (fa.sc); +} + static int t4_tom_mod_load(void) { diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index c3eb8578799d..a178c9b7ef5e 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -484,6 +484,7 @@ __be32 calc_options2(struct vi_info *, struct conn_params *); uint64_t select_ntuple(struct vi_info *, struct l2t_entry *); int negative_advice(int); int add_tid_to_history(struct adapter *, u_int); +struct adapter *find_offload_adapter(struct socket *); void t4_pcb_detach(struct toedev *, struct tcpcb *); /* t4_connect.c */ From nobody Fri Oct 3 00:04:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86b6kbSz6BMjm; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86b3cMTz3sdm; Fri, 03 Oct 2025 00:04:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=80Tz873Dm5Pm8pjB2f2SMKc2XMyKUCEUDWSUhN9olb8=; b=LL/BNh6lznTP1wJsu45OWbWELoaCHwqxv+BT57ySnUmTMp/o8GLTmjf9dCOZGc452yQupO c7H/CukPG4z0StVTc4aOjcnOdQAnW/TEgyku8S7/q//86/utfXQotm0AHfqWZq2RLVpKF2 6PF1LoN/JfS8itAf6F81eKxmk1Q6W5/lVnGUb8ysOPTHqSun/L9DPzS2FYnQTDYAxdu4i+ k5RNB+zFaNgQv26Pvaic8ack/5qAJLwLSaVaG02b1sebttZSu7me1CFY6R0ul7zfkTFHu6 PVL0rzXIgqqJ8n2MS5I6PHr9F8zz+bDS26rO0v+H4e23ZIOz1xuSuOUH664RaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=80Tz873Dm5Pm8pjB2f2SMKc2XMyKUCEUDWSUhN9olb8=; b=P33XODDP6O3JVHa7WpnRi78XQSMsKNCF2cQLjAb1AxciYleVglJIHP+Ln4a11E0rVpqK51 7G7rXziGPjvqFTZBAN5S9lg93zZx8t7BqmNcZp8Z2yKETnixGJ0NoKIYFe4RinIV3ZjGWC F3VfvwaMh6SB7GOYK9aajmQYRaF54Tu0KUH8PGApRYRMiSY7R8KR4Sme8e/hOfkWPLRHcP x/uDIDKhZYIXOYncNlMbjy7vV5/jjoqRF0EosiY6Fgs4aqS2TQaXCgn6XWNdb76jHUwZmV HzE1vuH+jCk3KlaGu9GjaLzQ9N3ZLCh+fQ9E/ty2/GveCNkThVz2qCRdZa6xBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449879; a=rsa-sha256; cv=none; b=VdpYhWSeW8fzkdm1yLNU08d4//BYJVSLBuZGYJ4K1qhBRRcilKJvEmJXtIi+JJLOwh2kTU F+vs7Z63vqCPrL1EOd5cZtREg0run1WeLD6pUruThqGpTCk7IH7AfO74sijHfVtRQ1eS0i V1X64KCpFPqCEmFMB93WkpySdc1GyDPuhZBTvlCfHs+UfrIRf7ksFYs0GmAagqkJd7uV33 J1DUE9hpJZqafG8P7hYpNI+5etn5M8TyKhvBBFCX47Q/xtWpMJBtobNmvdGhC6qtbF9Hjn 3lAQj8m/DfBJXUDytdOyCAoREDdSvrrGfQa4J2x8d5O4QqgfVHOmqK01k5AAVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86b31JWzVjS; Fri, 03 Oct 2025 00:04: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 59304dKA057308; Fri, 3 Oct 2025 00:04:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304dki057305; Fri, 3 Oct 2025 00:04:39 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:39 GMT Message-Id: <202510030004.59304dki057305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: daceb19407d0 - stable/15 - cxgbe: Move send_iscsi_flowc_wr to t4_tom.ko List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: daceb19407d07cacd31c66150e1db46ce50a097a Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=daceb19407d07cacd31c66150e1db46ce50a097a commit daceb19407d07cacd31c66150e1db46ce50a097a Author: John Baldwin AuthorDate: 2025-09-29 14:52:18 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:07 +0000 cxgbe: Move send_iscsi_flowc_wr to t4_tom.ko Rename the function to send_txdataplen_max_flowc_wr to match the parameter it sets. This function will be reused by other ULP modules. Sponsored by: Chelsio Communications (cherry picked from commit 35b883ccf36521a46ba1cd959c144328cce223c5) --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 44 +-------------------------------------- sys/dev/cxgbe/tom/t4_tom.c | 44 +++++++++++++++++++++++++++++++++++++++ sys/dev/cxgbe/tom/t4_tom.h | 1 + 3 files changed, 46 insertions(+), 43 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index a79cc58b870c..9cdfd0fb9652 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -989,48 +989,6 @@ is_memfree(struct adapter *sc) return (true); } -/* XXXNP: move this to t4_tom. */ -static void -send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) -{ - struct wrqe *wr; - struct fw_flowc_wr *flowc; - const u_int nparams = 1; - u_int flowclen; - struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; - - flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); - - wr = alloc_wrqe(roundup2(flowclen, 16), &toep->ofld_txq->wrq); - if (wr == NULL) { - /* XXX */ - panic("%s: allocation failure.", __func__); - } - flowc = wrtod(wr); - memset(flowc, 0, wr->wr_len); - - flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) | - V_FW_FLOWC_WR_NPARAMS(nparams)); - flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) | - V_FW_WR_FLOWID(toep->tid)); - - flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_TXDATAPLEN_MAX; - flowc->mnemval[0].val = htobe32(maxlen); - - KASSERT(howmany(flowclen, 16) <= MAX_OFLD_TX_SDESC_CREDITS, - ("%s: tx_credits %u too large", __func__, howmany(flowclen, 16))); - txsd->tx_credits = howmany(flowclen, 16); - txsd->plen = 0; - KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, - ("%s: not enough credits (%d)", __func__, toep->tx_credits)); - toep->tx_credits -= txsd->tx_credits; - if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) - toep->txsd_pidx = 0; - toep->txsd_avail--; - - t4_wrq_tx(sc, wr); -} - static void set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *toep, u_int ulp_submode) { @@ -1164,7 +1122,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) toep->params.ulp_mode = ULP_MODE_ISCSI; toep->ulpcb = icc; - send_iscsi_flowc_wr(icc->sc, toep, + send_txdataplen_max_flowc_wr(icc->sc, toep, roundup(max_iso_pdus * max_tx_pdu_len, tp->t_maxseg)); set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); INP_WUNLOCK(inp); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index f6d3a31667fb..53a945f8b4cc 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -2314,6 +2314,50 @@ find_offload_adapter(struct socket *so) return (fa.sc); } +void +send_txdataplen_max_flowc_wr(struct adapter *sc, struct toepcb *toep, + int maxlen) +{ + struct wrqe *wr; + struct fw_flowc_wr *flowc; + const u_int nparams = 1; + u_int flowclen; + struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; + + CTR(KTR_CXGBE, "%s: tid %u maxlen=%d", __func__, toep->tid, maxlen); + + flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); + + wr = alloc_wrqe(roundup2(flowclen, 16), &toep->ofld_txq->wrq); + if (wr == NULL) { + /* XXX */ + panic("%s: allocation failure.", __func__); + } + flowc = wrtod(wr); + memset(flowc, 0, wr->wr_len); + + flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) | + V_FW_FLOWC_WR_NPARAMS(nparams)); + flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) | + V_FW_WR_FLOWID(toep->tid)); + + flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_TXDATAPLEN_MAX; + flowc->mnemval[0].val = htobe32(maxlen); + + KASSERT(howmany(flowclen, 16) <= MAX_OFLD_TX_SDESC_CREDITS, + ("%s: tx_credits %u too large", __func__, howmany(flowclen, 16))); + txsd->tx_credits = howmany(flowclen, 16); + txsd->plen = 0; + KASSERT(toep->tx_credits >= txsd->tx_credits && toep->txsd_avail > 0, + ("%s: not enough credits (%d)", __func__, toep->tx_credits)); + toep->tx_credits -= txsd->tx_credits; + if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) + toep->txsd_pidx = 0; + toep->txsd_avail--; + + t4_wrq_tx(sc, wr); +} + static int t4_tom_mod_load(void) { diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index a178c9b7ef5e..b8aba17c07bb 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -485,6 +485,7 @@ uint64_t select_ntuple(struct vi_info *, struct l2t_entry *); int negative_advice(int); int add_tid_to_history(struct adapter *, u_int); struct adapter *find_offload_adapter(struct socket *); +void send_txdataplen_max_flowc_wr(struct adapter *, struct toepcb *, int); void t4_pcb_detach(struct toedev *, struct tcpcb *); /* t4_connect.c */ From nobody Fri Oct 3 00:04:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86d30Thz6BMhp; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86c4HHVz3sjd; Fri, 03 Oct 2025 00:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qfs6S+70X0FHk3I7ozvbSrwXfsNFUhq8vvnQ5HEtnlA=; b=IdYIdY+7tGrxdWWIghBQc//dqcRrY+vKAZHg0Oi/cVemn1Lsn3GpNHTlHupDiyURNOiQ+S q+eto+UwOo4SqhGHkV3/GRDKmCx7BoeAn2bRAeIcMmZVK+/EGtNKUaX9QbUQu5MNywPuwe 0F9tMUhTJLEEoql10DGs5cN9Hg7SyUTnqZhVJI+MnI0IThS/Pu93pMZHnbxgdLLoV9KPfB VwXxPzlGq6inS+bq9CHUZ6VLhWUaGN/lZJ05vP/RSQjof91FtP4qtiPJxBpwACBIw3nimH ao56A7ByeOXofWqbk+45i6feJhdj8OqESM5Yd0hbLG1Hp+M3UkniKVw1qgrtig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qfs6S+70X0FHk3I7ozvbSrwXfsNFUhq8vvnQ5HEtnlA=; b=ITfPOD+zFKA4DmbcwNLOs7kaNAGUxOO/95+oJgIFw8ZAybyURyA6iAR7/r2aEgqJqNNXyO xe+yXAdlD75CnVMbbdDaSKjY8RQDI3Sdu9LDVCGGerUBKg39jQgB6MV1RgUwUfqaqNpLOl LRXdC7j37vJ0+X4nTc6cJoH/XlEQfXIDHm8y22vQYlTnwqAY6rS0q/Fiv7MmEez5E28Uqf /OJ4+JO4rcO/xsTIOgWQoqlA1GAqoaTEvn1MWPmxIrJD2O4weP7UsAZMB4mhS7A09+BfKP IXkiUwyybWd2i9/2NaYQa0YtjwQJGxivytJVQzSasbSy0UF/DcPn3m7E4tzHCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449880; a=rsa-sha256; cv=none; b=deCkXYv7jEBr8vLkra2bJtPQnQi/MyQfIlqtJxXGLfuENUwleHPMlbAEDugqGLgdUQPBx1 +bSNTw9wkwP8J427PsPTa3EHTOIoSkFMJgF1NDp+r30qhzvSzrWsqF5k5DC7bySBdndC1G 6r4twcwE2iQq5OwyYWheL/7cOg8QJt10H2pFDSLTX1ORuZ8V0XMydUnS6CnbQx6c3ZFBS/ 2h1r/7F50cx+ItzpYY0wb7V+QMahD7F8lLCQK+RFNh2QX0/So5YPslTpq++G7dV2KBzrfo 5/NCQvt9deWPRR/eCME3/sJowBStGRHSgDONxKgm4dFxUzIlusQvFtMlvGQ+EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86c3jzfzV1N; Fri, 03 Oct 2025 00:04: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 59304emY057348; Fri, 3 Oct 2025 00:04:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304eb8057345; Fri, 3 Oct 2025 00:04:40 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:40 GMT Message-Id: <202510030004.59304eb8057345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 853d1343ac8f - stable/15 - cxgbe: Move the STAG and PBL memory pool arenas to the base driver List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 853d1343ac8f50d7ba8f56b8c261a5b7599a5bcf Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=853d1343ac8f50d7ba8f56b8c261a5b7599a5bcf commit 853d1343ac8f50d7ba8f56b8c261a5b7599a5bcf Author: John Baldwin AuthorDate: 2025-09-29 14:55:16 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:07 +0000 cxgbe: Move the STAG and PBL memory pool arenas to the base driver Both RDMA (iw_cxgbe) and NVMe offloads use TPT table entries to map transaction tags in incoming PDUs to buffers in host memory permitting direct placement of received data into host memory buffers avoiding copies (iSCSI offload uses a different scheme for mapping tags to host memory). Move the vmem arenas for the supporting card memory regions from iw_cxgbe to the main driver so they can be shared with the NVMe offload driver. In addition, add some helper routines for constructing work requests to update TPT table entries. Sponsored by: Chelsio Communications (cherry picked from commit 19d9a9b15178ed7cfe3f463f43e28cce13fc4f94) --- sys/conf/files | 2 + sys/dev/cxgbe/adapter.h | 24 +++++ sys/dev/cxgbe/iw_cxgbe/device.c | 20 ++-- sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h | 5 +- sys/dev/cxgbe/iw_cxgbe/mem.c | 110 ++++---------------- sys/dev/cxgbe/iw_cxgbe/resource.c | 38 +------ sys/dev/cxgbe/iw_cxgbe/t4.h | 1 - sys/dev/cxgbe/t4_main.c | 2 + sys/dev/cxgbe/t4_tpt.c | 193 ++++++++++++++++++++++++++++++++++++ sys/dev/cxgbe/tom/t4_tom.h | 6 ++ sys/modules/cxgbe/if_cxgbe/Makefile | 1 + 11 files changed, 261 insertions(+), 141 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 63bf5c3fd724..6da1f7e97973 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1393,6 +1393,8 @@ dev/cxgbe/t4_smt.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_l2t.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_tpt.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_tracer.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_vf.c optional cxgbev pci \ diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index e3906f8058a7..ac8cdddd41e5 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -971,6 +971,9 @@ struct adapter { vmem_t *key_map; struct tls_tunables tlst; + vmem_t *pbl_arena; + vmem_t *stag_arena; + uint8_t doorbells; int offload_map; /* port_id's with IFCAP_TOE enabled */ int bt_map; /* hw_port's that are BASE-T */ @@ -1549,6 +1552,27 @@ int t4_hashfilter_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbu int t4_del_hashfilter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); void free_hftid_hash(struct tid_info *); +/* t4_tpt.c */ +#define T4_STAG_UNSET 0xffffffff +#define T4_WRITE_MEM_DMA_LEN \ + roundup2(sizeof(struct ulp_mem_io) + sizeof(struct ulptx_sgl), 16) +#define T4_ULPTX_MIN_IO 32 +#define T4_MAX_INLINE_SIZE 96 +#define T4_WRITE_MEM_INLINE_LEN(len) \ + roundup2(sizeof(struct ulp_mem_io) + sizeof(struct ulptx_idata) + \ + roundup((len), T4_ULPTX_MIN_IO), 16) + +uint32_t t4_pblpool_alloc(struct adapter *, int); +void t4_pblpool_free(struct adapter *, uint32_t, int); +uint32_t t4_stag_alloc(struct adapter *, int); +void t4_stag_free(struct adapter *, uint32_t, int); +void t4_init_tpt(struct adapter *); +void t4_free_tpt(struct adapter *); +void t4_write_mem_dma_wr(struct adapter *, void *, int, int, uint32_t, + uint32_t, vm_paddr_t, uint64_t); +void t4_write_mem_inline_wr(struct adapter *, void *, int, int, uint32_t, + uint32_t, void *, uint64_t); + static inline struct wrqe * alloc_wrqe(int wr_len, struct sge_wrq *wrq) { diff --git a/sys/dev/cxgbe/iw_cxgbe/device.c b/sys/dev/cxgbe/iw_cxgbe/device.c index 3c4d269f6c69..4610f91e96ac 100644 --- a/sys/dev/cxgbe/iw_cxgbe/device.c +++ b/sys/dev/cxgbe/iw_cxgbe/device.c @@ -132,26 +132,21 @@ c4iw_rdev_open(struct c4iw_rdev *rdev) rdev->stats.rqt.total = sc->vres.rq.size; rdev->stats.qid.total = sc->vres.qp.size; - rc = c4iw_init_resource(rdev, c4iw_num_stags(rdev), T4_MAX_NUM_PD); + rc = c4iw_init_resource(rdev, T4_MAX_NUM_PD); if (rc) { device_printf(sc->dev, "error %d initializing resources\n", rc); goto err1; } - rc = c4iw_pblpool_create(rdev); - if (rc) { - device_printf(sc->dev, "error %d initializing pbl pool\n", rc); - goto err2; - } rc = c4iw_rqtpool_create(rdev); if (rc) { device_printf(sc->dev, "error %d initializing rqt pool\n", rc); - goto err3; + goto err2; } rdev->status_page = (struct t4_dev_status_page *) __get_free_page(GFP_KERNEL); if (!rdev->status_page) { rc = -ENOMEM; - goto err4; + goto err3; } rdev->status_page->qp_start = sc->vres.qp.start; rdev->status_page->qp_size = sc->vres.qp.size; @@ -168,15 +163,13 @@ c4iw_rdev_open(struct c4iw_rdev *rdev) rdev->free_workq = create_singlethread_workqueue("iw_cxgb4_free"); if (!rdev->free_workq) { rc = -ENOMEM; - goto err5; + goto err4; } return (0); -err5: - free_page((unsigned long)rdev->status_page); err4: - c4iw_rqtpool_destroy(rdev); + free_page((unsigned long)rdev->status_page); err3: - c4iw_pblpool_destroy(rdev); + c4iw_rqtpool_destroy(rdev); err2: c4iw_destroy_resource(&rdev->resource); err1: @@ -186,7 +179,6 @@ err1: static void c4iw_rdev_close(struct c4iw_rdev *rdev) { free_page((unsigned long)rdev->status_page); - c4iw_pblpool_destroy(rdev); c4iw_rqtpool_destroy(rdev); c4iw_destroy_resource(&rdev->resource); } diff --git a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h index ca2595b65b02..47ce10562c66 100644 --- a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h +++ b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h @@ -99,7 +99,6 @@ struct c4iw_id_table { }; struct c4iw_resource { - struct c4iw_id_table tpt_table; struct c4iw_id_table qid_table; struct c4iw_id_table pdid_table; }; @@ -904,11 +903,9 @@ int c4iw_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new, struct l2t_entry *l2t); u32 c4iw_get_resource(struct c4iw_id_table *id_table); void c4iw_put_resource(struct c4iw_id_table *id_table, u32 entry); -int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_tpt, u32 nr_pdid); +int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_pdid); int c4iw_init_ctrl_qp(struct c4iw_rdev *rdev); -int c4iw_pblpool_create(struct c4iw_rdev *rdev); int c4iw_rqtpool_create(struct c4iw_rdev *rdev); -void c4iw_pblpool_destroy(struct c4iw_rdev *rdev); void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev); void c4iw_destroy_resource(struct c4iw_resource *rscp); int c4iw_destroy_ctrl_qp(struct c4iw_rdev *rdev); diff --git a/sys/dev/cxgbe/iw_cxgbe/mem.c b/sys/dev/cxgbe/iw_cxgbe/mem.c index 9e879bde6169..ae0aa0edc17a 100644 --- a/sys/dev/cxgbe/iw_cxgbe/mem.c +++ b/sys/dev/cxgbe/iw_cxgbe/mem.c @@ -56,49 +56,23 @@ mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length) static int _c4iw_write_mem_dma_aligned(struct c4iw_rdev *rdev, u32 addr, u32 len, - void *data, int wait) + dma_addr_t data, int wait) { struct adapter *sc = rdev->adap; - struct ulp_mem_io *ulpmc; - struct ulptx_sgl *sgl; u8 wr_len; int ret = 0; struct c4iw_wr_wait wr_wait; struct wrqe *wr; - addr &= 0x7FFFFFF; - if (wait) c4iw_init_wr_wait(&wr_wait); - wr_len = roundup(sizeof *ulpmc + sizeof *sgl, 16); + wr_len = T4_WRITE_MEM_DMA_LEN; wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return -ENOMEM; - ulpmc = wrtod(wr); - - memset(ulpmc, 0, wr_len); - INIT_ULPTX_WR(ulpmc, wr_len, 0, 0); - ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) | - (wait ? F_FW_WR_COMPL : 0)); - ulpmc->wr.wr_lo = wait ? (u64)(unsigned long)&wr_wait : 0; - ulpmc->wr.wr_mid = cpu_to_be32(V_FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16))); - ulpmc->cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | - V_T5_ULP_MEMIO_ORDER(1) | - V_T5_ULP_MEMIO_FID(sc->sge.ofld_rxq[0].iq.abs_id)); - if (chip_id(sc) >= CHELSIO_T7) - ulpmc->dlen = cpu_to_be32(V_T7_ULP_MEMIO_DATA_LEN(len>>5)); - else - ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN(len>>5)); - ulpmc->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(ulpmc->wr), 16)); - ulpmc->lock_addr = cpu_to_be32(V_ULP_MEMIO_ADDR(addr)); - - sgl = (struct ulptx_sgl *)(ulpmc + 1); - sgl->cmd_nsge = cpu_to_be32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | - V_ULPTX_NSGE(1)); - sgl->len0 = cpu_to_be32(len); - sgl->addr0 = cpu_to_be64((u64)data); - + t4_write_mem_dma_wr(sc, wrtod(wr), wr_len, 0, addr, len, data, + wait ? (u64)(unsigned long)&wr_wait : 0); t4_wrq_tx(sc, wr); if (wait) @@ -111,74 +85,32 @@ static int _c4iw_write_mem_inline(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) { struct adapter *sc = rdev->adap; - struct ulp_mem_io *ulpmc; - struct ulptx_idata *ulpsc; - u8 wr_len, *to_dp, *from_dp; + u8 wr_len, *from_dp; int copy_len, num_wqe, i, ret = 0; struct c4iw_wr_wait wr_wait; struct wrqe *wr; - u32 cmd; - - cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE)); - cmd |= cpu_to_be32(F_T5_ULP_MEMIO_IMM); - - addr &= 0x7FFFFFF; CTR3(KTR_IW_CXGBE, "%s addr 0x%x len %u", __func__, addr, len); - num_wqe = DIV_ROUND_UP(len, C4IW_MAX_INLINE_SIZE); c4iw_init_wr_wait(&wr_wait); + num_wqe = DIV_ROUND_UP(len, T4_MAX_INLINE_SIZE); + from_dp = data; for (i = 0; i < num_wqe; i++) { - - copy_len = min(len, C4IW_MAX_INLINE_SIZE); - wr_len = roundup(sizeof *ulpmc + sizeof *ulpsc + - roundup(copy_len, T4_ULPTX_MIN_IO), 16); + copy_len = min(len, T4_MAX_INLINE_SIZE); + wr_len = T4_WRITE_MEM_INLINE_LEN(copy_len); wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return -ENOMEM; - ulpmc = wrtod(wr); - - memset(ulpmc, 0, wr_len); - INIT_ULPTX_WR(ulpmc, wr_len, 0, 0); - - if (i == (num_wqe-1)) { - ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) | - F_FW_WR_COMPL); - ulpmc->wr.wr_lo = - (__force __be64)(unsigned long) &wr_wait; - } else - ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR)); - ulpmc->wr.wr_mid = cpu_to_be32( - V_FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16))); - - ulpmc->cmd = cmd; - if (chip_id(sc) >= CHELSIO_T7) - ulpmc->dlen = cpu_to_be32(V_T7_ULP_MEMIO_DATA_LEN( - DIV_ROUND_UP(copy_len, T4_ULPTX_MIN_IO))); - else - ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN( - DIV_ROUND_UP(copy_len, T4_ULPTX_MIN_IO))); - ulpmc->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(ulpmc->wr), - 16)); - ulpmc->lock_addr = cpu_to_be32(V_ULP_MEMIO_ADDR(addr + i * 3)); - - ulpsc = (struct ulptx_idata *)(ulpmc + 1); - ulpsc->cmd_more = cpu_to_be32(V_ULPTX_CMD(ULP_TX_SC_IMM)); - ulpsc->len = cpu_to_be32(roundup(copy_len, T4_ULPTX_MIN_IO)); - - to_dp = (u8 *)(ulpsc + 1); - from_dp = (u8 *)data + i * C4IW_MAX_INLINE_SIZE; - if (data) - memcpy(to_dp, from_dp, copy_len); - else - memset(to_dp, 0, copy_len); - if (copy_len % T4_ULPTX_MIN_IO) - memset(to_dp + copy_len, 0, T4_ULPTX_MIN_IO - - (copy_len % T4_ULPTX_MIN_IO)); + t4_write_mem_inline_wr(sc, wrtod(wr), wr_len, 0, addr, copy_len, + from_dp, i == (num_wqe - 1) ? + (__force __be64)(unsigned long) &wr_wait : 0); t4_wrq_tx(sc, wr); - len -= C4IW_MAX_INLINE_SIZE; - } + if (from_dp != NULL) + from_dp += T4_MAX_INLINE_SIZE; + addr += T4_MAX_INLINE_SIZE >> 5; + len -= T4_MAX_INLINE_SIZE; + } ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, NULL, __func__); return ret; } @@ -208,7 +140,7 @@ _c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) dmalen = T4_ULPTX_MAX_DMA; remain -= dmalen; ret = _c4iw_write_mem_dma_aligned(rdev, addr, dmalen, - (void *)daddr, !remain); + daddr, !remain); if (ret) goto out; addr += dmalen >> 5; @@ -270,8 +202,8 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, stag_idx = (*stag) >> 8; if ((!reset_tpt_entry) && (*stag == T4_STAG_UNSET)) { - stag_idx = c4iw_get_resource(&rdev->resource.tpt_table); - if (!stag_idx) { + stag_idx = t4_stag_alloc(rdev->adap, 1); + if (stag_idx == T4_STAG_UNSET) { mutex_lock(&rdev->stats.lock); rdev->stats.stag.fail++; mutex_unlock(&rdev->stats.lock); @@ -316,7 +248,7 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry, sizeof(tpt), &tpt); if (reset_tpt_entry) { - c4iw_put_resource(&rdev->resource.tpt_table, stag_idx); + t4_stag_free(rdev->adap, stag_idx, 1); mutex_lock(&rdev->stats.lock); rdev->stats.stag.cur -= 32; mutex_unlock(&rdev->stats.lock); diff --git a/sys/dev/cxgbe/iw_cxgbe/resource.c b/sys/dev/cxgbe/iw_cxgbe/resource.c index 644ea0c631bf..cd20f1eafdd6 100644 --- a/sys/dev/cxgbe/iw_cxgbe/resource.c +++ b/sys/dev/cxgbe/iw_cxgbe/resource.c @@ -59,13 +59,9 @@ static int c4iw_init_qid_table(struct c4iw_rdev *rdev) } /* nr_* must be power of 2 */ -int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_tpt, u32 nr_pdid) +int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_pdid) { int err = 0; - err = c4iw_id_table_alloc(&rdev->resource.tpt_table, 0, nr_tpt, 1, - C4IW_ID_TABLE_F_RANDOM); - if (err) - goto tpt_err; err = c4iw_init_qid_table(rdev); if (err) goto qid_err; @@ -77,8 +73,6 @@ int c4iw_init_resource(struct c4iw_rdev *rdev, u32 nr_tpt, u32 nr_pdid) pdid_err: c4iw_id_table_free(&rdev->resource.qid_table); qid_err: - c4iw_id_table_free(&rdev->resource.tpt_table); - tpt_err: return -ENOMEM; } @@ -243,7 +237,6 @@ void c4iw_put_qpid(struct c4iw_rdev *rdev, u32 qid, void c4iw_destroy_resource(struct c4iw_resource *rscp) { - c4iw_id_table_free(&rscp->tpt_table); c4iw_id_table_free(&rscp->qid_table); c4iw_id_table_free(&rscp->pdid_table); } @@ -254,12 +247,9 @@ void c4iw_destroy_resource(struct c4iw_resource *rscp) u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size) { - unsigned long addr; + u32 addr; - vmem_xalloc(rdev->pbl_arena, roundup(size, (1 << MIN_PBL_SHIFT)), - 4, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, - M_FIRSTFIT|M_NOWAIT, &addr); - CTR3(KTR_IW_CXGBE, "%s addr 0x%x size %d", __func__, (u32)addr, size); + addr = t4_pblpool_alloc(rdev->adap, size); mutex_lock(&rdev->stats.lock); if (addr) { rdev->stats.pbl.cur += roundup(size, 1 << MIN_PBL_SHIFT); @@ -268,33 +258,15 @@ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size) } else rdev->stats.pbl.fail++; mutex_unlock(&rdev->stats.lock); - return (u32)addr; + return addr; } void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) { - CTR3(KTR_IW_CXGBE, "%s addr 0x%x size %d", __func__, addr, size); mutex_lock(&rdev->stats.lock); rdev->stats.pbl.cur -= roundup(size, 1 << MIN_PBL_SHIFT); mutex_unlock(&rdev->stats.lock); - vmem_xfree(rdev->pbl_arena, addr, roundup(size,(1 << MIN_PBL_SHIFT))); -} - -int c4iw_pblpool_create(struct c4iw_rdev *rdev) -{ - rdev->pbl_arena = vmem_create("PBL_MEM_POOL", - rdev->adap->vres.pbl.start, - rdev->adap->vres.pbl.size, - 1, 0, M_FIRSTFIT| M_NOWAIT); - if (!rdev->pbl_arena) - return -ENOMEM; - - return 0; -} - -void c4iw_pblpool_destroy(struct c4iw_rdev *rdev) -{ - vmem_destroy(rdev->pbl_arena); + t4_pblpool_free(rdev->adap, addr, size); } /* RQT Memory Manager. */ diff --git a/sys/dev/cxgbe/iw_cxgbe/t4.h b/sys/dev/cxgbe/iw_cxgbe/t4.h index 48f85cf7965b..ffb610420640 100644 --- a/sys/dev/cxgbe/iw_cxgbe/t4.h +++ b/sys/dev/cxgbe/iw_cxgbe/t4.h @@ -64,7 +64,6 @@ #define T4_MAX_NUM_PD 65536 #define T4_MAX_MR_SIZE (~0ULL) #define T4_PAGESIZE_MASK 0xffffffff000 /* 4KB-8TB */ -#define T4_STAG_UNSET 0xffffffff #define T4_FW_MAJ 0 #define A_PCIE_MA_SYNC 0x30b4 diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e9cb56562abe..388c5c104d19 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1655,6 +1655,7 @@ t4_attach(device_t dev) if (sc->vres.key.size != 0) sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start, sc->vres.key.size, 32, 0, M_FIRSTFIT | M_WAITOK); + t4_init_tpt(sc); /* * Second pass over the ports. This time we know the number of rx and @@ -1956,6 +1957,7 @@ t4_detach_common(device_t dev) #endif if (sc->key_map) vmem_destroy(sc->key_map); + t4_free_tpt(sc); #ifdef INET6 t4_destroy_clip_table(sc); #endif diff --git a/sys/dev/cxgbe/t4_tpt.c b/sys/dev/cxgbe/t4_tpt.c new file mode 100644 index 000000000000..d18eabb026f1 --- /dev/null +++ b/sys/dev/cxgbe/t4_tpt.c @@ -0,0 +1,193 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Chelsio Communications, Inc. + * Written by: John Baldwin + * + * 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 "common/common.h" + +/* + * Support routines to manage TPT entries used for both RDMA and NVMe + * offloads. This includes allocating STAG indices and managing the + * PBL pool. + */ + +#define T4_ULPTX_MIN_IO 32 +#define T4_MAX_INLINE_SIZE 96 +#define T4_ULPTX_MAX_DMA 1024 + +/* PBL and STAG Memory Managers. */ + +#define MIN_PBL_SHIFT 5 /* 32B == min PBL size (4 entries) */ + +uint32_t +t4_pblpool_alloc(struct adapter *sc, int size) +{ + vmem_addr_t addr; + + if (vmem_xalloc(sc->pbl_arena, roundup(size, (1 << MIN_PBL_SHIFT)), + 4, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, M_FIRSTFIT | M_NOWAIT, + &addr) != 0) + return (0); +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: addr 0x%lx size %d", __func__, addr, size); +#endif + return (addr); +} + +void +t4_pblpool_free(struct adapter *sc, uint32_t addr, int size) +{ +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: addr 0x%x size %d", __func__, addr, size); +#endif + vmem_xfree(sc->pbl_arena, addr, roundup(size, (1 << MIN_PBL_SHIFT))); +} + +uint32_t +t4_stag_alloc(struct adapter *sc, int size) +{ + vmem_addr_t stag_idx; + + if (vmem_alloc(sc->stag_arena, size, M_FIRSTFIT | M_NOWAIT, + &stag_idx) != 0) + return (T4_STAG_UNSET); +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: idx 0x%lx size %d", __func__, stag_idx, size); +#endif + return (stag_idx); +} + +void +t4_stag_free(struct adapter *sc, uint32_t stag_idx, int size) +{ +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: idx 0x%x size %d", __func__, stag_idx, size); +#endif + vmem_free(sc->stag_arena, stag_idx, size); +} + +void +t4_init_tpt(struct adapter *sc) +{ + if (sc->vres.pbl.size != 0) + sc->pbl_arena = vmem_create("PBL_MEM_POOL", sc->vres.pbl.start, + sc->vres.pbl.size, 1, 0, M_FIRSTFIT | M_WAITOK); + if (sc->vres.stag.size != 0) + sc->stag_arena = vmem_create("STAG", 1, + sc->vres.stag.size >> 5, 1, 0, M_FIRSTFIT | M_WAITOK); +} + +void +t4_free_tpt(struct adapter *sc) +{ + if (sc->pbl_arena != NULL) + vmem_destroy(sc->pbl_arena); + if (sc->stag_arena != NULL) + vmem_destroy(sc->stag_arena); +} + +/* + * TPT support routines. TPT entries are stored in the STAG adapter + * memory region and are written to via ULP_TX_MEM_WRITE commands in + * FW_ULPTX_WR work requests. + */ + +void +t4_write_mem_dma_wr(struct adapter *sc, void *wr, int wr_len, int tid, + uint32_t addr, uint32_t len, vm_paddr_t data, uint64_t cookie) +{ + struct ulp_mem_io *ulpmc; + struct ulptx_sgl *sgl; + + MPASS(wr_len == T4_WRITE_MEM_DMA_LEN); + + addr &= 0x7FFFFFF; + + memset(wr, 0, wr_len); + ulpmc = wr; + INIT_ULPTX_WR(ulpmc, wr_len, 0, tid); + if (cookie != 0) { + ulpmc->wr.wr_hi |= htobe32(F_FW_WR_COMPL); + ulpmc->wr.wr_lo = cookie; + } + ulpmc->cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | + V_T5_ULP_MEMIO_ORDER(1) | + V_T5_ULP_MEMIO_FID(sc->sge.ofld_rxq[0].iq.abs_id)); + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = htobe32(V_T7_ULP_MEMIO_DATA_LEN(len >> 5)); + else + ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN(len >> 5)); + ulpmc->len16 = htobe32((tid << 8) | + DIV_ROUND_UP(wr_len - sizeof(ulpmc->wr), 16)); + ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(addr)); + + sgl = (struct ulptx_sgl *)(ulpmc + 1); + sgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | V_ULPTX_NSGE(1)); + sgl->len0 = htobe32(len); + sgl->addr0 = htobe64(data); +} + +void +t4_write_mem_inline_wr(struct adapter *sc, void *wr, int wr_len, int tid, + uint32_t addr, uint32_t len, void *data, uint64_t cookie) +{ + struct ulp_mem_io *ulpmc; + struct ulptx_idata *ulpsc; + + MPASS(len > 0 && len <= T4_MAX_INLINE_SIZE); + MPASS(wr_len == T4_WRITE_MEM_INLINE_LEN(len)); + + addr &= 0x7FFFFFF; + + memset(wr, 0, wr_len); + ulpmc = wr; + INIT_ULPTX_WR(ulpmc, wr_len, 0, tid); + + if (cookie != 0) { + ulpmc->wr.wr_hi |= htobe32(F_FW_WR_COMPL); + ulpmc->wr.wr_lo = cookie; + } + + ulpmc->cmd = htobe32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | + F_T5_ULP_MEMIO_IMM); + + if (chip_id(sc) >= CHELSIO_T7) + ulpmc->dlen = htobe32(V_T7_ULP_MEMIO_DATA_LEN( + DIV_ROUND_UP(len, T4_ULPTX_MIN_IO))); + else + ulpmc->dlen = htobe32(V_ULP_MEMIO_DATA_LEN( + DIV_ROUND_UP(len, T4_ULPTX_MIN_IO))); + ulpmc->len16 = htobe32((tid << 8) | + DIV_ROUND_UP(wr_len - sizeof(ulpmc->wr), 16)); + ulpmc->lock_addr = htobe32(V_ULP_MEMIO_ADDR(addr)); + + ulpsc = (struct ulptx_idata *)(ulpmc + 1); + ulpsc->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM)); + ulpsc->len = htobe32(roundup(len, T4_ULPTX_MIN_IO)); + + if (data != NULL) + memcpy(ulpsc + 1, data, len); +} diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index b8aba17c07bb..c8c2d432b8f1 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -586,4 +586,10 @@ int tls_tx_key(struct toepcb *); void tls_uninit_toep(struct toepcb *); int tls_alloc_ktls(struct toepcb *, struct ktls_session *, int); +/* t4_tpt.c */ +uint32_t t4_pblpool_alloc(struct adapter *, int); +void t4_pblpool_free(struct adapter *, uint32_t, int); +int t4_pblpool_create(struct adapter *); +void t4_pblpool_destroy(struct adapter *); + #endif diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile index 981c3466c452..c8ba9df381a4 100644 --- a/sys/modules/cxgbe/if_cxgbe/Makefile +++ b/sys/modules/cxgbe/if_cxgbe/Makefile @@ -31,6 +31,7 @@ SRCS+= t4_netmap.c SRCS+= t4_sched.c SRCS+= t4_sge.c SRCS+= t4_smt.c +SRCS+= t4_tpt.c SRCS+= t4_tracer.c SRCS+= cudbg_common.c SRCS+= cudbg_flash_utils.c From nobody Fri Oct 3 00:04:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86d6syTz6BMyR; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86d4y3lz3srm; Fri, 03 Oct 2025 00:04:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7WHsaAt6nsy+Hb6+FzSItAMc2V4HNxSmWwQlelyOcDg=; b=SROMUeerPPLT4O45ZQNPZmtymosgytFC/PPO7o3yzpQvhh6eTvwLn7azw7lyBENXkZeyf+ m+rE7qdjRDWxwjhUROvM1KT4l3RRBZNbIC0Zmz0ZWD4NLL2jn03QPFo6M0Zytput4YW08R da/UsTjjzeb6SABWT+xQFt7H99tLCy5U4KbwRcTD//OlTsxPdb/5mOF0Au+UwKM99vkrf2 1F+oy4Wnm83hfwbtNnUn27bx03WtD6RT1soIzzL6q02iQu3xCj7NRNVrbMJkqOyAcFmCaK hVYJHZ3PVHmcSP90igMKnvPtN/w1AuV9WU7z5IYnWYsL9MFwO4d2B27kTDqgNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7WHsaAt6nsy+Hb6+FzSItAMc2V4HNxSmWwQlelyOcDg=; b=IfVNbgUQYcmIcE9mecr1MnXFM0z0TqStZp9uTrAWkPx7z08MWgTTr+OEqJOVjpXjFYQpfS Y9eXDCcKsQbkFf/wgPdQ1TNBUsKrGvwiOogT723FC1Cy5E9UhHYfbKbfOKLslR9bq+E/zb vafhhWvIGJLMs/f6T+0q2JaLSfW2qnl/XyyxUyYA0jqMs97ySDWeKYnM1P4H5/vqyduiRA lZT+YHtGZWRZYj3UvZk1BMezzIz9lpl1uo7ckuHl/VEEsH+qWxrXfDGze7EEGIlw/wUX/H PHfXeX5p90ZaawoBzL8tA0GBUfZQKRm/ULSYU5AWMal0fMHuhtWhKIZi2WraMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449881; a=rsa-sha256; cv=none; b=AfKk7zWBNihjQxelvaf/CrLT2N6zjO7rVXKRW8j4qkOOP0ndVO51dMCNYk45B1mXBtuh0G 6Oloe72/PutvUpQfCb+84nxeUxCC/SLluCBnHrie4vj0BQOOoydGkZvr5q/ISmu7YcYaOc 5dv5NeaVE/E0R3RfXZSfVgYE7KIP/WRUq+/fBdjYOsShpPfh8qXeJVzwhw0HtvXSgS+UQJ nbAZiMJCGzUoR8UK/MPSbsMCS8fR3SK92OYyPWb0ajJ0Y4AwPGnT0IhtvP/1/5nuNDaSzd PXEFpkmu7uiuiPh+dZ9avnpZFQ5nA2h58zqxxmSAPOuhvZsGeaQ0SugnvYCBGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86d4KS0zVfk; Fri, 03 Oct 2025 00:04: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 59304fU0057387; Fri, 3 Oct 2025 00:04:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304f1o057384; Fri, 3 Oct 2025 00:04:41 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:41 GMT Message-Id: <202510030004.59304f1o057384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 16763e046a98 - stable/15 - ccr: Support T7. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 16763e046a983c088a5a33366476fd731ec13791 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=16763e046a983c088a5a33366476fd731ec13791 commit 16763e046a983c088a5a33366476fd731ec13791 Author: John Baldwin AuthorDate: 2025-09-29 14:58:06 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:07 +0000 ccr: Support T7. - Use expanded channel ID fields (2 bits vs 1 bits), even on T6 as on T6 the extra bits were previously reserved and the channel IDs should only be 0 or 1 on T6. - Set CMDMORE in ULP_TX_PKT on T7. Sponsored by: Chelsio Communications (cherry picked from commit 8bc9d3089314635572accfe31a4a56afcc299bab) --- sys/dev/cxgbe/crypto/t4_crypto.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 2c83b10b13d6..24dfdc1f23db 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -458,8 +458,9 @@ ccr_populate_wreq(struct ccr_softc *sc, struct ccr_session *s, crwr->ulptx.cmd_dest = htobe32(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DATAMODIFY(0) | - V_ULP_TXPKT_CHANNELID(s->port->tx_channel_id) | + V_T7_ULP_TXPKT_CHANNELID(s->port->tx_channel_id) | V_ULP_TXPKT_DEST(0) | + (is_t7(sc->adapter) ? V_ULP_TXPKT_CMDMORE(1) : 0) | V_ULP_TXPKT_FID(sc->first_rxq_id) | V_ULP_TXPKT_RO(1)); crwr->ulptx.len = htobe32( ((wr_len - sizeof(struct fw_crypto_lookaside_wr)) / 16)); @@ -545,7 +546,7 @@ ccr_hash(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | + V_T7_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(0)); @@ -705,7 +706,7 @@ ccr_cipher(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | + V_T7_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1006,7 +1007,7 @@ ccr_eta(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | + V_T7_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1293,7 +1294,7 @@ ccr_gcm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | + V_T7_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1645,7 +1646,7 @@ ccr_ccm(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp) crwr->sec_cpl.op_ivinsrtofst = htobe32( V_CPL_TX_SEC_PDU_OPCODE(CPL_TX_SEC_PDU) | - V_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | + V_T7_CPL_TX_SEC_PDU_RXCHID(s->port->rx_channel_id) | V_CPL_TX_SEC_PDU_ACKFOLLOWS(0) | V_CPL_TX_SEC_PDU_ULPTXLPBK(1) | V_CPL_TX_SEC_PDU_CPLLEN(2) | V_CPL_TX_SEC_PDU_PLACEHOLDER(0) | V_CPL_TX_SEC_PDU_IVINSRTOFST(1)); @@ -1932,13 +1933,15 @@ ccr_init_port(struct ccr_softc *sc, int port) "Too many ports to fit in port_mask"); /* - * Completions for crypto requests on port 1 can sometimes + * Completions for crypto requests on port 1 on T6 can sometimes * return a stale cookie value due to a firmware bug. Disable * requests on port 1 by default on affected firmware. */ - if (sc->adapter->params.fw_vers >= FW_VERSION32(1, 25, 4, 0) || - port == 0) - sc->port_mask |= 1u << port; + if (port != 0 && is_t6(sc->adapter) && + sc->adapter->params.fw_vers < FW_VERSION32(1, 25, 4, 0)) + return; + + sc->port_mask |= 1u << port; } static int @@ -2745,7 +2748,9 @@ static driver_t ccr_driver = { sizeof(struct ccr_softc) }; -DRIVER_MODULE(ccr, t6nex, ccr_driver, ccr_modevent, NULL); +DRIVER_MODULE(ccr, chnex, ccr_driver, ccr_modevent, NULL); +DRIVER_MODULE(ccr, t6nex, ccr_driver, NULL, NULL); MODULE_VERSION(ccr, 1); MODULE_DEPEND(ccr, crypto, 1, 1, 1); +MODULE_DEPEND(ccr, chnex, 1, 1, 1); MODULE_DEPEND(ccr, t6nex, 1, 1, 1); From nobody Fri Oct 3 00:04:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86g2Q0Hz6BMfK; Fri, 03 Oct 2025 00:04:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86f63nNz3spc; Fri, 03 Oct 2025 00:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5AJQbUvfxApGxosTKGT8vZ/4YDdF77O/G2xJwhWki0Q=; b=cwFXhkJU8K6nGAhhWqXxX8Dy4nvA3c6Hr1qufvLQ4JgChxzh+Zr7+4ezgfgvNw6rhHGW92 TygFdy4bjwY621NZbGgYQRiaMeJSerG/c7g40HPceLPBb00h4rtytxIu3Q9U4BaRpKGrIR TIRlBAb01JnXGgFjl0ZS95WDpV4YU+WK7hWo9G4HopYS6JsgPx4ADu22x8iNsQKzCvliYV myQZevHRDRQptMsUqj3xx/ydzPc0ECo5j8gL9OadQPP9Mhzc6h8eJ4btDhaj1b9DZFpgPy R4iTl1H1RWOHR8bkVsAgQ71WxyAKA8lNzp54ViltW34oxESALdriAMKdUXZq9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5AJQbUvfxApGxosTKGT8vZ/4YDdF77O/G2xJwhWki0Q=; b=UcTryaBYZ1sKJICDrrtu9fJwVqZ9X2QYHQIRMTQNejyfNlT7CV9KfvNjw7QrJ7kLC2h7Bq IgUrNbW2zn+vWBX9QuoEkf3tQ2fkZioSnbcnm0KPEIYVa7SExfD0SmzMeyqxerPkJ/Ffuc 06RCjLvs0Lr3ceIbnc0oLYSouwnCpUB0hxM0RY8B24wPzChr+rTQaxXHhGudTLPUTwCtJf g7zApnbwz6JCTecEunVSxq/0KV8FOA71KrP/Rq7YrXkNszNcZTpbrg94xYQcYTIQxkGE+Q fV0+j5riSWYsMhUk2VCwSuzMt51DBdBrf8DiHAV+nMsi19tkb4RRoQ4yburJfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449882; a=rsa-sha256; cv=none; b=xml4fSwKphOiT60WzEkuWFN/bJ7piFmIprquOpwUl+DC1EIzWHEzK8mwyBiNl3OqTbltc0 73A4c1k5mvEPhhYzLBUNe2dF7xJbKucpl0I9kmTGm/A5CPMamAdL6wfhYbD9JZ9S4J+nga 1Dfcz7Zl3DTSIl+fvT76GifbIGQKhNXBM0aoglrE3SUDxCsXLeBzSAqavOuKlgC+GuuECo YMO1Pv113hs99dz3RZZL46kONrWLx1e43bZnW9DcByXc5ZsRUYZoNGajX4Ap1JDD7u9pP+ ZvRn9/0Z8WPo5RTURwAr3mcBK1Z1rPm/8BQoC6XkppnioDqj245oVC9M3Qctdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86f5VhkzV1P; Fri, 03 Oct 2025 00:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304gX8057420; Fri, 3 Oct 2025 00:04:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304geg057417; Fri, 3 Oct 2025 00:04:42 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:42 GMT Message-Id: <202510030004.59304geg057417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: d28c4d0ec6c5 - stable/15 - cxgbe: Support for NIC KTLS transmit on T7 adapters. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d28c4d0ec6c5f180cd1d5665c3541b0281370459 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=d28c4d0ec6c5f180cd1d5665c3541b0281370459 commit d28c4d0ec6c5f180cd1d5665c3541b0281370459 Author: John Baldwin AuthorDate: 2025-09-29 14:59:03 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:07 +0000 cxgbe: Support for NIC KTLS transmit on T7 adapters. Unlike NIC KTLS support on T6, T7 is able to reuse the existing TSO functionality directly, including trimming the output of the crypto engine before it is passed on to TSO. This is much simpler and does not require the use of bypass pseudo-connections in the TOE engine. Among other things this permits arbitrary TCP options (including the full range of possible TCP timestamp values) while also avoiding various edge cases where parts of a requested TCP packet could not always be transmitted (e.g. partial trailers). This implementation also permits NIC KTLS to be used in parallel with TOE. This version does not yet support connections over a VF (specifically the ktls_tunnel_packet function needs to handle the VF work request), nor does it support VxLAN offload. Sponsored by: Chelsio Communications (cherry picked from commit 4f272a5ef3d8073940e7719401d1e8de2de6100a) --- sys/conf/files | 2 + sys/dev/cxgbe/adapter.h | 20 +- sys/dev/cxgbe/crypto/t7_kern_tls.c | 1435 +++++++++++++++++++++++++++++++++++ sys/dev/cxgbe/offload.h | 7 +- sys/dev/cxgbe/t4_main.c | 16 +- sys/dev/cxgbe/t4_sge.c | 36 +- sys/modules/cxgbe/if_cxgbe/Makefile | 1 + 7 files changed, 1503 insertions(+), 14 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 6da1f7e97973..d9730e6bf55b 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1405,6 +1405,8 @@ dev/cxgbe/common/t4vf_hw.c optional cxgbev pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/crypto/t6_kern_tls.c optional cxgbe pci kern_tls \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/crypto/t7_kern_tls.c optional cxgbe pci kern_tls \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/crypto/t4_keyctx.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/cudbg/cudbg_common.c optional cxgbe \ diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index ac8cdddd41e5..9064d148cba9 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -640,12 +640,22 @@ struct sge_txq { uint64_t kern_tls_full; uint64_t kern_tls_octets; uint64_t kern_tls_waste; - uint64_t kern_tls_options; uint64_t kern_tls_header; - uint64_t kern_tls_fin; uint64_t kern_tls_fin_short; uint64_t kern_tls_cbc; uint64_t kern_tls_gcm; + union { + struct { + /* T6 only. */ + uint64_t kern_tls_options; + uint64_t kern_tls_fin; + }; + struct { + /* T7 only. */ + uint64_t kern_tls_lso; + uint64_t kern_tls_splitmode; + }; + }; /* stats for not-that-common events */ @@ -1425,6 +1435,12 @@ void t6_ktls_modunload(void); int t6_ktls_try(if_t, struct socket *, struct ktls_session *); int t6_ktls_parse_pkt(struct mbuf *); int t6_ktls_write_wr(struct sge_txq *, void *, struct mbuf *, u_int); + +/* t7_kern_tls.c */ +int t7_tls_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, + struct m_snd_tag **); +int t7_ktls_parse_pkt(struct mbuf *); +int t7_ktls_write_wr(struct sge_txq *, void *, struct mbuf *, u_int); #endif /* t4_keyctx.c */ diff --git a/sys/dev/cxgbe/crypto/t7_kern_tls.c b/sys/dev/cxgbe/crypto/t7_kern_tls.c new file mode 100644 index 000000000000..402b2cab20ba --- /dev/null +++ b/sys/dev/cxgbe/crypto/t7_kern_tls.c @@ -0,0 +1,1435 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Chelsio Communications + * Written by: John Baldwin + * + * 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 "opt_inet.h" +#include "opt_inet6.h" +#include "opt_kern_tls.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common/common.h" +#include "common/t4_regs.h" +#include "common/t4_regs_values.h" +#include "common/t4_tcb.h" +#include "t4_l2t.h" +#include "t4_clip.h" +#include "t4_mp_ring.h" +#include "crypto/t4_crypto.h" + +#if defined(INET) || defined(INET6) + +#define TLS_HEADER_LENGTH 5 + +struct tls_scmd { + __be32 seqno_numivs; + __be32 ivgen_hdrlen; +}; + +struct tlspcb { + struct m_snd_tag com; + struct vi_info *vi; /* virtual interface */ + struct adapter *sc; + struct sge_txq *txq; + + int tx_key_addr; + bool inline_key; + unsigned char enc_mode; + + struct tls_scmd scmd0; + struct tls_scmd scmd0_short; + + unsigned int tx_key_info_size; + + uint16_t prev_mss; + + /* Only used outside of setup and teardown when using inline keys. */ + struct tls_keyctx keyctx; +}; + +static void t7_tls_tag_free(struct m_snd_tag *mst); +static int ktls_setup_keys(struct tlspcb *tlsp, + const struct ktls_session *tls, struct sge_txq *txq); + +static const struct if_snd_tag_sw t7_tls_tag_sw = { + .snd_tag_free = t7_tls_tag_free, + .type = IF_SND_TAG_TYPE_TLS +}; + +static inline struct tlspcb * +mst_to_tls(struct m_snd_tag *t) +{ + return (__containerof(t, struct tlspcb, com)); +} + +static struct tlspcb * +alloc_tlspcb(struct ifnet *ifp, struct vi_info *vi, int flags) +{ + struct port_info *pi = vi->pi; + struct adapter *sc = pi->adapter; + struct tlspcb *tlsp; + + tlsp = malloc(sizeof(*tlsp), M_CXGBE, M_ZERO | flags); + if (tlsp == NULL) + return (NULL); + + m_snd_tag_init(&tlsp->com, ifp, &t7_tls_tag_sw); + tlsp->vi = vi; + tlsp->sc = sc; + tlsp->tx_key_addr = -1; + + return (tlsp); +} + +int +t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, + struct m_snd_tag **pt) +{ + const struct ktls_session *tls; + struct tlspcb *tlsp; + struct adapter *sc; + struct vi_info *vi; + struct inpcb *inp; + struct sge_txq *txq; + int error, explicit_iv_size, keyid, mac_first; + + tls = params->tls.tls; + + /* Only TLS 1.1 and TLS 1.2 are currently supported. */ + if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || + tls->params.tls_vminor < TLS_MINOR_VER_ONE || + tls->params.tls_vminor > TLS_MINOR_VER_TWO) + return (EPROTONOSUPPORT); + + /* Sanity check values in *tls. */ + switch (tls->params.cipher_algorithm) { + case CRYPTO_AES_CBC: + /* XXX: Explicitly ignore any provided IV. */ + switch (tls->params.cipher_key_len) { + case 128 / 8: + case 192 / 8: + case 256 / 8: + break; + default: + return (EINVAL); + } + switch (tls->params.auth_algorithm) { + case CRYPTO_SHA1_HMAC: + case CRYPTO_SHA2_256_HMAC: + case CRYPTO_SHA2_384_HMAC: + break; + default: + return (EPROTONOSUPPORT); + } + explicit_iv_size = AES_BLOCK_LEN; + mac_first = 1; + break; + case CRYPTO_AES_NIST_GCM_16: + if (tls->params.iv_len != SALT_SIZE) + return (EINVAL); + switch (tls->params.cipher_key_len) { + case 128 / 8: + case 192 / 8: + case 256 / 8: + break; + default: + return (EINVAL); + } + explicit_iv_size = 8; + mac_first = 0; + break; + default: + return (EPROTONOSUPPORT); + } + + vi = if_getsoftc(ifp); + sc = vi->adapter; + + tlsp = alloc_tlspcb(ifp, vi, M_WAITOK); + + if (sc->tlst.inline_keys) + keyid = -1; + else + keyid = t4_alloc_tls_keyid(sc); + if (keyid < 0) { + CTR(KTR_CXGBE, "%s: %p using immediate key ctx", __func__, + tlsp); + tlsp->inline_key = true; + } else { + tlsp->tx_key_addr = keyid; + CTR(KTR_CXGBE, "%s: %p allocated TX key addr %#x", __func__, + tlsp, tlsp->tx_key_addr); + } + + inp = params->tls.inp; + INP_RLOCK(inp); + if (inp->inp_flags & INP_DROPPED) { + INP_RUNLOCK(inp); + error = ECONNRESET; + goto failed; + } + + txq = &sc->sge.txq[vi->first_txq]; + if (inp->inp_flowtype != M_HASHTYPE_NONE) + txq += ((inp->inp_flowid % (vi->ntxq - vi->rsrv_noflowq)) + + vi->rsrv_noflowq); + tlsp->txq = txq; + INP_RUNLOCK(inp); + + error = ktls_setup_keys(tlsp, tls, txq); + if (error) + goto failed; + + tlsp->enc_mode = t4_tls_cipher_mode(tls); + tlsp->tx_key_info_size = t4_tls_key_info_size(tls); + + /* The SCMD fields used when encrypting a full TLS record. */ + tlsp->scmd0.seqno_numivs = htobe32(V_SCMD_SEQ_NO_CTRL(3) | + V_SCMD_PROTO_VERSION(t4_tls_proto_ver(tls)) | + V_SCMD_ENC_DEC_CTRL(SCMD_ENCDECCTRL_ENCRYPT) | + V_SCMD_CIPH_AUTH_SEQ_CTRL((mac_first == 0)) | + V_SCMD_CIPH_MODE(tlsp->enc_mode) | + V_SCMD_AUTH_MODE(t4_tls_auth_mode(tls)) | + V_SCMD_HMAC_CTRL(t4_tls_hmac_ctrl(tls)) | + V_SCMD_IV_SIZE(explicit_iv_size / 2) | V_SCMD_NUM_IVS(1)); + + tlsp->scmd0.ivgen_hdrlen = V_SCMD_IV_GEN_CTRL(0) | + V_SCMD_TLS_FRAG_ENABLE(0); + if (tlsp->inline_key) + tlsp->scmd0.ivgen_hdrlen |= V_SCMD_KEY_CTX_INLINE(1); + + /* + * The SCMD fields used when encrypting a partial TLS record + * (no trailer and possibly a truncated payload). + */ + tlsp->scmd0_short.seqno_numivs = V_SCMD_SEQ_NO_CTRL(0) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_ENC_DEC_CTRL(SCMD_ENCDECCTRL_ENCRYPT) | + V_SCMD_CIPH_AUTH_SEQ_CTRL((mac_first == 0)) | + V_SCMD_AUTH_MODE(SCMD_AUTH_MODE_NOP) | + V_SCMD_HMAC_CTRL(SCMD_HMAC_CTRL_NOP) | + V_SCMD_IV_SIZE(AES_BLOCK_LEN / 2) | V_SCMD_NUM_IVS(0); + if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) + tlsp->scmd0_short.seqno_numivs |= + V_SCMD_CIPH_MODE(SCMD_CIPH_MODE_AES_CTR); + else + tlsp->scmd0_short.seqno_numivs |= + V_SCMD_CIPH_MODE(tlsp->enc_mode); + tlsp->scmd0_short.seqno_numivs = + htobe32(tlsp->scmd0_short.seqno_numivs); + + tlsp->scmd0_short.ivgen_hdrlen = V_SCMD_IV_GEN_CTRL(0) | + V_SCMD_TLS_FRAG_ENABLE(0) | V_SCMD_AADIVDROP(1); + if (tlsp->inline_key) + tlsp->scmd0_short.ivgen_hdrlen |= V_SCMD_KEY_CTX_INLINE(1); + + TXQ_LOCK(txq); + if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) + txq->kern_tls_gcm++; + else + txq->kern_tls_cbc++; + TXQ_UNLOCK(txq); + *pt = &tlsp->com; + return (0); + +failed: + m_snd_tag_rele(&tlsp->com); + return (error); +} + +static int +ktls_setup_keys(struct tlspcb *tlsp, const struct ktls_session *tls, + struct sge_txq *txq) +{ + struct tls_key_req *kwr; + struct tls_keyctx *kctx; + void *items[1]; + struct mbuf *m; + int error; + + /* + * Store the salt and keys in the key context. For + * connections with an inline key, this key context is passed + * as immediate data in each work request. For connections + * storing the key in DDR, a work request is used to store a + * copy of the key context in DDR. + */ + t4_tls_key_ctx(tls, KTLS_TX, &tlsp->keyctx); + if (tlsp->inline_key) + return (0); + + /* Populate key work request. */ + m = alloc_wr_mbuf(TLS_KEY_WR_SZ, M_NOWAIT); + if (m == NULL) { + CTR(KTR_CXGBE, "%s: %p failed to alloc WR mbuf", __func__, + tlsp); + return (ENOMEM); + } + m->m_pkthdr.snd_tag = m_snd_tag_ref(&tlsp->com); + m->m_pkthdr.csum_flags |= CSUM_SND_TAG; + kwr = mtod(m, void *); + memset(kwr, 0, TLS_KEY_WR_SZ); + + t4_write_tlskey_wr(tls, KTLS_TX, 0, 0, tlsp->tx_key_addr, kwr); + kctx = (struct tls_keyctx *)(kwr + 1); + memcpy(kctx, &tlsp->keyctx, sizeof(*kctx)); + + /* + * Place the key work request in the transmit queue. It + * should be sent to the NIC before any TLS packets using this + * session. + */ + items[0] = m; + error = mp_ring_enqueue(txq->r, items, 1, 1); + if (error) + m_free(m); + else + CTR(KTR_CXGBE, "%s: %p sent key WR", __func__, tlsp); + return (error); +} + +static u_int +ktls_base_wr_size(struct tlspcb *tlsp) +{ + u_int wr_len; + + wr_len = sizeof(struct fw_ulptx_wr); // 16 + wr_len += sizeof(struct ulp_txpkt); // 8 + wr_len += sizeof(struct ulptx_idata); // 8 + wr_len += sizeof(struct cpl_tx_sec_pdu);// 32 + if (tlsp->inline_key) + wr_len += tlsp->tx_key_info_size; + else { + wr_len += sizeof(struct ulptx_sc_memrd);// 8 + wr_len += sizeof(struct ulptx_idata); // 8 + } + /* SplitMode CPL_RX_PHYS_DSGL here if needed. */ + /* CPL_TX_*_LSO here if needed. */ + wr_len += sizeof(struct cpl_tx_pkt_core);// 16 + return (wr_len); +} + +static u_int +ktls_sgl_size(u_int nsegs) +{ + u_int wr_len; + + /* First segment is part of ulptx_sgl. */ + nsegs--; + + wr_len = sizeof(struct ulptx_sgl); + wr_len += 8 * ((3 * nsegs) / 2 + (nsegs & 1)); + return (wr_len); +} + +/* + * A request that doesn't need to generate the TLS trailer is a short + * record. For these requests, part of the TLS record payload is + * encrypted without invoking the MAC. + * + * Returns true if this record should be sent as a short record. In + * either case, the remaining outputs describe the how much of the + * TLS record to send as input to the crypto block and the amount of + * crypto output to trim via SplitMode: + * + * *header_len - Number of bytes of TLS header to pass as immediate + * data + * + * *offset - Start offset of TLS record payload to pass as DSGL data + * + * *plen - Length of TLS record payload to pass as DSGL data + * + * *leading_waste - amount of non-packet-header bytes to drop at the + * start of the crypto output + * + * *trailing_waste - amount of crypto output to drop from the end + */ +static bool +ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, + u_int tlen, u_int *header_len, u_int *offset, u_int *plen, + u_int *leading_waste, u_int *trailing_waste) +{ + const struct tls_record_layer *hdr; + u_int new_tlen, rlen; + + MPASS(tlen > m_tls->m_epg_hdrlen); + + hdr = (void *)m_tls->m_epg_hdr; + rlen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length); + + /* + * Default to sending the full record as input to the crypto + * engine and relying on SplitMode to drop any waste. + */ + *header_len = m_tls->m_epg_hdrlen; + *offset = 0; + *plen = rlen - (m_tls->m_epg_hdrlen + m_tls->m_epg_trllen); + *leading_waste = mtod(m_tls, vm_offset_t); + *trailing_waste = rlen - tlen; + if (!tlsp->sc->tlst.short_records) + return (false); + + if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_CBC) { + /* + * For AES-CBC we have to send input from the start of + * the TLS record payload that is a multiple of the + * block size. new_tlen rounds up tlen to the end of + * the containing AES block. If this last block + * overlaps with the trailer, send the full record to + * generate the MAC. + */ + new_tlen = TLS_HEADER_LENGTH + + roundup2(tlen - TLS_HEADER_LENGTH, AES_BLOCK_LEN); + if (rlen - new_tlen < m_tls->m_epg_trllen) + return (false); + + *trailing_waste = new_tlen - tlen; + *plen = new_tlen - m_tls->m_epg_hdrlen; + } else { + /* + * For AES-GCM we have to send the full record if + * the end overlaps with the trailer. Otherwise, we + * can use AES-CTR to encrypt a partial PDU. + */ + if (rlen - tlen < m_tls->m_epg_trllen) + return (false); + + /* + * The last record can be partially encrypted via + * AES-CTR without any trailing waste. + */ + *trailing_waste = 0; + *plen = tlen - m_tls->m_epg_hdrlen; + + /* + * In addition, with AES-CTR, we can minimize leading + * waste by starting encryption at the start of the + * closest AES block. + */ + if (mtod(m_tls, vm_offset_t) >= m_tls->m_epg_hdrlen) { + *header_len = 0; + *offset = rounddown2(mtod(m_tls, vm_offset_t) - + m_tls->m_epg_hdrlen, AES_BLOCK_LEN); + *plen -= *offset; + *leading_waste -= (m_tls->m_epg_hdrlen + *offset); + } + } + return (true); +} + +static int +ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struct mbuf *m_tls, + int *nsegsp) +{ + u_int header_len, imm_len, offset, plen, tlen, wr_len; + u_int leading_waste, trailing_waste; + bool short_record; + + M_ASSERTEXTPG(m_tls); + + /* + * The relative offset of the last byte to send from the TLS + * record. + */ + tlen = mtod(m_tls, vm_offset_t) + m_tls->m_len; + if (tlen <= m_tls->m_epg_hdrlen) { + /* + * For requests that only want to send the TLS header, + * send a tunnelled packet as immediate data. + */ + wr_len = sizeof(struct fw_eth_tx_pkt_wr) + + sizeof(struct cpl_tx_pkt_core) + + roundup2(m->m_len + m_tls->m_len, 16); + if (wr_len > SGE_MAX_WR_LEN) { + CTR(KTR_CXGBE, + "%s: %p TLS header-only packet too long (len %d)", + __func__, tlsp, m->m_len + m_tls->m_len); + } + + /* This should always be the last TLS record in a chain. */ + MPASS(m_tls->m_next == NULL); + *nsegsp = 0; + return (wr_len); + } + + short_record = ktls_is_short_record(tlsp, m_tls, tlen, &header_len, + &offset, &plen, &leading_waste, &trailing_waste); + + /* Calculate the size of the work request. */ + wr_len = ktls_base_wr_size(tlsp); + + if (leading_waste != 0 || trailing_waste != 0) { + /* + * Partial records might require a SplitMode + * CPL_RX_PHYS_DSGL. + */ + wr_len += sizeof(struct cpl_t7_rx_phys_dsgl); + } + + /* Budget for an LSO header even if we don't use it. */ + wr_len += sizeof(struct cpl_tx_pkt_lso_core); + + /* + * Headers (including the TLS header) are always sent as + * immediate data. Short records include a raw AES IV as + * immediate data. + */ + imm_len = m->m_len + header_len; + if (short_record) + imm_len += AES_BLOCK_LEN; + wr_len += roundup2(imm_len, 16); + + /* TLS record payload via DSGL. */ + *nsegsp = sglist_count_mbuf_epg(m_tls, m_tls->m_epg_hdrlen + offset, + plen); + wr_len += ktls_sgl_size(*nsegsp); + + wr_len = roundup2(wr_len, 16); + return (wr_len); +} + +int +t7_ktls_parse_pkt(struct mbuf *m) +{ + struct tlspcb *tlsp; + struct ether_header *eh; + struct ip *ip; + struct ip6_hdr *ip6; + struct tcphdr *tcp; + struct mbuf *m_tls; + void *items[1]; + int nsegs; + u_int wr_len, tot_len; + uint16_t eh_type; + + /* + * Locate headers in initial mbuf. + * + * XXX: This assumes all of the headers are in the initial mbuf. + * Could perhaps use m_advance() like parse_pkt() if that turns + * out to not be true. + */ + M_ASSERTPKTHDR(m); + MPASS(m->m_pkthdr.snd_tag != NULL); + tlsp = mst_to_tls(m->m_pkthdr.snd_tag); + + if (m->m_len <= sizeof(*eh) + sizeof(*ip)) { + CTR(KTR_CXGBE, "%s: %p header mbuf too short", __func__, tlsp); + return (EINVAL); + } + eh = mtod(m, struct ether_header *); + eh_type = ntohs(eh->ether_type); + if (eh_type == ETHERTYPE_VLAN) { + struct ether_vlan_header *evh = (void *)eh; + + eh_type = ntohs(evh->evl_proto); + m->m_pkthdr.l2hlen = sizeof(*evh); + } else + m->m_pkthdr.l2hlen = sizeof(*eh); + + switch (eh_type) { + case ETHERTYPE_IP: + ip = (struct ip *)(eh + 1); + if (ip->ip_p != IPPROTO_TCP) { + CTR(KTR_CXGBE, "%s: %p mbuf not IPPROTO_TCP", __func__, + tlsp); + return (EINVAL); + } + m->m_pkthdr.l3hlen = ip->ip_hl * 4; + break; + case ETHERTYPE_IPV6: + ip6 = (struct ip6_hdr *)(eh + 1); + if (ip6->ip6_nxt != IPPROTO_TCP) { + CTR(KTR_CXGBE, "%s: %p, mbuf not IPPROTO_TCP (%u)", + __func__, tlsp, ip6->ip6_nxt); + return (EINVAL); + } + m->m_pkthdr.l3hlen = sizeof(struct ip6_hdr); + break; + default: + CTR(KTR_CXGBE, "%s: %p mbuf not ETHERTYPE_IP{,V6}", __func__, + tlsp); + return (EINVAL); + } + if (m->m_len < m->m_pkthdr.l2hlen + m->m_pkthdr.l3hlen + + sizeof(*tcp)) { + CTR(KTR_CXGBE, "%s: %p header mbuf too short (2)", __func__, + tlsp); + return (EINVAL); + } + tcp = (struct tcphdr *)((char *)(eh + 1) + m->m_pkthdr.l3hlen); + m->m_pkthdr.l4hlen = tcp->th_off * 4; + + /* Bail if there is TCP payload before the TLS record. */ + if (m->m_len != m->m_pkthdr.l2hlen + m->m_pkthdr.l3hlen + + m->m_pkthdr.l4hlen) { + CTR(KTR_CXGBE, + "%s: %p header mbuf bad length (%d + %d + %d != %d)", + __func__, tlsp, m->m_pkthdr.l2hlen, m->m_pkthdr.l3hlen, + m->m_pkthdr.l4hlen, m->m_len); + return (EINVAL); + } + + /* Assume all headers are in 'm' for now. */ + MPASS(m->m_next != NULL); + MPASS(m->m_next->m_flags & M_EXTPG); + + tot_len = 0; + + /* + * Each of the remaining mbufs in the chain should reference a + * TLS record. + */ + for (m_tls = m->m_next; m_tls != NULL; m_tls = m_tls->m_next) { + MPASS(m_tls->m_flags & M_EXTPG); + + wr_len = ktls_wr_len(tlsp, m, m_tls, &nsegs); +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: %p wr_len %d nsegs %d", __func__, tlsp, + wr_len, nsegs); +#endif + if (wr_len > SGE_MAX_WR_LEN || nsegs > TX_SGL_SEGS) + return (EFBIG); + tot_len += roundup2(wr_len, EQ_ESIZE); + + /* + * Store 'nsegs' for the first TLS record in the + * header mbuf's metadata. + */ + if (m_tls == m->m_next) + set_mbuf_nsegs(m, nsegs); + } + + MPASS(tot_len != 0); + + set_mbuf_len16(m, tot_len / 16); +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: %p len16 %d nsegs %d", __func__, tlsp, + mbuf_len16(m), mbuf_nsegs(m)); +#endif + items[0] = m; + return (mp_ring_enqueue(tlsp->txq->r, items, 1, 256)); +} + +static inline bool +needs_vlan_insertion(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + + return (m->m_flags & M_VLANTAG); +} + +static inline uint64_t +pkt_ctrl1(struct sge_txq *txq, struct mbuf *m, uint16_t eh_type) +{ + uint64_t ctrl1; + + /* Checksums are always offloaded */ + if (eh_type == ETHERTYPE_IP) { + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); + } else { + MPASS(m->m_pkthdr.l3hlen == sizeof(struct ip6_hdr)); + ctrl1 = V_TXPKT_CSUM_TYPE(TX_CSUM_TCPIP6) | + V_T6_TXPKT_ETHHDR_LEN(m->m_pkthdr.l2hlen - ETHER_HDR_LEN) | + V_TXPKT_IPHDR_LEN(m->m_pkthdr.l3hlen); + } + txq->txcsum++; + + /* VLAN tag insertion */ + if (needs_vlan_insertion(m)) { + ctrl1 |= F_TXPKT_VLAN_VLD | + V_TXPKT_VLAN(m->m_pkthdr.ether_vtag); + txq->vlan_insertion++; + } + + return (ctrl1); +} + +static inline void * +write_lso_cpl(void *cpl, struct mbuf *m0, uint16_t mss, uint16_t eh_type, + int total_len) +{ + struct cpl_tx_pkt_lso_core *lso; + uint32_t ctrl; + + KASSERT(m0->m_pkthdr.l2hlen > 0 && m0->m_pkthdr.l3hlen > 0 && + m0->m_pkthdr.l4hlen > 0, + ("%s: mbuf %p needs TSO but missing header lengths", + __func__, m0)); + + ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | + F_LSO_FIRST_SLICE | F_LSO_LAST_SLICE | + V_LSO_ETHHDR_LEN((m0->m_pkthdr.l2hlen - ETHER_HDR_LEN) >> 2) | + V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2) | + V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2); + if (eh_type == ETHERTYPE_IPV6) + ctrl |= F_LSO_IPV6; + + lso = cpl; + lso->lso_ctrl = htobe32(ctrl); + lso->ipid_ofst = htobe16(0); + lso->mss = htobe16(mss); + lso->seqno_offset = htobe32(0); + lso->len = htobe32(total_len); + + return (lso + 1); +} + +static inline void * +write_split_mode_rx_phys(void *dst, struct mbuf *m, struct mbuf *m_tls, + u_int crypto_hdr_len, u_int leading_waste, u_int trailing_waste) +{ + struct cpl_t7_rx_phys_dsgl *cpl; + uint16_t *len; + uint8_t numsge; + + /* Forward first (3) and third (1) segments. */ + numsge = 0xa; + + cpl = dst; + cpl->ot.opcode = CPL_RX_PHYS_DSGL; + cpl->PhysAddrFields_lo_to_NumSGE = + htobe32(F_CPL_T7_RX_PHYS_DSGL_SPLITMODE | + V_CPL_T7_RX_PHYS_DSGL_NUMSGE(numsge)); + + len = (uint16_t *)(cpl->RSSCopy); + + /* + * First segment always contains packet headers as well as + * transmit-related CPLs. + */ + len[0] = htobe16(crypto_hdr_len); + + /* + * Second segment is "gap" of data to drop at the front of the + * TLS record. + */ + len[1] = htobe16(leading_waste); + + /* Third segment is how much of the TLS record to send. */ + len[2] = htobe16(m_tls->m_len); + + /* Fourth segment is how much data to drop at the end. */ + len[3] = htobe16(trailing_waste); + +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: forward %u skip %u forward %u skip %u", + __func__, be16toh(len[0]), be16toh(len[1]), be16toh(len[2]), + be16toh(len[3])); +#endif + return (cpl + 1); +} + +/* + * If the SGL ends on an address that is not 16 byte aligned, this function will + * add a 0 filled flit at the end. + */ +static void +write_gl_to_buf(struct sglist *gl, caddr_t to) +{ + struct sglist_seg *seg; + __be64 *flitp; + struct ulptx_sgl *usgl; + int i, nflits, nsegs; + + KASSERT(((uintptr_t)to & 0xf) == 0, + ("%s: SGL must start at a 16 byte boundary: %p", __func__, to)); + + nsegs = gl->sg_nseg; + MPASS(nsegs > 0); + + nflits = (3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1) + 2; + flitp = (__be64 *)to; + seg = &gl->sg_segs[0]; + usgl = (void *)flitp; + + usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | + V_ULPTX_NSGE(nsegs)); + usgl->len0 = htobe32(seg->ss_len); + usgl->addr0 = htobe64(seg->ss_paddr); + seg++; + + for (i = 0; i < nsegs - 1; i++, seg++) { + usgl->sge[i / 2].len[i & 1] = htobe32(seg->ss_len); + usgl->sge[i / 2].addr[i & 1] = htobe64(seg->ss_paddr); + } + if (i & 1) + usgl->sge[i / 2].len[1] = htobe32(0); + flitp += nflits; + + if (nflits & 1) { + MPASS(((uintptr_t)flitp) & 0xf); + *flitp++ = 0; + } + + MPASS((((uintptr_t)flitp) & 0xf) == 0); +} + +static inline void +copy_to_txd(struct sge_eq *eq, caddr_t from, caddr_t *to, int len) +{ + + MPASS((uintptr_t)(*to) >= (uintptr_t)&eq->desc[0]); + MPASS((uintptr_t)(*to) < (uintptr_t)&eq->desc[eq->sidx]); + + if (__predict_true((uintptr_t)(*to) + len <= + (uintptr_t)&eq->desc[eq->sidx])) { + bcopy(from, *to, len); + (*to) += len; + if ((uintptr_t)(*to) == (uintptr_t)&eq->desc[eq->sidx]) + (*to) = (caddr_t)eq->desc; + } else { + int portion = (uintptr_t)&eq->desc[eq->sidx] - (uintptr_t)(*to); + + bcopy(from, *to, portion); + from += portion; + portion = len - portion; /* remaining */ + bcopy(from, (void *)eq->desc, portion); + (*to) = (caddr_t)eq->desc + portion; + } +} + +static int +ktls_write_tunnel_packet(struct sge_txq *txq, void *dst, struct mbuf *m, + struct mbuf *m_tls, u_int available, tcp_seq tcp_seqno, u_int pidx, + uint16_t eh_type) +{ + struct tx_sdesc *txsd; + struct fw_eth_tx_pkt_wr *wr; + struct cpl_tx_pkt_core *cpl; + uint32_t ctrl; + int len16, ndesc, pktlen; + struct ether_header *eh; + struct ip *ip, newip; + struct ip6_hdr *ip6, newip6; + struct tcphdr *tcp, newtcp; + caddr_t out; + + TXQ_LOCK_ASSERT_OWNED(txq); + M_ASSERTPKTHDR(m); + + /* Locate the template TLS header. */ + M_ASSERTEXTPG(m_tls); + + /* This should always be the last TLS record in a chain. */ + MPASS(m_tls->m_next == NULL); + + wr = dst; + pktlen = m->m_len + m_tls->m_len; + ctrl = sizeof(struct cpl_tx_pkt_core) + pktlen; + len16 = howmany(sizeof(struct fw_eth_tx_pkt_wr) + ctrl, 16); + ndesc = tx_len16_to_desc(len16); + MPASS(ndesc <= available); + + /* Firmware work request header */ + /* TODO: Handle VF work request. */ + wr->op_immdlen = htobe32(V_FW_WR_OP(FW_ETH_TX_PKT_WR) | + V_FW_ETH_TX_PKT_WR_IMMDLEN(ctrl)); + + ctrl = V_FW_WR_LEN16(len16); + wr->equiq_to_len16 = htobe32(ctrl); + wr->r3 = 0; + + cpl = (void *)(wr + 1); + + /* CPL header */ + cpl->ctrl0 = txq->cpl_ctrl0; + cpl->pack = 0; + cpl->len = htobe16(pktlen); + + out = (void *)(cpl + 1); + + /* Copy over Ethernet header. */ + eh = mtod(m, struct ether_header *); *** 697 LINES SKIPPED *** From nobody Fri Oct 3 00:04:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86j3LWLz6BMw1; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86j0PM5z3t1H; Fri, 03 Oct 2025 00:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvGwy0U4O3yBTO27G4/BsmvYstJ/QJ3NQxw2nVrrIpE=; b=CJshdBpW0esZeYdUvu2KsIMcp3vtfd94KjhjARpDrYKXZTvePIr2Y/mCYVPkXLLEXzfWHy 6bufbsbUjRQDOsoodtLgMZyC+MqEUPL6H6SxKxAcPAFfqTVfl2Ii5XeGh3RpjwQ1Yyi6dn l4c2awLZ8hX0EILzORPZMWpI0zuH6MmPVqMpI/GPbqWvb7BqoHdTZ5RsKfozI35retM9tK 1+T2b5NxJqjC+lQNaqeqinhjevcBt5JmExEg9N/1ew36A82MSU3hxZtWNSuwg2FRXZc66r 5/QaDdyM40A9uXy0/vLWNtfcBdnJBWRirzYpxXREmvb77R+03j8c9b6V5kOxBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvGwy0U4O3yBTO27G4/BsmvYstJ/QJ3NQxw2nVrrIpE=; b=mi5CMrR7uz9KPuCaPbpBrn1Yd5iQdZoydDp2RX1F9aqkeMR9hffrPi8cB7F+2yWWqM/eMF Kw6x+HnQMx5qBryTWWbockHa7OG31Ag1DRlSxsb0d3To7voBZ4g/JBuk0CqbP+JJJy00nn lMenHwcEQb+3d0rysdGZ6BitQSlHRPKkeAuKubaLs1tj23LnEH1fuNA5gH9bP5hCONCDBI bw4md53Xdjo304K6qUnSY0t9nqgpSiAFPlv294o7BDi/4xtCVszYUYuKXlGdKXAUfTvYay 1NBFV8pRUkhiEEOmTEOJkFEigJAHI3n8B+8z+0PU3hd0nSGDFEsZecdZl+Rshw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449885; a=rsa-sha256; cv=none; b=EFFknigVX2rTIm4+thCcXMX1FXRMJsswJ+Cemw2zlAeTYx4Hq+LT0n7goIYrK0T7V1V3St Om3cvyadcmhJF9IORbdEZwckCX1iSkYUjK8zsX0RBdtlHkQzLFoKmyVSiQbe6Kh2XJVTkB uY4qYgAFIbJPbifgaBwO0KK4jwtLXB8zwAXQduTTiFtqAjl1JmDjKFHPfPMurKWl4BVPs+ O99KHBTQogZ2rdAV3qT9jeBHtvDk3bBlX2odKyediu1PQc+chzWGNgrUyDsDkzkaMnVamU TefLdwt6e+p8HEf5/881J88MhIPb/Csv0ikgMx0lEbPciOdJpJcFHxrAuzSQoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86h74RtzVjT; Fri, 03 Oct 2025 00:04: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 59304iKD057486; Fri, 3 Oct 2025 00:04:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304iou057483; Fri, 3 Oct 2025 00:04:44 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:44 GMT Message-Id: <202510030004.59304iou057483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: e36647988f31 - stable/15 - cxgbe: Extend NIC TLS to support TLS 1.3. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e36647988f31d97e2fcca9ba37b0fdbd45d7236e Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=e36647988f31d97e2fcca9ba37b0fdbd45d7236e commit e36647988f31d97e2fcca9ba37b0fdbd45d7236e Author: John Baldwin AuthorDate: 2025-09-29 15:04:44 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:08 +0000 cxgbe: Extend NIC TLS to support TLS 1.3. One unusual quirk is that the crypto engine requires the driver to provide an 8 byte placeholder as input before the AAD that is replaced with the middle 8 bytes of the nonce generated from the sequence number and key context. Sponsored by: Chelsio Communications (cherry picked from commit 5b9dc22c91068e206fb6cc18ee0cef27067223df) --- sys/dev/cxgbe/crypto/t7_kern_tls.c | 101 ++++++++++++++++++++++++++++--------- 1 file changed, 77 insertions(+), 24 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t7_kern_tls.c b/sys/dev/cxgbe/crypto/t7_kern_tls.c index 402b2cab20ba..5063648b2ba9 100644 --- a/sys/dev/cxgbe/crypto/t7_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t7_kern_tls.c @@ -74,6 +74,7 @@ struct tlspcb { int tx_key_addr; bool inline_key; + bool tls13; unsigned char enc_mode; struct tls_scmd scmd0; @@ -131,14 +132,14 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, struct vi_info *vi; struct inpcb *inp; struct sge_txq *txq; - int error, explicit_iv_size, keyid, mac_first; + int error, iv_size, keyid, mac_first; tls = params->tls.tls; - /* Only TLS 1.1 and TLS 1.2 are currently supported. */ + /* TLS 1.1 through TLS 1.3 are currently supported. */ if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || tls->params.tls_vminor < TLS_MINOR_VER_ONE || - tls->params.tls_vminor > TLS_MINOR_VER_TWO) + tls->params.tls_vminor > TLS_MINOR_VER_THREE) return (EPROTONOSUPPORT); /* Sanity check values in *tls. */ @@ -161,12 +162,10 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, default: return (EPROTONOSUPPORT); } - explicit_iv_size = AES_BLOCK_LEN; + iv_size = AES_BLOCK_LEN; mac_first = 1; break; case CRYPTO_AES_NIST_GCM_16: - if (tls->params.iv_len != SALT_SIZE) - return (EINVAL); switch (tls->params.cipher_key_len) { case 128 / 8: case 192 / 8: @@ -175,7 +174,13 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, default: return (EINVAL); } - explicit_iv_size = 8; + + /* + * The IV size for TLS 1.2 is the explicit IV in the + * record header. For TLS 1.3 it is the size of the + * sequence number. + */ + iv_size = 8; mac_first = 0; break; default: @@ -186,6 +191,7 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, sc = vi->adapter; tlsp = alloc_tlspcb(ifp, vi, M_WAITOK); + tlsp->tls13 = tls->params.tls_vminor == TLS_MINOR_VER_THREE; if (sc->tlst.inline_keys) keyid = -1; @@ -224,14 +230,19 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, tlsp->tx_key_info_size = t4_tls_key_info_size(tls); /* The SCMD fields used when encrypting a full TLS record. */ - tlsp->scmd0.seqno_numivs = htobe32(V_SCMD_SEQ_NO_CTRL(3) | + if (tlsp->tls13) + tlsp->scmd0.seqno_numivs = V_SCMD_SEQ_NO_CTRL(0); + else + tlsp->scmd0.seqno_numivs = V_SCMD_SEQ_NO_CTRL(3); + tlsp->scmd0.seqno_numivs |= V_SCMD_PROTO_VERSION(t4_tls_proto_ver(tls)) | V_SCMD_ENC_DEC_CTRL(SCMD_ENCDECCTRL_ENCRYPT) | V_SCMD_CIPH_AUTH_SEQ_CTRL((mac_first == 0)) | V_SCMD_CIPH_MODE(tlsp->enc_mode) | V_SCMD_AUTH_MODE(t4_tls_auth_mode(tls)) | V_SCMD_HMAC_CTRL(t4_tls_hmac_ctrl(tls)) | - V_SCMD_IV_SIZE(explicit_iv_size / 2) | V_SCMD_NUM_IVS(1)); + V_SCMD_IV_SIZE(iv_size / 2) | V_SCMD_NUM_IVS(1); + tlsp->scmd0.seqno_numivs = htobe32(tlsp->scmd0.seqno_numivs); tlsp->scmd0.ivgen_hdrlen = V_SCMD_IV_GEN_CTRL(0) | V_SCMD_TLS_FRAG_ENABLE(0); @@ -390,20 +401,29 @@ ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, u_int *leading_waste, u_int *trailing_waste) { const struct tls_record_layer *hdr; - u_int new_tlen, rlen; + u_int new_tlen, trailer_len, rlen; MPASS(tlen > m_tls->m_epg_hdrlen); hdr = (void *)m_tls->m_epg_hdr; rlen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length); + /* + * For TLS 1.3 treat the inner record type stored as the first + * byte of the trailer as part of the payload rather than part + * of the trailer. + */ + trailer_len = m_tls->m_epg_trllen; + if (tlsp->tls13) + trailer_len--; + /* * Default to sending the full record as input to the crypto * engine and relying on SplitMode to drop any waste. */ *header_len = m_tls->m_epg_hdrlen; *offset = 0; - *plen = rlen - (m_tls->m_epg_hdrlen + m_tls->m_epg_trllen); + *plen = rlen - (m_tls->m_epg_hdrlen + trailer_len); *leading_waste = mtod(m_tls, vm_offset_t); *trailing_waste = rlen - tlen; if (!tlsp->sc->tlst.short_records) @@ -420,7 +440,7 @@ ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, */ new_tlen = TLS_HEADER_LENGTH + roundup2(tlen - TLS_HEADER_LENGTH, AES_BLOCK_LEN); - if (rlen - new_tlen < m_tls->m_epg_trllen) + if (rlen - new_tlen < trailer_len) return (false); *trailing_waste = new_tlen - tlen; @@ -431,7 +451,7 @@ ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, * the end overlaps with the trailer. Otherwise, we * can use AES-CTR to encrypt a partial PDU. */ - if (rlen - tlen < m_tls->m_epg_trllen) + if (rlen - tlen < trailer_len) return (false); /* @@ -512,11 +532,14 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struct mbuf *m_tls, /* * Headers (including the TLS header) are always sent as * immediate data. Short records include a raw AES IV as - * immediate data. + * immediate data. TLS 1.3 non-short records include a + * placeholder for the sequence number as immediate data. */ imm_len = m->m_len + header_len; if (short_record) imm_len += AES_BLOCK_LEN; + else if (tlsp->tls13) + imm_len += sizeof(uint64_t); wr_len += roundup2(imm_len, 16); /* TLS record payload via DSGL. */ @@ -1044,6 +1067,8 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, imm_len = m->m_len + header_len; if (short_record) imm_len += AES_BLOCK_LEN; + else if (tlsp->tls13) + imm_len += sizeof(uint64_t); wr_len += roundup2(imm_len, 16); wr_len += ktls_sgl_size(nsegs); @@ -1141,15 +1166,25 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, txq->kern_tls_short++; } else { /* - * AAD is TLS header. IV is after AAD. The cipher region - * starts after the IV. See comments in ccr_authenc() and - * ccr_gmac() in t4_crypto.c regarding cipher and auth - * start/stop values. + * AAD is TLS header. IV is after AAD for TLS < 1.3. + * For TLS 1.3, a placeholder for the TLS sequence + * number is provided as an IV before the AAD. The + * cipher region starts after the AAD and IV. See + * comments in ccr_authenc() and ccr_gmac() in + * t4_crypto.c regarding cipher and auth start/stop + * values. */ - aad_start = 1; - aad_stop = TLS_HEADER_LENGTH; - iv_offset = TLS_HEADER_LENGTH + 1; - cipher_start = m_tls->m_epg_hdrlen + 1; + if (tlsp->tls13) { + iv_offset = 1; + aad_start = 1 + sizeof(uint64_t); + aad_stop = sizeof(uint64_t) + TLS_HEADER_LENGTH; + cipher_start = aad_stop + 1; + } else { + aad_start = 1; + aad_stop = TLS_HEADER_LENGTH; + iv_offset = TLS_HEADER_LENGTH + 1; + cipher_start = m_tls->m_epg_hdrlen + 1; + } if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) { cipher_stop = 0; auth_start = cipher_start; @@ -1162,7 +1197,8 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, auth_insert = 0; } - sec_pdu->pldlen = htobe32(m_tls->m_epg_hdrlen + plen); + sec_pdu->pldlen = htobe32((tlsp->tls13 ? sizeof(uint64_t) : 0) + + m_tls->m_epg_hdrlen + plen); /* These two flits are actually a CPL_TLS_TX_SCMD_FMT. */ sec_pdu->seqno_numivs = tlsp->scmd0.seqno_numivs; @@ -1256,6 +1292,15 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, newtcp->th_flags = tcp->th_flags & ~(TH_PUSH | TH_FIN); out += m->m_len; + /* + * Insert placeholder for sequence number as IV for TLS 1.3 + * non-short records. + */ + if (tlsp->tls13 && !short_record) { + memset(out, 0, sizeof(uint64_t)); + out += sizeof(uint64_t); + } + /* Populate the TLS header */ memcpy(out, m_tls->m_epg_hdr, header_len); out += header_len; @@ -1265,7 +1310,15 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, iv = out; if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) { memcpy(iv, tlsp->keyctx.u.txhdr.txsalt, SALT_SIZE); - memcpy(iv + 4, hdr + 1, 8); + if (tlsp->tls13) { + uint64_t value; + + value = be64dec(tlsp->keyctx.u.txhdr.txsalt + + 4); + value ^= m_tls->m_epg_seqno; + be64enc(iv + 4, value); + } else + memcpy(iv + 4, hdr + 1, 8); be32enc(iv + 12, 2 + offset / AES_BLOCK_LEN); } else memcpy(iv, hdr + 1, AES_BLOCK_LEN); From nobody Fri Oct 3 00:04:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86j0K1qz6BMvx; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86h0fJDz3skK; Fri, 03 Oct 2025 00:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fdydXwinIJoWeFTflhbzcioj15Yn+jFGUWKIgvkrIcQ=; b=nr9ZN+JH8m992hNC4mlqLl5xO0DcIORNzL0RLHL3VzqLlrJL3uZatXrjb6cdkIHTUiZUzC JJ68IzrS2TAaLpWaqgcdu+ZeAtpyVm3TD/21KnH2YWw0ti3Sq+CkO+MmuZJdPszQ6CEyrH VfmAQCtyt+y7kQo075daT/omaFYPhg/vSm68RInVDLUNyMHs2MMVi+D7Y5tv7r7wzjPq5B TeIGzVIDDq0xkhxjJEM9uA29P0xuDRNdSGaKKTspNCMO+3uyDH1t5DEaw/BjVo7+7ybRSF XqnQ16MK5hsID6Q5lwgmXqX7MmUus3ATDQI21pPNvrAF0q1tEMIZIYuF2x35mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fdydXwinIJoWeFTflhbzcioj15Yn+jFGUWKIgvkrIcQ=; b=m3Y1HSwulWuyjiNcSRNTQaZ5MQbnXMGcBzpJknYIn3KmudRkJa64le9qKthn/MsbVARWjQ /su3Dyn7f0Q5aqzD6aPUDLH4TJHqAT2wWX3ZgPYz78hZ8y28vKOZocN9I57ydfRb0rKBwO WAuBQgetHqvB9inWzAD7ZWw2O+tbl8xQD0o6byUqAnCSJvMkYIQ8KKawLF/eyiH1+VOCSY JcFnFWZVyOE7PaLUIBHX+1SQl5KWJuEQEUk95WMzE5tRS68DLKjprBTg1nSvn/Oej/nRoq Lryi3X3Nf4dSYdCf/I0qH4cnPUCysOKHleJfBpmjGmWUZ0MgZArUBYHq7mbhAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449884; a=rsa-sha256; cv=none; b=Go3/YKBuQMqsN76AwpvZEy8nEvCXMot3AJqSR+vFnFeIFb5ipp9891nMltj+/COLLRP/if JSxNRU6i2bZ6rr214FacFiAn+ky8+ytf4VEfyCIfv5ffRhCqdQt0HxOqhZzfXCGDLnh0LN XTEtFfLZVhc77tQsoH/E4ZZ6/DGr/ydGys8wE+xRzfdr9OdAs3jf8j/0dkzdnzHjMkgQQU VldjZeVSVaOcivT9q3z8X7baeHGc6d1gmyYxcDrKe0Y+NvC8kS31TLj+KjdaOd9dW8wkH9 lL1nfWV/4wBuYCI9F8c0+sKNXwsXUXpx5xd9MqRvjeFvGpPUPZwrmnM55Bqrfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86g6Rs6zVcs; Fri, 03 Oct 2025 00:04:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304hBP057453; Fri, 3 Oct 2025 00:04:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304hda057450; Fri, 3 Oct 2025 00:04:43 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:43 GMT Message-Id: <202510030004.59304hda057450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: e35760a50bc4 - stable/15 - cxgbe: Support for TLS 1.3 in key contexts. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e35760a50bc424420fb56b64adda54343c5911ad Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=e35760a50bc424420fb56b64adda54343c5911ad commit e35760a50bc424420fb56b64adda54343c5911ad Author: John Baldwin AuthorDate: 2025-09-29 15:02:28 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:08 +0000 cxgbe: Support for TLS 1.3 in key contexts. For TLS 1.3 the 4 byte salt field has been extended to hold the 12 byte nonce. Sponsored by: Chelsio Communications (cherry picked from commit 6154961e2e4c7e1d998f4c9e22c5370d17edb160) --- sys/dev/cxgbe/crypto/t4_crypto.h | 1 + sys/dev/cxgbe/crypto/t4_keyctx.c | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t4_crypto.h b/sys/dev/cxgbe/crypto/t4_crypto.h index 452e48d20dfd..71c9ec3903ef 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.h +++ b/sys/dev/cxgbe/crypto/t4_crypto.h @@ -139,6 +139,7 @@ struct phys_sge_pairs { #define SCMD_PROTO_VERSION_TLS_1_2 0 #define SCMD_PROTO_VERSION_TLS_1_1 1 #define SCMD_PROTO_VERSION_GENERIC 4 +#define SCMD_PROTO_VERSION_TLS_1_3 8 #define SCMD_CIPH_MODE_NOP 0 #define SCMD_CIPH_MODE_AES_CBC 1 diff --git a/sys/dev/cxgbe/crypto/t4_keyctx.c b/sys/dev/cxgbe/crypto/t4_keyctx.c index 52a75666c3aa..b85e50fd6cb1 100644 --- a/sys/dev/cxgbe/crypto/t4_keyctx.c +++ b/sys/dev/cxgbe/crypto/t4_keyctx.c @@ -437,10 +437,16 @@ t4_tls_key_info_size(const struct ktls_session *tls) int t4_tls_proto_ver(const struct ktls_session *tls) { - if (tls->params.tls_vminor == TLS_MINOR_VER_ONE) + switch (tls->params.tls_vminor) { + case TLS_MINOR_VER_ONE: return (SCMD_PROTO_VERSION_TLS_1_1); - else + case TLS_MINOR_VER_TWO: return (SCMD_PROTO_VERSION_TLS_1_2); + case TLS_MINOR_VER_THREE: + return (SCMD_PROTO_VERSION_TLS_1_3); + default: + __assert_unreachable(); + } } int @@ -491,6 +497,17 @@ t4_tls_hmac_ctrl(const struct ktls_session *tls) } } +static int +tls_seqnum_ctrl(const struct ktls_session *tls) +{ + switch (tls->params.tls_vminor) { + case TLS_MINOR_VER_THREE: + return (0); + default: + return (3); + } +} + static int tls_cipher_key_size(const struct ktls_session *tls) { @@ -557,7 +574,7 @@ t4_tls_key_ctx(const struct ktls_session *tls, int direction, kctx->u.rxhdr.authmode_to_rxvalid = V_TLS_KEYCTX_TX_WR_AUTHMODE(t4_tls_auth_mode(tls)) | - V_TLS_KEYCTX_TX_WR_SEQNUMCTRL(3) | + V_TLS_KEYCTX_TX_WR_SEQNUMCTRL(tls_seqnum_ctrl(tls)) | V_TLS_KEYCTX_TX_WR_RXVALID(1); kctx->u.rxhdr.ivpresent_to_rxmk_size = @@ -607,7 +624,8 @@ t4_tls_key_ctx(const struct ktls_session *tls, int direction, _Static_assert(offsetof(struct tx_keyctx_hdr, txsalt) == offsetof(struct rx_keyctx_hdr, rxsalt), "salt offset mismatch"); - memcpy(kctx->u.txhdr.txsalt, tls->params.iv, SALT_SIZE); + memcpy(kctx->u.txhdr.txsalt, tls->params.iv, + tls->params.iv_len); t4_init_gmac_hash(tls->params.cipher_key, tls->params.cipher_key_len, hash); } else { From nobody Fri Oct 3 00:04:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86l0CCSz6BMk0; Fri, 03 Oct 2025 00:04:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86k1x7sz3t1b; Fri, 03 Oct 2025 00:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmxZ0N4SJMTrfhLd7c4JISdJaJMlTHxJfLRIQyRMnHM=; b=EfNTpG6aAgguiEcCQcXQCbF1fH1gItAkPKY7w+SnDsjKhMREJjt9Dm2e/fXb1ZIjj0Qkux C0p6wD/tp5RTxwW30maYJYdMAtTu144HDWQqbeMC77mnr4Qn8TvDWdXZTSje0T5FF/110s CHgdedgKVpDZxnEJ0OW5b94NO4EjAIBi7pChsCSM3POD4C+D+vK8mNpJe+v4tm01XhQTlj 3VJYqMIAYm8cCkrAETX0WtFBZO8twABaXYsw5oFw1nSb44dpzJWs4MMbqCvvjaUNgR+TPP PQ85N3H15TpWEP9qqn1MHunv5YqEev0mpQExQQLJ4CphD69fPWaTDzKSYUNgzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmxZ0N4SJMTrfhLd7c4JISdJaJMlTHxJfLRIQyRMnHM=; b=JkYMp5EkOkRFzuL4H6gIZYOaFqqmATEfaLeOt0OeXUQ4Plt4ycT5/HenvIABtkXPBVu65C 4L7lf+btxc0DdQ+e0Ie80mxytWG+/ZZoykrygmhm4H4yEToLMP9TX32YTp+DLbuWSOc9fP LNm2qFC89HmFjtcssMwJUcSZrUYAGMj57je88KM4TaR53eHGqkYuitbhbd1QzQ53Z+TRqW R/PuJincfNhTqtBevDyYf0KN5Nn6ioRzDDh+tg1QIOZTM0F3fb+LIOm/OfjsWEyHLmi5Ha BonqKS3IY60r5xtAnf0Q8TYkbD1IKOuDW5rXpQD8Q0BrB1IyWawCkTBAL0bpBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449886; a=rsa-sha256; cv=none; b=pO+H/J4rIxKpwp+/UXGzk9kyJRZxor+u+qoY/Kffyow2IxhPPXWB53nhDP4n2yuyCZLZ/A DXaBUh/UBqyFIO7RcGacDpwE22lHjhtPBWH48DTbATBgXSlIGThGeiiPKi/d2k0S8AJJvg vsnXMKHaWYb660rqJp7e+WhT5/57VP4oEKyV6lgJIIwgxrsVdr002YngovE9zewwaRRrGa bK4Bg2QjMiKc67xzKNpcnit/5mh8emjZ//rDGYfxnvH9Z5vJ9VgJYmhBx18y6kGzpci9NC IMAa72k/aSPAhzuhVvGTwwGzz5GflWG82eX8dABAW0o4qDRzcvpCuZ4uk7VxIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86k1JCtzVct; Fri, 03 Oct 2025 00:04: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 59304ke7057520; Fri, 3 Oct 2025 00:04:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304kKv057517; Fri, 3 Oct 2025 00:04:46 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:46 GMT Message-Id: <202510030004.59304kKv057517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: f184ef0797b9 - stable/15 - cxgbe TOE TLS: Better support for partial records for T7. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f184ef0797b932512cfeb28192f2f585fb83f0ee Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f184ef0797b932512cfeb28192f2f585fb83f0ee commit f184ef0797b932512cfeb28192f2f585fb83f0ee Author: John Baldwin AuthorDate: 2025-09-29 15:06:46 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:08 +0000 cxgbe TOE TLS: Better support for partial records for T7. T7 is able to start TOE TLS receive offload more cleanly if a partial TLS record containing a full header and at least one other byte has been received. In that case it is able to request the remaining bytes for the current TLS record from the NIC. Once those bytes has been received TLS receive offload can then be received starting with the subsequent record. Sponsored by: Chelsio Communications (cherry picked from commit 1e9849415ff9ed958d63bc7e5128c39e991933d2) --- sys/dev/cxgbe/tom/t4_tls.c | 165 +++++++++++++++++++++++++++++++-------------- 1 file changed, 114 insertions(+), 51 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 0e15a8ec6871..bc12d1f773a9 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -1091,33 +1091,60 @@ out: } /* - * Send a work request setting multiple TCB fields to enable - * ULP_MODE_TLS. + * Send a work request setting one or more TCB fields to partially or + * fully enable ULP_MODE_TLS. + * + * - If resid == 0, the socket buffer ends at a record boundary + * (either empty or contains one or more complete records). Switch + * to ULP_MODE_TLS (if not already) and enable TLS decryption. + * + * - If resid != 0, the socket buffer contains a partial record. In + * this case, switch to ULP_MODE_TLS partially and configure the TCB + * to pass along the remaining resid bytes undecrypted. Once they + * arrive, this is called again with resid == 0 and enables TLS + * decryption. */ static void -tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) +tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno, + size_t resid) { struct mbuf *m; struct work_request_hdr *wrh; struct ulp_txpkt *ulpmc; int fields, key_offset, len; - KASSERT(ulp_mode(toep) == ULP_MODE_NONE, - ("%s: tid %d already ULP_MODE_TLS", __func__, toep->tid)); + /* + * If we are already in ULP_MODE_TLS, then we should now be at + * a record boundary and ready to finish enabling TLS RX. + */ + KASSERT(resid == 0 || ulp_mode(toep) == ULP_MODE_NONE, + ("%s: tid %d needs %zu more data but already ULP_MODE_TLS", + __func__, toep->tid, resid)); fields = 0; + if (ulp_mode(toep) == ULP_MODE_NONE) { + /* 2 writes for the overlay region */ + fields += 2; + } - /* 2 writes for the overlay region */ - fields += 2; + if (resid == 0) { + /* W_TCB_TLS_SEQ */ + fields++; - /* W_TCB_TLS_SEQ */ - fields++; + /* W_TCB_ULP_RAW */ + fields++; + } else { + /* W_TCB_PDU_LEN */ + fields++; - /* W_TCB_ULP_RAW */ - fields++; + /* W_TCB_ULP_RAW */ + fields++; + } - /* W_TCB_ULP_TYPE */ - fields ++; + if (ulp_mode(toep) == ULP_MODE_NONE) { + /* W_TCB_ULP_TYPE */ + fields ++; + } /* W_TCB_T_FLAGS */ fields++; @@ -1136,43 +1163,78 @@ tls_update_tcb(struct adapter *sc, struct toepcb *toep, uint64_t seqno) INIT_ULPTX_WRH(wrh, len, 1, toep->tid); /* atomic */ ulpmc = (struct ulp_txpkt *)(wrh + 1); - /* - * Clear the TLS overlay region: 1023:832. - * - * Words 26/27 are always set to zero. Words 28/29 - * contain seqno and are set when enabling TLS - * decryption. Word 30 is zero and Word 31 contains - * the keyid. - */ - ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 26, - 0xffffffffffffffff, 0); + if (ulp_mode(toep) == ULP_MODE_NONE) { + /* + * Clear the TLS overlay region: 1023:832. + * + * Words 26/27 are always set to zero. Words 28/29 + * contain seqno and are set when enabling TLS + * decryption. Word 30 is zero and Word 31 contains + * the keyid. + */ + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 26, + 0xffffffffffffffff, 0); - /* - * RX key tags are an index into the key portion of MA - * memory stored as an offset from the base address in - * units of 64 bytes. - */ - key_offset = toep->tls.rx_key_addr - sc->vres.key.start; - ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 30, - 0xffffffffffffffff, - (uint64_t)V_TCB_RX_TLS_KEY_TAG(key_offset / 64) << 32); - - CTR3(KTR_CXGBE, "%s: tid %d enable TLS seqno %lu", __func__, - toep->tid, seqno); - ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_RX_TLS_SEQ, - V_TCB_RX_TLS_SEQ(M_TCB_RX_TLS_SEQ), V_TCB_RX_TLS_SEQ(seqno)); - ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_ULP_RAW, - V_TCB_ULP_RAW(M_TCB_ULP_RAW), - V_TCB_ULP_RAW((V_TF_TLS_KEY_SIZE(3) | V_TF_TLS_CONTROL(1) | - V_TF_TLS_ACTIVE(1) | V_TF_TLS_ENABLE(1)))); - - toep->flags &= ~TPF_TLS_STARTING; - toep->flags |= TPF_TLS_RECEIVE; - - /* Set the ULP mode to ULP_MODE_TLS. */ - toep->params.ulp_mode = ULP_MODE_TLS; - ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_ULP_TYPE, - V_TCB_ULP_TYPE(M_TCB_ULP_TYPE), V_TCB_ULP_TYPE(ULP_MODE_TLS)); + /* + * RX key tags are an index into the key portion of MA + * memory stored as an offset from the base address in + * units of 64 bytes. + */ + key_offset = toep->tls.rx_key_addr - sc->vres.key.start; + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, 30, + 0xffffffffffffffff, + (uint64_t)V_TCB_RX_TLS_KEY_TAG(key_offset / 64) << 32); + } + + if (resid == 0) { + /* + * The socket buffer is empty or only contains + * complete TLS records: Set the sequence number and + * enable TLS decryption. + */ + CTR3(KTR_CXGBE, "%s: tid %d enable TLS seqno %lu", __func__, + toep->tid, seqno); + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, + W_TCB_RX_TLS_SEQ, V_TCB_RX_TLS_SEQ(M_TCB_RX_TLS_SEQ), + V_TCB_RX_TLS_SEQ(seqno)); + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, + W_TCB_ULP_RAW, V_TCB_ULP_RAW(M_TCB_ULP_RAW), + V_TCB_ULP_RAW((V_TF_TLS_KEY_SIZE(3) | V_TF_TLS_CONTROL(1) | + V_TF_TLS_ACTIVE(1) | V_TF_TLS_ENABLE(1)))); + + toep->flags &= ~TPF_TLS_STARTING; + toep->flags |= TPF_TLS_RECEIVE; + } else { + /* + * The socket buffer ends with a partial record with a + * full header and needs at least 6 bytes. + * + * Set PDU length. This is treating the 'resid' bytes + * as a TLS PDU, so the first 5 bytes are a fake + * header and the rest are the PDU length. + */ + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, + W_TCB_PDU_LEN, V_TCB_PDU_LEN(M_TCB_PDU_LEN), + V_TCB_PDU_LEN(resid - sizeof(struct tls_hdr))); + CTR3(KTR_CXGBE, "%s: tid %d setting PDU_LEN to %zu", + __func__, toep->tid, resid - sizeof(struct tls_hdr)); + + /* Clear all bits in ULP_RAW except for ENABLE. */ + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, + W_TCB_ULP_RAW, V_TCB_ULP_RAW(M_TCB_ULP_RAW), + V_TCB_ULP_RAW(V_TF_TLS_ENABLE(1))); + + /* Wait for 'resid' bytes to be delivered as CPL_RX_DATA. */ + toep->tls.rx_resid = resid; + } + + if (ulp_mode(toep) == ULP_MODE_NONE) { + /* Set the ULP mode to ULP_MODE_TLS. */ + toep->params.ulp_mode = ULP_MODE_TLS; + ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, + W_TCB_ULP_TYPE, V_TCB_ULP_TYPE(M_TCB_ULP_TYPE), + V_TCB_ULP_TYPE(ULP_MODE_TLS)); + } /* Clear TF_RX_QUIESCE. */ ulpmc = mk_set_tcb_field_ulp(sc, ulpmc, toep->tid, W_TCB_T_FLAGS, @@ -1205,7 +1267,8 @@ tls_check_rx_sockbuf(struct adapter *sc, struct toepcb *toep, * size of a TLS record, re-enable receive and pause again once * we get more data to try again. */ - if (!have_header || resid != 0) { + if (!have_header || (resid != 0 && (resid < sizeof(struct tls_hdr) || + is_t6(sc)))) { CTR(KTR_CXGBE, "%s: tid %d waiting for more data", __func__, toep->tid); toep->flags &= ~TPF_TLS_RX_QUIESCED; @@ -1213,7 +1276,7 @@ tls_check_rx_sockbuf(struct adapter *sc, struct toepcb *toep, return; } - tls_update_tcb(sc, toep, seqno); + tls_update_tcb(sc, toep, seqno, resid); } void From nobody Fri Oct 3 00:04:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86m22l2z6BMk3; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86l2PJ5z3t3S; Fri, 03 Oct 2025 00:04:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nm9OrIhGrLnlHx7UC3w/ZFCrltW3UcjbaW09+odtFfQ=; b=oCQSF0YEIDAxOn1i6VHyN4z4OOo5U6ZCQKwmUWPbG+UeYrYPb8MRpOIavjqbNY6kl8VrnO GQ5+4f+5OtW7qXzO80rjIC3/HyDydxGkeSyYW9SArkVFxIeWidRxofubcQYrf1zOSXIDwr nbiQCyVhut0POIK2DA22ZswNapbyL8dqf1Ml8k29c1I1rhXJW3LoavHcXpNpjNNzmRdSYg 5uBC1b+BNn8mRaO0UJxnAXe39/Wes6a8SgQNvtuun2KR1SsAL6FLLUBH5WxE7DnJv3JiH7 LEL5K12MqybncxJBef/WrxkPVFYPFAG3ELQfCbSPb8kvVY2oIxs+aClGJ8kLOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nm9OrIhGrLnlHx7UC3w/ZFCrltW3UcjbaW09+odtFfQ=; b=fTlCZY2nGa1WNftI2Fro92KCeJI2rOPs2b8aeyuEHT3g7bl5C6PzMXXzymjdil1dj8s4NK 5yB7Dcow50lgoAU6goTMBZunkMbaehE3UjL7keZ89Qpoo9KTSADWiRQMY9xPdy5D9B6XdU hn+GU7Um8m4jKFBEjQRkllXJDRiC8d+mHkSoCJnoQ14UiDU3JQB9wRUCwBsZkGpCjQXf5M q3i1Q36w0DjdlhN6kOFV93Y7T780t63JRWI605GwLH35y8xEuMtrFDy5XzJHNSafDMWSwu ghYMGC9r0HQTSc/406ddMQBBIMxXI3vgPVxXaZz8AwwIhxHroz65P2q4cvdxnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449887; a=rsa-sha256; cv=none; b=nDn/Jsd/I7JGVTtYi4+MKap9l7TxKGQuRqvIxkhzKf7+H5s3jSdnNqtsu+aPog9yKfvKFX kep+CpYBRN0Y+RwLjYcZOIWCL3ZpGb/3quBxsN9MZMzGkCfh5wA30dHdAXQZsj9jWgbhqG XhpPRlV9m7sy6WcBK8TiEd4NbV+FfkxNxN/0mJkdY/SAKtg5KakrKpSGuIMxr3UN51N3SN kL0OhZv0sIT5WH5m9qxfq68yrRO38kY9g6WbpvkxERpwfOdS8afcZ93CUFnqmtmf4VxZBS q64tLTLDi9yKncvCYf0a4iUg+Of/4T9SNTyTxDqC/mINERqo9drh5l/rpMTPPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86l1YkMzVfl; Fri, 03 Oct 2025 00:04:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59304lbp057559; Fri, 3 Oct 2025 00:04:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304l3r057556; Fri, 3 Oct 2025 00:04:47 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:47 GMT Message-Id: <202510030004.59304l3r057556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 97c6187bdcc5 - stable/15 - cxgbe TOE TLS: Support for TLS 1.3 for transmit. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 97c6187bdcc51faf48b3cba59b771c5a42ea0a92 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=97c6187bdcc51faf48b3cba59b771c5a42ea0a92 commit 97c6187bdcc51faf48b3cba59b771c5a42ea0a92 Author: John Baldwin AuthorDate: 2025-09-29 15:09:03 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:08 +0000 cxgbe TOE TLS: Support for TLS 1.3 for transmit. Sponsored by: Chelsio Communications (cherry picked from commit 7de77bea2a6136af55fdf9cc49fb5b6e7cb9615e) --- sys/dev/cxgbe/tom/t4_tls.c | 84 ++++++++++++++++++++++++++++++---------------- sys/dev/cxgbe/tom/t4_tls.h | 1 + 2 files changed, 56 insertions(+), 29 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index bc12d1f773a9..677fd143e248 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -207,7 +207,7 @@ int tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) { struct adapter *sc = td_adapter(toep->td); - int error, explicit_iv_size, mac_first; + int error, iv_size, mac_first; if (!can_tls_offload(sc)) return (EINVAL); @@ -228,6 +228,26 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) } } + /* TLS 1.1 through TLS 1.3 are currently supported. */ + if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || + tls->params.tls_vminor < TLS_MINOR_VER_ONE || + tls->params.tls_vminor > TLS_MINOR_VER_THREE) { + return (EPROTONOSUPPORT); + } + + /* TLS 1.3 is only supported on T7+. */ + if (tls->params.tls_vminor == TLS_MINOR_VER_THREE) { + if (is_t6(sc)) { + return (EPROTONOSUPPORT); + } + + /* Only TX for TLS 1.3 for now. */ + if (direction == KTLS_RX) { + return (EPROTONOSUPPORT); + } + } + + /* Sanity check values in *tls. */ switch (tls->params.cipher_algorithm) { case CRYPTO_AES_CBC: /* XXX: Explicitly ignore any provided IV. */ @@ -247,13 +267,10 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) default: return (EPROTONOSUPPORT); } - explicit_iv_size = AES_BLOCK_LEN; + iv_size = AES_BLOCK_LEN; mac_first = 1; break; case CRYPTO_AES_NIST_GCM_16: - if (tls->params.iv_len != SALT_SIZE) { - return (EINVAL); - } switch (tls->params.cipher_key_len) { case 128 / 8: case 192 / 8: @@ -262,20 +279,19 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) default: return (EINVAL); } - explicit_iv_size = 8; + + /* + * The IV size for TLS 1.2 is the explicit IV in the + * record header. For TLS 1.3 it is the size of the + * sequence number. + */ + iv_size = 8; mac_first = 0; break; default: return (EPROTONOSUPPORT); } - /* Only TLS 1.1 and TLS 1.2 are currently supported. */ - if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || - tls->params.tls_vminor < TLS_MINOR_VER_ONE || - tls->params.tls_vminor > TLS_MINOR_VER_TWO) { - return (EPROTONOSUPPORT); - } - /* Bail if we already have a key. */ if (direction == KTLS_TX) { if (toep->tls.tx_key_addr != -1) @@ -290,6 +306,7 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) return (error); if (direction == KTLS_TX) { + toep->tls.tls13 = tls->params.tls_vminor == TLS_MINOR_VER_THREE; toep->tls.scmd0.seqno_numivs = (V_SCMD_SEQ_NO_CTRL(3) | V_SCMD_PROTO_VERSION(t4_tls_proto_ver(tls)) | @@ -298,14 +315,14 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) V_SCMD_CIPH_MODE(t4_tls_cipher_mode(tls)) | V_SCMD_AUTH_MODE(t4_tls_auth_mode(tls)) | V_SCMD_HMAC_CTRL(t4_tls_hmac_ctrl(tls)) | - V_SCMD_IV_SIZE(explicit_iv_size / 2)); + V_SCMD_IV_SIZE(iv_size / 2)); toep->tls.scmd0.ivgen_hdrlen = (V_SCMD_IV_GEN_CTRL(1) | V_SCMD_KEY_CTX_INLINE(0) | V_SCMD_TLS_FRAG_ENABLE(1)); - toep->tls.iv_len = explicit_iv_size; + toep->tls.iv_len = iv_size; toep->tls.frag_size = tls->params.max_frame_len; toep->tls.fcplenmax = get_tp_plen_max(tls); toep->tls.expn_per_ulp = tls->params.tls_hlen + @@ -352,7 +369,8 @@ tls_uninit_toep(struct toepcb *toep) static void write_tlstx_wr(struct fw_tlstx_data_wr *txwr, struct toepcb *toep, - unsigned int plen, unsigned int expn, uint8_t credits, int shove) + unsigned int plen, unsigned int expn, uint8_t credits, int shove, + int num_ivs) { struct tls_ofld_info *tls_ofld = &toep->tls; unsigned int len = plen + expn; @@ -365,7 +383,7 @@ write_tlstx_wr(struct fw_tlstx_data_wr *txwr, struct toepcb *toep, txwr->plen = htobe32(len); txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(ULP_MODE_TLS) | V_TX_URG(0) | /* F_T6_TX_FORCE | */ V_TX_SHOVE(shove)); - txwr->ctxloc_to_exp = htobe32(V_FW_TLSTX_DATA_WR_NUMIVS(1) | + txwr->ctxloc_to_exp = htobe32(V_FW_TLSTX_DATA_WR_NUMIVS(num_ivs) | V_FW_TLSTX_DATA_WR_EXP(expn) | V_FW_TLSTX_DATA_WR_CTXLOC(TLS_SFO_WR_CONTEXTLOC_DDR) | V_FW_TLSTX_DATA_WR_IVDSGL(0) | @@ -381,20 +399,20 @@ write_tlstx_wr(struct fw_tlstx_data_wr *txwr, struct toepcb *toep, static void write_tlstx_cpl(struct cpl_tx_tls_sfo *cpl, struct toepcb *toep, - struct tls_hdr *tls_hdr, unsigned int plen, uint64_t seqno) + struct tls_hdr *tls_hdr, unsigned int plen, uint8_t rec_type, + uint64_t seqno) { struct tls_ofld_info *tls_ofld = &toep->tls; int data_type, seglen; seglen = plen; - data_type = tls_content_type(tls_hdr->type); + data_type = tls_content_type(rec_type); cpl->op_to_seg_len = htobe32(V_CPL_TX_TLS_SFO_OPCODE(CPL_TX_TLS_SFO) | V_CPL_TX_TLS_SFO_DATA_TYPE(data_type) | V_CPL_TX_TLS_SFO_CPL_LEN(2) | V_CPL_TX_TLS_SFO_SEG_LEN(seglen)); cpl->pld_len = htobe32(plen); if (data_type == CPL_TX_TLS_SFO_TYPE_CUSTOM) - cpl->type_protover = htobe32( - V_CPL_TX_TLS_SFO_TYPE(tls_hdr->type)); + cpl->type_protover = htobe32(V_CPL_TX_TLS_SFO_TYPE(rec_type)); cpl->seqno_numivs = htobe32(tls_ofld->scmd0.seqno_numivs | V_SCMD_NUM_IVS(1)); cpl->ivgen_hdrlen = htobe32(tls_ofld->scmd0.ivgen_hdrlen); @@ -498,6 +516,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) int tls_size, tx_credits, shove, sowwakeup; struct ofld_tx_sdesc *txsd; char *buf; + bool tls13; INP_WLOCK_ASSERT(inp); KASSERT(toep->flags & TPF_FLOWC_WR_SENT, @@ -533,6 +552,7 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) return; } + tls13 = toep->tls.tls13; txsd = &toep->txsd[toep->txsd_pidx]; for (;;) { tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); @@ -599,9 +619,11 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) sizeof(struct cpl_tx_tls_sfo) + sizeof(struct ulptx_idata) + sizeof(struct ulptx_sc_memrd); - /* Explicit IVs for AES-CBC and AES-GCM are <= 16. */ - MPASS(toep->tls.iv_len <= AES_BLOCK_LEN); - wr_len += AES_BLOCK_LEN; + if (!tls13) { + /* Explicit IVs for AES-CBC and AES-GCM are <= 16. */ + MPASS(toep->tls.iv_len <= AES_BLOCK_LEN); + wr_len += AES_BLOCK_LEN; + } /* Account for SGL in work request length. */ nsegs = count_ext_pgs_segs(m); @@ -671,8 +693,10 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) expn_size = m->m_epg_hdrlen + m->m_epg_trllen; tls_size = m->m_len - expn_size; - write_tlstx_wr(txwr, toep, tls_size, expn_size, credits, shove); - write_tlstx_cpl(cpl, toep, thdr, tls_size, m->m_epg_seqno); + write_tlstx_wr(txwr, toep, tls_size, expn_size, credits, shove, + tls13 ? 0 : 1); + write_tlstx_cpl(cpl, toep, thdr, tls_size, + tls13 ? m->m_epg_record_type : thdr->type, m->m_epg_seqno); idata = (struct ulptx_idata *)(cpl + 1); idata->cmd_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_NOOP)); @@ -683,10 +707,12 @@ t4_push_ktls(struct adapter *sc, struct toepcb *toep, int drop) V_ULPTX_LEN16(toep->tls.tx_key_info_size >> 4)); memrd->addr = htobe32(toep->tls.tx_key_addr >> 5); - /* Copy IV. */ buf = (char *)(memrd + 1); - memcpy(buf, thdr + 1, toep->tls.iv_len); - buf += AES_BLOCK_LEN; + if (!tls13) { + /* Copy IV. */ + memcpy(buf, thdr + 1, toep->tls.iv_len); + buf += AES_BLOCK_LEN; + } write_ktlstx_sgl(buf, m, nsegs); diff --git a/sys/dev/cxgbe/tom/t4_tls.h b/sys/dev/cxgbe/tom/t4_tls.h index 753a30890fdc..6faf946e9e3c 100644 --- a/sys/dev/cxgbe/tom/t4_tls.h +++ b/sys/dev/cxgbe/tom/t4_tls.h @@ -74,6 +74,7 @@ struct tls_ofld_info { unsigned short adjusted_plen; unsigned short expn_per_ulp; unsigned short pdus_per_ulp; + bool tls13; struct tls_scmd scmd0; u_int iv_len; unsigned int tx_key_info_size; From nobody Fri Oct 3 00:04:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86m5f6Hz6BN3h; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86m3Jztz3syw; Fri, 03 Oct 2025 00: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=1759449888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGAHeyHOh/p4vQgD7hzZstH7z0Mz1WqqaIkE5uaZuaI=; b=QM0RoV4Dj3kBaA6SUaLxrjVYdICKjTH/Md/iYTlCCGvk/e+le0xr3UVdcem73Bg9ctmodQ Ea+3LUwlsZUUwxEt46Dk/AyqXp/TbTUXSDjbQarkmnFNIufNRoC9A+KDhea+vVCKepMPho gVoFJMAyNLKVutwr3pra/HvOkBfxl8rHEZL8Dki9AMmf1l2buGPbYuPsL9TEan2f6WHUIV n6opzEg5INONHeQ/HrDDTUDvfDId+j+EUB7rU1i/3JW038YYHJe7gFXmwrLVpdQlnL+x69 w/dwJWBygFRwcCNMFLjgLmvI1AlGd4QpDpIiI9tRQ+npedQHcaMnGW8Ysk9v1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGAHeyHOh/p4vQgD7hzZstH7z0Mz1WqqaIkE5uaZuaI=; b=fO3EUo3LybtD/Lxp4C0u0YHVtwSV0Dx0gQR59MQ6bcOJ23JIJmnMxkvz/wN0Ytk6ZqJQ9N yPjfu+3PbAzH0o8ZUcI7BjYKK36R1N+OpCDSOwzpP3xgTjPGNb6qf0QtpFEUhKFENMu0dj xjAj3f1mhXFqssSh/TMwgPaIj6D1BcpzpZG9rVkOjJCxUhilQUfAl99Y80xkVShndR44ck /ssth5l2QwtzyfXr+96COjNnPVJAyJGUPiPAZdOipHcS+WOOV+af3uayyGza13GfMa+AsJ 4tIa63ovgQc1xDU4GLtZYp7xBr6Tc3PqvsF7u9exc81uFpE5KOYOet91s81MOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449888; a=rsa-sha256; cv=none; b=UBLj1gFQUSv7zquSaS3aFHY0+mmGf9IPeV4O4EhA8Ca0mYymkIdfbAEZwqHlgcyUJ427Dc pVYE87Vn1SMURCTm2R+QLuv5TT8zDv3Qye1ljOnyFLSSf6TpFGO1kC2dG8kgrORhyCg5Xv NReAdTq7JJxnxLViYLVXPEUNTO/SDD1FikdXiLBoCtVf9YLaGh5mrc+uhg2kYqYRPu2eKr vha5Mje6W1Q6rDhIokl58dXl/HnAqh1Bj5ROolShmiow/VgJ+cJ7gfcsIYH+ZuE2XJ0Ih1 58pxdU75OVbdpx2hviF6in9ltFeYK88B3DTS+NDxj06q0t/QDPVmKOPZcOXFiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86m2sp1zVjV; Fri, 03 Oct 2025 00: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 59304mm1057592; Fri, 3 Oct 2025 00: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 59304mMo057589; Fri, 3 Oct 2025 00:04:48 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:48 GMT Message-Id: <202510030004.59304mMo057589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: f83f48e62222 - stable/15 - cxgbe TOE TLS: Support for TLS 1.3 for receive List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f83f48e62222feec094174e3d27590e9b0eb6c53 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f83f48e62222feec094174e3d27590e9b0eb6c53 commit f83f48e62222feec094174e3d27590e9b0eb6c53 Author: John Baldwin AuthorDate: 2025-09-29 15:10:08 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:08 +0000 cxgbe TOE TLS: Support for TLS 1.3 for receive Sponsored by: Chelsio Communications (cherry picked from commit e2fae07e093bf4953ad7359b2aa9ca62b0d76adf) --- sys/dev/cxgbe/tom/t4_tls.c | 51 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_tls.c b/sys/dev/cxgbe/tom/t4_tls.c index 677fd143e248..bbcc1c88c3db 100644 --- a/sys/dev/cxgbe/tom/t4_tls.c +++ b/sys/dev/cxgbe/tom/t4_tls.c @@ -240,11 +240,6 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) if (is_t6(sc)) { return (EPROTONOSUPPORT); } - - /* Only TX for TLS 1.3 for now. */ - if (direction == KTLS_RX) { - return (EPROTONOSUPPORT); - } } /* Sanity check values in *tls. */ @@ -305,8 +300,8 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_session *tls, int direction) if (error) return (error); + toep->tls.tls13 = tls->params.tls_vminor == TLS_MINOR_VER_THREE; if (direction == KTLS_TX) { - toep->tls.tls13 = tls->params.tls_vminor == TLS_MINOR_VER_THREE; toep->tls.scmd0.seqno_numivs = (V_SCMD_SEQ_NO_CTRL(3) | V_SCMD_PROTO_VERSION(t4_tls_proto_ver(tls)) | @@ -834,8 +829,8 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) struct sockbuf *sb; struct mbuf *tls_data; struct tls_get_record *tgr; - struct mbuf *control; - int pdu_length, trailer_len; + struct mbuf *control, *n; + int pdu_length, resid, trailer_len; #if defined(KTR) || defined(INVARIANTS) int len; #endif @@ -883,7 +878,9 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) /* * The payload of this CPL is the TLS header followed by - * additional fields. + * additional fields. For TLS 1.3 the type field holds the + * inner record type and the length field has been updated to + * strip the inner record type, padding, and MAC. */ KASSERT(m->m_len >= sizeof(*tls_hdr_pkt), ("%s: payload too small", __func__)); @@ -895,7 +892,14 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) ("%s: sequence mismatch", __func__)); } - /* Report decryption errors as EBADMSG. */ + /* + * Report decryption errors as EBADMSG. + * + * XXX: To support rekeying for TLS 1.3 this will eventually + * have to be updated to recrypt the data with the old key and + * then decrypt with the new key. Punt for now as KTLS + * doesn't yet support rekeying. + */ if ((tls_hdr_pkt->res_to_mac_error & M_TLSRX_HDR_PKT_ERROR) != 0) { CTR4(KTR_CXGBE, "%s: tid %u TLS error %#x ddp_vld %#x", __func__, toep->tid, tls_hdr_pkt->res_to_mac_error, @@ -913,6 +917,33 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) return (0); } + /* For TLS 1.3 trim the header and trailer. */ + if (toep->tls.tls13) { + KASSERT(tls_data != NULL, ("%s: TLS 1.3 record without data", + __func__)); + MPASS(tls_data->m_pkthdr.len == pdu_length); + m_adj(tls_data, sizeof(struct tls_record_layer)); + if (tls_data->m_pkthdr.len > be16toh(tls_hdr_pkt->length)) + tls_data->m_pkthdr.len = be16toh(tls_hdr_pkt->length); + resid = tls_data->m_pkthdr.len; + if (resid == 0) { + m_freem(tls_data); + tls_data = NULL; + } else { + for (n = tls_data;; n = n->m_next) { + if (n->m_len < resid) { + resid -= n->m_len; + continue; + } + + n->m_len = resid; + m_freem(n->m_next); + n->m_next = NULL; + break; + } + } + } + /* Handle data received after the socket is closed. */ sb = &so->so_rcv; SOCKBUF_LOCK(sb); From nobody Fri Oct 3 00:04:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86p290Wz6BMyj; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86n4SzJz3t2F; Fri, 03 Oct 2025 00:04:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RKJspgOhnGskwo4qSnV14URjlD4/nnGQhf9JeWrObDs=; b=CZvwsdPVmsLwdRK1gIKL5lpvOzj0V3zxudQIedj23Oh86ZIzXv1i/LFfRFREwy72O+40AM b7PyE7yYvWNIHzFRAUPoWj4epmoNrMoVZJySOpI8B7LJKIGG7nYe0SHjtu1Qpz6Ty8crQg e0CVrdh+HbmtKwqLsajA+gXdXeAzWtpAUt+OpGkgo3tMjNOE+1pV5/Q9qiLeLnrN4tAI+c XciguJqkd3OlXKC8I0QCjhPEK8+a5CIV+V3gQxr7nEDJgNd0WmBmovU6F0z4t0Mc8fyNHx ydksiurHK0RGd3AwQm6Pe7C+Hhai7BfIVqAMzRZFzmXCoKj3SxPvHXcKZ9GG3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RKJspgOhnGskwo4qSnV14URjlD4/nnGQhf9JeWrObDs=; b=H5+mAVmdEb7Cwn+0rGp4fAWM3kespa1NM8jdA7N7HFtsIL+4F/XGGEu0P0GxTw0H/ehhxd 9KWSx6GXk8kpNFfbfe10SmvR2n3+/YROhCNkKypDGx1IZ+Jx1WbvLcVZ8o16T82+a2oCKa dmxGSlxxMgQxcAu9ICJUOacSqy4Eb9qORLrqk8HRc813RPYGNZyTPIO2MN7EHLRplASdQw A74Ox48ltQqYzl++RJq4BY0fovxwvP5FOA2wcr4p80LCMNkvx5JS7IuapWJoj90+Kfelg9 3SobSipTnB7e0OYM6QuFYSqa1EuLwPYhVfpvnN2pXdtwZ9KRvE9IyXGlMWRTBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449889; a=rsa-sha256; cv=none; b=AgfM/tmV+suLR2G8Q6Cq9gZNIEmp/sTY5qVxR47eauayVEbvZ5TJjWZXhKmq4iO1PBWytL mR3R7afrPu7rvGT5UK8bFQeo5llOGlot6535jEPuaX9Rt97V8E0fw6KTCEtii0agyD9fFK QLxTqBDAiq7WH2QA6KmtbEeWnheW2S+jzlXYQzseiLYH8qEaEoXNDGUdkMLaV8HdDrCGQN 3jkqABenx5wBtUKudue0JrhwnfvOQEnAwkWUPJ4Yn2PvihiMzkst9MUzoNfkAUsJ0BDou5 oGhqU5cxaW8nmrT0e2E+hEMvRBXBSWlfB4nMjMZ0a2U+9lefgKsdfIj0z1EkLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86n3pNszVcv; Fri, 03 Oct 2025 00:04: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 59304nLM057625; Fri, 3 Oct 2025 00:04:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304nR8057622; Fri, 3 Oct 2025 00:04:49 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:49 GMT Message-Id: <202510030004.59304nR8057622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 48656dc9c52d - stable/15 - cxgbe mp_ring: Add mp_ring_enqueue_only List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 48656dc9c52d8136df546893906d09e57b0958de Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=48656dc9c52d8136df546893906d09e57b0958de commit 48656dc9c52d8136df546893906d09e57b0958de Author: John Baldwin AuthorDate: 2025-09-29 15:10:42 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:08 +0000 cxgbe mp_ring: Add mp_ring_enqueue_only Unlike mp_ring_enqueue, this function is meant to be called from within a drain routine to enqueue more packets to the queue currently being drained. To avoid recursion, it only enqueues additional items without becoming a consumer. Sponsored by: Chelsio Communications (cherry picked from commit 96054b97b418d1ff2b781e9e23cc86a79d91909a) --- sys/dev/cxgbe/t4_mp_ring.c | 81 +++++++++++++++++++++++++++++++++++++++++++++- sys/dev/cxgbe/t4_mp_ring.h | 1 + 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/t4_mp_ring.c b/sys/dev/cxgbe/t4_mp_ring.c index 531fd356728e..916c363a0c2a 100644 --- a/sys/dev/cxgbe/t4_mp_ring.c +++ b/sys/dev/cxgbe/t4_mp_ring.c @@ -305,7 +305,6 @@ failed: } void - mp_ring_free(struct mp_ring *r) { int i; @@ -472,6 +471,86 @@ mp_ring_enqueue(struct mp_ring *r, void **items, int n, int budget) return (0); } +/* + * Enqueue n items but never drain the ring. Can be called + * to enqueue new items while draining the ring. + * + * Returns an errno. + */ +int +mp_ring_enqueue_only(struct mp_ring *r, void **items, int n) +{ + union ring_state os, ns; + uint16_t pidx_start, pidx_stop; + int i; + + MPASS(items != NULL); + MPASS(n > 0); + + /* + * Reserve room for the new items. Our reservation, if successful, is + * from 'pidx_start' to 'pidx_stop'. + */ + os.state = atomic_load_64(&r->state); + + /* Should only be used from the drain callback. */ + MPASS(os.flags == BUSY || os.flags == TOO_BUSY || + os.flags == TAKING_OVER); + + for (;;) { + if (__predict_false(space_available(r, os) < n)) { + /* Not enough room in the ring. */ + counter_u64_add(r->dropped, n); + return (ENOBUFS); + } + + /* There is room in the ring. */ + + ns.state = os.state; + ns.pidx_head = increment_idx(r, os.pidx_head, n); + critical_enter(); + if (atomic_fcmpset_64(&r->state, &os.state, ns.state)) + break; + critical_exit(); + cpu_spinwait(); + }; + + pidx_start = os.pidx_head; + pidx_stop = ns.pidx_head; + + /* + * Wait for other producers who got in ahead of us to enqueue their + * items, one producer at a time. It is our turn when the ring's + * pidx_tail reaches the beginning of our reservation (pidx_start). + */ + while (ns.pidx_tail != pidx_start) { + cpu_spinwait(); + ns.state = atomic_load_64(&r->state); + } + + /* Now it is our turn to fill up the area we reserved earlier. */ + i = pidx_start; + do { + r->items[i] = *items++; + if (__predict_false(++i == r->size)) + i = 0; + } while (i != pidx_stop); + + /* + * Update the ring's pidx_tail. The release style atomic guarantees + * that the items are visible to any thread that sees the updated pidx. + */ + os.state = atomic_load_64(&r->state); + do { + ns.state = os.state; + ns.pidx_tail = pidx_stop; + } while (atomic_fcmpset_rel_64(&r->state, &os.state, ns.state) == 0); + critical_exit(); + + counter_u64_add(r->not_consumer, 1); + return (0); +} + void mp_ring_check_drainage(struct mp_ring *r, int budget) { diff --git a/sys/dev/cxgbe/t4_mp_ring.h b/sys/dev/cxgbe/t4_mp_ring.h index 949174b9056d..07b15906cd43 100644 --- a/sys/dev/cxgbe/t4_mp_ring.h +++ b/sys/dev/cxgbe/t4_mp_ring.h @@ -62,6 +62,7 @@ int mp_ring_alloc(struct mp_ring **, int, void *, ring_drain_t, ring_can_drain_t, struct malloc_type *, struct mtx *, int); void mp_ring_free(struct mp_ring *); int mp_ring_enqueue(struct mp_ring *, void **, int, int); +int mp_ring_enqueue_only(struct mp_ring *, void **, int); void mp_ring_check_drainage(struct mp_ring *, int); void mp_ring_reset_stats(struct mp_ring *); bool mp_ring_is_idle(struct mp_ring *); From nobody Fri Oct 3 00:04:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86q0g41z6BMk6; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86p5WdWz3t0N; Fri, 03 Oct 2025 00:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fWkqNx99PGfxZM4RGZ/jxuVR7BtDut9XcXHE2lT0n+E=; b=Ycd/EO2/7kodUNoJnglUOXTEi6g8IHXxmMhbADtyWxJqZpzX5lmJLwRK6m2x1ffaOuCAUU SARh9Fs8GQGoJdtiOERrD9EgtRa+zIP/er+kUtmYEQnWy1UlZVUGF7ddcC6hze0IHY+nh4 7lxjLkfhVgTiyyaCYWQWZjH5dVCK2nqRxZDgpqsVZet3wfhamzwkgnK5B0yho24cWI+adG FoCrPzSLqX7TLNm2KNTLg2vyXAOLhvwySuABxVj2jB+d/dEHcrDMHO1xlxvpH2aEcIx32V wJL4iShp0da2sszZme9KmWxNMGTdCzB/KwcqUOk8p4hKRfe10zkSI+lqSfjW7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fWkqNx99PGfxZM4RGZ/jxuVR7BtDut9XcXHE2lT0n+E=; b=ClTPHJg6rxkAK5GCNgc7yyBWj1MxaBqwdOl7f6gYx1MFEj7e9pTDL9cs8iiFhmgGwIuc9B Qk6CO7ZvwDqwGaW6RD4KXPh2afqSZtz6EDuOOvRH5aeg2azAKnap0nkFQ260qIs952NQqe byUdTWbaC1NkOZMoRjPsd+PzPjG8dErX40cRRqYbr8cpAN6trAIuHydqRQrWzdzL0DAl8k I1xgWEoHLF6KajzvUi5aR0URta0KLWJ8IlWg7xUUHgr8konZCY3hRVCaE5N2r1j8BQbAR/ q6ptQTuC2yLAWBvckEVmgI6lMruWNnZSKoHThBYPjW1BkxB4z0W3ndGNaVdM1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449890; a=rsa-sha256; cv=none; b=qXcRzK6O0Q7mjFi6d+xbMgIeC+D9bsBA9yJvoBKOcM7PCi6uNL0yIMXUBvu8iZuYpVdUBU HJDjNY/yNjcLeCW8SKovbipcD/UUuxwLEQKCTXKfmp520puJWP00LZvTGOafb1iq0Rp2Hq Xqe5THus+76y5ebmUcrpHHHDMx5NKSr6ZQojsJQEU4AEgtWX8wiQZpMxT6Mr4yQJ+OzdYN 0tyTMAgcA194Jbcq3SJNrOmnQYElM3l03cVLedhQAnsTn+vW98hmzx2RT56vDv0vW+GjvD V2XISsnp9cJ2+qx2Q5nQvSb9UltWRWB/kdqlBj2IW/xDy2sXgk94rEBny3laqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86p4rW2zTlK; Fri, 03 Oct 2025 00:04: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 59304oNb057660; Fri, 3 Oct 2025 00:04:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304ojx057657; Fri, 3 Oct 2025 00:04:50 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:50 GMT Message-Id: <202510030004.59304ojx057657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 1e062655dc66 - stable/15 - cxgbe: Permit multiple handlers for CPL6_FW_PLD List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1e062655dc66bb0d914dc837cdcd08307f9ca2b4 Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=1e062655dc66bb0d914dc837cdcd08307f9ca2b4 commit 1e062655dc66bb0d914dc837cdcd08307f9ca2b4 Author: John Baldwin AuthorDate: 2025-09-29 15:12:09 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:09 +0000 cxgbe: Permit multiple handlers for CPL6_FW_PLD Currently this CPL is only used to handle replies from lookaside crypto requests submitted by ccr(4). However, in the future this request will be returned for other requests. Use the low bit in the cookie field as a way to identify replies to ccr(4) vs other use cases. This should be safe as 'struct cryptop' pointers should be word-aligned. Sponsored by: Chelsio Communications (cherry picked from commit 96469647bce10132408db9b436dae8941356453b) --- sys/dev/cxgbe/adapter.h | 17 +++++++++++++++++ sys/dev/cxgbe/crypto/t4_crypto.c | 27 +++++++++++++++++++++++---- sys/dev/cxgbe/t4_sge.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 6 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 9064d148cba9..64fa4526d9f4 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -412,6 +412,23 @@ enum { NUM_CPL_COOKIES = 8 /* Limited by M_COOKIE. Do not increase. */ }; +/* + * Crypto replies use the low bit in the 64-bit cookie of CPL_FW6_PLD as a + * CPL cookie to identify the sender/receiver. + */ +enum { + CPL_FW6_COOKIE_CCR = 0, + + NUM_CPL_FW6_COOKIES = 2 /* Low bits of cookie value. */ +}; + +_Static_assert(powerof2(NUM_CPL_FW6_COOKIES), + "NUM_CPL_FW6_COOKIES must be a power of 2"); + +#define CPL_FW6_COOKIE_MASK (NUM_CPL_FW6_COOKIES - 1) + +#define CPL_FW6_PLD_COOKIE(cpl) (be64toh((cpl)->data[1]) & ~CPL_FW6_COOKIE_MASK) + struct sge_iq; struct rss_header; typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 24dfdc1f23db..80e31b1159fd 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -208,6 +208,7 @@ struct ccr_softc { counter_u64_t stats_pad_error; counter_u64_t stats_sglist_error; counter_u64_t stats_process_error; + counter_u64_t stats_pointer_error; counter_u64_t stats_sw_fallback; struct sysctl_ctx_list ctx; @@ -1884,6 +1885,9 @@ ccr_sysctls(struct ccr_softc *sc) SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "process_error", CTLFLAG_RD, &sc->stats_process_error, "Requests failed during queueing"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "pointer_error", + CTLFLAG_RD, &sc->stats_pointer_error, + "Requests with a misaligned request pointer"); SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "sw_fallback", CTLFLAG_RD, &sc->stats_sw_fallback, "Requests processed by falling back to software"); @@ -1991,6 +1995,7 @@ ccr_attach(device_t dev) sc->stats_pad_error = counter_u64_alloc(M_WAITOK); sc->stats_sglist_error = counter_u64_alloc(M_WAITOK); sc->stats_process_error = counter_u64_alloc(M_WAITOK); + sc->stats_pointer_error = counter_u64_alloc(M_WAITOK); sc->stats_sw_fallback = counter_u64_alloc(M_WAITOK); ccr_sysctls(sc); @@ -2037,6 +2042,7 @@ ccr_detach(device_t dev) counter_u64_free(sc->stats_pad_error); counter_u64_free(sc->stats_sglist_error); counter_u64_free(sc->stats_process_error); + counter_u64_free(sc->stats_pointer_error); counter_u64_free(sc->stats_sw_fallback); for_each_port(sc->adapter, i) { ccr_free_port(sc, i); @@ -2534,6 +2540,16 @@ ccr_process(device_t dev, struct cryptop *crp, int hint) s = crypto_get_driver_session(crp->crp_session); sc = device_get_softc(dev); + /* + * Request pointers with the low bit set in the pointer can't + * be stored as the cookie in the CPL_FW6_PLD reply. + */ + if (((uintptr_t)crp & CPL_FW6_COOKIE_MASK) != 0) { + counter_u64_add(sc->stats_pointer_error, 1); + error = EINVAL; + goto out_unlocked; + } + mtx_lock(&s->lock); error = ccr_populate_sglist(s->sg_input, &crp->crp_buf); if (error == 0 && CRYPTO_HAS_OUTPUT_BUFFER(crp)) @@ -2640,6 +2656,7 @@ ccr_process(device_t dev, struct cryptop *crp, int hint) out: mtx_unlock(&s->lock); +out_unlocked: if (error) { crp->crp_etype = error; crypto_done(crp); @@ -2649,7 +2666,7 @@ out: } static int -do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_header *rss, +fw6_pld_ccr(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { struct ccr_softc *sc; @@ -2664,7 +2681,7 @@ do_cpl6_fw_pld(struct sge_iq *iq, const struct rss_header *rss, else cpl = (const void *)(rss + 1); - crp = (struct cryptop *)(uintptr_t)be64toh(cpl->data[1]); + crp = (struct cryptop *)(uintptr_t)CPL_FW6_PLD_COOKIE(cpl); s = crypto_get_driver_session(crp->crp_session); status = be64toh(cpl->data[0]); if (CHK_MAC_ERR_BIT(status) || CHK_PAD_ERR_BIT(status)) @@ -2718,10 +2735,12 @@ ccr_modevent(module_t mod, int cmd, void *arg) switch (cmd) { case MOD_LOAD: - t4_register_cpl_handler(CPL_FW6_PLD, do_cpl6_fw_pld); + t4_register_shared_cpl_handler(CPL_FW6_PLD, fw6_pld_ccr, + CPL_FW6_COOKIE_CCR); return (0); case MOD_UNLOAD: - t4_register_cpl_handler(CPL_FW6_PLD, NULL); + t4_register_shared_cpl_handler(CPL_FW6_PLD, NULL, + CPL_FW6_COOKIE_CCR); return (0); default: return (EOPNOTSUPP); diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 155a47552b40..6a32aeae4a82 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -350,6 +350,7 @@ cpl_handler_t l2t_write_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t act_open_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t abort_rpl_rss_handlers[NUM_CPL_COOKIES]; cpl_handler_t fw4_ack_handlers[NUM_CPL_COOKIES]; +cpl_handler_t fw6_pld_handlers[NUM_CPL_FW6_COOKIES]; void t4_register_an_handler(an_handler_t h) @@ -479,6 +480,21 @@ fw4_ack_handler(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) return (fw4_ack_handlers[cookie](iq, rss, m)); } +static int +fw6_pld_handler(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + const struct cpl_fw6_pld *cpl; + uint64_t cookie; + + if (m != NULL) + cpl = mtod(m, const void *); + else + cpl = (const void *)(rss + 1); + cookie = be64toh(cpl->data[1]) & CPL_FW6_COOKIE_MASK; + + return (fw6_pld_handlers[cookie](iq, rss, m)); +} + static void t4_init_shared_cpl_handlers(void) { @@ -488,6 +504,7 @@ t4_init_shared_cpl_handlers(void) t4_register_cpl_handler(CPL_ACT_OPEN_RPL, act_open_rpl_handler); t4_register_cpl_handler(CPL_ABORT_RPL_RSS, abort_rpl_rss_handler); t4_register_cpl_handler(CPL_FW4_ACK, fw4_ack_handler); + t4_register_cpl_handler(CPL_FW6_PLD, fw6_pld_handler); } void @@ -496,8 +513,12 @@ t4_register_shared_cpl_handler(int opcode, cpl_handler_t h, int cookie) uintptr_t *loc; MPASS(opcode < nitems(t4_cpl_handler)); - MPASS(cookie > CPL_COOKIE_RESERVED); - MPASS(cookie < NUM_CPL_COOKIES); + if (opcode == CPL_FW6_PLD) { + MPASS(cookie < NUM_CPL_FW6_COOKIES); + } else { + MPASS(cookie > CPL_COOKIE_RESERVED); + MPASS(cookie < NUM_CPL_COOKIES); + } MPASS(t4_cpl_handler[opcode] != NULL); switch (opcode) { @@ -516,6 +537,9 @@ t4_register_shared_cpl_handler(int opcode, cpl_handler_t h, int cookie) case CPL_FW4_ACK: loc = (uintptr_t *)&fw4_ack_handlers[cookie]; break; + case CPL_FW6_PLD: + loc = (uintptr_t *)&fw6_pld_handlers[cookie]; + break; default: MPASS(0); return; From nobody Fri Oct 3 00:04:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cd86q6ZjZz6BN3r; Fri, 03 Oct 2025 00:04: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cd86q5nYTz3tBs; Fri, 03 Oct 2025 00:04:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NtHKD4dIKaM6SZpk1LwbfOlU8lFLlEtrTnEzYdF3TVw=; b=OOgt/ionr3U0Et8Rsw6rbLYbG4fvSfCPVCWG0oDnvkJ6uA3b2z5Zxq+1J7Z0sTdayid5z1 Et1hJE3vj+0FPJx5xAUKpf8IIDmDzQINNyHZiEOUblKIOzRgCm1J1F0S68EoPQS6Yt3Pz5 aTwISxrR9m78FKppF0jZ+Sjp9glmFJmCBsJk9xyZyN5DhbbJ+dvyafndlHYZvHT4eIJTbY /fwtkx1XKESYqo3K5TkSczbLB/oaos0VRE8qxlslQJBzIYJ7Id8cS+w02pyF7VnAanPwOc jUSrOXX4nZt9bht+/EF4JSHZwKYSu8mafA42tbmOPmhXPAPXj23enSHB3fiHKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759449891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NtHKD4dIKaM6SZpk1LwbfOlU8lFLlEtrTnEzYdF3TVw=; b=kOrFJYJRedFFVE+GaigyRPBoOs75cipLZHujyYNNQX0FLgT/2spsrVhWEN8MvOsF1JTBs0 KBFfu6dQm/+ewe5vJFbyh8AqQ/rOfCdwkxhHcE3feqqjKyTRHGgznng04II6Oyq+kFCyxA Yz0eqczjuusXLJnq2byGtS1F1gSCwokYFS0bLz2wCXbzAcTAn1Ma6TVA5/HKQNYYCwXOv3 1ulhXqzWbd4nbeNfcv0Bc7BTNr9i/PiewaTiH051EZOAiYM38Erj8grv95tbUJPQNxDOOH DhtPnLGBKmGJuihWBzvAV01gzZ86h3H1z7bESXAZNbDyCh7nGslwKpYxf8nfFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759449891; a=rsa-sha256; cv=none; b=YKUbAEOI52CmecYOnr8ndgUxEzprEkzh0jaVkL9bOQj9XY2YW5xbq7e0XDOEhS7LQ/PXoY uYGARTLVws8slf1DJEQTrdmmNrun7qBGrHoEg4hVC5ZVXZfEApbSCrY7notSVNFRmeCO6x xO8a6SgejopwNiyL3uA4UbHlJeqBlE/h0jx+ogwhPyPYMxm03y9OOZJDD1JNk6IyuOpeGH wmzkcU21htlwOL3MzQRXrWFpbkEirmaVmlvB144+AZy/B/S5EKEL2HAMYfeFL899ugHRNC BBzpaxw+ualHF6p9XdNq4N6tbHKXwoZWITBT3PdLznh+qvm9zWz3U7e2mLRpMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cd86q5MVyzVcw; Fri, 03 Oct 2025 00:04: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 59304p1x057695; Fri, 3 Oct 2025 00:04:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59304plt057692; Fri, 3 Oct 2025 00:04:51 GMT (envelope-from git) Date: Fri, 3 Oct 2025 00:04:51 GMT Message-Id: <202510030004.59304plt057692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 6f0160bf8cc2 - stable/15 - cxgbe: Use partial GCM mode for partial TLS records on T7 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 6f0160bf8cc2a935a3ed17e171b27722cff4e66f Auto-Submitted: auto-generated The branch stable/15 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=6f0160bf8cc2a935a3ed17e171b27722cff4e66f commit 6f0160bf8cc2a935a3ed17e171b27722cff4e66f Author: John Baldwin AuthorDate: 2025-09-29 15:14:26 +0000 Commit: Navdeep Parhar CommitDate: 2025-10-02 22:09:09 +0000 cxgbe: Use partial GCM mode for partial TLS records on T7 T7's crypto co-processor adds a new partial GCM mode. This permits an AES-GCM operation to be split into multiple requests. After each request, the partial GHASH state is returned to the host and must be included in the subsequent request to continue the GHASH computation. Make use of this when sending a TLS record that spans multiple TCP "request" (where a request can use TSO to span multiple segments). This permits computing the final GHASH value across multiple requests without having to re-send the entire TLS record for the final request. To ensure that intermediate GHASH results are available when needed, mbuf chains are queued in the TLS pcb and only dispatched one at a time to the NIC TXQ. Packets which do not request a GHASH result queue the next mbuf from the connection as soon as they are written into the TXQ. Packets which do request a GHASH result queue the next mbuf after the the GHASH result is returned by a message on a NIC RXQ. Note that partial GCM mode is only used for the in-order data at the "tip" of a connection and not for retransmits of earlier data. Retransmits will not request a GHASH result so will enqueue the next mbuf from the connection to the NIC TXQ after being written. Partial GCM mode is also not TLS-aware and only supports "plain" AES-GCM. Thus, TLS AAD must be explicitly constructed and sent as part of the work request in the TXQ at the start of each TLS record. However, by avoiding the need to retransmit the entire TLS record's contents for the last mbuf spanning a TLS record, the overall amount of "wasted" DMA is reduced by a factor of about 30. Sponsored by: Chelsio Communications (cherry picked from commit 9e269eafebfca6c876be76a78e4bda621a921e45) --- sys/dev/cxgbe/adapter.h | 7 + sys/dev/cxgbe/crypto/t7_kern_tls.c | 886 +++++++++++++++++++++++++++++++++---- sys/dev/cxgbe/offload.h | 13 +- sys/dev/cxgbe/t4_main.c | 29 +- sys/dev/cxgbe/t4_sge.c | 16 + 5 files changed, 854 insertions(+), 97 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 64fa4526d9f4..55f09fefb7e3 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -418,6 +418,7 @@ enum { */ enum { CPL_FW6_COOKIE_CCR = 0, + CPL_FW6_COOKIE_KTLS, NUM_CPL_FW6_COOKIES = 2 /* Low bits of cookie value. */ }; @@ -669,8 +670,12 @@ struct sge_txq { }; struct { /* T7 only. */ + uint64_t kern_tls_ghash_received; + uint64_t kern_tls_ghash_requested; uint64_t kern_tls_lso; + uint64_t kern_tls_partial_ghash; uint64_t kern_tls_splitmode; + uint64_t kern_tls_trailer; }; }; @@ -1456,6 +1461,8 @@ int t6_ktls_write_wr(struct sge_txq *, void *, struct mbuf *, u_int); /* t7_kern_tls.c */ int t7_tls_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, struct m_snd_tag **); +void t7_ktls_modload(void); +void t7_ktls_modunload(void); int t7_ktls_parse_pkt(struct mbuf *); int t7_ktls_write_wr(struct sge_txq *, void *, struct mbuf *, u_int); #endif diff --git a/sys/dev/cxgbe/crypto/t7_kern_tls.c b/sys/dev/cxgbe/crypto/t7_kern_tls.c index 5063648b2ba9..217459126361 100644 --- a/sys/dev/cxgbe/crypto/t7_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t7_kern_tls.c @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "common/common.h" #include "common/t4_regs.h" @@ -78,13 +80,29 @@ struct tlspcb { unsigned char enc_mode; struct tls_scmd scmd0; + struct tls_scmd scmd0_partial; struct tls_scmd scmd0_short; unsigned int tx_key_info_size; uint16_t prev_mss; - /* Only used outside of setup and teardown when using inline keys. */ + /* Fields used for GCM records using GHASH state. */ + uint16_t ghash_offset; + uint64_t ghash_tls_seqno; + char ghash[AES_GMAC_HASH_LEN]; + bool ghash_valid; + bool ghash_pending; + bool ghash_lcb; + bool queue_mbufs; + uint8_t rx_chid; + uint16_t rx_qid; + struct mbufq pending_mbufs; + + /* + * Only used outside of setup and teardown when using inline + * keys or for partial GCM mode. + */ struct tls_keyctx keyctx; }; @@ -92,6 +110,9 @@ static void t7_tls_tag_free(struct m_snd_tag *mst); static int ktls_setup_keys(struct tlspcb *tlsp, const struct ktls_session *tls, struct sge_txq *txq); +static void *zero_buffer; +static vm_paddr_t zero_buffer_pa; + static const struct if_snd_tag_sw t7_tls_tag_sw = { .snd_tag_free = t7_tls_tag_free, .type = IF_SND_TAG_TYPE_TLS @@ -118,6 +139,10 @@ alloc_tlspcb(struct ifnet *ifp, struct vi_info *vi, int flags) tlsp->vi = vi; tlsp->sc = sc; tlsp->tx_key_addr = -1; + tlsp->ghash_offset = -1; + tlsp->rx_chid = pi->rx_chan; + tlsp->rx_qid = sc->sge.rxq[pi->vi->first_rxq].iq.abs_id; + mbufq_init(&tlsp->pending_mbufs, INT_MAX); return (tlsp); } @@ -191,6 +216,16 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, sc = vi->adapter; tlsp = alloc_tlspcb(ifp, vi, M_WAITOK); + + /* + * Pointers with the low bit set in the pointer can't + * be stored as the cookie in the CPL_FW6_PLD reply. + */ + if (((uintptr_t)tlsp & CPL_FW6_COOKIE_MASK) != 0) { + error = EINVAL; + goto failed; + } + tlsp->tls13 = tls->params.tls_vminor == TLS_MINOR_VER_THREE; if (sc->tlst.inline_keys) @@ -250,7 +285,7 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, tlsp->scmd0.ivgen_hdrlen |= V_SCMD_KEY_CTX_INLINE(1); /* - * The SCMD fields used when encrypting a partial TLS record + * The SCMD fields used when encrypting a short TLS record * (no trailer and possibly a truncated payload). */ tlsp->scmd0_short.seqno_numivs = V_SCMD_SEQ_NO_CTRL(0) | @@ -274,6 +309,25 @@ t7_tls_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, if (tlsp->inline_key) tlsp->scmd0_short.ivgen_hdrlen |= V_SCMD_KEY_CTX_INLINE(1); + /* + * The SCMD fields used when encrypting a short TLS record + * using a partial GHASH. + */ + tlsp->scmd0_partial.seqno_numivs = V_SCMD_SEQ_NO_CTRL(0) | + V_SCMD_PROTO_VERSION(SCMD_PROTO_VERSION_GENERIC) | + V_SCMD_ENC_DEC_CTRL(SCMD_ENCDECCTRL_ENCRYPT) | + V_SCMD_CIPH_AUTH_SEQ_CTRL((mac_first == 0)) | + V_SCMD_CIPH_MODE(tlsp->enc_mode) | + V_SCMD_AUTH_MODE(t4_tls_auth_mode(tls)) | + V_SCMD_HMAC_CTRL(t4_tls_hmac_ctrl(tls)) | + V_SCMD_IV_SIZE(AES_BLOCK_LEN / 2) | V_SCMD_NUM_IVS(1); + tlsp->scmd0_partial.seqno_numivs = + htobe32(tlsp->scmd0_partial.seqno_numivs); + + tlsp->scmd0_partial.ivgen_hdrlen = V_SCMD_IV_GEN_CTRL(0) | + V_SCMD_TLS_FRAG_ENABLE(0) | V_SCMD_AADIVDROP(1) | + V_SCMD_KEY_CTX_INLINE(1); + TXQ_LOCK(txq); if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) txq->kern_tls_gcm++; @@ -340,7 +394,7 @@ ktls_setup_keys(struct tlspcb *tlsp, const struct ktls_session *tls, } static u_int -ktls_base_wr_size(struct tlspcb *tlsp) +ktls_base_wr_size(struct tlspcb *tlsp, bool inline_key) { u_int wr_len; @@ -348,7 +402,7 @@ ktls_base_wr_size(struct tlspcb *tlsp) wr_len += sizeof(struct ulp_txpkt); // 8 wr_len += sizeof(struct ulptx_idata); // 8 wr_len += sizeof(struct cpl_tx_sec_pdu);// 32 - if (tlsp->inline_key) + if (inline_key) wr_len += tlsp->tx_key_info_size; else { wr_len += sizeof(struct ulptx_sc_memrd);// 8 @@ -396,18 +450,15 @@ ktls_sgl_size(u_int nsegs) * *trailing_waste - amount of crypto output to drop from the end */ static bool -ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, - u_int tlen, u_int *header_len, u_int *offset, u_int *plen, - u_int *leading_waste, u_int *trailing_waste) +ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, u_int tlen, + u_int rlen, u_int *header_len, u_int *offset, u_int *plen, + u_int *leading_waste, u_int *trailing_waste, bool send_partial_ghash, + bool request_ghash) { - const struct tls_record_layer *hdr; - u_int new_tlen, trailer_len, rlen; + u_int new_tlen, trailer_len; MPASS(tlen > m_tls->m_epg_hdrlen); - hdr = (void *)m_tls->m_epg_hdr; - rlen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length); - /* * For TLS 1.3 treat the inner record type stored as the first * byte of the trailer as part of the payload rather than part @@ -446,30 +497,63 @@ ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, *trailing_waste = new_tlen - tlen; *plen = new_tlen - m_tls->m_epg_hdrlen; } else { - /* - * For AES-GCM we have to send the full record if - * the end overlaps with the trailer. Otherwise, we - * can use AES-CTR to encrypt a partial PDU. - */ - if (rlen - tlen < trailer_len) - return (false); + if (rlen - tlen < trailer_len || + (rlen - tlen == trailer_len && request_ghash)) { + /* + * For AES-GCM we have to send the full record + * if the end overlaps with the trailer and a + * partial GHASH isn't being sent. + */ + if (!send_partial_ghash) + return (false); + + /* + * Will need to treat any excess trailer bytes as + * trailing waste. *trailing_waste is already + * correct. + */ + } else { + /* + * We can use AES-CTR or AES-GCM in partial GHASH + * mode to encrypt a partial PDU. + * + * The last block can be partially encrypted + * without any trailing waste. + */ + *trailing_waste = 0; + *plen = tlen - m_tls->m_epg_hdrlen; + } /* - * The last record can be partially encrypted via - * AES-CTR without any trailing waste. + * If this request starts at the first byte of the + * payload (so the previous request sent the full TLS + * header as a tunnel packet) and a partial GHASH is + * being requested, the full TLS header must be sent + * as input for the GHASH. */ - *trailing_waste = 0; - *plen = tlen - m_tls->m_epg_hdrlen; + if (mtod(m_tls, vm_offset_t) == m_tls->m_epg_hdrlen && + request_ghash) + return (true); /* - * In addition, with AES-CTR, we can minimize leading - * waste by starting encryption at the start of the - * closest AES block. + * In addition, we can minimize leading waste by + * starting encryption at the start of the closest AES + * block. */ if (mtod(m_tls, vm_offset_t) >= m_tls->m_epg_hdrlen) { *header_len = 0; - *offset = rounddown2(mtod(m_tls, vm_offset_t) - - m_tls->m_epg_hdrlen, AES_BLOCK_LEN); + *offset = mtod(m_tls, vm_offset_t) - + m_tls->m_epg_hdrlen; + if (*offset >= *plen) + *offset = *plen; + else + *offset = rounddown2(*offset, AES_BLOCK_LEN); + + /* + * If the request is just bytes from the trailer, + * trim the offset to the end of the payload. + */ + *offset = min(*offset, *plen); *plen -= *offset; *leading_waste -= (m_tls->m_epg_hdrlen + *offset); } @@ -477,12 +561,22 @@ ktls_is_short_record(struct tlspcb *tlsp, struct mbuf *m_tls, return (true); } +/* Size of the AES-GCM TLS AAD for a given connection. */ +static int +ktls_gcm_aad_len(struct tlspcb *tlsp) +{ + return (tlsp->tls13 ? sizeof(struct tls_aead_data_13) : + sizeof(struct tls_aead_data)); +} + static int ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struct mbuf *m_tls, int *nsegsp) { - u_int header_len, imm_len, offset, plen, tlen, wr_len; + const struct tls_record_layer *hdr; + u_int header_len, imm_len, offset, plen, rlen, tlen, wr_len; u_int leading_waste, trailing_waste; + bool inline_key, last_ghash_frag, request_ghash, send_partial_ghash; bool short_record; M_ASSERTEXTPG(m_tls); @@ -512,11 +606,61 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struct mbuf *m_tls, return (wr_len); } - short_record = ktls_is_short_record(tlsp, m_tls, tlen, &header_len, - &offset, &plen, &leading_waste, &trailing_waste); + hdr = (void *)m_tls->m_epg_hdr; + rlen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length); + + /* + * See if this request might make use of GHASH state. This + * errs on the side of over-budgeting the WR size. + */ + last_ghash_frag = false; + request_ghash = false; + send_partial_ghash = false; + if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM && + tlsp->sc->tlst.partial_ghash && tlsp->sc->tlst.short_records) { + u_int trailer_len; + + trailer_len = m_tls->m_epg_trllen; + if (tlsp->tls13) + trailer_len--; + KASSERT(trailer_len == AES_GMAC_HASH_LEN, + ("invalid trailer length for AES-GCM")); + + /* Is this the start of a TLS record? */ + if (mtod(m_tls, vm_offset_t) <= m_tls->m_epg_hdrlen) { + /* + * Might use partial GHASH if this doesn't + * send the full record. + */ + if (tlen < rlen) { + if (tlen < (rlen - trailer_len)) + send_partial_ghash = true; + request_ghash = true; + } + } else { + send_partial_ghash = true; + if (tlen < rlen) + request_ghash = true; + if (tlen >= (rlen - trailer_len)) + last_ghash_frag = true; + } + } + + /* + * Assume not sending partial GHASH for this call to get the + * larger size. + */ + short_record = ktls_is_short_record(tlsp, m_tls, tlen, rlen, + &header_len, &offset, &plen, &leading_waste, &trailing_waste, + false, request_ghash); + + inline_key = send_partial_ghash || tlsp->inline_key; /* Calculate the size of the work request. */ - wr_len = ktls_base_wr_size(tlsp); + wr_len = ktls_base_wr_size(tlsp, inline_key); + + if (send_partial_ghash) + wr_len += AES_GMAC_HASH_LEN; if (leading_waste != 0 || trailing_waste != 0) { /* @@ -534,23 +678,92 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struct mbuf *m_tls, * immediate data. Short records include a raw AES IV as * immediate data. TLS 1.3 non-short records include a * placeholder for the sequence number as immediate data. + * Short records using a partial hash may also need to send + * TLS AAD. If a partial hash might be sent, assume a short + * record to get the larger size. */ imm_len = m->m_len + header_len; - if (short_record) + if (short_record || send_partial_ghash) { imm_len += AES_BLOCK_LEN; - else if (tlsp->tls13) + if (send_partial_ghash && header_len != 0) + imm_len += ktls_gcm_aad_len(tlsp); + } else if (tlsp->tls13) imm_len += sizeof(uint64_t); wr_len += roundup2(imm_len, 16); - /* TLS record payload via DSGL. */ + /* + * TLS record payload via DSGL. For partial GCM mode we + * might need an extra SG entry for a placeholder. + */ *nsegsp = sglist_count_mbuf_epg(m_tls, m_tls->m_epg_hdrlen + offset, plen); - wr_len += ktls_sgl_size(*nsegsp); + wr_len += ktls_sgl_size(*nsegsp + (last_ghash_frag ? 1 : 0)); + + if (request_ghash) { + /* AES-GCM records might return a partial hash. */ + wr_len += sizeof(struct ulp_txpkt); + wr_len += sizeof(struct ulptx_idata); + wr_len += sizeof(struct cpl_tx_tls_ack); + wr_len += sizeof(struct rss_header) + + sizeof(struct cpl_fw6_pld); + wr_len += AES_GMAC_HASH_LEN; + } wr_len = roundup2(wr_len, 16); return (wr_len); } +/* Queue the next pending packet. */ +static void +ktls_queue_next_packet(struct tlspcb *tlsp, bool enqueue_only) +{ +#ifdef KTR + struct ether_header *eh; + struct tcphdr *tcp; + tcp_seq tcp_seqno; +#endif + struct mbuf *m; + void *items[1]; + int rc; + + TXQ_LOCK_ASSERT_OWNED(tlsp->txq); + KASSERT(tlsp->queue_mbufs, ("%s: mbufs not being queued for %p", + __func__, tlsp)); + for (;;) { + m = mbufq_dequeue(&tlsp->pending_mbufs); + if (m == NULL) { + tlsp->queue_mbufs = false; + return; + } + +#ifdef KTR + eh = mtod(m, struct ether_header *); + tcp = (struct tcphdr *)((char *)eh + m->m_pkthdr.l2hlen + + m->m_pkthdr.l3hlen); + tcp_seqno = ntohl(tcp->th_seq); +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, "%s: pkt len %d TCP seq %u", __func__, + m->m_pkthdr.len, tcp_seqno); +#endif +#endif + + items[0] = m; + if (enqueue_only) + rc = mp_ring_enqueue_only(tlsp->txq->r, items, 1); + else { + TXQ_UNLOCK(tlsp->txq); + rc = mp_ring_enqueue(tlsp->txq->r, items, 1, 256); + TXQ_LOCK(tlsp->txq); + } + if (__predict_true(rc == 0)) + return; + + CTR(KTR_CXGBE, "%s: pkt len %d TCP seq %u dropped", __func__, + m->m_pkthdr.len, tcp_seqno); + m_freem(m); + } +} + int t7_ktls_parse_pkt(struct mbuf *m) { @@ -561,7 +774,7 @@ t7_ktls_parse_pkt(struct mbuf *m) struct tcphdr *tcp; struct mbuf *m_tls; void *items[1]; - int nsegs; + int error, nsegs; u_int wr_len, tot_len; uint16_t eh_type; @@ -664,14 +877,42 @@ t7_ktls_parse_pkt(struct mbuf *m) } MPASS(tot_len != 0); - set_mbuf_len16(m, tot_len / 16); + + if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) { + /* Defer packets beyond what has been sent so far. */ + TXQ_LOCK(tlsp->txq); + if (tlsp->queue_mbufs) { + error = mbufq_enqueue(&tlsp->pending_mbufs, m); + if (error == 0) { +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, + "%s: %p len16 %d nsegs %d TCP seq %u deferred", + __func__, tlsp, mbuf_len16(m), + mbuf_nsegs(m), ntohl(tcp->th_seq)); +#endif + } + TXQ_UNLOCK(tlsp->txq); + return (error); + } + tlsp->queue_mbufs = true; + TXQ_UNLOCK(tlsp->txq); + } + #ifdef VERBOSE_TRACES CTR(KTR_CXGBE, "%s: %p len16 %d nsegs %d", __func__, tlsp, mbuf_len16(m), mbuf_nsegs(m)); #endif items[0] = m; - return (mp_ring_enqueue(tlsp->txq->r, items, 1, 256)); + error = mp_ring_enqueue(tlsp->txq->r, items, 1, 256); + if (__predict_false(error != 0)) { + if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM) { + TXQ_LOCK(tlsp->txq); + ktls_queue_next_packet(tlsp, false); + TXQ_UNLOCK(tlsp->txq); + } + } + return (error); } static inline bool @@ -741,6 +982,47 @@ write_lso_cpl(void *cpl, struct mbuf *m0, uint16_t mss, uint16_t eh_type, return (lso + 1); } +static inline void * +write_tx_tls_ack(void *dst, u_int rx_chid, u_int hash_len, bool ghash_lcb) +{ + struct cpl_tx_tls_ack *cpl; + uint32_t flags; + + flags = ghash_lcb ? F_CPL_TX_TLS_ACK_LCB : F_CPL_TX_TLS_ACK_PHASH; + cpl = dst; + cpl->op_to_Rsvd2 = htobe32(V_CPL_TX_TLS_ACK_OPCODE(CPL_TX_TLS_ACK) | + V_T7_CPL_TX_TLS_ACK_RXCHID(rx_chid) | F_CPL_TX_TLS_ACK_ULPTXLPBK | + flags); + + /* 32 == AckEncCpl, 16 == LCB */ + cpl->PldLen = htobe32(V_CPL_TX_TLS_ACK_PLDLEN(32 + 16 + hash_len)); + cpl->Rsvd3 = 0; + + return (cpl + 1); +} + +static inline void * +write_fw6_pld(void *dst, u_int rx_chid, u_int rx_qid, u_int hash_len, + uint64_t cookie) +{ + struct rss_header *rss; + struct cpl_fw6_pld *cpl; + + rss = dst; + memset(rss, 0, sizeof(*rss)); + rss->opcode = CPL_FW6_PLD; + rss->qid = htobe16(rx_qid); + rss->channel = rx_chid; + + cpl = (void *)(rss + 1); + memset(cpl, 0, sizeof(*cpl)); + cpl->opcode = CPL_FW6_PLD; + cpl->len = htobe16(hash_len); + cpl->data[1] = htobe64(cookie); + + return (cpl + 1); +} + static inline void * write_split_mode_rx_phys(void *dst, struct mbuf *m, struct mbuf *m_tls, u_int crypto_hdr_len, u_int leading_waste, u_int trailing_waste) @@ -790,7 +1072,7 @@ write_split_mode_rx_phys(void *dst, struct mbuf *m, struct mbuf *m_tls, * If the SGL ends on an address that is not 16 byte aligned, this function will * add a 0 filled flit at the end. */ -static void +static void * write_gl_to_buf(struct sglist *gl, caddr_t to) { struct sglist_seg *seg; @@ -829,10 +1111,11 @@ write_gl_to_buf(struct sglist *gl, caddr_t to) } MPASS((((uintptr_t)flitp) & 0xf) == 0); + return (flitp); } static inline void -copy_to_txd(struct sge_eq *eq, caddr_t from, caddr_t *to, int len) +copy_to_txd(struct sge_eq *eq, const char *from, caddr_t *to, int len) { MPASS((uintptr_t)(*to) >= (uintptr_t)&eq->desc[0]); @@ -857,8 +1140,8 @@ copy_to_txd(struct sge_eq *eq, caddr_t from, caddr_t *to, int len) static int ktls_write_tunnel_packet(struct sge_txq *txq, void *dst, struct mbuf *m, - struct mbuf *m_tls, u_int available, tcp_seq tcp_seqno, u_int pidx, - uint16_t eh_type) + const void *src, u_int len, u_int available, tcp_seq tcp_seqno, u_int pidx, + uint16_t eh_type, bool last_wr) { struct tx_sdesc *txsd; struct fw_eth_tx_pkt_wr *wr; @@ -874,14 +1157,8 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *dst, struct mbuf *m, TXQ_LOCK_ASSERT_OWNED(txq); M_ASSERTPKTHDR(m); - /* Locate the template TLS header. */ - M_ASSERTEXTPG(m_tls); - - /* This should always be the last TLS record in a chain. */ - MPASS(m_tls->m_next == NULL); - wr = dst; - pktlen = m->m_len + m_tls->m_len; + pktlen = m->m_len + len; ctrl = sizeof(struct cpl_tx_pkt_core) + pktlen; len16 = howmany(sizeof(struct fw_eth_tx_pkt_wr) + ctrl, 16); ndesc = tx_len16_to_desc(len16); @@ -938,17 +1215,17 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *dst, struct mbuf *m, copy_to_txd(&txq->eq, (caddr_t)(tcp + 1), &out, m->m_len - (m->m_pkthdr.l2hlen + m->m_pkthdr.l3hlen + sizeof(*tcp))); - /* Copy the subset of the TLS header requested. */ - copy_to_txd(&txq->eq, (char *)m_tls->m_epg_hdr + - mtod(m_tls, vm_offset_t), &out, m_tls->m_len); + /* Copy the payload data. */ + copy_to_txd(&txq->eq, src, &out, len); txq->imm_wrs++; txq->txpkt_wrs++; - txq->kern_tls_header++; - txsd = &txq->sdesc[pidx]; - txsd->m = m; + if (last_wr) + txsd->m = m; + else + txsd->m = NULL; txsd->desc_used = ndesc; return (ndesc); @@ -976,15 +1253,21 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, u_int aad_start, aad_stop; u_int auth_start, auth_stop, auth_insert; u_int cipher_start, cipher_stop, iv_offset; - u_int header_len, imm_len, ndesc, nsegs, offset, plen, tlen, wr_len; + u_int header_len, offset, plen, rlen, tlen; + u_int imm_len, ndesc, nsegs, txpkt_lens[2], wr_len; u_int cpl_len, crypto_hdr_len, post_key_context_len; u_int leading_waste, trailing_waste; u_short ip_len; - bool last_wr, need_lso, short_record, split_mode, using_scratch; + bool inline_key, ghash_lcb, last_ghash_frag, last_wr, need_lso; + bool request_ghash, send_partial_ghash, short_record, split_mode; + bool using_scratch; MPASS(tlsp->txq == txq); M_ASSERTEXTPG(m_tls); + /* Final work request for this mbuf chain? */ + last_wr = (m_tls->m_next == NULL); + /* * The relative offset of the last byte to send from the TLS * record. @@ -999,12 +1282,20 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, CTR(KTR_CXGBE, "%s: %p header-only TLS record %u", __func__, tlsp, (u_int)m_tls->m_epg_seqno); #endif - return (ktls_write_tunnel_packet(txq, dst, m, m_tls, available, - tcp_seqno, pidx, eh_type)); + /* This should always be the last TLS record in a chain. */ + MPASS(last_wr); + + txq->kern_tls_header++; + + return (ktls_write_tunnel_packet(txq, dst, m, + (char *)m_tls->m_epg_hdr + mtod(m_tls, vm_offset_t), + m_tls->m_len, available, tcp_seqno, pidx, eh_type, + last_wr)); } /* Locate the TLS header. */ hdr = (void *)m_tls->m_epg_hdr; + rlen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length); #ifdef VERBOSE_TRACES CTR(KTR_CXGBE, "%s: offset %lu len %u TCP seq %u TLS record %u", @@ -1012,18 +1303,153 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, (u_int)m_tls->m_epg_seqno); #endif - short_record = ktls_is_short_record(tlsp, m_tls, tlen, &header_len, - &offset, &plen, &leading_waste, &trailing_waste); + /* Should this request make use of GHASH state? */ + ghash_lcb = false; + last_ghash_frag = false; + request_ghash = false; + send_partial_ghash = false; + if (tlsp->enc_mode == SCMD_CIPH_MODE_AES_GCM && + tlsp->sc->tlst.partial_ghash && tlsp->sc->tlst.short_records) { + u_int trailer_len; + + trailer_len = m_tls->m_epg_trllen; + if (tlsp->tls13) + trailer_len--; + KASSERT(trailer_len == AES_GMAC_HASH_LEN, + ("invalid trailer length for AES-GCM")); + + /* Is this the start of a TLS record? */ + if (mtod(m_tls, vm_offset_t) <= m_tls->m_epg_hdrlen) { + /* + * If this is the very first TLS record or + * if this is a newer TLS record, request a partial + * hash, but not if we are going to send the whole + * thing. + */ + if ((tlsp->ghash_tls_seqno == 0 || + tlsp->ghash_tls_seqno < m_tls->m_epg_seqno) && + tlen < rlen) { + /* + * If we are only missing part or all + * of the trailer, send a normal full + * record but request the hash. + * Otherwise, use partial GHASH mode. + */ + if (tlen >= (rlen - trailer_len)) + ghash_lcb = true; + else + send_partial_ghash = true; + request_ghash = true; + tlsp->ghash_tls_seqno = m_tls->m_epg_seqno; + } + } else if (tlsp->ghash_tls_seqno == m_tls->m_epg_seqno && + tlsp->ghash_valid) { + /* + * Compute the offset of the first AES block as + * is done in ktls_is_short_record. + */ + if (rlen - tlen < trailer_len) + plen = rlen - (m_tls->m_epg_hdrlen + + trailer_len); + else + plen = tlen - m_tls->m_epg_hdrlen; + offset = mtod(m_tls, vm_offset_t) - m_tls->m_epg_hdrlen; + if (offset >= plen) + offset = plen; + else + offset = rounddown2(offset, AES_BLOCK_LEN); + if (tlsp->ghash_offset == offset) { + if (offset == plen) { + /* + * Send a partial trailer as a + * tunnelled packet as + * immediate data. + */ +#ifdef VERBOSE_TRACES + CTR(KTR_CXGBE, + "%s: %p trailer-only TLS record %u", + __func__, tlsp, + (u_int)m_tls->m_epg_seqno); +#endif + + txq->kern_tls_trailer++; + + offset = mtod(m_tls, vm_offset_t) - + (m_tls->m_epg_hdrlen + plen); + KASSERT(offset <= AES_GMAC_HASH_LEN, + ("offset outside of trailer")); + return (ktls_write_tunnel_packet(txq, + dst, m, tlsp->ghash + offset, + m_tls->m_len, available, tcp_seqno, + pidx, eh_type, last_wr)); + } + + /* + * If this request sends the end of + * the payload, it is the last + * fragment. + */ + if (tlen >= (rlen - trailer_len)) { + last_ghash_frag = true; + ghash_lcb = true; + } + + /* + * Only use partial GCM mode (rather + * than an AES-CTR short record) if + * there is input auth data to pass to + * the GHASH. That is true so long as + * there is at least one full block of + * payload data, or if the remaining + * payload data is the final partial + * block. + */ + if (plen - offset >= GMAC_BLOCK_LEN || + last_ghash_frag) { + send_partial_ghash = true; + + /* + * If not sending the complete + * end of the record, this is + * a middle request so needs + * to request an updated + * partial hash. + */ + if (tlen < rlen) + request_ghash = true; + } + } + } + } + + short_record = ktls_is_short_record(tlsp, m_tls, tlen, rlen, + &header_len, &offset, &plen, &leading_waste, &trailing_waste, + send_partial_ghash, request_ghash); + if (short_record) { #ifdef VERBOSE_TRACES CTR(KTR_CXGBE, "%s: %p short TLS record %u hdr %u offs %u plen %u", __func__, tlsp, (u_int)m_tls->m_epg_seqno, header_len, offset, plen); + if (send_partial_ghash) { + if (header_len != 0) + CTR(KTR_CXGBE, "%s: %p sending initial GHASH", + __func__, tlsp); + else + CTR(KTR_CXGBE, "%s: %p sending partial GHASH for offset %u%s", + __func__, tlsp, tlsp->ghash_offset, + last_ghash_frag ? ", last_frag" : ""); + } #endif + KASSERT(send_partial_ghash || !request_ghash, + ("requesting but not sending partial hash for short record")); + } else { + KASSERT(!send_partial_ghash, + ("sending partial hash with full record")); } - if ((short_record || trailing_waste != 0) && m_tls->m_next == NULL && + if (tlen < rlen && m_tls->m_next == NULL && (tcp->th_flags & TH_FIN) != 0) { txq->kern_tls_fin_short++; #ifdef INVARIANTS @@ -1031,21 +1457,28 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, #endif } - /* Use cached value for first record in chain. */ - if (m->m_next == m_tls) + /* + * Use cached value for first record in chain if not using + * partial GCM mode. ktls_parse_pkt() calculates nsegs based + * on send_partial_ghash being false. + */ + if (m->m_next == m_tls && !send_partial_ghash) nsegs = mbuf_nsegs(m); else nsegs = sglist_count_mbuf_epg(m_tls, m_tls->m_epg_hdrlen + offset, plen); - /* Final work request for this mbuf chain? */ - last_wr = (m_tls->m_next == NULL); - /* Determine if we need an LSO header. */ need_lso = (m_tls->m_len > mss); /* Calculate the size of the TLS work request. */ - wr_len = ktls_base_wr_size(tlsp); + inline_key = send_partial_ghash || tlsp->inline_key; + wr_len = ktls_base_wr_size(tlsp, inline_key); + + if (send_partial_ghash) { + /* Inline key context includes partial hash in OPAD. */ + wr_len += AES_GMAC_HASH_LEN; + } /* * SplitMode is required if there is any thing we need to trim @@ -1065,14 +1498,33 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, wr_len += sizeof(struct cpl_tx_pkt_lso_core); imm_len = m->m_len + header_len; - if (short_record) + if (short_record) { imm_len += AES_BLOCK_LEN; - else if (tlsp->tls13) + if (send_partial_ghash && header_len != 0) + imm_len += ktls_gcm_aad_len(tlsp); + } else if (tlsp->tls13) imm_len += sizeof(uint64_t); wr_len += roundup2(imm_len, 16); - wr_len += ktls_sgl_size(nsegs); - + wr_len += ktls_sgl_size(nsegs + (last_ghash_frag ? 1 : 0)); wr_len = roundup2(wr_len, 16); + txpkt_lens[0] = wr_len - sizeof(*wr); + + if (request_ghash) { + /* + * Requesting the hash entails a second ULP_TX_PKT + * containing CPL_TX_TLS_ACK, CPL_FW6_PLD, and space + * for the hash. + */ + txpkt_lens[1] = sizeof(struct ulp_txpkt); + txpkt_lens[1] += sizeof(struct ulptx_idata); + txpkt_lens[1] += sizeof(struct cpl_tx_tls_ack); + txpkt_lens[1] += sizeof(struct rss_header) + + sizeof(struct cpl_fw6_pld); + txpkt_lens[1] += AES_GMAC_HASH_LEN; + wr_len += txpkt_lens[1]; + } else + txpkt_lens[1] = 0; + ndesc = howmany(wr_len, EQ_ESIZE); MPASS(ndesc <= available); @@ -1098,8 +1550,9 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, V_ULP_TXPKT_DATAMODIFY(0) | V_T7_ULP_TXPKT_CHANNELID(tlsp->vi->pi->port_id) | V_ULP_TXPKT_DEST(0) | + V_ULP_TXPKT_CMDMORE(request_ghash ? 1 : 0) | V_ULP_TXPKT_FID(txq->eq.cntxt_id) | V_ULP_TXPKT_RO(1)); - txpkt->len = htobe32(howmany(wr_len - sizeof(*wr), 16)); + txpkt->len = htobe32(howmany(txpkt_lens[0], 16)); /* ULPTX_IDATA sub-command */ idata = (void *)(txpkt + 1); @@ -1121,8 +1574,13 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, cpl_len += sizeof(struct cpl_t7_rx_phys_dsgl); post_key_context_len = cpl_len + imm_len; - if (tlsp->inline_key) + if (inline_key) { idata->len += tlsp->tx_key_info_size + post_key_context_len; + if (send_partial_ghash) { + /* Partial GHASH in key context. */ + idata->len += AES_GMAC_HASH_LEN; + } + } *** 520 LINES SKIPPED *** From nobody Fri Oct 3 01:54:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdBYY4Zqzz6976j; Fri, 03 Oct 2025 01: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdBYY3xgCz4GjL; Fri, 03 Oct 2025 01: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=1759456481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGNGnrRuh6PQkpizE0fM/GWpXXvSOn6OxpJO9EDHgSI=; b=GVNg5+7JplrqOJLR0bTwv4Rz9ZG8hLx8MsImw+e9ySgTh6JgZNGD5evl2HaDlkdJAO/g5F ryjImNVzyRonh93prCdQfzRlQEI1Q1vVSaEXcRdItL1iTAJ4hYrd1UNuC/eAp0ervDw60R 9Dv6DNmnZ8fnaLPdN19YNdCEGCFH+3BIIbG6dnB6kc6qKS+9rtP0hIcDn/zqiodRqZTRt3 vQfTDH541ol0Pr3oLNYgsca2ID7tJmgUrNS4SnXsv/RtjBT2TPSmTLx+Se+CjwnqTyxDb/ WV2jjIQSnd8wlscrIIQvZ5O/zLsZVFdFtZ+32IMmdb+4gjxQx98Rg8BYzxhpLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vGNGnrRuh6PQkpizE0fM/GWpXXvSOn6OxpJO9EDHgSI=; b=ZrZ0UOBIdp+bxWbNN9qjyIadG0q0jHk2yPI5dF/ljwoyh9ra8iqDrcYsEOC7H6Zk/TUXo3 +rXEOddW5coQQNjrWc9Bjym4h3QBtLya7igMnu6BnOXnS6z/F2dLefZ15i+s7bJZyMcd95 olHnJEVYkYWQC4Z1skNT+YkcMg39HlTm0HXdVaeFQkxREUI1x6qYF/DAjRcw8JuJ3vFkOC iOxK4ruBlWezgRK/zGfszQ3dsasaEcthhr5WywHYudQZ3gR7AxYibVfxDsIppoiktb2cxL VFpiwA+DzjXtcj1dim4vGAYEQlAxZ2/dLFtWMJ2SUTU4E3F9vuvTfwEreYQjcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759456481; a=rsa-sha256; cv=none; b=jBoyZVdydPMQ+5RLUpAyI8oc3HU0pMjJTjYyzPR6WDfQtjeCA+3n4pGabnAAi5Vs04L3Vs DxmJrTBS0xvGbtxMA07NHof3/uHkV0+S8gKhnoZzX3jaoQP0SRsjujXtWI8eH7FFPgC4a8 DZMKK+vqFKCRHAarejOKMgdGG0LekqEHP/SvcTpi0JqhP97wPMAG1548bxVteuxYpUA5+5 MLy+igaLzFZ/3gQAK38fLHnL4YElD6AYEnHHOaKy3Xl8GmpJajjMy65SKj5qSDDwL4QSjl 3i4S//R6j9hHp9toeKIxCNyKkzqpmaKQvOQuSxy9rhrS0/462lAm6bVzrYYGOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdBYY3S32zZfv; Fri, 03 Oct 2025 01: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 5931sft9065527; Fri, 3 Oct 2025 01: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 5931sfAQ065526; Fri, 3 Oct 2025 01:54:41 GMT (envelope-from git) Date: Fri, 3 Oct 2025 01:54:41 GMT Message-Id: <202510030154.5931sfAQ065526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: b7e81b99447c - Create tag release/13.5.0-p4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/13.5.0-p4 X-Git-Reftype: annotated tag X-Git-Commit: b7e81b99447c8bef8d077aebec8af78743ab7545 Auto-Submitted: auto-generated The annotated tag release/13.5.0-p4 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/13.5.0-p4 tag release/13.5.0-p4 Tagger: Philip Paeps TaggerDate: 2025-10-03 01:47:30 +0000 Tag FreeBSD 13.5-RELEASE-p4 commit e8acfa0be301a840585d0ab42af9ce5e334a59cc Author: Gordon Tetlow AuthorDate: 2025-09-16 16:28:16 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-16 16:28:16 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Oct 3 01:54:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdBYm0PK4z696jp; Fri, 03 Oct 2025 01:54: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdBYl4Htvz4H3f; Fri, 03 Oct 2025 01:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tFC4LWDnhwxYLlX1a8uuhtscB3f99YIosytgaiOW+7g=; b=PU2PAOBv22agz4RVjcf5rPQyQAT1zFor5O+IkxETBNL0XVVmJPOuZpJPtmFtRN872v1rLQ /GbANwGAEinGRtrcVTbi6QdAP4h4Dlsb0T0qzOeD5rW8N1v3uZhcbAxckrs2u+KqzQRSWY i59fPHeNiMb2EzNm76CWsFvgEw7UVn8QGo54Z7QOKLeaprjqlqyiFByJvATA3GfZzaNyDo UP/Y0p2XWKKJWsIrr2WZMWvv5k0d0tUjvROGH4Rt3BJrtagbav9NmuYImpwD2P0f8sLqWu HrelGFz4MBd5q9KtVe30uYTfS7ATRWLWsTDKfnK6XYOBAb0rIVnMxK5RaECUeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tFC4LWDnhwxYLlX1a8uuhtscB3f99YIosytgaiOW+7g=; b=tyHP9wp53x0FD+oWBYCrblUMfzac0hFRNiDsaUKMPnyZ1SsBZQmQ8nioe28kjjPdJafZv2 Ig912QZ3afJyBHJdI7mcpgxB90ZVTLRj3ISXMD5S5KRSmOrR+7hD3GVX27vfCCcdqZQSgR KkFjH46mOyDGvfB72hGQd3STOrweVPgz+/DlbgigCXS5rI4EeeCKebC+4mwQ0Ey3ggTpl7 wuheRYhmCsgASlSl9bRIhbBaY8cj9QWqW/NFu53ZdEpCi36GgFJTDT4BIod9csMa2KA9xg 9ByWZv15lgUrWml814kgT+8aiVrmr9I7DGRzml2nvZjSllT9WkTmOSF5Q8UvGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759456491; a=rsa-sha256; cv=none; b=YnVLL91L7/WszsRTcUPoELlrOt07p2jaozuz0WT3CS92grFLFDAM1QwpR5mfTYd7uMVAo8 AsfAemmozEw/Za1lYzQTmEML4IqSBDmmc6WTe7E+rrfPvgf7kkOtQQGCDfCxsCQDNOCjiG Q++sipGWHOCeTuBrKveelc5uGJ0JP48EytJJskFTdxU+hg5AJGfBAj4ottMbmkUyqcG1Oi Bpnke+TucGXfWyzwqTuSzdqdJ92gtRpKvMW+HJbmdh2v2jaE0dok9+qrJn9mFgDh+5OiKc rX+NjsJPRpRNKHTSZqP/Y5O5WL+HN1sTigPAHo8mTu3MjRxyUeZJ7A1fxVVJfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdBYl3vjPzZj6; Fri, 03 Oct 2025 01:54: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 5931sp9t065653; Fri, 3 Oct 2025 01:54:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5931spvN065652; Fri, 3 Oct 2025 01:54:51 GMT (envelope-from git) Date: Fri, 3 Oct 2025 01:54:51 GMT Message-Id: <202510030154.5931spvN065652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 7790fb48139c - Create tag release/13.5.0-p5 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/13.5.0-p5 X-Git-Reftype: annotated tag X-Git-Commit: 7790fb48139cacbe4cacf8c6a33ce5c0d6d24e60 Auto-Submitted: auto-generated The annotated tag release/13.5.0-p5 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/13.5.0-p5 tag release/13.5.0-p5 Tagger: Philip Paeps TaggerDate: 2025-10-03 01:47:42 +0000 Tag FreeBSD 13.5-RELEASE-p5 commit c106ed3325076a75e8aabaa78c60c6c5d0e69c65 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:36:55 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:36:55 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Oct 3 01:57:05 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdBcK44Wxz697GC; Fri, 03 Oct 2025 01:57: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdBcK3KvBz4HRL; Fri, 03 Oct 2025 01:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFOGu4ac9exzfEhmO89s54HLqayxpjhEEpmiLGG/gzU=; b=O4M3RQIzfMJ8NEzGz7VShRV+24NoVnMeh/8E2MdWtYDKXqvzMHKraHXzrk5ogNdd+bL4r0 4JcylM8RzSdAab5IIR2dCeaURVI/VDZUCuQI8Yqcw3iZrAYV5EGDOYmu7H63Jr7C9CkfVT oEtwlHOAH+QnKTCN2yHQOSPdjPieVUrmWaOrDglSFBb7XE64Ze41IUpSnyaOiREsbFRN1W 7iRLzkk4hkQOxKkT20hCouzIOYGEHBJB98MDeFu+97zadIjSM5ZqQxdXv/DOJ8b6W6itb8 /oEoyL1x0NA9gy5FYNXePfYSsE8KlX24ywaIgTeJW5loDH/x70bBA0msZKvtYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFOGu4ac9exzfEhmO89s54HLqayxpjhEEpmiLGG/gzU=; b=KHUTUiFfhR6fojf8j6crMEKPgR/xcevTLM46bHIYruxFReQO3s7dY9+kqdqDlNiml8bdy7 ehxL40mvVAfIFF6KDK3TQqN0iHbHqZjhTkbPWPW45d2an9vteharpsCliMdV74wSnWZyJf RS6P/i6ZSDihepfduxPX6YA1X4yQ+coWQw1YfL+AlEw48L0J3A0u1r6pe9RM6nY8TiaIpT UuU7upsz95LoR/EHdx8TIR9Iib7qFi0PS/757uZJ6893NPI9RW4GCOYLvsrr2w2zk6qzb1 lIz+4rTx4Gh4fARxQiMNwmAhV0pkwqZLyB+iLoEl3yofYLQFnTMoSgeu1NZ+Og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759456625; a=rsa-sha256; cv=none; b=eeuMOFb7FLbEL9HWzwiuo7E/VFXuzxjurheIDgCkDawpl5QXPjKoueJfgQP9M2I7Q+2YD5 I+XhO+BQkbTy5Z6ETAiSDhE1fNWL6FULQwCcsdHpFxb4dPYcmSki4iqCBxxkAb+S2e8IpP CqW2/ZZ+eqHFiw4yeyWJOewumswCNfJGU5AlO/98w/WPQRnjp+TKI+kLDSoTtTD9oUk7BE G0u6BiCeM4W/rlWQ0mlfs3dYVsnPIQ2zD+JqYcVpUXDgxV2DI9AO/FraTQyk4hnVG6AUNr UubhnjgWyXs05TTQu6HePgIKMo5RkechXNB8J3YGlexJzcTAnxpF8weRJCe0ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdBcK2wDkzbDd; Fri, 03 Oct 2025 01:57: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 5931v5AF066442; Fri, 3 Oct 2025 01:57:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5931v5V4066441; Fri, 3 Oct 2025 01:57:05 GMT (envelope-from git) Date: Fri, 3 Oct 2025 01:57:05 GMT Message-Id: <202510030157.5931v5V4066441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: a94b649d5f9a - Create tag release/14.2.0-p6 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.2.0-p6 X-Git-Reftype: annotated tag X-Git-Commit: a94b649d5f9a9f46e3e487a7171d1bea578bba99 Auto-Submitted: auto-generated The annotated tag release/14.2.0-p6 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.2.0-p6 tag release/14.2.0-p6 Tagger: Philip Paeps TaggerDate: 2025-10-03 01:53:51 +0000 Tag FreeBSD 14.2-RELEASE-p6 commit f3ffa7eb382a2b90816f94aa2fb2431688e0c2b8 Author: Gordon Tetlow AuthorDate: 2025-09-16 16:28:35 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-16 16:28:35 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Oct 3 01:57:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdBcW39BPz697CZ; Fri, 03 Oct 2025 01:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdBcW2VTzz4Hk8; Fri, 03 Oct 2025 01:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456635; h=from:from:reply-to:subject:subject: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/UGPcNjka/G50d/jIG/6GZQTHYWqxsYPlPFjCFT1f0=; b=PpPU37gxIIowZDM8+ay5gLPBeBftQNN0C6Ns+aok1lcUgkm21AujA1N+3pk/u5LBSX11gL H1eM5wss4t9WEJoRvxYR9eMDgqQ2Mzd5l547YO0L4La9Co5CTLU04XxjNAWtoHm+r5u1sm 9eoyGPlCRsfEIzmvO9R5pdMseiBLQ2n/wOn8AbWfQ10UHTXtHcQNdKruKl4lMDR0wKZeMw 60cyfcFeZz7k26cstwo40TNwzj6593H1zHdUmTm96suqL/qjn6xuHdRidAX8frdDlS0Z+3 cgX25eXs+zVSs3htA5QhadhAqSQW9RQn0OKEbz8iWw4uOCLWN2MYlJbjnahjnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456635; h=from:from:reply-to:subject:subject: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/UGPcNjka/G50d/jIG/6GZQTHYWqxsYPlPFjCFT1f0=; b=EgkoRwdVHlqbzpZD9tN+mOs9Nv79+fuKtoMuRDK5xRdlm7t3yDPsf/pfOLcitQr2CmDjxK BtB+6PjYPzPF8OvLWhsU1Tpvq+CNTOmNjqSEENcMbIIyeJV5jtqh7x01rDC+Hbg99uk0T5 d5WSJY4Ciq7Hm7kViTj+jvOuOm6w9fy9Y3xH4k4LU//92i4v+Zm40s8ymloha9g2i2vyBz ngW9HiEU88/OShe6NlyvmjcBCv3OyIR/SW+x0LNcJaZ/4DU4eqgAa6qVap6nowOF5CeCII oON8md5y8iI1KFfIoumUZvC5ohZIS22wVqkVDVEDaSwq9b1YEHaOvZhkkiCRsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759456635; a=rsa-sha256; cv=none; b=FZ8L7ef9AwltCAIBe3C9hkj8drzQ7Kg6+FRhqiII2tntSM55S5MBDKhFbq+u8DazrOlMkq nOMionoikJSQdyH0+S8SWfJg3v5GBSXSUfdyn7GueX4VHOTx/UHdWsCWI0NCS3A88Ib/Fu V5T1BlRb6mE6kd+nd4KL75RvN7Q/UDKg6uNRqHRESPjHxhKdWpwUgBfE4jLaRr6mn/9jbF p/aanjPzOm0mTGEVcXYe3ShSx8WMANsPLkUtE59KXLQlhzXWKEiOZunAYcArvREX9nVWHX /4PPVpl0AvJwEZeegfrTO3fM3ng1jGIGJbiNC8m5aBB4NbzlkHU9TNsY8OT80g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdBcW24drzZj8; Fri, 03 Oct 2025 01:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5931vFhA066562; Fri, 3 Oct 2025 01:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5931vFj4066561; Fri, 3 Oct 2025 01:57:15 GMT (envelope-from git) Date: Fri, 3 Oct 2025 01:57:15 GMT Message-Id: <202510030157.5931vFj4066561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 3ff6ec7d5303 - Create tag release/14.2.0-p7 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.2.0-p7 X-Git-Reftype: annotated tag X-Git-Commit: 3ff6ec7d530357149eeb650fc74caaed87ca55eb Auto-Submitted: auto-generated The annotated tag release/14.2.0-p7 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.2.0-p7 tag release/14.2.0-p7 Tagger: Philip Paeps TaggerDate: 2025-10-03 01:54:04 +0000 Tag FreeBSD 14.2-RELEASE-p7 commit 16a79708d089423ec0c3d32f25e7ca97ae58e97b Author: Gordon Tetlow AuthorDate: 2025-09-30 15:36:37 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:36:37 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Oct 3 01:59:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdBg81bRHz697PX; Fri, 03 Oct 2025 01:59: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdBg80vJVz4J6t; Fri, 03 Oct 2025 01:59:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0et9oJaxwzu+uwjxQdX7jqbCkR+cGsrAdwsStXuYXeg=; b=FPyDHTCOFUnUnv6mB2RQ9FMhkA8rz5Tox+7DB8aeFtNwkJtpupMbP0DMGOb++xnGOoB2zf bSUE7S7IsMfvJ/2OdlG8zM2uswimoBsVRNtbDCd3SAbPqofxffB4/AcwP/z4mgZrKuadfz F/ZXdH7hDjjd02zTpQH5ZBGMzLZJsb0RipwSPbLqJCzwY9PANAZ2aqPrUrRsptfgERLxdT 8gojZcBBIeVkFm3HZ42dhHlJg8O3IaRdENM2yySzWz9Q2P+CRW4vj/l9KNvVXRy7OvMANm mY8syIXzN1E4U/xQfG3Qh67CIXhdU1f+lVk1o1E0j2CbN0DtLGuEeqHAKk07Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0et9oJaxwzu+uwjxQdX7jqbCkR+cGsrAdwsStXuYXeg=; b=uCvdwDyGym/cQ5JcvgT1AiEEQz6AoBX1bWrbWaL3Wh1P89WKX2OrJlJWSIr0pcYfVeaHYF pkWp4EEQESwIr+6hG4lmJIPjCOdsDZ7f2EzV103RPM8OUi0nYyvsB1lmdRh0Ukya5TTGJ8 joyaTN0BGSS0hT617osseMmL5iiJTDGbkXUUWETC8lzBBp3KVNW0ZjN39OGWMupp2SjZYd sAR2/ilLA9r4WDMv7K4LiYDxOEEhzZLroKOj2U4C4QOXW/p07ADhfJraH/uzyi0dJtRb7J Ayr8HtYorepLzimopg39x5DoR6YubELCkzPmBYu29KUW9o1qiTHuj2MoZJynjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759456772; a=rsa-sha256; cv=none; b=wLbF+2/39eKJaG70MKJOxgjDf6vcyhZyhwSSySRk+i0V29MFJhTOJPDTeXWxlXsPhkFEav kxRmUeI7lBUZSogAbkx7rbuGFUFQObMYEEpqVFgJStD3mj3VnKNjzPX0h9VQms5S695xPu BtzwfvZzd64LGpC69H7qkYqyNGmkNdB48UwLG1NBh5Ngn0isT+zJ8KLV/2//53t7ryszVi /r0dTN4ksOQQ+i1j8gX+b8AfL1spuAC1BkN2/4eJNyE+ZLwL/1BEJREuhJjz8/DakiDrLZ qPbYX6YPaVzbkfgEmw2fN0272LllqPNK4tdxFVigA7bs35K2k/2aFJqNj2Nm3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdBg80RXRzb0Z; Fri, 03 Oct 2025 01:59: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 5931xVHA067290; Fri, 3 Oct 2025 01:59:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5931xVVA067289; Fri, 3 Oct 2025 01:59:31 GMT (envelope-from git) Date: Fri, 3 Oct 2025 01:59:31 GMT Message-Id: <202510030159.5931xVVA067289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: d01f71cb9844 - Create tag release/14.3.0-p3 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.3.0-p3 X-Git-Reftype: annotated tag X-Git-Commit: d01f71cb984400f834bc54266f4c16cf4d0aa043 Auto-Submitted: auto-generated The annotated tag release/14.3.0-p3 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.3.0-p3 tag release/14.3.0-p3 Tagger: Philip Paeps TaggerDate: 2025-10-03 01:56:27 +0000 Tag FreeBSD 14.3-RELEASE-p3 commit 30ad842dd9704cb36ac4f00e90429b39407ca909 Author: Gordon Tetlow AuthorDate: 2025-09-16 23:10:20 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-16 23:10:20 +0000 Correct release patch information. Pointy hat to: gordon Approved by: so From nobody Fri Oct 3 01:59:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdBgH4QsJz697Mt; Fri, 03 Oct 2025 01:59: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdBgH3yfbz4JHH; Fri, 03 Oct 2025 01:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mt0RWKm0GdaoSRdzx7QDCsHFl1zM5f4pgjeq2i52Jjs=; b=FWQ9ucN1wcE4W7gWkb3nDn90ONXA9Wz/mP6HGlNfGRM/bu2r+SnkMSvaNuS9FOd/qy+9FR l/DwPwkLE/P2SIfU8dvOPI37lt8lm6ejyWiyjKnZ7542yqU51G6JbI0+zWNM/CljQ0XGWE BQ8ZWb6XOVov1KYUdzSXqzavnm6EFNlvCv+eSVO/M6TJSOoEewiWt0TsiDHA18lLQrS9C3 p9VP2UvrhZxQGzQI9P0KrJDP1k6lydTplNYxO0jUqRKotplWj6lSnoodISvEvJiN9aB2Km ZU4RZyg6i/HCnFpYfVdBVdNEqTQV4eJl/YS8ywYbNhp/1/gI/DRSo9bxW3dtUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759456779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mt0RWKm0GdaoSRdzx7QDCsHFl1zM5f4pgjeq2i52Jjs=; b=gr0uDHesToVSVi8ASXNg6t8VHS7kboQHHp3Z8duLmEsZwL47M7hi8ThNG4GUyelPBF0in3 7m2lQO4WHoO5dphKgVg/XeGxNs2uKWrLuyJTD/lBjLbU/xfjbmLbwoEHT2Qg2i1Z7KDBwJ ZskUPe11rlWf06iLC21AXQCpJ8R67eKlPj3y5PardV+kW5M7nOWSVVsa+ayFca1C/ZpKpH llkQfUHOyAd+xqMXLl7JgfdwahE6yt0Wm/fcZV0FQMczoMeuTQAVHgQikfllJ1PpmVTB5j Ykd1Vm3hOu9A4usviDBPNB6xl7vcgvXGeuql5AiJklSDycOh7Khszg1pNMItMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759456779; a=rsa-sha256; cv=none; b=c8DV2D8wrylP600yPmyQH6uducR5aDOSlOfI1OxmujNQEfURXQOmrMl5pLPRY+5Q/O6Xvr 4if7+42Abbu5oEbSLWiuDjY/SO2ExIhCK0AJ1ZoIYkNavFlJs3OifGchdWUrnKcdnD8rkG ZmUmlNtUuXjsp88DJsEDRFJEnhW7y2kpefEBRozFsrgKXjSxiRT8SxTk53YS6uyWXOjk0n 2Ixq6Sx16SNHHQlKBO7dmkBlrYujWMQpKYjH7jmCBvFLxv6TdWg8yxvvSstIuritWh/iB1 VFMgo5vgSaNrUBRICI/smL3r6MUdq0qmVYjic91F4bX8Nl3iqXoRzl81b2W65Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdBgH3RkszZly; Fri, 03 Oct 2025 01:59: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 5931xdJi067416; Fri, 3 Oct 2025 01:59:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5931xd7Y067415; Fri, 3 Oct 2025 01:59:39 GMT (envelope-from git) Date: Fri, 3 Oct 2025 01:59:39 GMT Message-Id: <202510030159.5931xd7Y067415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 198a99ae44bf - Create tag release/14.3.0-p4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/release/14.3.0-p4 X-Git-Reftype: annotated tag X-Git-Commit: 198a99ae44bf0e644b6b6efd9a51e41076a28656 Auto-Submitted: auto-generated The annotated tag release/14.3.0-p4 has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=release/14.3.0-p4 tag release/14.3.0-p4 Tagger: Philip Paeps TaggerDate: 2025-10-03 01:56:36 +0000 Tag FreeBSD 14.3-RELEASE-p4 commit 7f1785f09fb2a35290c45bcc604b5c0ad1b25b99 Author: Gordon Tetlow AuthorDate: 2025-09-30 15:35:49 +0000 Commit: Gordon Tetlow CommitDate: 2025-09-30 15:35:49 +0000 Add UPDATING entries and bump version. Approved by: so From nobody Fri Oct 3 08:32:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdMNB0ZNYz69ty4; Fri, 03 Oct 2025 08:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdMNB086pz43Mk; Fri, 03 Oct 2025 08:32:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kv/cANmldTXILSzjdPJnsASyTaGPW8zyXMM1c68wFHA=; b=ktCp/Rrhfe0QiQ/FRMZELr1ktEP+a6N6oUs+WRyTN6wardFTacuVLGgSF7vggoBr1RXIbu ESSs0vDm+ZaAgfPiumZHsJHGwjO9zWRM9m/+wuqaZ78QOCainOcFEPfwNX/tuJWzsljmx/ +BtfW1V2HRdX9gcpOLMYhvpYt89wGIqC9e7Km1doSzNExqYjfcVEGavziU7LkeZ78FuppJ Jbu8idA2pQ8IbOS9TjEMogBpNtFDvPHNEq2kZV0do/as1GU9VZo1fGzrU4gPw3TmWjtiPD MsI3xqWH0KMqoj6TFmOKIWELRUPnb7KH0GTh/BVo4Gg8vOlOfsXqABXL7QW4kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kv/cANmldTXILSzjdPJnsASyTaGPW8zyXMM1c68wFHA=; b=TChotBtciK2QYSO18+EMjTCFuCzkMOaEXZkk84UOyHgiRqBpcXKKB83vl8nZ5ye5WNUA8P MZoqmOxeQ1PFyQvS2nfJba5TloGvI0mOvS3NBs2N1sPCCQtLlRfw2Cdv+y+jgaUVxlSa0g WWqN+BLBYcWP6bB+6kjZOKcM2xQoy1eJj+w958/9XCZ1Sgg1WyYewP+d7o1KJdd4k/gQIH wJIyqNszodaaqPros2x7RPlz6h3xzC6EgKlJ8KRoTaJrw+dpu/OJX+RtCd4KZmxp3ldMwM z5gK3tl9JXUfbR5JrXqT1lFibSSOMF4RLaj53r9N4+Iv82eq2rFL7nSLptJ9YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759480330; a=rsa-sha256; cv=none; b=yxy9gIEQOuozD03PRUc0E2bqpcxoSI9A9L3WdOKxvhvob7ldxeOC3siKNiDeb+0lUbi/9H +Mu4jQqWUv37nVfTXrkz8x5J1niyCup93JxJN/n1ekkvtjug6WbO+UyUK3Iz9UBA9oHWrP gmZpU3SdT+FAR5BzA8YqAkxAsERUvqQgc/qJfJusCr511jxMR+Mh8662nKQBUF7AwCbL6k iL1f3FdbdK5IFIHs8pEIpVFWXePVqo8kSZf/l5fjKB+5ogxeeRr82chmn15f3stgPyFOrD 4GBElaDH3VwDMG6xyBsJevvcpQLdFsGXXDfCeGvE2NZvKVhSwKq0HVLlqwTlqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdMN96qxvzmpq; Fri, 03 Oct 2025 08:32: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 5938W9jt020359; Fri, 3 Oct 2025 08:32:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5938W9f0020356; Fri, 3 Oct 2025 08:32:09 GMT (envelope-from git) Date: Fri, 3 Oct 2025 08:32:09 GMT Message-Id: <202510030832.5938W9f0020356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 3d548504c705 - stable/14 - vtnet: disable hardware TCP LRO by default List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3d548504c705ac9a38a0fee2e85985340c1fe488 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3d548504c705ac9a38a0fee2e85985340c1fe488 commit 3d548504c705ac9a38a0fee2e85985340c1fe488 Author: Michael Tuexen AuthorDate: 2025-09-29 23:58:37 +0000 Commit: Michael Tuexen CommitDate: 2025-10-03 08:28:45 +0000 vtnet: disable hardware TCP LRO by default Hardware TCP LRO results in problems in settings with IP forwarding being enabled. In case of nodes without IP forwarding, using software LRO is also beneficial in general, since it can provide better information about what was received on the wire. Therefore, disable hardware TCP LRO by default. By tuning the loader tunable, this can be changed. PR: 263229 Reviewed by: Timo Völker Differential Revision: https://reviews.freebsd.org/D52684 (cherry picked from commit 6e4b811009d63f33c59d51f28fd4a030ca90843e) --- share/man/man4/vtnet.4 | 22 +++++++++++++++++----- sys/dev/virtio/network/if_vtnet.c | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 8b96445f0f04..dbe1283eceab 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 September 26, 2025 +.Dd September 30, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -54,6 +54,18 @@ TCP segmentation offload (TSO), TCP large receive offload (LRO), hardware VLAN tag stripping/insertion features, a multicast hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. +.Pp +Two flavors of TCP LRO are supported: +Hardware TCP LRO, which is performed by the host providing TCP segments larger +than the MTU to the guest, and Software TCP LRO, which is performed by the +network stack of the guest processing TCP segments in an optimized way. +Only one flavour of TCP LRO should be used. +Since hardware TCP LRO can have bad interactions with IP forwarding and +software TCP LRO mitigates several drawbacks of hardware TCP LRO, the default +setting is to disable hardware TCP LRO. +See the loader tunable +.Va hw.vtnet. Ns Ar X Ns Va .lro_disable . +.Pp TCP/UDP receive checksum offload cannot be configured independently for IPv4 and IPv6. Selecting an MTU larger than 1500 bytes with the @@ -94,8 +106,8 @@ This tunable disables TCP segmentation offloading. The default value is 0. .It Va hw.vtnet.lro_disable .It Va hw.vtnet. Ns Ar X Ns Va .lro_disable -This tunable disables large receive offload. -The default value is 0. +This tunable disables hardware TCP LRO. +The default value is 1. .It Va hw.vtnet.mq_disable .It Va hw.vtnet. Ns Ar X Ns Va .mq_disable This tunable disables multiqueue. @@ -119,11 +131,11 @@ 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. +This tunable sets the software TCP 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. +This tunable sets the depth of the software TCP LRO mbuf queue. The default value is 0. .El .Sh TRANSMIT QUEUE STATISTICS diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 38e7e0f48cf4..846b2d49b15d 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -282,7 +282,7 @@ static int vtnet_tso_disable = 0; SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable, 0, "Disables TSO"); -static int vtnet_lro_disable = 0; +static int vtnet_lro_disable = 1; SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable, 0, "Disables hardware LRO"); From nobody Fri Oct 3 08:32:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdMNC1llQz69vTX; Fri, 03 Oct 2025 08:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdMNC0wP8z432J; Fri, 03 Oct 2025 08: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=1759480331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K33vwb4k2umwRYytun0jOurc/kqO3bkavWVdLo9VXqc=; b=XNoNO2F5Wx8qmVlDnp9eQusQMt9C9C7IfanSW4KkjqjSCX2eHciuvD+U8IC7PnsX+c+MfT GEHVuGH9OZ7Ayyb+fSyzNvxFHNllNQFCgBkc6iw5UtbiBfhssdX8fAg0OHmAvGWS1VfhuG gGyu6V1c+fTQlSn5SuYzJp3AYq0vVu4ff9jTXjAwg1RpNmZjQR1OsCjx5mAx+uE3la2W3m pfEZkogm4iITltIT+77EHKKToGHAxmjrFeud1PtYbwDv8kgodkiDRQzsf/ajGooDMGuHR+ OFFM7JyIhAKs5Q7AaTH39PMXAZ4vShz4e+sZVTBLpHjajLl80dtP9YL4ji2arw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K33vwb4k2umwRYytun0jOurc/kqO3bkavWVdLo9VXqc=; b=OKOAVTJUsnyVUBKoK0/NGdasdPlT1JsJOKFHSzlNMZ+k3hPEOdUH0Ddg6DhQXUqNvBYGqq J/lBhg9DuHL/qImiWM82DG4FrfIXdbS0bdAaGHWTksyJmmdHV0LeIqd3bWwxRpbuv75w8B MO9zdS7At+g0OMSpntUkO/oKfOPO5VnQjp3lg/ME0xhx90GLfSQ/+scO/5aBovy1vwyd+y AKmFF4dPvqmcuWWJjNtzWvqJEYBYKdj5xaxamIR2ecwExC38d9fc/mG2fMATj8/5+uuTca xCsWJjrtwR1vSrp3AZgU8x6s/f2V7JfHEnQGIZN6eobwyUy7VmnrXd561GrxSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759480331; a=rsa-sha256; cv=none; b=HPMBIvh0wjfX3qZVNj59rq6YNnOoIxXPnRZXNyRiAmwT7AQP3YT2opToDFieYi8b6jesTS hYmXzDiCEO6epC0E4z6hxrOQkV9n/yonweBb7r57paDf5LM5xI5ohEqyqQuvPRM9WhIRul RQW9inOgnVPxtB4+Hp4fvk3Do1NKm7OMjW9IK9G6jUjiFhg+4Ka+NwP/yHvF7NSCVT3Mas xbrmluAxPk7tnZp4d7qgD8es5D1jnGughaRxyi4ui7ycjCgWUgpLD1WNPkVs/Ca4vhDmku fRgBiSLoUS7TwWLvyFCb/7oZEsYjivY6vtunYd0WIyMX/OmTWUidQxWCl1lRcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdMNC0Mzzzn1H; Fri, 03 Oct 2025 08: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 5938WA6D020391; Fri, 3 Oct 2025 08:32:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5938WAPA020388; Fri, 3 Oct 2025 08:32:10 GMT (envelope-from git) Date: Fri, 3 Oct 2025 08:32:10 GMT Message-Id: <202510030832.5938WAPA020388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: c55c8a899edc - stable/14 - tcp: apply rate limits to challenge ACKs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c55c8a899edcb5736df46058ac57e8d20f653991 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c55c8a899edcb5736df46058ac57e8d20f653991 commit c55c8a899edcb5736df46058ac57e8d20f653991 Author: Michael Tuexen AuthorDate: 2025-09-30 20:06:33 +0000 Commit: Michael Tuexen CommitDate: 2025-10-03 08:31:41 +0000 tcp: apply rate limits to challenge ACKs When sending challenge ACKs from the SYN-cache, apply the same rate limiting as in other states. Reviewed by: cc, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52754 (cherry picked from commit c2900b6e8255ba4f54dbd897cf42427db577ed3d) --- sys/netinet/tcp_syncache.c | 28 ++++++++++++++++++++++++---- sys/netinet/tcp_syncache.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 9d2c5dd5098e..012240f46ffb 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -130,6 +130,7 @@ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); static int syncache_respond(struct syncache *, const struct mbuf *, int); +static int syncache_send_challenge_ack(struct syncache *, struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -702,10 +703,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m, "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - if (syncache_respond(sc, m, TH_ACK) == 0) { - TCPSTAT_INC(tcps_sndacks); - TCPSTAT_INC(tcps_sndtotal); - } else { + if (syncache_send_challenge_ack(sc, m) != 0) { syncache_drop(sc, sch); TCPSTAT_INC(tcps_sc_dropped); } @@ -976,6 +974,10 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) if (sc->sc_rxmits > 1) tp->snd_cwnd = 1; + /* Copy over the challenge ACK state. */ + tp->t_challenge_ack_end = sc->sc_challenge_ack_end; + tp->t_challenge_ack_cnt = sc->sc_challenge_ack_cnt; + #ifdef TCP_OFFLOAD /* * Allow a TOE driver to install its hooks. Note that we hold the @@ -2060,6 +2062,24 @@ syncache_respond(struct syncache *sc, const struct mbuf *m0, int flags) return (error); } +static int +syncache_send_challenge_ack(struct syncache *sc, struct mbuf *m) +{ + int error; + + if (tcp_challenge_ack_check(&sc->sc_challenge_ack_end, + &sc->sc_challenge_ack_cnt)) { + error = syncache_respond(sc, m, TH_ACK); + if (error == 0) { + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + } + } else { + error = 0; + } + return (error); +} + /* * The purpose of syncookies is to handle spoofed SYN flooding DoS attacks * that exceed the capacity of the syncache by avoiding the storage of any diff --git a/sys/netinet/tcp_syncache.h b/sys/netinet/tcp_syncache.h index 219cddee0b1d..9445940bcec5 100644 --- a/sys/netinet/tcp_syncache.h +++ b/sys/netinet/tcp_syncache.h @@ -69,6 +69,8 @@ struct syncache { u_int8_t sc_requested_s_scale:4, sc_requested_r_scale:4; u_int16_t sc_flags; + u_int32_t sc_challenge_ack_cnt; /* chall. ACKs sent in epoch */ + sbintime_t sc_challenge_ack_end; /* End of chall. ack epoch */ #if defined(TCP_OFFLOAD) || !defined(TCP_OFFLOAD_DISABLE) struct toedev *sc_tod; /* entry added by this TOE */ void *sc_todctx; /* TOE driver context */ From nobody Fri Oct 3 08:37:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdMVb4D5Vz69vnP; Fri, 03 Oct 2025 08:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdMVb37zwz4401; Fri, 03 Oct 2025 08:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l52frMKpLDcZGaSGne4lwqMMP0iAioRKmh1gp5s5Ds8=; b=iBoOgrg7Z9KgdRCtJgeU4JmYsf691M2D9cmoe5UShOx3sA09YwTL2+WvSxCkW6MqvJ6rQz C07svcI9MctSJSel9/a4gko6cRCGIsn3ULCAvJRJEvEpuLAIb1gnpY11xpwDzg3C20RQ4y L49MYCIRMjCX5gSodtBgK4p83MVkVeR8/A+0SW9FGR14HLCMWKmdfkwJtZu/+ATMxxhkdk AZfQMMk8/8DhOwwPIFQABR4BDa+e8HGxnUJi/wzUVxPoJ6USkc8SegC4yKoQ22w8qMckmx zyGGbInrUeit84GDe8AqRfWiPetk08ty8mvsF6O82wguzgP4dDfLgG5lscWrFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l52frMKpLDcZGaSGne4lwqMMP0iAioRKmh1gp5s5Ds8=; b=iZgtknbKgJKmmdVRzoj06DO6InbaE3QdPhPFHXQfEhuQU/jFM7thdfVUqfdTeP9gbEJiSi wdR+z0cbYD09Udxs7dOKXgjknXmdQ6lPJ4PWWsGNLUmDSxZgGZXwOBP+dVUdTZa25vXTeT oDjTgW1B+o+UYsxr7hbCiv9I5ewZgl7vyHGazer6pw/aL7wggD6q9OPErzR+o67+VVX+Kg IMQeYQGf7ibnM13wuQizUHiD1v8b2LuGKgDdq140kANvQHy9OFSS3/nd1PEbV+lUEmdFQ7 QglwS2UCBjPfZ0Q6H3kGZ0eZI//Ha/HY6BeTtQzDGcniEk/n42fWCGaOYkyYfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759480663; a=rsa-sha256; cv=none; b=DZzltRKIzp0V8uLgZg9178ayjdyGhy4q99S1D0KJUla9+bPy7rY/U8KVSdNY4WSJdJkyEA pQFVjvmy9R900ccKVH/eEGBbQ+VEy1Slk9fKMgVsV2jR3YIDlk3BCTWqXZ0FyVVoZNdjIL dQiEZGUyM31+xl1DFQLgBDPJNATVTfWGs/2MV1eQDX+LCucbKsVhFq5Wnz/8K2G7R6QdR2 367h9iJfisq9mzE6pwDRb8lLhzjU9O6UtFOBelQXpiX97oDiFgXSK72mqUqW21nn2F5vlf ur3Q2bmZFLO37sjsFm+2MxYgINTZMPgkEQS9Xe7jPLvcCJnmSg9HE/8rgcyxyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdMVb2df5znTF; Fri, 03 Oct 2025 08:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5938bhtK023068; Fri, 3 Oct 2025 08:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5938bhvp023065; Fri, 3 Oct 2025 08:37:43 GMT (envelope-from git) Date: Fri, 3 Oct 2025 08:37:43 GMT Message-Id: <202510030837.5938bhvp023065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e1a7840dd941 - stable/15 - vtnet: disable hardware TCP LRO by default List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: e1a7840dd941f5bf320f474a34f2f6d891cdaf66 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e1a7840dd941f5bf320f474a34f2f6d891cdaf66 commit e1a7840dd941f5bf320f474a34f2f6d891cdaf66 Author: Michael Tuexen AuthorDate: 2025-09-29 23:58:37 +0000 Commit: Michael Tuexen CommitDate: 2025-10-03 08:34:08 +0000 vtnet: disable hardware TCP LRO by default Hardware TCP LRO results in problems in settings with IP forwarding being enabled. In case of nodes without IP forwarding, using software LRO is also beneficial in general, since it can provide better information about what was received on the wire. Therefore, disable hardware TCP LRO by default. By tuning the loader tunable, this can be changed. PR: 263229 Reviewed by: Timo Völker Differential Revision: https://reviews.freebsd.org/D52684 (cherry picked from commit 6e4b811009d63f33c59d51f28fd4a030ca90843e) --- share/man/man4/vtnet.4 | 22 +++++++++++++++++----- sys/dev/virtio/network/if_vtnet.c | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4 index 636ce4cc9b60..fd41b36882a6 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 September 26, 2025 +.Dd September 30, 2025 .Dt VTNET 4 .Os .Sh NAME @@ -54,6 +54,18 @@ TCP segmentation offload (TSO), TCP large receive offload (LRO), hardware VLAN tag stripping/insertion features, a multicast hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. +.Pp +Two flavors of TCP LRO are supported: +Hardware TCP LRO, which is performed by the host providing TCP segments larger +than the MTU to the guest, and Software TCP LRO, which is performed by the +network stack of the guest processing TCP segments in an optimized way. +Only one flavour of TCP LRO should be used. +Since hardware TCP LRO can have bad interactions with IP forwarding and +software TCP LRO mitigates several drawbacks of hardware TCP LRO, the default +setting is to disable hardware TCP LRO. +See the loader tunable +.Va hw.vtnet. Ns Ar X Ns Va .lro_disable . +.Pp TCP/UDP receive checksum offload cannot be configured independently for IPv4 and IPv6. Selecting an MTU larger than 1500 bytes with the @@ -94,8 +106,8 @@ This tunable disables TCP segmentation offloading. The default value is 0. .It Va hw.vtnet.lro_disable .It Va hw.vtnet. Ns Ar X Ns Va .lro_disable -This tunable disables large receive offload. -The default value is 0. +This tunable disables hardware TCP LRO. +The default value is 1. .It Va hw.vtnet.mq_disable .It Va hw.vtnet. Ns Ar X Ns Va .mq_disable This tunable disables multiqueue. @@ -119,11 +131,11 @@ 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. +This tunable sets the software TCP 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. +This tunable sets the depth of the software TCP 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. diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 634ba0de2d55..471c6b3714b2 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -281,7 +281,7 @@ static int vtnet_tso_disable = 0; SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable, 0, "Disables TSO"); -static int vtnet_lro_disable = 0; +static int vtnet_lro_disable = 1; SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable, 0, "Disables hardware LRO"); From nobody Fri Oct 3 08:38:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdMWP2NSJz69BRB; Fri, 03 Oct 2025 08:38: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdMWP1jhyz44nN; Fri, 03 Oct 2025 08:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mBiTexwjWCgyRlusIsx2Ix/kgYJx+dAwN67ZCjsJtBI=; b=QSvkBuJEI8okXW+kcwAgutEWw92o1RSfuzi/vcHml2UUpziStdtq72cfmZQderZkD8XP8u r3W9B/+0SY4v6ORCcVgM39rYZnVeovqzMAOLELZLcaOyqopsrMA7o05P+r7/jX6CpI6CbS y6h+SvEREn/4YqKTubAgjpNWepMrO1vFzoy5Z1ti8iVBbSOIAQAqyqW/awKqCo9uE28T93 PEDYDG3Mlk8gnmKF5/kTazPhzKcrsNP98+OPrydtOdzRkqpJ4o2RREB2Y14yxBa5J30WGm ng+2pGAwViGB+IITJuVvP2JH0r4IQXs7B069hAKKeIwhgkteniuoZ31AbvAAMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759480705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mBiTexwjWCgyRlusIsx2Ix/kgYJx+dAwN67ZCjsJtBI=; b=vlnClUOd25HGtcV2aYBzcaRWYSlr0mq5eVIaxjNJsQqfwr6c9xTlABpKwV7MbGSQ/h6uxd OGcOFLorPOFlGS8ZX6I5rGVhhrmY99VLeW7TOL8ZIpIcg8Ubj9RHvBsCPysSGZ+RfFqF1O DGCH9G0vqpQVglDLEIQHKAW5NepAG39pLDjBAmb+Fm8kDAdNDgUP7KDcYkeuezmMreaWRX LTuN2E8LJ2fGk1aVJHpDp5g62jhUnQ/dpKwuhJLB/W7Ibnpj3/HS2yWbDZdgb2NTcTv+Fl HwLOsYwUdPHk80Qnxun/iJc3l2Tbi7v7Jg1GwtBxNC9x44ynT2u+SWOQqQhYEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759480705; a=rsa-sha256; cv=none; b=sbaqTxKhdv0MFvNfYJ72sw66o28k5MwuLnluZtau8kKItszpxOrLsLWu9ho7nIgobWyxje 6lv/wHh1CF7yHZCcrtxHzNvOiZcXx30oZ69DIyjdBV/Wpnvd9X+ZsNGPl8nyw2WJpTs0NO LEp5zdkPyuqLjJ/NOp2FIpIuH2QLqSc4cgWbk9/JJtxdEnN/EC1bwvu2HPeZK12hWb+dsi vSvZ5Txq5RnawtyR865p7Lf1OFNdC9cT9JAUZUy9Md6LziyNkWMSUetbqJxMV7s7Zj5wmA fDopcWhQY0aGz5S2s+49VFXT8Y2qmDbjjnrhEmqlbogidmntduipWvNl8WZkDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdMWP1DDvznS2; Fri, 03 Oct 2025 08:38: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 5938cPbZ023395; Fri, 3 Oct 2025 08:38:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5938cP7q023392; Fri, 3 Oct 2025 08:38:25 GMT (envelope-from git) Date: Fri, 3 Oct 2025 08:38:25 GMT Message-Id: <202510030838.5938cP7q023392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0cd22970019e - stable/15 - tcp: apply rate limits to challenge ACKs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 0cd22970019e2efa5e98ad5671c454bd420a51e1 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd22970019e2efa5e98ad5671c454bd420a51e1 commit 0cd22970019e2efa5e98ad5671c454bd420a51e1 Author: Michael Tuexen AuthorDate: 2025-09-30 20:06:33 +0000 Commit: Michael Tuexen CommitDate: 2025-10-03 08:38:05 +0000 tcp: apply rate limits to challenge ACKs When sending challenge ACKs from the SYN-cache, apply the same rate limiting as in other states. Reviewed by: cc, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52754 (cherry picked from commit c2900b6e8255ba4f54dbd897cf42427db577ed3d) --- sys/netinet/tcp_syncache.c | 28 ++++++++++++++++++++++++---- sys/netinet/tcp_syncache.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 1ee6c6e31f33..72e9dccea9a5 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -122,6 +122,7 @@ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); static int syncache_respond(struct syncache *, const struct mbuf *, int); +static int syncache_send_challenge_ack(struct syncache *, struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -694,10 +695,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m, "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - if (syncache_respond(sc, m, TH_ACK) == 0) { - TCPSTAT_INC(tcps_sndacks); - TCPSTAT_INC(tcps_sndtotal); - } else { + if (syncache_send_challenge_ack(sc, m) != 0) { syncache_drop(sc, sch); TCPSTAT_INC(tcps_sc_dropped); } @@ -963,6 +961,10 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) if (sc->sc_rxmits > 1) tp->snd_cwnd = 1; + /* Copy over the challenge ACK state. */ + tp->t_challenge_ack_end = sc->sc_challenge_ack_end; + tp->t_challenge_ack_cnt = sc->sc_challenge_ack_cnt; + #ifdef TCP_OFFLOAD /* * Allow a TOE driver to install its hooks. Note that we hold the @@ -2053,6 +2055,24 @@ syncache_respond(struct syncache *sc, const struct mbuf *m0, int flags) return (error); } +static int +syncache_send_challenge_ack(struct syncache *sc, struct mbuf *m) +{ + int error; + + if (tcp_challenge_ack_check(&sc->sc_challenge_ack_end, + &sc->sc_challenge_ack_cnt)) { + error = syncache_respond(sc, m, TH_ACK); + if (error == 0) { + TCPSTAT_INC(tcps_sndacks); + TCPSTAT_INC(tcps_sndtotal); + } + } else { + error = 0; + } + return (error); +} + /* * The purpose of syncookies is to handle spoofed SYN flooding DoS attacks * that exceed the capacity of the syncache by avoiding the storage of any diff --git a/sys/netinet/tcp_syncache.h b/sys/netinet/tcp_syncache.h index a336571f12c9..37f6ff3d6ca9 100644 --- a/sys/netinet/tcp_syncache.h +++ b/sys/netinet/tcp_syncache.h @@ -67,6 +67,8 @@ struct syncache { u_int8_t sc_requested_s_scale:4, sc_requested_r_scale:4; u_int16_t sc_flags; + u_int32_t sc_challenge_ack_cnt; /* chall. ACKs sent in epoch */ + sbintime_t sc_challenge_ack_end; /* End of chall. ack epoch */ #if defined(TCP_OFFLOAD) struct toedev *sc_tod; /* entry added by this TOE */ void *sc_todctx; /* TOE driver context */ From nobody Fri Oct 3 16:28:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdYxP0Mfqz6B84f; Fri, 03 Oct 2025 16:28: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdYxN6sFpz49mB; Fri, 03 Oct 2025 16:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759508889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sclv/V/o9zCnhSFOqQ8I4ILqit9yNZG9emdSPcGDYjo=; b=x8u41IV2hWF/NSYmaHmPSjzmpfzIYdTy4GMdL+Pp/yWYlXm0UNFTfi2y/Rdj7d+WrzUW3v vT1eImyKDzJCX6uF+l7aGu5YqxjaTTN9E5pdflOwlh4W+kWT9gqRQiOfFhZlQj7Yals5mX yX8tgU3nOafPDSJZM+Onwlzint23Ef5AiNSIcSdEUzcBGvaZEMiM0I7+dQhm0p99rHqbux 02jXO/VB6F2PIzKMqgi4LlcRyosrCnAkkQOvMwkxPUBJa+K/L9aIIWgxfFynS0ALo7SxKd Tvmb+qjy6aRyAg6nWWrgGu0nfWBajFB3lt8PaBtzPt9jYpV03O+KeTs0PTQdlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759508889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Sclv/V/o9zCnhSFOqQ8I4ILqit9yNZG9emdSPcGDYjo=; b=Gkgi35nSnw7kHK6iCFte/E8te4QkX1vBTIIxCu3cUBMe2VNQ4viConeCXfO9mdL6wukCLG CBoFPg/NhlojNpN1DCabG/uOOqt/PHEUi1O4ejPYn+bpPjTbcP4e5gA4JNoXg5Kz4uyiFe 9Q2/GkzT8vVsa/Wd/Xyd5/5WAy3LAjMOQWP7DVmUKODRgwuMSkpeI+vufKTajkg6Lti0iB PnH16S16uhHNNt100oWXpx9v0wPdE4czMZQuDQwK3Fi9RLs9XliNh1gglMfyB6LeH8d1Zu Ib/zjG2AXWPUsyMBodn12O4DtUjOT2akZUOzpa0OLcqIpOz8Q+oz+eebL/wvIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759508889; a=rsa-sha256; cv=none; b=oFyyTu0MtkBqA8wLhJbZMbPdmxVWeZg8AGsCjxdP1uOm4vsPl9c0a5y5rgUDl4OIdYPUzF ozWUQ40y5afoXsZnOBGvJyHFCUkXz3KlOjWyEw/9hH5PSIrGFqvQr20bDWUh6wDo2lPUay jgNLtsrFGV+HbNIo7bIaKHvqNpCWvT/bbabInZHh9PP4QcfKsttxFZQ24xbb02lMjmpsD3 cYDhR/ByUO+I13B7/xiqS+cbbMNdc7FMpPXDmYRfqu/1CIoEPqyCmK2OKAUyl/2EW80FzI t+Nd0V5VjY1+g/rXlRg3TnlwGCjpWoF6xue8l6PQkGNRtpFGK4SkU2wWx+VoaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdYxN6Gdvz124K; Fri, 03 Oct 2025 16:28: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 593GS8V1009221; Fri, 3 Oct 2025 16:28:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GS85r009218; Fri, 3 Oct 2025 16:28:08 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:28:08 GMT Message-Id: <202510031628.593GS85r009218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 9d0b660e6949 - stable/14 - jemalloc: Fix activating debug on WITHOUT_MALLOC_PRODUCTION List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d0b660e69492b3dda65735c6bc4714d259bb20a Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9d0b660e69492b3dda65735c6bc4714d259bb20a commit 9d0b660e69492b3dda65735c6bc4714d259bb20a Author: Olivier Certner AuthorDate: 2025-10-02 09:09:26 +0000 Commit: Olivier Certner CommitDate: 2025-10-03 16:27:21 +0000 jemalloc: Fix activating debug on WITHOUT_MALLOC_PRODUCTION When stable/14 was branched, MALLOC_PRODUCTION wasn't moved from __DEFAULT_NO_OPTIONS to __DEFAULT_YES_OPTIONS but instead 'jemalloc_FreeBSD.h' was changed to stop defining JEMALLOC_DEBUG (and also, strangely, to start defining MALLOC_PRODUCTION always, although that does not have any effect in jemalloc's code). While this effectively turned off jemalloc debugging, it also prevents people from turning it on again. Additionally, leaving MALLOC_PRODUCTION in __DEFAULT_NO_OPTIONS would be confusing. Finally, this puts stable/14 in line with what was done for stable/15. This is a direct commit to stable/14. Reviewed by: markj Fixes: 29a16ce065db ("release: update stable/14 following branching from main") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52850 --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h | 2 +- share/mk/src.opts.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h index 493300157a70..7adb7f26b888 100644 --- a/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h +++ b/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h @@ -5,7 +5,7 @@ #undef JEMALLOC_OVERRIDE_VALLOC #ifndef MALLOC_PRODUCTION -#define MALLOC_PRODUCTION +#define JEMALLOC_DEBUG #endif #undef JEMALLOC_DSS diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index b3f635bc5a70..0bc3d64806c9 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -145,6 +145,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MALLOC_PRODUCTION \ MLX5TOOL \ NETCAT \ NETGRAPH \ @@ -213,7 +214,6 @@ __DEFAULT_NO_OPTIONS = \ LLVM_ASSERTIONS \ LLVM_BINUTILS \ LLVM_FULL_DEBUGINFO \ - MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ RPCBIND_WARMSTART_SUPPORT \ From nobody Fri Oct 3 16:53:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVm3HKRz6BBNl; Fri, 03 Oct 2025 16:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVm28yhz3H9s; Fri, 03 Oct 2025 16:53:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OrfPCY0Sz+9ozmgud3VwXXazR/MSWbC1W4Jz0DdE9s8=; b=PrUrB6ghhtqurZTfaBjp2ZAkxtsphYLPVrMkOMICaFhZtuu5prvWmAXQ5zsa4FgBvBZ9Lx aWkmI2fr4Pvzv9n9VnO19nrA8BV5EaTH/NfDcp21HM8HBexiH4R2s5k7Qy2Tpngx8LWsiL QuaLodkpbVDO3WZxVOownDGbJCMNVzr0MT+9pYxysJj7fbti+4I2OKZZebad5rvzirWLXk Vu9GMvpDfm/FQJ6RxxbJCkfAv7VL8wiPPnzfoPDbeNoSGhJQ8DN/QNSEkxs+U3zTV02Ods TM8TnSi/MvIloRX/gCqhQoj8yc4YZgagfsdlF/UrYyH7GJ1ImOqN6/kEGRwKXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OrfPCY0Sz+9ozmgud3VwXXazR/MSWbC1W4Jz0DdE9s8=; b=LkpqvFc78Wl1jA7c4syhaz6lT2qQfXmzurNPrrzMrjQGch0hjPl0ygjSCj/1fRkl2mbVmI VAkmkFbI87PcKwRGnZQOfh6J3KfiDIYbs5wx6o1jQi/yZcao76TkxhxjSRbgmNKwi0/btH QF6XQhsBfvA7aVBQppAvx+US9D2JlKlSjOQkyG2QCbSfpFieR6Nk+sph2vj8WxWwEdLj+b AVaJBnkjS5yP2Q1Jq+J9N/ssnX/yC7wT6pA5PinQce8b7SYmvTKlZ72xJc1udVjotVxGSB KiKO3SZi9Cdx0IWkr6/lGWgSxkC+v668f9J5w3CBwZHHOlWR3vd6+OhLuSeBfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510416; a=rsa-sha256; cv=none; b=KhIedvnOTWMhGyEp95a5WVHb+5Po1CBc++hKFMWsZpFomuHnolphnmwmGvf9ejQOYB+DLq QGFTvAOGCaJ9XNvJx358my1F+RCBMEcmleVRbylexZw6gBOlIXO+fX0c7QRKzlSurqPLug J2KYeyrQQVfYVi9s1L4+ygAv9S5cnr+Ar+vWgi0ll7QAUZye+bkQ/31vMpnamKKYKZQKtA p3Cxf7YMlX4DuEY/XQZIXSmlAXD/KC3590A4rA8Q/NxBwDqaQ/H9qYGJoqZawabgKeU35u u3QiPWGcfOUCg/bVdF2QcTuFRN8PARcDy+qlX06KoyQXip3UAHsd7eGNG2qofA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVm1Zv1z138j; Fri, 03 Oct 2025 16:53: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 593GraaN063977; Fri, 3 Oct 2025 16:53:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GraBM063974; Fri, 3 Oct 2025 16:53:36 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:36 GMT Message-Id: <202510031653.593GraBM063974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 4c04d125ed5a - stable/15 - Update vmimage.subr List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 4c04d125ed5adf00dc8125095efbe13d3b6c08b9 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=4c04d125ed5adf00dc8125095efbe13d3b6c08b9 commit 4c04d125ed5adf00dc8125095efbe13d3b6c08b9 Author: Unicorn9x AuthorDate: 2025-09-01 11:30:48 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:40:57 +0000 Update vmimage.subr This "noatime" tweak, reduced the OPNsense constant 50kb - 80kb disk writes that wear down the SSD / NVME. Signed-off-by: Unicorn9x Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1834 (cherry picked from commit 3ed0cdf7de79fc0f50f57e75cdb9ae178ab0e74c) --- release/tools/vmimage.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 20f90f01c0c7..9ee2e1d47a59 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -110,7 +110,7 @@ vm_install_base() { echo '# Custom /etc/fstab for FreeBSD VM images' \ > ${DESTDIR}/etc/fstab if [ "${VMFS}" != zfs ]; then - echo "/dev/${ROOTLABEL}/rootfs / ${VMFS} rw 1 1" \ + echo "/dev/${ROOTLABEL}/rootfs / ${VMFS} rw,noatime 1 1" \ >> ${DESTDIR}/etc/fstab fi if [ -z "${NOSWAP}" ]; then From nobody Fri Oct 3 16:53:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVn3qD8z6BBZn; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVn30R9z3Gqt; Fri, 03 Oct 2025 16:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bv2pzj28V0CZMxHva7FG/sQMypLi0pKX+mwGz29iFf0=; b=l6Cyydejczaq5N0aq6r/gHpqc0IWF1sUhdI/0DRLe99r1x6ssjrxVz3cxeCmVY6eCAG+Xk Ubc8C8iHrvh7/2Y+uXH+0SKmtCdaWwoagQHeWK9/HqlENp30bDk8Kz3NqEJMa3uA+/WC94 n2L7m4/Wm5Sp2RTrk9Xqmxp8v7KZb20L1nxRrMM2sHRG6BmJ60owPZTryDK+6icsaHd+CC 6W+aVVFGZiVOr0l4xQlCbB69NhUfgz4DR4HYoSWzyvrYVWFqorPS901ey4MoYQjBorwkhZ 0+ty5sR1kFIKh35KqZ9JhVwyD3C1AYc/XKSINsFEb7y4+9T5piIMNWhuW1rMpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bv2pzj28V0CZMxHva7FG/sQMypLi0pKX+mwGz29iFf0=; b=LMqLH4l9HJFd3hEho67knUZ4nJY2NuVXwgng1S6AJMALtGwWFih+3najrua28wpCUn1k/e rRzwSJ1JLJVwbfzEU9YrgTZrJIOu3olpsaA5fNKVkmIdCglAfxdw8LsCSOJibuK+eHDlhS zYh40sDXmPgh1+cq5Ub2X6YqbZxmZUWFJwq7a9Hji87yS6oxvN7RPmLnPHOkfuDfRlhNRm zfLhwfBT+/mI3axRypeBoNx6nwW/3M1srGFOMKIAsjcBVBUw24yGRpbti98Z4zDgg3tNyN 44LoaVnE7VAVO02AoRDhDWZW5F0ofq+124t4qhgKorzsVy9Z0rxWtIOlBRfy6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510417; a=rsa-sha256; cv=none; b=aVYOW88MCeUb5CBWMpRFPbaNIkUaE90djcbuwBs13vr55ZZ0XRegWFyP6z9MBAnq5+tO7g clgd6OGVlyaeKSBvGobC+DHrU2jroT2VfS8sCrp0/TMVL33JuNMVGwATN94PZcQ/wqynp3 F32TMkjbqeyopGQzXYLV00HiAtzIH5lZ8T8ZI4Q8l1kYLLUw3ZFKMGKgqtGlRQv1of7/Eb +i4ZKNQ6os2oV08Im1GKsWu0/BRZ9tPwPx3s+k8V2EpBzH70FmC8MU4/e3bVwjoKbdrOtG /JGTaC5mLfbjq93DdLmXRhUuazKuPqeQKpr0FG+1Gmwg15FtMXcYtBG6v8QgRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVn2TP1z138k; Fri, 03 Oct 2025 16:53:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 593Grbrq064017; Fri, 3 Oct 2025 16:53:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrbTI064014; Fri, 3 Oct 2025 16:53:37 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:37 GMT Message-Id: <202510031653.593GrbTI064014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: e9f564a47e93 - stable/15 - release: Made it possible to specify more attributes in metalog entries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: e9f564a47e93a1c6bf806c13d8d6612d5a252c21 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e9f564a47e93a1c6bf806c13d8d6612d5a252c21 commit e9f564a47e93a1c6bf806c13d8d6612d5a252c21 Author: Mark Johnston AuthorDate: 2025-09-11 13:05:13 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:41:57 +0000 release: Made it possible to specify more attributes in metalog entries Verify that the target file or directory exists, and add support for an optional mode. This is required to enable NO_ROOT builds of some cloudware image types. No functional change intended. Reviewed by: cperciva, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52449 (cherry picked from commit 6207325f3aac067fb16f0aa42012302014035ebf) --- release/tools/vmimage.subr | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 9ee2e1d47a59..dbec38485fec 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -39,8 +39,21 @@ cleanup() { } metalog_add_data() { + local file mode type + if [ -n "${NO_ROOT}" ]; then - echo "$1 type=file uname=root gname=wheel mode=0644" >> \ + file=$1 + if [ -f ${DESTDIR}/${file} ]; then + type=file + mode=${2:-0644} + elif [ -d ${DESTDIR}/${file} ]; then + type=dir + mode=${2:-0755} + else + echo "metalog_add_data: ${file} not found" >&2 + return 1 + fi + echo "${file} type=${type} uname=root gname=wheel mode=${mode}" >> \ ${DESTDIR}/METALOG fi } From nobody Fri Oct 3 16:53:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVp6WRqz6BBZr; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVp3nXtz3HB7; Fri, 03 Oct 2025 16:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IRcUv0fwI43CtWFALXQrztIkW8VBsye7F5jSZsPeScM=; b=L+BFmj2XnOnFEget3jGQ1rHJg/RT3Xx0LOHvVkPygNNKHt57HpheSUMRzXInlOzxAt4BzE +QyMJNlZYSlY/IseFYChkggVvXBHxa6V1JLCjNr/0QjByI+M/tYgPHOBabK2k0SpxD9kHE XKZxGEcopMiLXx9X8m99DzG+QSf6jq078FjLlLQI3SfalxWZdIDNMrjtLgSPFLuDR3VAYW 2Khnc8fZ+VeE2Y4T5q7at8HBjtxph4Nn2xBWmE6zdmRovZJAfArkgmzwf8Shmxf+0jbzmW ImJoGj6mDwq+84b4Pd6P9MeZFLfRBdF88IXrith4imKsbhx28FGbXj+imeJzTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IRcUv0fwI43CtWFALXQrztIkW8VBsye7F5jSZsPeScM=; b=ptSRFCdoSpaxkmV1smYBuVDFLRu7XR0+rkJofpbcoQO21VRW7HD9BN2U/SHqbuzbtzeH/+ S68GR1ybATsC/tAUXtEcuScyVJX91bMCLHgbja+9CqCQHa1DuzML4T8VJIIbhDtPQkNJyL wXBHnZjCYShRHQRuHq5nTYH9IDGqIw/wN0nJzn31PaFvZ92p7I0g/Ga2tXWuYUV0+9aaYq W7nC+mm+g1Bxgt/1eaYz4h8TO+bL8mGM7RgvVRLEtcfyKxjKjSrf3nqdPmbYbVrCSnIfVa 0Y20RDY0K07kgFLVQXNlfpxWpNu8cDx8ZuBVugLCriclzhrFOaStTx5RXjYvhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510418; a=rsa-sha256; cv=none; b=CfPk21eeBxiBZG08OUOY2NBSQdpeM5K9ayQLrcHQKTskVoun3J4fJBzZOPSDuPa3y7r9C8 nEn5NcElbC2ovZJUSk7ufrCEN9SJmxG7JpGXJICZAXjqOfPy5DN4Lgac/FesLIdgGlp3Uc d4ujxD2V67KzfCzcxv28LFwkEiaCnA9PPkdP2X3JtcB4fO3hbTVe5GlushKzPtDIC+lpzT p1duSRPouTEgzu6Uz9KtWtwkWmRLPtFt+36B4sA5r7gsnH3mc/KhgVwH200UdfOyAY61fc LoufXQpqZqDi2zgz60EZlKaROpEm0JgNLNZVTBt1HhSLHlEVV3vFPNi2bCUgmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVp3Lqgz13Nv; Fri, 03 Oct 2025 16:53: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 593Grc9P064053; Fri, 3 Oct 2025 16:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593Grcnn064051; Fri, 3 Oct 2025 16:53:38 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:38 GMT Message-Id: <202510031653.593Grcnn064051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: b9a0e12f6ea3 - stable/15 - release: Create /firstboot in common VM image creation code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: b9a0e12f6ea365d38d1813fa4643cd84293453f7 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b9a0e12f6ea365d38d1813fa4643cd84293453f7 commit b9a0e12f6ea365d38d1813fa4643cd84293453f7 Author: Mark Johnston AuthorDate: 2025-09-11 13:05:31 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:42:21 +0000 release: Create /firstboot in common VM image creation code Some services, such as growfs, only run upon the first boot of an image. The first boot is indicated by the presence of the file /firstboot, which is unlinked after boot. Individual cloudware types shouldn't be responsible for creating it. Do so in a centralized place. Aside from simplifying things, this ensures that we create a metalog entry for the firstboot file. Reviewed by: cperciva, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52450 (cherry picked from commit 1d6b6ea2d0e617d29681da3cf121abec309d272f) --- release/tools/azure.conf | 2 -- release/tools/basic-ci.conf | 2 -- release/tools/basic-cloudinit.conf | 2 -- release/tools/ec2.conf | 3 --- release/tools/gce.conf | 2 -- release/tools/openstack.conf | 1 - release/tools/oracle.conf | 2 -- release/tools/vmimage.subr | 11 +++++------ tests/ci/tools/ci.conf | 1 - 9 files changed, 5 insertions(+), 21 deletions(-) diff --git a/release/tools/azure.conf b/release/tools/azure.conf index dfb90f1cd4f6..7975e1db0822 100644 --- a/release/tools/azure.conf +++ b/release/tools/azure.conf @@ -58,7 +58,5 @@ mlx5en_load="YES" EOF metalog_add_data ./boot/loader.conf - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/basic-ci.conf b/release/tools/basic-ci.conf index 4bcb87aec791..e235c03d39fe 100644 --- a/release/tools/basic-ci.conf +++ b/release/tools/basic-ci.conf @@ -30,7 +30,5 @@ PermitEmptyPasswords yes UsePAM no EOF - touch_firstboot - return 0 } diff --git a/release/tools/basic-cloudinit.conf b/release/tools/basic-cloudinit.conf index 7088c0a5f72a..f8554c42f49c 100644 --- a/release/tools/basic-cloudinit.conf +++ b/release/tools/basic-cloudinit.conf @@ -34,7 +34,5 @@ PasswordAuthentication yes UsePAM no EOF - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index aecaabfcd277..335db6cca93a 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -136,9 +136,6 @@ EOF chmod 755 ${DESTDIR}/etc/autofs/special_efs metalog_add_data ./etc/autofs/special_efs 0755 - # The first time the AMI boots, run "first boot" scripts. - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/gce.conf b/release/tools/gce.conf index e1c208e69fe5..a7ccfc27a75c 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -113,8 +113,6 @@ EOF ## of the image prior to packaging for upload to GCE. #sed -E -i '' 's/^([^#].*[[:space:]])on/\1off/' ${DESTDIR}/etc/ttys - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/openstack.conf b/release/tools/openstack.conf index 05d2d13bbb39..b73734a4fd04 100644 --- a/release/tools/openstack.conf +++ b/release/tools/openstack.conf @@ -47,6 +47,5 @@ vm_extra_pre_umount() { echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf - touch ${DESTDIR}/firstboot return 0 } diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf index debc5c1352dd..ebda3b3d6e61 100644 --- a/release/tools/oracle.conf +++ b/release/tools/oracle.conf @@ -89,7 +89,5 @@ EOF sed -i '' -E -e 's/^pool.*iburst/server 169.254.169.254 iburst/' \ ${DESTDIR}/etc/ntp.conf - touch ${DESTDIR}/firstboot - return 0 } diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index dbec38485fec..577abaac73cf 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -185,7 +185,6 @@ vm_extra_enable_services() { ${DESTDIR}/etc/rc.conf # Expand the filesystem to fill the disk. echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf - touch ${DESTDIR}/firstboot fi return 0 @@ -396,6 +395,11 @@ vm_create_disk() { >> ${DESTDIR}/etc/fstab fi + # Add a marker file which indicates that this image has never + # been booted. Some services run only upon the first boot. + touch ${DESTDIR}/firstboot + metalog_add_data ./firstboot + echo "Building filesystem... Please wait." buildfs @@ -420,8 +424,3 @@ vm_extra_create_disk() { return 0 } - -touch_firstboot() { - touch ${DESTDIR}/firstboot - metalog_add_data ./firstboot -} diff --git a/tests/ci/tools/ci.conf b/tests/ci/tools/ci.conf index 1d2921ab75f3..2302fc479a47 100644 --- a/tests/ci/tools/ci.conf +++ b/tests/ci/tools/ci.conf @@ -119,7 +119,6 @@ fdesc /dev/fd fdescfs rw 0 0 EOF mkdir -p ${DESTDIR}/usr/local/etc/rc.d cp -p ${scriptdir}/../../tests/ci/tools/freebsdci ${DESTDIR}/usr/local/etc/rc.d/ - touch ${DESTDIR}/firstboot return 0 } From nobody Fri Oct 3 16:53:39 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVq6tcnz6BBXt; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVq4jCBz3Gt2; Fri, 03 Oct 2025 16:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myJ2NpVWKip5D/xkrXYQkISpL5FxR7m0xfMkOfKwhhE=; b=x85kWGbjkisjx0c88YhpXaLFmbwp1S8lMgvIaesJN6Y0ylvCEelhR9DDIhctTsxsWdjuAz mmXYkXaOwR5Ia4/tv3ok/4GaoOaBugehDVkPHg1sqPgk2uHghlmGARrVqz/ugUJSTmDxSj NR2NjsCwjM0c4Rs1xVcGr6WiDstVRj5kGNNXdS+RdwjlnPSK/sH3UrK17bLCIAcxWBdGub OPXUFYv/JI4syI2b2N/wHqJNaufU/eXHOYOmplUyyN/hXP9n6p3NzqFvTo9nzVG8I8B6p1 x+eRYUA+V6qYEsgwIeDLDsU5zr3aoEos2SIxs05TPDJFL1MKFhUUgm00ouwVnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=myJ2NpVWKip5D/xkrXYQkISpL5FxR7m0xfMkOfKwhhE=; b=QrMTYa57894beID/JXDV3wt9kytf3pNF7e3CW4VcPp/aTj4WeEy8KhbXdBiVd/k0CQQiJI zJ06sclTIz/ae/i6Mah/VcAD2q9B3BhlxvsPyfLDbUA65mLso2ZIfNAbcIu1w41/ALNMbx BA3UJNDGbr/mspQIvehXIMQgwHkXm+0zeSeU5zyV6qJ9RHyLTRb9LRvEx6Ow5vPNSo+t2U dq8yLoWJLjRXxwMfMKen0OBhD5OmwlozIuAFtcwGlbxp4dvW46HHJKs0BMqCFjdpteyE1w payKYjyS4tMZbpiEujEFFJZWXRerRcs4JGDrxIfMdg+ruEbYa4XPlWDcg0f6Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510419; a=rsa-sha256; cv=none; b=GoGoqMN05cog7S/tbj6bGLuWFizhE+6hZw3uTFEDmThqowb+VVP5j6qNa4O8YLkIz0edGD hDUATJIxSGEXKyBdA/A0yB5SzwfN/w9y/LHMSNH7iQQ5BuHr8E9CQtM3STVrBsH91AWjn7 8Ja7bL++1zSyCtveIxGshbDRAlRR38Ts+CG+Lm71wFg0Oa+disaETEfKOH2jknP3CezwsX jWy1ubIJsvzAeKq9ng2Ahou8llLYXlC+nhJ3U12Ygdx6GHFJOkQVI8J22Yk5IOkvioay2E wiO0kdr4jdqxO6iIa6WIo2EidofEDR33waohQKim4G5EjhrW7VtDAF5S27rudQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVq4Hfyz13bN; Fri, 03 Oct 2025 16:53: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 593Grddk064088; Fri, 3 Oct 2025 16:53:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrdU0064085; Fri, 3 Oct 2025 16:53:39 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:39 GMT Message-Id: <202510031653.593GrdU0064085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 822fd5606748 - stable/15 - pkgbase: set origin for each packages as base/FreeBSD-* List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 822fd56067489db1fa3f1d4ea375125f7abb23dd Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=822fd56067489db1fa3f1d4ea375125f7abb23dd commit 822fd56067489db1fa3f1d4ea375125f7abb23dd Author: Baptiste Daroussin AuthorDate: 2025-09-23 07:53:58 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:45:47 +0000 pkgbase: set origin for each packages as base/FreeBSD-* MFC After: 3 day Reviewed by: ivy Differential Revision: https://reviews.freebsd.org/D52689 (cherry picked from commit 23e69b54973fcb68d14986ec1600d9dfd0cb7af3) --- release/packages/template.ucl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release/packages/template.ucl b/release/packages/template.ucl index bf4b1b44bbec..1609a7213be0 100644 --- a/release/packages/template.ucl +++ b/release/packages/template.ucl @@ -8,8 +8,7 @@ name = "${PKG_NAME_PREFIX}-${PKGNAME}" # Base packages always install to /. prefix = "/" -# For base packages, origin is always "base". -origin = "base" +origin = "base/${PKG_NAME_PREFIX}-${PKGNAME}" categories = [ base ] # $VERSION is the version of the base system being built. From nobody Fri Oct 3 16:53:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVs0S8gz6BBmC; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVr5Bvpz3HGL; Fri, 03 Oct 2025 16:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kN7ixnr64ll33kdV4kgtB983NJo6Yr3MEEOr3yR2E5Q=; b=nOCwqyae+er1T5qgDNbNuF0DmZvCjhtyBaifOJ8hGzmIv14M6VamqxHswmDKeBmhMzWv31 TuUpBMSagUwq4TEmz6KyeYyv/AxOhH0E5yw428yidVLJRt+PP1zL7lk3aLlCAgzXw80xUg KkC+qw+WCDx4d6uPtOxvKD/Cn7mjOPmAIm4eYyr3QQg6VtpM+luLqLMJb7AdknV9NckTfb xYynAJ3awGXHg0t0Ebq4d/g0u657QpUktdXYtnCt+A3Dy8I3MdNEg/V2F6V8opJd6rUNK3 Ow7YzKNawgaO+GJ1DCa835u0lXYYeisKWTKH1V2AkVVuIrVhUTHsmZ7f2kU3iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kN7ixnr64ll33kdV4kgtB983NJo6Yr3MEEOr3yR2E5Q=; b=ozZWCyKavFadNTFSOjOMzoBS+kZvHGNfpxxusxX82F280vQVMGCEhIPK95VWfgcWsrCBZy Gm84PVSeBb1t7O6s9H6NpufgVV0M08P58hQxeveaPXBc4LL+4jpbtG72mlo5zXuTATTlh6 riW6WjTQXXwEQvKEc/fc/956/vsATR3Wtpiia14AOoaVq9HstEEFldOThe3hvAK2SbHJej 5cweaRK1GI13IhpiY9YnGe3QATUR3+TVklBYhInSKor892zE/dvKPb5EbkTdbkk+JzUUts 0guyMnABoIXrrqbl/qbIVrwEm56LwG+0P4IZ6XECnJajhf3D/Ou4iuGktE+ckg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510420; a=rsa-sha256; cv=none; b=IFH4KfszX55yyArZuKNKLnHLcP3mEJy5RW6UNa+2ZHjrCruQtxVqKywZtAv+ds5SwSUxfL jVa3o1hWFjmzBR7pD/vh80XAkBEqMgdGU8/wfDYTVaxhclMYf9e3YSgHls16tCEzdFmayl +6OqK90HrG8rVwF6h7v7hcBUkE0OCyVLlOBgdIzRYikjX7P8fVdpLIBGj2/wOIDoC59H+6 UXssMPYDSRQYS3Rf/Ywx2UMA48UOGSyubpzhluoa9YZRz7Scq6Y/p99ZqWemcNxHnUV+3N CCg90p6PBlgUIc37Bv4FMLYc22Xp8BVN8m6iZyfRBzdB+Eg0yDoqES5RQOIS9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVr4phWz13Nw; Fri, 03 Oct 2025 16:53: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 593Grevb064123; Fri, 3 Oct 2025 16:53:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GreKi064119; Fri, 3 Oct 2025 16:53:40 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:40 GMT Message-Id: <202510031653.593GreKi064119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 67c560b1843b - stable/15 - release.sh: Pass through NO_ROOT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 67c560b1843b669ac0b574745ddf0661b778bd0b Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=67c560b1843b669ac0b574745ddf0661b778bd0b commit 67c560b1843b669ac0b574745ddf0661b778bd0b Author: Colin Percival AuthorDate: 2025-09-24 00:32:27 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:46:01 +0000 release.sh: Pass through NO_ROOT To be specific, set NO_ROOT=1 WITHOUT_QEMU=1 (those options go together and it is an error to specify one without the other) if NO_ROOT is defined in release.conf. MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 723445fdeee741750a9a3fbd116b540bf605d93a) --- release/release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release/release.sh b/release/release.sh index 0815c7c78d14..f0226e4cd3c5 100755 --- a/release/release.sh +++ b/release/release.sh @@ -200,6 +200,9 @@ env_check() { WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ WITH_CLOUDWARE=${WITH_CLOUDWARE} WITH_OCIIMAGES=${WITH_OCIIMAGES} \ XZ_THREADS=${XZ_THREADS} NOPKGBASE=${NOPKGBASE}" + if [ -n "${NO_ROOT}" ]; then + RELEASE_RMAKEFLAGS="${RELEASE_RMAKEFLAGS} NO_ROOT=1 WITHOUT_QEMU=1" + fi return 0 } # env_check() From nobody Fri Oct 3 16:53:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVt0fldz6BBdR; Fri, 03 Oct 2025 16:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVs5lPLz3HRV; Fri, 03 Oct 2025 16:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tAnk7JMBEBhTBFcwQLWL3+bSoHUmP6hAjXdLqKf3pRE=; b=CAklRNwmkO6E4YL8TxkzmuXi1Ec1ULREPmo14gg1EuW8LVEUn1LYBENN0gno2AIkU+X83C XPhZ+QKgE9o2+VaStPEAEHHc4i5jpTa+4URloabbtzD9DZzY4ihxdkC7+AefhtKSHcuw8Y y4mK7qsGS+EWUpNpfAakG+Qh+1eQ1qZ0nW22BE4tnIO/TjOKZJN0tqEoC0KBQZ7TY+FiOK iQu9JVlicEC5HGnTo676DElPbXaxjiDtNkOtrX4pc6aaO5+PJbj7abbb0LZyx6RsqPr/+r 5L/xeJUF8vk3nxYFFwWOY1hIiMw7ZUDp6mRlpCexF5vpIc/GtYmpvglS34KJ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tAnk7JMBEBhTBFcwQLWL3+bSoHUmP6hAjXdLqKf3pRE=; b=ChaP84G6dgA51oDH6AyzRaKCcGtMfEpeWmzoGcupgcPKBaT0kQT8Mm1zPtO4wlrpcZ5+e2 wBBlenaU+ee0XEQeX9moymATSFX5Sgj0D6ZuWaeIj0aEfYJv0ldAGung7ZliW0ZaqS6INH 2Y6lKB1v74YMaHpPu8fWGRSztkr8zUK4oieGg+wcFzikBWLjOLr4qVGBM3cUDE8uoLlwTq org43kozsILM1QiaDkd7nnzMKpcIbjwc3K2P2LStwGEJF966AtWLfX5QqW5sDnW44QFlJ5 eCHuo6tIsHm6F2FMzVe5HcP3wzuX5CdipvaI+yDE2pyYndjfoUhpkXdp2vZ+kA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510421; a=rsa-sha256; cv=none; b=j2pIiaE4pk0IOgDsAyqNLJLPoZ/vSTsIgmU6h48uD5/+tWQJdHQ4bB+bcz/d/L4JCEYNQS aiF82Z8hV7beSaFISt0wvkbP4/BDdRgVxp+GNXYMnwbRtFw5r7XA5aSM3m+LmESCO9Ro/5 6TmhdMh2gvZ/iugjHeYR/jbUReWHZBdt2kZ9nc6sKAPSUk7z+VgeEfeCuiYznOGnip7UP9 RHe0S2r/cVD+q/0BSyjkUuK4L/GqAYZQEKFxWQY3OYZtf/PmS6j00xuWTRpJt0FlQ8AgWj EtGZitGbkJOzDMmjrByBo9AjNXHnWgRMbZBDwyVIKUrGJHiYydeB0DpqWOfqww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVs5Jjlz13Nx; Fri, 03 Oct 2025 16:53: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 593Grfdt064160; Fri, 3 Oct 2025 16:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrfEh064157; Fri, 3 Oct 2025 16:53:41 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:41 GMT Message-Id: <202510031653.593GrfEh064157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: a9c551dc5c93 - stable/15 - release: Build all cloudware regardless of noroot List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: a9c551dc5c933cd06d42f19d5414d3a0a35c89db Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=a9c551dc5c933cd06d42f19d5414d3a0a35c89db commit a9c551dc5c933cd06d42f19d5414d3a0a35c89db Author: Colin Percival AuthorDate: 2025-09-24 12:42:11 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:46:08 +0000 release: Build all cloudware regardless of noroot There are still some minor breakage with NO_ROOT (aka WITHOUT_QEMU) builds but turning all the cloudware on unconditionally will allow for more testing of the build process concurrently with the final bug fixes landing. Discussed with: markj MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 86114bae092bd023165e5b9df244fc0849172429) --- release/Makefile.vm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 7b1591e5390c..eafd1d6abf71 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -19,10 +19,6 @@ VMDK_DESC= VMWare, VirtualBox disk image QCOW2_DESC= Qemu, KVM disk image RAW_DESC= Unformatted raw disk image -.if defined(WITHOUT_QEMU) -CLOUDWARE_TYPES?= \ - BASIC-CI -.else CLOUDWARE_TYPES?= AZURE \ BASIC-CI \ BASIC-CLOUDINIT \ @@ -30,7 +26,6 @@ CLOUDWARE_TYPES?= AZURE \ GCE \ ORACLE \ VAGRANT -.endif AZURE_FORMAT= vhdf AZURE_FSLIST?= ufs zfs AZURE_DESC= Microsoft Azure platform image From nobody Fri Oct 3 16:53:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVw1bP6z6BBmM; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVv6w9Fz3HJS; Fri, 03 Oct 2025 16:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eflY8lZICV7/Z/4H39oO3dT+V8IrnaWgne4pRh+1yzk=; b=HlCvyIf8bBw1zVhkPfLyBeiaIeuJeYLiOeO5dgSloRTIlsWMi5RoQ5gTLO3CCVnQyZpAm1 iZa7u6r9Nmi4RYmQLCIv5acgHqQUerjzeY2MhBlXjo1BGNvCoiVlnulJQ+l9/lzCT0n04Q ENzEMVaU4ZMvvItUiP7bDV6WwDH4rTz4gTyX4BKViy7nk13Tt2iULeJQ34RbQpH+BIo3Hb QxAm/iTQlCa+WFPnBmVNMCuhdXCisPBykAjHik8syMz5R9qSVsWma7sbmSJYSL7emvRRI1 2a+O4qDjDiBFePWOtTdSTazEGaQvf69W5GqxHVzjarG33S1tOm7qrQBMvYcP8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eflY8lZICV7/Z/4H39oO3dT+V8IrnaWgne4pRh+1yzk=; b=WGOGjVQTbcmsMx1EKpSvdoMxq6xZ2xdFDrKAdZ2838DvBXIuvZMNngYMlu+U2M3p3Dx14z RPEa9NmQh7DxhohYMvB6HH5TXMqtuvIcXKfIkm0hu/I54B+PEHDzGJdLCVr9/3hQzvbIO5 jHC7a1rEcjBPNje8mLtRcqApKDt5ZLMTywrKUZRBGQk/LYrFOhww+z88sBYruyZeU6BUGQ tZJpeOExYY3nY6t5x2DLsJCF6vuWRCQwdNlh7c2kncsTOL7dAOMkDQX85P+1YCzgicKeU5 tZD/mPa5MWrbjY6wjCZbCP0SXco9tz+9VYdEpE73GkAx/bcsikkoo4pevHWlqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510424; a=rsa-sha256; cv=none; b=PGoR3B05dAe6+74DYFlUjAokvCatSJeYJspdQoJ0Bdccce/b5zehfKBo8LmXEFNwLrF7W2 hJZckH1HWnHjnDNfF7reeOJc77pOWR1WaH4vbKTZrHbS/z+EPPG/uwgicsID27ZPB7ERw9 JMIISg18c0ju6SBItdbqdeBbgln6anziYD8QexXfzsw63um0icXVa8hq7ACcJ19o/afo25 nSVgay1tF1UJrWzeBEN0Y6SGLpZcrpAfvpvwo0SEMPFpXHexmI7Nx83nzR6+izYaek9Gob vGga4RWTege9Df4vqH4JlEUp2yGPVptHvKa3/0DfYmKILd/qn0T+PmEbOj/dpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVv6WyVz135N; Fri, 03 Oct 2025 16:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 593GrhkN064233; Fri, 3 Oct 2025 16:53:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrhNa064230; Fri, 3 Oct 2025 16:53:43 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:43 GMT Message-Id: <202510031653.593GrhNa064230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 085b0eb3ebf1 - stable/15 - packages: Add a sound package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 085b0eb3ebf13e65facbf77fd3b1f90f19a570b9 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=085b0eb3ebf13e65facbf77fd3b1f90f19a570b9 commit 085b0eb3ebf13e65facbf77fd3b1f90f19a570b9 Author: Lexi Winter AuthorDate: 2025-10-02 01:16:11 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:05 +0000 packages: Add a sound package Put virtual_oss, /etc/devd/snd.conf and the other audio-related tools into a new "sound" package. Don't create a separate -lib package, since it's unlikely someone will want mixer(3) without mixer(8). Put the sound package in the optional set rather than minimal, since it's not actually required for audio hardware support, and many systems (including nearly all servers) won't want it installed. MFC after: 3 seconds Reviewed by: christos Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52823 (cherry picked from commit 1b806e607f52285f973fb1106491668fd28da6a4) --- UPDATING | 6 ++++++ lib/libmixer/Makefile | 2 ++ lib/libsamplerate/Makefile | 2 ++ libexec/rc/rc.d/Makefile | 4 +++- release/packages/ucl/sound-all.ucl | 42 ++++++++++++++++++++++++++++++++++++++ sbin/devd/Makefile | 7 ++++++- usr.bin/beep/Makefile | 2 ++ usr.bin/mididump/Makefile | 2 ++ usr.sbin/mixer/Makefile | 2 ++ usr.sbin/sndctl/Makefile | 2 ++ usr.sbin/virtual_oss/Makefile.inc | 2 ++ 11 files changed, 71 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index 6ee866092f47..6e893f07df61 100644 --- a/UPDATING +++ b/UPDATING @@ -17,6 +17,12 @@ and/or ports. can install the ftp/freebsd-ftpd port. pkgbase users should remove the orphaned FreeBSD-ftpd package. +20251002: + Audio-related utilities including mixer(8) and virtual_oss(8) have + moved to the new FreeBSD-sound package. If you have set-optional or + set-base installed this package will be installed automatically, + otherwise you should install it manually if you need these utilities. + 20250929: Both drm-kmod and nividia-drm ports had to be updated to either no longer conflict on LinuxKPI vs. native PCI changes and/or to keep diff --git a/lib/libmixer/Makefile b/lib/libmixer/Makefile index a0bb37a85fb8..49621ad1f188 100644 --- a/lib/libmixer/Makefile +++ b/lib/libmixer/Makefile @@ -1,3 +1,5 @@ +PACKAGE= sound + LIB= mixer SRCS= ${LIB}.c INCS= ${LIB}.h diff --git a/lib/libsamplerate/Makefile b/lib/libsamplerate/Makefile index 256f2087284f..c094cbb791d2 100644 --- a/lib/libsamplerate/Makefile +++ b/lib/libsamplerate/Makefile @@ -1,5 +1,7 @@ .PATH: ${SRCTOP}/contrib/libsamplerate +PACKAGE= sound + LIB= samplerate INTERNALLIB= diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index a116ba751fde..7ac2f382b989 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -213,7 +213,9 @@ CCDPACKAGE= ccdconfig .endif .if ${MK_CUSE} != "no" -CONFS+= virtual_oss +CONFGROUPS+= VOSS +VOSS= virtual_oss +VOSSPACKAGE= sound .endif .if ${MK_KERBEROS_SUPPORT} != "no" diff --git a/release/packages/ucl/sound-all.ucl b/release/packages/ucl/sound-all.ucl new file mode 100644 index 000000000000..6a8ad098c6b1 --- /dev/null +++ b/release/packages/ucl/sound-all.ucl @@ -0,0 +1,42 @@ +/* + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2025 Lexi Winter + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +comment = "Audio utilities" + +desc = < +PACKAGE= sound + PROG= mididump SRCS= ${PROG}.c MAN= ${PROG}.1 diff --git a/usr.sbin/mixer/Makefile b/usr.sbin/mixer/Makefile index 9e96c2f2d2e8..6c75e65d2a9b 100644 --- a/usr.sbin/mixer/Makefile +++ b/usr.sbin/mixer/Makefile @@ -1,5 +1,7 @@ .include +PACKAGE= sound + PROG= mixer SRCS= ${PROG}.c MAN= ${PROG}.8 diff --git a/usr.sbin/sndctl/Makefile b/usr.sbin/sndctl/Makefile index c1830413f931..d6697bb88fd5 100644 --- a/usr.sbin/sndctl/Makefile +++ b/usr.sbin/sndctl/Makefile @@ -1,5 +1,7 @@ .include +PACKAGE= sound + PROG= sndctl SRCS= ${PROG}.c MAN= ${PROG}.8 diff --git a/usr.sbin/virtual_oss/Makefile.inc b/usr.sbin/virtual_oss/Makefile.inc index 01b5f23410c8..d2b0d74fa8c4 100644 --- a/usr.sbin/virtual_oss/Makefile.inc +++ b/usr.sbin/virtual_oss/Makefile.inc @@ -1 +1,3 @@ +PACKAGE?= sound + .include "../Makefile.inc" From nobody Fri Oct 3 16:53:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVv36D0z6BBNy; Fri, 03 Oct 2025 16:53:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVt6fjJz3HJL; Fri, 03 Oct 2025 16:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Ra970qE8kXtVT56OxoAedItN5SqevC/0xEYcq+O/S4=; b=xPsK1PjT30jZHVbDZxLRFePbr0oNWTMeSHL6DbPJ6jExYsVs7v2D1FytV7BMPHLKfwAkVA TMuSP3YfCpKbmKEadS9cl3S924MGbWnxRZZSUd9+T+hwbSpSnN/TCf2kcTt1W8XBQj3Dwg taniZzGP0iRtrCrJGM9ZfWavPTYKGxChfoER4xI36uz2pxvQi0stgD2bhTRh1jsGUYJ5FS z7YhvQG8aWGmtKu3ZpzvxB2NsrOqttJUWR6Mxwm1iEyxBfsepVMozy1D8I3/gtmrdhSqmM vPG8fOZ8UYYoyuTWVFxxjJca4xyOjVy2Dojbax/8VTSW7V2SIgMZdHBcVbDO8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7Ra970qE8kXtVT56OxoAedItN5SqevC/0xEYcq+O/S4=; b=dSmA02l3fn3bAEX0pqchAoS+2Nf0WWhGxWDBUtUCeHSEbpBFeSbAVukD8G9GaAsE35Y0u9 UKLOjH8IsG7CNR0RFrxXr0jSFNJBOpJXFmNGr09ZfbTsxNubACHGWOiYoXpy4vIZYxF/nS OwqJQWwuayUkjnt3JS+SdnLumsjbfEgUWNOKkUkVGSzy0KM+MjCmBpJlhdBG/X5LvdrqaG f+hW6ipPdrb/ehm5I6nvKCaVBEDjDnJzdPC1tWaeVQ/u57+CidkXFTaylLTZRav64mtvtB FtGUkyMy2qdW0LW68X1lOlJfbfuTjdEFzgpUdez0j7UnGJYWLu/a9LEgn04+sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510422; a=rsa-sha256; cv=none; b=GGOYCwklnLll7VgtiUGNSIl7YoWCPejIgCyqjBDyqGkg+tu9yfV/Svflz8XSOHx8YqLoZo WuxNpBj+SDtdv/dZYwrCe5IA4Zv8PutBGnkfPkGlCikkU4r4o8oESESDSCRULvpEIueQ5H NxD0Q6zVKf5iDNcD7+2nCxmG2rFS9loqIVZ3J1zgIone66VpnjVUDGaNjj1AgP+N1zSl4q ZtilgS7vKpy4rOy3gxppqwsDBpxsepZ3n/6OaIeFOtkbojwD3Ur24Dlqlb7gPRT0+9sWId ud7pcLOJYKy4HijEOXczQ7B1OB4TxCX/rEDl1bFB7xUBFK8WHvbRqwOL7emC3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVt6BGWz13Ny; Fri, 03 Oct 2025 16:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 593Grgxk064193; Fri, 3 Oct 2025 16:53:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrgoE064190; Fri, 3 Oct 2025 16:53:42 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:42 GMT Message-Id: <202510031653.593GrgoE064190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 6e93fa6a6cca - stable/15 - release: create pkgbase repo config from Makefile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 6e93fa6a6cca88e1d5beb58766991d7f2b223827 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=6e93fa6a6cca88e1d5beb58766991d7f2b223827 commit 6e93fa6a6cca88e1d5beb58766991d7f2b223827 Author: Isaac Freund AuthorDate: 2025-07-24 08:43:33 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:49:34 +0000 release: create pkgbase repo config from Makefile This will allow the VM image build scripts to use the same repository config file for installing base system packages at build time. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D51482 (cherry picked from commit f4f0308440d2321fa9172dab1029f16a70289e4e) --- release/Makefile | 22 +++++++++++++++------- release/scripts/pkgbase-stage.lua | 18 ++++-------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/release/Makefile b/release/Makefile index 6aec279cf161..27a5d58c828d 100644 --- a/release/Makefile +++ b/release/Makefile @@ -134,7 +134,7 @@ CLEANFILES+= ${I}.xz .if defined(WITH_DVD) && !empty(WITH_DVD) CLEANFILES+= pkg-stage .endif -CLEANDIRS= dist pkgdb-dvd pkgdb-disc1 pkgbase-repo pkgbase-repo-conf ftp disc1 disc1-disc1 disc1-memstick bootonly bootonly-bootonly bootonly-memstick dvd +CLEANDIRS= dist pkgdb-dvd pkgdb-disc1 pkgbase-repo pkgbase-repo-dir ftp disc1 disc1-disc1 disc1-memstick bootonly bootonly-bootonly bootonly-memstick dvd beforeclean: chflags -R noschg . .include @@ -195,8 +195,10 @@ dvd: packagesystem .endif .if !defined(NOPKGBASE) || empty(NOPKGBASE) -PKGBASE_REPO= pkgbase-repo -PKG_ABI= $$(${PKG_CMD} -o ABI_FILE=${.TARGET}/usr/bin/uname config ABI) +PKGBASE_REPO_DIR= pkgbase-repo-dir +WSTAGEDIR!= ${IMAKE} -f Makefile.inc1 -C ${WORLDDIR} -V WSTAGEDIR +PKG_ABI_FILE= ${WSTAGEDIR}/usr/bin/uname +PKG_ABI= $$(${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI) .endif pkgbase-repo: @@ -205,7 +207,13 @@ pkgbase-repo: ( ${IMAKE} -C ${WORLDDIR} packages REPODIR=${.OBJDIR}/pkgbase-repo \ INCLUDE_PKG_IN_PKGBASE_REPO=YES BOOTSTRAP_PKG_FROM_PORTS=YES ) -disc1: ${PKGBASE_REPO} +pkgbase-repo-dir: pkgbase-repo + mkdir -p pkgbase-repo-dir + printf "FreeBSD-base: { url: "file://%s", enabled: yes }" \ + ${.OBJDIR}/pkgbase-repo/${PKG_ABI}/latest \ + > pkgbase-repo-dir/FreeBSD-base.conf + +disc1: ${PKGBASE_REPO_DIR} # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -219,7 +227,7 @@ disc1: ${PKGBASE_REPO} # Create offline pkgbase repo on release media mkdir -p ${.TARGET}/usr/freebsd-packages/repos/ ${.CURDIR}/scripts/pkgbase-stage.lua disc \ - ${.OBJDIR}/pkgbase-repo/${PKG_ABI}/latest \ + ${.OBJDIR}/pkgbase-repo-dir \ ${.TARGET}/usr/freebsd-packages/offline \ "${_ALL_libcompats}" ${PKG_ABI} ${.OBJDIR}/pkgdb-disc1 cp ${.CURDIR}/scripts/FreeBSD-base-offline.conf \ @@ -307,7 +315,7 @@ bootonly: echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG -dvd: ${PKGBASE_REPO} +dvd: ${PKGBASE_REPO_DIR} # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -317,7 +325,7 @@ dvd: ${PKGBASE_REPO} # Create offline pkgbase repo on release media mkdir -p ${.TARGET}/usr/freebsd-packages/repos/ ${.CURDIR}/scripts/pkgbase-stage.lua dvd \ - ${.OBJDIR}/pkgbase-repo/${PKG_ABI}/latest \ + ${.OBJDIR}/pkgbase-repo-dir \ ${.TARGET}/usr/freebsd-packages/offline \ "${_ALL_libcompats}" ${PKG_ABI} ${.OBJDIR}/pkgdb-dvd cp ${.CURDIR}/scripts/FreeBSD-base-offline.conf \ diff --git a/release/scripts/pkgbase-stage.lua b/release/scripts/pkgbase-stage.lua index 56cb2dc758ec..efc4f8af0cbf 100755 --- a/release/scripts/pkgbase-stage.lua +++ b/release/scripts/pkgbase-stage.lua @@ -81,30 +81,20 @@ local function main() -- Determines package subset selected local media = assert(arg[1]) assert(media == "disc" or media == "dvd") - -- Local repository to fetch from - local source = assert(arg[2]) + -- Directory containing FreeBSD-base repository config + local repo_dir = assert(arg[2]) -- Directory to create new repository local target = assert(arg[3]) - -- =hitespace separated list of all libcompat names (e.g. "32") + -- Whitespace separated list of all libcompat names (e.g. "32") local all_libcompats = assert(arg[4]) -- ABI of repository local ABI = assert(arg[5]) -- pkgdb to use local PKGDB = assert(arg[6]) - assert(os.execute("mkdir -p pkgbase-repo-conf")) - local f = assert(io.open("pkgbase-repo-conf/FreeBSD-base.conf", "w")) - assert(f:write(string.format([[ - FreeBSD-base: { - url: "file://%s", - enabled: yes - } - ]], source))) - assert(f:close()) - local pkg = "pkg -o ASSUME_ALWAYS_YES=yes -o IGNORE_OSVERSION=yes " .. "-o ABI=" .. ABI .. " " .. - "-o INSTALL_AS_USER=1 -o PKG_DBDIR=" .. PKGDB .. " -R ./pkgbase-repo-conf " + "-o INSTALL_AS_USER=1 -o PKG_DBDIR=" .. PKGDB .. " -R " .. repo_dir .. " " assert(os.execute(pkg .. "update")) From nobody Fri Oct 3 16:53:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVx5WBHz6BBmQ; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVx102pz3HdC; Fri, 03 Oct 2025 16:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzdGX3dL1seM3J75gm+3enU2btF2k5sIvLFRpzVCBqk=; b=bvLUs0PW7pZuzmq+H3r22KuVD78Wl24+b67gCd2Ww4vpWmraG51aQHDN01s1i2JCKChEHL L8tNZrc25B6Iu2Klf7ObOZ1rRW9q5ZypAnSr8qi95it/Oj7DR4dbeJvQofOwxXAJcFucbg 3yjZyGfVv9+1iMTRVE+Z7+e2Aa7zxYvMju/ABUVuyJ4IuOXTuRw9TVqmF6HIpH+/UAtPLg cJGwqVKlf6N2FOZ+/1SOEZltSndE6ekx79DXK09F3WSpqKbBxhb1AK0YjKeK7gQEAJRW+C cYKxI2vvZCwV/HNVaa8TJmSlC42LfkupyrONmkqdm0poUZoYkHbOPQT0ceKdeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzdGX3dL1seM3J75gm+3enU2btF2k5sIvLFRpzVCBqk=; b=wHmIFXT4lvpt25RXhnKg10ZSzikDrHDSRZLkSuoCH16jssPWxZ3B0LvQe0EM2XJW1tXYJ7 vZYSdYVDLbz2Mod6QlIGGUWBgvWOIiqPEQgqTKHAdiYhpmtNWTwmLDL7SsfIPmcQ/A8xF8 WZWR/0AzIZtp0HMXof2HSZWpUAa3OHdv1XFTNhiy93xpdAaFdEj/e8knPIZ35JDifNzKop 0JZjJJGoK+PFkaNe1wszF5S3qqCvi58EU4XrlniNe72Dnum1/Y+gucpJv1icK5XsMIp0YK u/5FMjDNdGKw2Kjh+AL3cFbTPSNkFr8SamszZ0ATyMHU1WtAI2XDKikBiuidmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510425; a=rsa-sha256; cv=none; b=cYRKl/lBfIglEjyEbB/WcHcZhLEgf1TmOHIDNTN0lEIwImFIW9RkMTIaUlVYHrD88MSRTW KhIuqNCAn/chW3cjSke+Yp0GVu9PRhSbrEkAwZQcZEmBxRpB5PH0TTkQz5ygGIdJPSwF5f Ipf4zoKETZUc28kPKJitZSXeL0Cjl1hnp4QrHKOQ9S47EQYllbu3/aX8H0v+2uy2UB3VPe bmpWr7Mlpstq5Z/wkr23JIrJtygn8e1lWSjSHiLR4KCKBD+hqJFc3L8/LK+W1Hk2ftwLFw ECUM8tCl/LT5Iap8WMg8gyrZwbQFudHositVoAMUwNi8W9M+I3VGLNrWUecYEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVx0TJJz138l; Fri, 03 Oct 2025 16:53: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 593GriSm064267; Fri, 3 Oct 2025 16:53:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593Gri8E064264; Fri, 3 Oct 2025 16:53:44 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:44 GMT Message-Id: <202510031653.593Gri8E064264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 779b8a20e4d0 - stable/15 - release: Install pkg(8) from the release repo on bootonly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 779b8a20e4d039433b5115773f664c6d56b1adf1 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=779b8a20e4d039433b5115773f664c6d56b1adf1 commit 779b8a20e4d039433b5115773f664c6d56b1adf1 Author: Lexi Winter AuthorDate: 2025-10-02 11:45:09 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:11 +0000 release: Install pkg(8) from the release repo on bootonly Although bootonly doesn't contain an offline package repository, we still want pkg installed so the user can use it to repair an existing system. Installing it from the release repository ensures it's always available without depending on pkg.freebsd.org. While here, fix a typo in PKGBASE_REPO_ARGS. MFC after: 3 seconds Reviewed by: cperciva Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52848 (cherry picked from commit 3b9d89e1c90fd3b2667c07d5a0bfd300bf635bb3) --- release/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/release/Makefile b/release/Makefile index 27a5d58c828d..169dc947c692 100644 --- a/release/Makefile +++ b/release/Makefile @@ -82,7 +82,7 @@ PKG_ENV+= ASSUME_ALWAYS_YES=yes PKG_ARGS+= -o METALOG=METALOG PKG_ARGS+= -r ${.TARGET} PKG_REPO_ARGS= -o REPOS_DIR=${.CURDIR}/pkg_repos -PKGBASE_REPO_ARGS=-o REPOS_DIR=${.OBJDIR}/pkgbase-repo-conf +PKGBASE_REPO_ARGS=-o REPOS_DIR=${.OBJDIR}/pkgbase-repo-dir # Pass -f to make sure pkg writes to the METALOG even if the package # is already installed from a previous build PKG_INSTALL= env ${PKG_ENV} ${PKG_CMD} ${PKG_ARGS} ${PKG_REPO_ARGS} install -f @@ -277,7 +277,7 @@ disc1: ${PKGBASE_REPO_DIR} echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG touch ${.TARGET} -bootonly: +bootonly: ${PKGBASE_REPO_DIR} # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -296,7 +296,12 @@ bootonly: echo "./usr/freebsd-dist/MANIFEST type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG .endif .if ${.MAKE.OS} == "FreeBSD" && (!defined(NOPKG) || empty(NOPKG)) - ${PKG_INSTALL} pkg || true +.if !defined(NOPKGBASE) || empty(NOPKGBASE) + ${PKGBASE_INSTALL} pkg + ${PKGBASE_CLEAN} +.else + ${PKG_INSTALL} pkg +.endif ${PKG_INSTALL} wifi-firmware-iwlwifi-kmod wifi-firmware-rtw88-kmod || true ${PKG_CLEAN} || true .endif From nobody Fri Oct 3 16:53:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVy62Hpz6BBq1; Fri, 03 Oct 2025 16: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVy1XHbz3HYK; Fri, 03 Oct 2025 16: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=1759510426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jr9JrJLItLb0fzX/VNxgpMHUgXlU1BmM9ooCNB31Ymk=; b=PfXZMsJ14saNzmt/csJhqk7D6wFHT+nYLQVBdzzsh30vEjfPnwtES2YszHOLvL42eh1gsl ae4p8QhCOtqClBYsZ8AWR92/Rdi6kipF7BeQA4RE/w9HY7NzH11SbsMOxi0hfbhTj10qNI VOerit+3d4sFe1LLy1kKVeGF5F0XclRcaLRrsXQxcd/XT41B0hujiMcwbT14hegAd2gBgy w606EW14xRWkluIOYiKEfp/bYWwpjmFn1JFchKh0ULoeGgUEh9fEBW4aJmvPnmauANuZ8T 8To/j+0rX1GYDae2Us2pzmC8+sxe4ha/yeuMMNi1JAJ21IAR6eu/yXu1fFMalA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jr9JrJLItLb0fzX/VNxgpMHUgXlU1BmM9ooCNB31Ymk=; b=sMqmk88QUE9/mtftwr66bo8Dd0EZUlG357f/cAyDA5qldruvh5KrhE5K51qdWbtHNeY0df rXICkdZ6kqSdVfqBE4y4lrL7ZxWflHRVYetZRXw1hpEOUDbZ394Gw4pnOhaXZIRi463HJa NWzFbhiT9tnlJRA5v4iu1J8bRreTbz+KSL+J4/o2gmM+9Pp8B39bnz+b5JbCPE6q+xfQ5Q 72r/4ZTQ6jb4K2ETpQwS8WTvubyLz8K0ZdZAPVhJDRGg/13MBIDtvSAvlU6MG5YTXOHYSt rUjlV0XMYyRefr0mOEH9m1geziJPSzpGPSy/AvJnPktinyDtRdVWSeepYJMmKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510426; a=rsa-sha256; cv=none; b=G9ypoaVfIKfczifEPCQuUnUTneDufuY2b8WcdiB5XivK6JBmWgLUt6sf9JAZlF9m9jtImz +RzVtnTOz6FHpgI0keLS1/DYI2ddBxxfK8jQx+SF8QcnEut7bqhN05EavzAJwAiN7l/GGb HWbpxnbsdxOrlvGHQjUI4DUtATb6YuFYnV4FW0MjcMcruMiYpiqrWWuXmmEZBC8ABSYfCx 6xV/DFAtwosWeA5t/JBdwHuTmiJ8xQgkTs4YCmylCx88xRvUCfw5ctQJ+kM5qq5qL+s+B9 QtDfB4X0DCM7nqk5L3Q0O0goE62WjpEE37p91qm4BbfJImR/ykPtJCgUiskKdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVy1141z135P; Fri, 03 Oct 2025 16: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 593GrkJA064304; Fri, 3 Oct 2025 16: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 593GrkKP064301; Fri, 3 Oct 2025 16:53:46 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:46 GMT Message-Id: <202510031653.593GrkKP064301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: cef8f3aca925 - stable/15 - release: Fix NO_ROOT cross-building VM images List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: cef8f3aca9255a1193e4ba2578a01bb11c399a62 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cef8f3aca9255a1193e4ba2578a01bb11c399a62 commit cef8f3aca9255a1193e4ba2578a01bb11c399a62 Author: Ed Maste AuthorDate: 2025-10-02 22:07:04 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:20 +0000 release: Fix NO_ROOT cross-building VM images Pass PKG_ABI to virtual machine image builds. Reviewed by: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52874 (cherry picked from commit 5c5c0571c2984669024dca5356f973ffc18a3e02) --- release/Makefile | 15 ++++++++------- release/Makefile.vm | 2 ++ release/tools/vmimage.subr | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/release/Makefile b/release/Makefile index 169dc947c692..04fbeff091e7 100644 --- a/release/Makefile +++ b/release/Makefile @@ -75,11 +75,19 @@ VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH} .endfor .endif +.if !defined(NOPKGBASE) || empty(NOPKGBASE) +PKGBASE_REPO_DIR= pkgbase-repo-dir +WSTAGEDIR!= ${IMAKE} -f Makefile.inc1 -C ${WORLDDIR} -V WSTAGEDIR +PKG_ABI_FILE= ${WSTAGEDIR}/usr/bin/uname +PKG_ABI= $$(${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI) +.endif + .if ${.MAKE.OS} == "FreeBSD" # For installing packages into the release media. PKG_ENV+= INSTALL_AS_USER=yes PKG_ENV+= ASSUME_ALWAYS_YES=yes PKG_ARGS+= -o METALOG=METALOG +PKG_ARGS+= -o ABI=${PKG_ABI} PKG_ARGS+= -r ${.TARGET} PKG_REPO_ARGS= -o REPOS_DIR=${.CURDIR}/pkg_repos PKGBASE_REPO_ARGS=-o REPOS_DIR=${.OBJDIR}/pkgbase-repo-dir @@ -194,13 +202,6 @@ bootonly: packagesystem dvd: packagesystem .endif -.if !defined(NOPKGBASE) || empty(NOPKGBASE) -PKGBASE_REPO_DIR= pkgbase-repo-dir -WSTAGEDIR!= ${IMAKE} -f Makefile.inc1 -C ${WORLDDIR} -V WSTAGEDIR -PKG_ABI_FILE= ${WSTAGEDIR}/usr/bin/uname -PKG_ABI= $$(${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI) -.endif - pkgbase-repo: mkdir -p pkgbase-repo mkdir -p /tmp/ports /tmp/distfiles diff --git a/release/Makefile.vm b/release/Makefile.vm index eafd1d6abf71..336e8fc82299 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -134,6 +134,7 @@ cw-${_CW:tl}-${_FS}-${_FMT}: ${QEMUTGT} ${PKGBASE_REPO_DIR} ${WITHOUT_QEMU:DWITHOUT_QEMU=true} \ ${NO_ROOT:DNO_ROOT=true} \ PKG_CMD=${PKG_CMD:Upkg} \ + PKG_ABI=${PKG_ABI} \ PKG_REPOS_DIR=${PKG_REPOS_DIR:U${.OBJDIR}/${.TARGET}/etc/pkg} \ PKG_REPO_NAME=${PKG_REPO_NAME:UFreeBSD-ports} \ PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ @@ -192,6 +193,7 @@ vm-image: ${QEMUTGT} ${PKGBASE_REPO_DIR} ${WITHOUT_QEMU:DWITHOUT_QEMU=true} \ ${NO_ROOT:DNO_ROOT=true} \ PKG_CMD=${PKG_CMD:Upkg} \ + PKG_ABI=${PKG_ABI} \ PKG_REPOS_DIR=${PKG_REPOS_DIR:U${.OBJDIR}/${.TARGET}-${FORMAT}-${FS}/etc/pkg} \ PKG_REPO_NAME=${PKG_REPO_NAME:UFreeBSD-ports} \ PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 577abaac73cf..f307e7888e93 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -94,7 +94,7 @@ vm_install_base() { local pkg_cmd pkg_cmd="pkg --rootdir ${DESTDIR} --repo-conf-dir ${PKGBASE_REPO_DIR} -o ASSUME_ALWAYS_YES=yes -o IGNORE_OSVERSION=yes - -o INSTALL_AS_USER=yes " + -o ABI=${PKG_ABI} -o INSTALL_AS_USER=yes " $pkg_cmd update selected=$($pkg_cmd rquery -U -r FreeBSD-base %n | \ vm_filter_base_packages | vm_extra_filter_base_packages) @@ -198,6 +198,7 @@ vm_extra_install_packages() { for pkg in ${VM_EXTRA_PACKAGES}; do INSTALL_AS_USER=yes \ ${PKG_CMD} \ + -o ABI=${PKG_ABI} \ -o METALOG=${DESTDIR}/METALOG.pkg \ -o REPOS_DIR=${PKG_REPOS_DIR} \ -o PKG_DBDIR=${DESTDIR}/var/db/pkg \ From nobody Fri Oct 3 16:53:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZVz4bP6z6BBmW; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZVz1y9Hz3HYT; Fri, 03 Oct 2025 16:53:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AGIo1d92/NZBLs7RDwdFAFZXaOnH35KRGj8cEFKpuJ4=; b=T9Uc5D8xlNorXSI9WRSobBpi+hGoliUVUNmD8Mdd8E6ofqC5VdL/vcNQOFRnDh2/zYYxe8 /fBHaUe8bjQJpH8e0t0apkEsVLe9IeWhEFIgRpcRRsCpdYahvqsG2QgBG2hWntHc3PwVfh PrF0jKk+AZ/oNL9PCu+FHyZtTKxUaJ5Y0L/3+5rt/urGBeyQQFt/iTeWTiHAqQms4BiwOW pyRrM20g8nxdcalNaagKK9vSg5tgtS/UK1cBe2WQ95s/jh8e0FO5MpOIf/QJ+H2utag603 +1cB5xrJV4Vnu+a1g2SsoM457rMfCn6cIJwR1YJ7rtfhMnYoKqk0wXSbdc+CEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AGIo1d92/NZBLs7RDwdFAFZXaOnH35KRGj8cEFKpuJ4=; b=GhFHO/NLqjhWixrgtgYb1GRA9X+J6CMONgKyKm/o/XOd7l6Dbzhqi9/CAYeLbIV2sFbdJz f3HeNsOM/ZQFL2HBmhz93bfNqKznMCiC/U3lEBtGHFIA96vmubEdbSNIC6wV1ZHxzG3SHd daMbhgeKB/R6cyBWepF2Zy3Rcy4zvkVxiWiH05m+JdxJoxzPiKaCcl5BFIx5X9MqxOF8vU A7YZnHadwHJ9ZFqqjuj2qfCdyYTwOrQEbMFMYr7oQjdlpa0ggGjUFr3PWlE3QYiLc5ahn0 Ex5zZl4OLzhq2J9t6Byt7n/GRgj6TgI6PR8FdFdg+LOYdN7oRbaV/qf5wrQg9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510427; a=rsa-sha256; cv=none; b=rnQDhVdaIgHSb9DxhXDWjeED3ei/6+jLCibVbtlBRIlHxRwhCQIwODvxpwubAfq6a0Ff88 ovRY3tNOUWFYWSakdVMsWC3DY5V2m7ja11E5HpxBjwKwm9RPskeGzzGOv+PrM1p65F4z5B jg6vTY+hlRuE3q+rXSIzHToCz7TD86fyxj8DbLItuAq5ediv+JLdJyEcCFdkD1HiOHidB4 9oz5h6JCk1Xj3ko2GCR1V1Hzj9bdVdGrm2kLJyevagTIN7cAjgR8XkeYvj0yZD/a3iWxbW IZqD85ePx6w0yCHsic0fvU17DVDJqLlotlUfWNCsx+kkqTiDU4eRiPQDNFRxfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZVz1YtJz13bQ; Fri, 03 Oct 2025 16:53: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 593GrlGu064338; Fri, 3 Oct 2025 16:53:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrloK064335; Fri, 3 Oct 2025 16:53:47 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:47 GMT Message-Id: <202510031653.593GrloK064335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: eec0cbd26887 - stable/15 - vmimage.subr: Fix NO_ROOT build in ..._rmcache List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: eec0cbd268877912c6f2a4633ad1c34c357d6370 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=eec0cbd268877912c6f2a4633ad1c34c357d6370 commit eec0cbd268877912c6f2a4633ad1c34c357d6370 Author: Colin Percival AuthorDate: 2025-10-03 01:06:44 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:29 +0000 vmimage.subr: Fix NO_ROOT build in ..._rmcache When doing a NO_ROOT build we can't run pkg inside a chroot, for multiple reasons including not having /dev mounted. MFC after: 6 hours Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 86221f965c06efa1cd5b2da640ae23edded7c8b9) --- release/tools/vmimage.subr | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index f307e7888e93..fba09d532b4a 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -250,9 +250,16 @@ vm_emulation_cleanup() { } vm_extra_pkg_rmcache() { - if [ -e ${DESTDIR}/usr/local/sbin/pkg ]; then - chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ - /usr/local/sbin/pkg clean -y -a + if [ -n "${NO_ROOT}" ]; then + ${PKG_CMD} \ + -o ASSUME_ALWAYS_YES=yes \ + -r ${DESTDIR} \ + clean -y -a + else + if [ -e ${DESTDIR}/usr/local/sbin/pkg ]; then + chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ + /usr/local/sbin/pkg clean -y -a + fi fi return 0 From nobody Fri Oct 3 16:53:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZW05WGLz6BBh5; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZW02Y9dz3HK9; Fri, 03 Oct 2025 16:53:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sytnDAIq7Vv+EL35BphGvW05g13E+eDz4kt0zYVyb7w=; b=GdEpWexEPOuLIAH42STdOrrCJIoZnybsdPx1hi2OeZiWgbzPnU+TrsVz+ntKURiyOVHcBi CIVtEVW9KzPOoLkYcqY4E0KAi4xHq6KukHZmK3UOIXarIoeJpDZrk+ETefQophxZVpTim9 toF/xeYnaEFabnllWiQw0XacJ5ykfUJtCVQ+bW66LMosD6ODk1XO0kNtGLOY3+SyUQTLCA g6CTGy4L3jxSPtceWtoE/6wa6x5GZ4t27CQNoxblKKJ5y8NhKPYCTGLox7/UT6uY6LLaUE idB4dkT5G13tPmTZw5d7hrUcUJEfaKNUIjpXR739y248opa4NguNkNuHyqEKSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sytnDAIq7Vv+EL35BphGvW05g13E+eDz4kt0zYVyb7w=; b=NAjan0GYNfAT500ccbvGXQ+2og5vQWdAiCM5sGRCOuZYSTjQX2XZ/EVR3JYbm8xr9Ozddp gTOEgiIabkFVp9RqgJH3nI4G/0w9fo0GZ4/FswazZl7gstSHhxPm+4U4GpH4fMySIReVac 1OOBz96S3BqF2d2XI1bMaylLmdkrsUJBx6CCC0V7kwwGD9ikHC2EF+AvRFJCN+jnor8fgJ 8q3sdGuOsP1QbaQOa1Hdt5V+OHcs/lQDaGSnpt4X2TctwIh9qoPI+WMsZNsjK5Oj/glLUg 1ggSTVZvxd6aLNxbPwiw5oqfHMGHRwE8xgBCnUsB/khLvn2nTWZqdrUtUg71og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510428; a=rsa-sha256; cv=none; b=lWTCc0NAsfg9Wf9DUDb5SFUFghpGlHYxRykt4bAg9aWvrYrmx335sQRKK+xkUgkfeNZfGh WZy97REqh1krkTqnvLo8lu7dYIovozAM8W61447lid2P/CjfKS6U4V1YkHXSz2G8jEHdi8 aXuE7cj9BW46GdZQxEnxOTz8GasG1MvgPhb05MI96lO9aem/va8UOmQNm/4iW8BoBsiWOJ /VUof02UHWvo1oK9MaAPfB5r42xL4x0UK/d35LsaGkm8YNT94dwuruRyxPYHmFg8rkP4k7 RnVKYwf2fIX73LvTO7lRkcJMM07UBI0MKmydL6M+BkAeVyuaIFEwSn6Zwx8V/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZW025RGz13P0; Fri, 03 Oct 2025 16:53: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 593GrmY0064372; Fri, 3 Oct 2025 16:53:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593Grmvg064369; Fri, 3 Oct 2025 16:53:48 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:48 GMT Message-Id: <202510031653.593Grmvg064369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 06221931cf08 - stable/15 - create-sets.sh: Add missing copyright header List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 06221931cf0868b85142da4b1549b2c197e549d6 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=06221931cf0868b85142da4b1549b2c197e549d6 commit 06221931cf0868b85142da4b1549b2c197e549d6 Author: Lexi Winter AuthorDate: 2025-10-03 03:58:06 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:33 +0000 create-sets.sh: Add missing copyright header I wrote this file and am the only person who has modified it since it was added. MFC after: 3 days (cherry picked from commit a22f8bd45701ce1535147ddd71291fd1de769ecf) --- release/packages/create-sets.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/release/packages/create-sets.sh b/release/packages/create-sets.sh index 09567657c161..3780e8ee46c6 100755 --- a/release/packages/create-sets.sh +++ b/release/packages/create-sets.sh @@ -1,4 +1,20 @@ #! /bin/sh +# +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2025 Lexi Winter +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Generate metapackage sets. We do this by examining the annotations field # of the packages we previously built. From nobody Fri Oct 3 16:53:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZW15y5Lz6BBmb; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZW13DmYz3Hdt; Fri, 03 Oct 2025 16:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pziz4mzc+C9vSwrr2cC5xBmtQO1CafwDyKgi0OEnsfY=; b=G48KCXI/VRADQtGprnd0pncdmghn2BDpJvZkwGiL+rwGF8itZpLJUiVgE7UKQYd/rW/4wj 80j7Kpd4TrV6qhIRHVm8g0IGetSu0KGqh+px0fY7fRmPlZR8AE8Ub56MpfauiUfRPobR4U BX9uyNQuXwwGr5T6Qe5xyjwVwysFWtYUHiNoawVuJK6cvxJFd7WCNpfcenEY9TCly/JURb c9EI6avlV0FMArYAhDCoDMwykNnmG4TaV3uyxQv5stD7PHLsDlKod6c0HZt3XO+vEI6OeC DYUzhxF2rOxDGIrkg3hiy6FekEcsU2Fu5CZgC9DGAfDnPd9MiUc194iq1FlJqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pziz4mzc+C9vSwrr2cC5xBmtQO1CafwDyKgi0OEnsfY=; b=qlP3L2qkUpwBEq/nL+aHWCgT4dhwhcCNlVYnnFzTF+kWgu5LDito0m0mCQbM59YITT/CZV 1m761CjbVNcAzWFWL4yvv9Pgbi9BWhcjK3X+xtcN2YH8kZujahi+xpse6bUu6F+wOI+tLH ZCQjXgeW0vZLi5oIm/6PZorYLNsegalSNnX2qiLGMSOflsNaYUMc9g6zeVeDfZ4glH5Vgx Im6LuBZ8edlvz+Z5ZGp+5BbMntDM/vjJeMmfsEXUAlNUD7V169LAP3qh/rB6cseIEne8xH YQZzFtENXLG13uMkv69nmFTmu5DSzIuMw6A1NoVr687l6cuaGfqgcqNtk6iJSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510429; a=rsa-sha256; cv=none; b=wP2W7U7ytbZD1DUvrueVoE2xUI2L2pYnOr35qD9rJKyJ294C/cMsViyxORjmal1Zr3f9Ra 1fdWXYterOCEtpjgo/3eMUSvfrPxQ9O7biPcojxw9rY/F+aH2cSG2sN6id0WgwgBcDK4Z3 3WceWlUGb80fPNnLWX/Bip5ydUIBC6jWSX6PEn/HV9rVMk27BVh8ZhM/NOXbgo5mhHDr32 2fQkSOWvOKBr3gw0S/cr+vGHwGc66hHHwnnD2585cGDQLkaJCbpbZ0ZIh18CxkNedzcYsi h001z3T0bJk/wjDISJthrwzFlw7GU691TlAQMkSWrwvMDU7MO/+G3ukWWn/lfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZW12njPz13bR; Fri, 03 Oct 2025 16:53: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 593Grn1q064408; Fri, 3 Oct 2025 16:53:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrnLP064405; Fri, 3 Oct 2025 16:53:49 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:49 GMT Message-Id: <202510031653.593GrnLP064405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 627511cb1e84 - stable/15 - vmimage.subr: Support NO_ROOT pkgbase List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 627511cb1e842844a0897f19b81e13fed208d2fb Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=627511cb1e842844a0897f19b81e13fed208d2fb commit 627511cb1e842844a0897f19b81e13fed208d2fb Author: Colin Percival AuthorDate: 2025-10-03 07:23:43 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:37 +0000 vmimage.subr: Support NO_ROOT pkgbase We need to tell pkg to record files in METALOG; otherwise when we create the VM image it's almost empty. MFC after: 6 hours Sponsored by: https://www.patreon.com/cperciva (cherry picked from commit 08b497dc6c4da23be83f7cd51edff07f09d63fd6) --- release/tools/vmimage.subr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index fba09d532b4a..27cca78be6e3 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -95,6 +95,9 @@ vm_install_base() { pkg_cmd="pkg --rootdir ${DESTDIR} --repo-conf-dir ${PKGBASE_REPO_DIR} -o ASSUME_ALWAYS_YES=yes -o IGNORE_OSVERSION=yes -o ABI=${PKG_ABI} -o INSTALL_AS_USER=yes " + if -n "${NO_ROOT}" ]; then + pkg_cmd="$pkg_cmd -o METALOG=METALOG" + fi $pkg_cmd update selected=$($pkg_cmd rquery -U -r FreeBSD-base %n | \ vm_filter_base_packages | vm_extra_filter_base_packages) From nobody Fri Oct 3 16:53:50 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZW26Q2fz6BBh8; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZW244TZz3HfK; Fri, 03 Oct 2025 16:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uJ9rM3uWdkIdiyuZvDsA0o85P0H4PRUiIIfqCMDr8Rk=; b=q/rFW/NTOv7oIPTZJ9vxgaQINcY4m0ulKUpIQUmZscQxEX6w5vtwDSk5KM5WBI4hHK64YI AHUV6gWnXfzpsSLMzh3aM+Nv7vu6loG0npJ5vPusGcz0RILRExLWb1HKDkiH1x7OLWmtyH jMjgAnQVur6sZAIpCodcfUMTzDgLY6C8ppma7X8sqwu8sxxrVYzA2Idkn2RDpEyDW92RBG LrJ2xR7XILNxurW48fROlMkDcXsSw7Ngc3S66k+ggCeDBrHsDEA6h94PbCgENZx+TqBayt vrQViwj3Nf9Hd/neDH7G96c+nR7fnw2/FBwlX43axA9Y0+daSF4uhBPSBbddKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uJ9rM3uWdkIdiyuZvDsA0o85P0H4PRUiIIfqCMDr8Rk=; b=SZJ9qCtN6fad5D/u2ovU63jmJbXIj1SrnQG7NnRdVjzt8A2W0O4A8zBJSs6j0dVW8r9ZbW VPd15k8AQb68ahKOiWTyykWL9dgRXGhzaLRUHcNo+21IGm4zlbBoE2idDLXfBF9DZT48Z9 JijMAAUVA8LsNoQe9KgLI8uyp3C1F50Lyw3BUCsqqenyq17SZ0I8fgsnsFDiVtvSlgRJBU WXT2rOztOxNNRZzEC8w7qDvVuidmN5C2UNzoNG29K2NMeXi71l9Dvi0k8WheKSM+OgjJ/S 474eez+0r/rPt2G3vdbl89sKUk948mFPNEk7uj8vJb81aApMxmGsyoHefjTXRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510430; a=rsa-sha256; cv=none; b=iSVgog8fFOTE21O7BOAJTkVVKnFMtiQgYn8s4WLI7AbwldHdrORVDUF9gzOzgVBkPgvF3O AjkgDsu1RGD/oYZbeHV+KwWUk5WH8d3vbRJJodQP0ssNGpe9Q1dTWheOjVZ7lBKeg4z4VW Ji4RY4iLpzMBcb9Z6hwQNsQ5rW/IIVy6Na/6oMu7FRVU6Nc2b63NYnL2GSI6ihCuhUximV gzdWHJwp65dBIHimEpF/FVpu1T8f8TKzezaAkHfm70ezdBtTZrswWC6V+h1Thi7Mzz6v0/ bJa3VaLaWfAbgUSAgHhvXsvlRAYOY8v5yl3zNEKZkSimR6E5GgHQSb2LzuyCQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZW23LV6z13P1; Fri, 03 Oct 2025 16:53:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 593GroEV064446; Fri, 3 Oct 2025 16:53:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593Grojk064443; Fri, 3 Oct 2025 16:53:50 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:50 GMT Message-Id: <202510031653.593Grojk064443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: eb90941ee5ad - stable/15 - vmimage.subr: fix typo in checking NO_ROOT var List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: eb90941ee5ad87cd69c13d089b72920f755c1132 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=eb90941ee5ad87cd69c13d089b72920f755c1132 commit eb90941ee5ad87cd69c13d089b72920f755c1132 Author: Siva Mahadevan AuthorDate: 2025-07-15 16:45:24 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:41 +0000 vmimage.subr: fix typo in checking NO_ROOT var Reviewed by: imp Fixes: 08b497dc6c4d ("vmimage.subr: Support NO_ROOT pkgbase") Signed-off-by: Siva Mahadevan Pull-request: https://github.com/freebsd/freebsd-src/pull/1867 Sponsored by: The FreeBSD Foundation (cherry picked from commit 65e2ce55b662447fb4e87246262c07bf5a25efe9) --- release/tools/vmimage.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 27cca78be6e3..3b0519c21dbc 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -95,7 +95,7 @@ vm_install_base() { pkg_cmd="pkg --rootdir ${DESTDIR} --repo-conf-dir ${PKGBASE_REPO_DIR} -o ASSUME_ALWAYS_YES=yes -o IGNORE_OSVERSION=yes -o ABI=${PKG_ABI} -o INSTALL_AS_USER=yes " - if -n "${NO_ROOT}" ]; then + if [ -n "${NO_ROOT}" ]; then pkg_cmd="$pkg_cmd -o METALOG=METALOG" fi $pkg_cmd update From nobody Fri Oct 3 16:53:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZW35wRGz6BBmj; Fri, 03 Oct 2025 16:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZW34d6Yz3Hhf; Fri, 03 Oct 2025 16:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMKSw/twE0qtLULsV5Ap/nn3Mk2bM1RRrmBDWdHMpMU=; b=pP/rIWjLE+fSnisozuhp5e+T24irpOt7aG8MoXUT2NEGcguw53s6koSjQEAT5O+MErv38J 0zHJOcMYxB/rFkWeUVkRVcf9ec6UMiUQ0xrqJJbeygKoMVolt6byn1xbPKZgy02Va8l20a DfsVRAn8bJpPAve/KSOU9hS6uaZEhThDjhAcYWKKx6qvQSSzuB/CX/tjbRpL5+Rk07H4Ls vyNDe9EIofB3W7GHUbc8mQr3oixXO5G0gHUkwyuRN8bPkHIQJBWUB6fftHMNuFIZeE3mA4 QhNXjQtL8do3xuYTID1n4ZGN7r6mKmGrhiwU5gg+bniITJgoLY0ivhTlxyqEqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMKSw/twE0qtLULsV5Ap/nn3Mk2bM1RRrmBDWdHMpMU=; b=Fl81UgZaLi9odooxu6sNuUmj3AXn+2VyZwALMCoym6dYNUuVoLRkSZK3phXWtcgDRgWO8u YeMN+hG0+92lIZRhZ65idcIIV49deWG0GafcK7VM/amwLIjePmeLlbUvvbQfl7VYapGpag 9IGGwUdmdpdKyr3qYAYg+YumpS824N9CegVyOipP1Nt0lgYaaqdp2E5Z5qsvvOBSOSdr3x VRcXHsNXLfwyotTuP9yZ/jbWXnsDiDhiyY89lrL0QuAGFOn2llK6mJH6myJYJDQCFPJGH8 FTfxInt0V3Kft8recWBNGx5Nc3YU8X7lZREAsuaoFJi0NGdkJy9qmFuBkQmlkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510431; a=rsa-sha256; cv=none; b=KNT5SXyUEowbVTNEFvxc56o1B11YWecVyJm3lUSgE/i7++F6zefs9r4/2QlHSZRQaTzP+G vpqw+8Yliz9qf/w4JK2zUXiKxTcFkq7S2O6R03ve+PUN3Gv5GL31Oe8C9BkLYjzMx+mz4G VYbppIUiC2nuPrz350UKxE9N5LInH/z4CanuqJKEQLIH9udOD5dllaN+vHvqhSnHuuJNph vIXGCKKlT6W8x3MKk8LRgtVa8cU06QdDw4cs99dTah9z7DIJcm9hkGuDuYV02LXThSdjPQ g1/JXl8zeUxdDJ1Hfi/oK4XWuLHAkvPj64EiEVNYuXXAaz4i2ZZW+koj18QVSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZW345HYz13QZ; Fri, 03 Oct 2025 16:53: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 593Grp7u064481; Fri, 3 Oct 2025 16:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593Grpxj064478; Fri, 3 Oct 2025 16:53:51 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:51 GMT Message-Id: <202510031653.593Grpxj064478@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 2730e35e147c - stable/15 - release: Consolidate pkgbase-repo dependency List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 2730e35e147caaf1303bdc5ec7464a427d2480ea Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=2730e35e147caaf1303bdc5ec7464a427d2480ea commit 2730e35e147caaf1303bdc5ec7464a427d2480ea Author: Ed Maste AuthorDate: 2025-06-23 14:53:02 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:50:47 +0000 release: Consolidate pkgbase-repo dependency Use the same approach for pkgbase-repo-dir as for the packagesystem dependency. Reviewed by: Isaac Freund Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52884 (cherry picked from commit ac1408bd1d2d3f2bb2d8c77e91420fe9e66926ca) --- release/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/release/Makefile b/release/Makefile index 04fbeff091e7..f7ce537cb4c4 100644 --- a/release/Makefile +++ b/release/Makefile @@ -201,6 +201,11 @@ disc1: packagesystem bootonly: packagesystem dvd: packagesystem .endif +.if !defined(NOPKGBASE) || empty(NOPKGBASE) +disc1: pkgbase-repo-dir +bootonly: pkgbase-repo-dir +dvd: pkgbase-repo-dir +.endif pkgbase-repo: mkdir -p pkgbase-repo @@ -214,7 +219,7 @@ pkgbase-repo-dir: pkgbase-repo ${.OBJDIR}/pkgbase-repo/${PKG_ABI}/latest \ > pkgbase-repo-dir/FreeBSD-base.conf -disc1: ${PKGBASE_REPO_DIR} +disc1: # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -278,7 +283,7 @@ disc1: ${PKGBASE_REPO_DIR} echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG touch ${.TARGET} -bootonly: ${PKGBASE_REPO_DIR} +bootonly: # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ @@ -321,7 +326,7 @@ bootonly: ${PKGBASE_REPO_DIR} echo "./boot/loader.conf type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG -dvd: ${PKGBASE_REPO_DIR} +dvd: # Install system mkdir -p ${.TARGET} ( cd ${WORLDDIR} && ${IMAKE} installworld installkernel distribution \ From nobody Fri Oct 3 16:53:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZW509tNz6BBdj; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZW45NG4z3HgH; Fri, 03 Oct 2025 16:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TLw+z9/izrcNoBJ//CJyWqqy0qSM/hOYtGNu5yYFrbI=; b=fg5han3UqDgo65YAjAX+dtm/7guHnNhc37TToCqHAB5tJbiU/uMyOoFz6ShvcIQnaRR660 pftOReL8fLWCSUG7KoL4dKI+pdIYOx9TsYi7ZF0VGXwjeiY/IpU9EvO0Q5L8NLeNn3jKQs EEm7IfkwH1esF3z4nUbT33wKsDnKMhUbT9cwdFxDgIxxKYQ0y9HRzCudJNx7dyo1NpO7TK TOQeMdPyKDWsPnzMd9rAz+p8gSfnzHcSO1w3MSRr7q8+itTw3Bi26of7k/QOsWQeOiVNWZ xJsJdRlxEBlCD0cxGZapzmE7QkTS4Tl7jOjfjAIuG6oe6Cw6htKqJwMzWuuQ3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TLw+z9/izrcNoBJ//CJyWqqy0qSM/hOYtGNu5yYFrbI=; b=aJaXxCJ/UEqipcYiKr8v/0hYwdaYyJCuu0ZAyWzn9AXeKGKGekGCLo+kjCxbtPzT08g4yw tRYq7Jp45+WI+6C4PqGc/KGvcOUrLpxJ06hy4pAQe+bEgWBEBHz1ot/eWirEEt1NPx6kw+ NFC9BZXeqaiwPYMgtYjb+xcgUAOepzSOOgqecaUdB8ctEtlK7tfs897rP2ojgAiwd/W5XU sFL8d7UJNJFEqps/WJiLPMce6Pc3UhpTOkJWwBveWInEziINmsiiIvNtUDomYCn4c9kAsn xoRVE8Zi8oLxzvVr8c0SZ782OMrHmzI2+QUPu5k09Ci1NCAKCKg+fNrPtjPvhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510432; a=rsa-sha256; cv=none; b=um8MrTEeBSTAdujv96lckcWZR0xTFWVkxY8Wce1FoGMPDzmcnT2sZncLgSs0bl3462RI/S c9DxBhPjaOKPYhn4NoiJvD3VD/YKY0hzJARkC1VvTM1XuA41geNDrbCuF9DT6G+RL2t9jD 8yzocOpBiP4zKtWE23ytYGnmBqWLS/ORXKBYrtFSf3sSDguZ4yJ+x8n71ODK7KnhLI7F0o 2EYnKlykOyuvTzG8WG4pL8Xdaink4is3bPRhWyZTL+tHjq7maMB/L66Ou8j766k0RCqkEM qP8ZsbSFZJWIXMGUzRZ2xe6HMv/gL2GeKV+NUbuSf/lygUC/kMkrLBVWz2eMvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZW44rYyz13bS; Fri, 03 Oct 2025 16:53: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 593GrqZV064517; Fri, 3 Oct 2025 16:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593Grqxa064514; Fri, 3 Oct 2025 16:53:52 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:52 GMT Message-Id: <202510031653.593Grqxa064514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 2d997bf6b5a5 - stable/15 - release: Use standard Azure disk image extension List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 2d997bf6b5a53ef4059b034ea1e6620ad173d897 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=2d997bf6b5a53ef4059b034ea1e6620ad173d897 commit 2d997bf6b5a53ef4059b034ea1e6620ad173d897 Author: Ed Maste AuthorDate: 2023-02-24 18:31:26 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:51:53 +0000 release: Use standard Azure disk image extension Azure images are Microsoft VHD files which use the .vhd extension. We use the mkimg format arg "vhdf" to specify the fixed vhd format, but the extension should remain .vhd. Reviewed by: lwhsu, whu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38761 (cherry picked from commit fb77d8e546e1894300843600409c48596644b3b6) --- release/Makefile.azure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/Makefile.azure b/release/Makefile.azure index 577221ee3899..09dcde6af636 100644 --- a/release/Makefile.azure +++ b/release/Makefile.azure @@ -39,7 +39,7 @@ azure-check-depends: .endif .for _FS in ${AZURE_FSLIST} -AZURE_IMG_${_FS}= ${.OBJDIR}/azure.${_FS}.vhdf +AZURE_IMG_${_FS}= ${.OBJDIR}/azure.${_FS}.vhd AZURE_TARGET_${_FS}= ${OSRELEASE}-${_FS}${SNAPSHOT_DATE} azure-do-upload-${_FS}: From nobody Fri Oct 3 16:53:53 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdZW61VFtz6BBmq; Fri, 03 Oct 2025 16:53: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdZW56R7hz3Hc1; Fri, 03 Oct 2025 16:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6hM29kRSGtBMPmnjZF9T4iUGkli5ny1P8eSj06ta4qQ=; b=Q0vjSiU+czGpk7Xa+f0pLSIPTsBEKoPxiPXeXurp1oel1wZUfL0l5vplZZNCb3Rw85QXfV PCXO5d0M+NNe2w6p2HlT/x42Jt3wxcZ/gsWgFnbYUrgTgTEvcD3JbnV4/6J/szYv96cnzS 2dmpymyJLakvD0+boXU7nwAe1a37ZuRIciuznz/wjFUC0KRZYA4Gixc65tztXmO+daxbr8 JE7cLe3F4mlBi3/tyConIaZ4fciFhMVP68lXQB5rxFUF7GfbnWMjRPSUMWFb0GXWb1PQN2 ZUefFNF26TYzZADa8kPptPLc5BzLZhMwPPrNmLG5s78IBZD8YKygofCYXOA/Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759510433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6hM29kRSGtBMPmnjZF9T4iUGkli5ny1P8eSj06ta4qQ=; b=n0V0iilFLZ4aNEG8NV9CsoMxzma0vQbZRN+AeNAOf0kUNi76PensBkLtGVYONTTBspYAD4 stO5+tn6PObGSzI5qz+EF6HoWb3aPc4ghDzbdFZ1a+t4BAGoDC/cXnPj8mQXuFFYmDcDI8 D0fbv7Ol1rwEo7a7aryQMLtAhYQ2XbZPX41dflcL/L6Axy5oBJTfJa/2o7H55zh3cIUXLQ OkumtuDR/cJxacb247eta4pTY3yQ5HYa3/DJsuEwwxNu5Wzi1VuTmjWV5Lx3Rj22x+j7Az 6jmdVmN6koTeGyE68Sjjsi4DhKrQBw4Z2CXtPoQT/63YUFWYghyxZ5qFMY9IMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759510433; a=rsa-sha256; cv=none; b=PcaCPm55bEK0wxjT+EQkuMrJlmAk7GOCCrQZE88dTSMNj88ZUsjze8s0KKF5IR39dn9mve GGlZ29rp3VsP5EqoD966nwlVylT1HCwXSg20TB1i42IC+6s3szay6y5BtGx/XEoz5W/UYY J1m6f4iCZB8hlrswVADcEBuh/ZkMP3+MOlV/AogWv7PnFtm33hc+QcIo834nw2Va5b642N eGF2+TKaHhN2tqrDCt7XmlfuaRzKSCVCvjBXudm4JLboJGIIAMM6jebnJl5RczVjKlPFyi aa4lvutpgAGq/FWlRy0+JoGt9dRkjmPd/aCxdd9Kdk25Cn2um553eauRJQ0AHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdZW55zMVz138m; Fri, 03 Oct 2025 16:53: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 593GrrD2064553; Fri, 3 Oct 2025 16:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593GrrC4064550; Fri, 3 Oct 2025 16:53:53 GMT (envelope-from git) Date: Fri, 3 Oct 2025 16:53:53 GMT Message-Id: <202510031653.593GrrC4064550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 77bec6e492b7 - stable/15 - diff3: Move to own package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 77bec6e492b7da7a60fc4e9461c7caba9f8d3ddc Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=77bec6e492b7da7a60fc4e9461c7caba9f8d3ddc commit 77bec6e492b7da7a60fc4e9461c7caba9f8d3ddc Author: Ed Maste AuthorDate: 2025-10-01 09:28:56 +0000 Commit: Colin Percival CommitDate: 2025-10-03 16:52:43 +0000 diff3: Move to own package diff3 is the last remaining GPL-licensed userland component. Move it to its own package, so that it may be excluded if desired. Reviewed by: ivy Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52810 (cherry picked from commit e7258c42520c18c034f644b97377d8d2a0ad8b7c) --- gnu/usr.bin/diff3/Makefile | 3 ++- release/packages/ucl/diff3-all.ucl | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gnu/usr.bin/diff3/Makefile b/gnu/usr.bin/diff3/Makefile index 4d7bb8a82e1c..568733801a6b 100644 --- a/gnu/usr.bin/diff3/Makefile +++ b/gnu/usr.bin/diff3/Makefile @@ -1,8 +1,9 @@ +PACKAGE= diff3 + DIFFSRC=${SRCTOP}/contrib/diff/src .PATH: ${DIFFSRC} \ ${SRCTOP}/contrib/diff/lib \ ${SRCTOP}/contrib/diff/man - PROG= diff3 SRCS= diff3.c version-etc.c \ xmalloc.c error.c c-stack.c exitfail.c cmpbuf.c diff --git a/release/packages/ucl/diff3-all.ucl b/release/packages/ucl/diff3-all.ucl new file mode 100644 index 000000000000..b4e53e63c67f --- /dev/null +++ b/release/packages/ucl/diff3-all.ucl @@ -0,0 +1,15 @@ +/* + * SPDX-License-Identifier: ISC + */ + +comment = "GNU 3-way file comparison and merge utility" + +desc = < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 0a9fa94c0b46 - stable/15 - nda.4: Add a HARDWARE section, tag SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0a9fa94c0b4642b3aff0a9fb89d469a7e1140066 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=0a9fa94c0b4642b3aff0a9fb89d469a7e1140066 commit 0a9fa94c0b4642b3aff0a9fb89d469a7e1140066 Author: Warner Losh AuthorDate: 2025-10-03 14:30:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-03 17:47:50 +0000 nda.4: Add a HARDWARE section, tag SPDX The description likely also needs some love. MFC after: 1 hour Co-authored-by: ziaee (typed up imps suggestion, tagged spdx) Differential Revision: https://reviews.freebsd.org/D52866 (cherry picked from commit f19aea89abd8964bf96d134c2bd6e127464c79f6) --- share/man/man4/nda.4 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/share/man/man4/nda.4 b/share/man/man4/nda.4 index c4fa157af851..e45b2905462e 100644 --- a/share/man/man4/nda.4 +++ b/share/man/man4/nda.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2017 Netflix, Inc. .\" .\" Redistribution and use in source and binary forms, with or without @@ -23,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 6, 2020 +.Dd October 2, 2025 .Dt NDA 4 .Os .Sh NAME @@ -39,6 +41,14 @@ driver provides support for direct access devices, implementing the .Tn NVMe command protocol, that are attached to the system through a host adapter supported by the CAM subsystem. +.Sh HARDWARE +The +.Nm +driver supports NVMe +.Pq Non-Volatile Memory Express +storage devices connected via PCIe or over NVMF +.Pq NVMe over Fabric +via the CAM subsystem. .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 From nobody Fri Oct 3 17:52:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdbpp4z5fz6BJMS; Fri, 03 Oct 2025 17:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdbpp2b2qz3WJg; Fri, 03 Oct 2025 17:52:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759513954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3OU+2ftdEt5pyjIKRwaCcO6oqcE/5R+YkOMHWfZav8Y=; b=VFlwADkz+XTtq9AbKBYnI+S+jnJ46nSrxH3krhyFuHyY7G/1hRc0LFM9rZMXFej1l+RStX SlAjKSFQPnvRuQwRN7j9zhncWdweOwiCzC2mQZ/T9SV3eKhm02z/D2qiTgWWREfmwFw5qP MG3VNiJijJgMLuAQIO9FFITZxy2ODbRDNA4UQmI6+PnpLcpiqMdbhcEjAW3IJ2lC601KHx DKgP4lNiZEYLx9uJB4iR02TgxqZKkalPIhalNnNkzv7RByyCsllyYCidLlXsbfh8G/pVKM 2T/i5SE8W3WoQ5FX9rAuTuLwC2pWUUJGKOwe5dI24miq04VF7dpinvzA1yyiWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759513954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3OU+2ftdEt5pyjIKRwaCcO6oqcE/5R+YkOMHWfZav8Y=; b=FZL4m21yxG+131kBcSwPg/qc8CFdTXUR8pr/ZD4FJ/RbqhPrv2QbsXdFdf7jNyiDR2tLMG 1tXzgfEd3wZTfAdm0FCRKoQN4GQYkr599RzoC+bMRVrFwSyOgiYCaaLt9Sgxej37Sq5/6l Is/87U09Ciwaw6+Shf28vdJ0mIBeKovV5tGjqHpPCvhWjnmS8qamRiReay7l/OA6UxVsdx 1l7Iucmud7rw8I2fQK7kqtDCj9r60tIXiHNxKTVdQ47tQLa7fq9fEH4jLWiZcONH8PE3nI H9SudAL3TDGT5faSsFuimJiGtXP4V0SNcHw/e1BKi2EPuw8n/oiVO2zItAE+/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759513954; a=rsa-sha256; cv=none; b=R5pWd5klDga6OJdAKdKXFUSwFuQN8YAkdzK7Dc8xibwvzbGMnejHEDQJG6lQCo8tuHvGqW 71hsQ2tSj90OZZ5UqHyLlDV53zIXXi8j3ImOYlFYepy/p6R2JeUB2z93Nvta4ADkhxFrmA 1rXVcyvFCkmdmiberkzsTVT55uF6NrMz5Dld8UVgzPzPxxnrATlxwgcsRLd/o/x+B4PjMk yPc8ugtKtW+YiqBHb3r2TC7vXKx32LK7gyHU32glAtMipszmKIL+YCEaxywiFkQ6fwJNCk yV/f2ckP70g9wcQ7EBuZE6aCIt212/v1ed3+yL8OwL2pGooFeIGe31+eQSiuwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdbpn7501z14jt; Fri, 03 Oct 2025 17:52: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 593HqXY3077475; Fri, 3 Oct 2025 17:52:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593HqXWM077472; Fri, 3 Oct 2025 17:52:33 GMT (envelope-from git) Date: Fri, 3 Oct 2025 17:52:33 GMT Message-Id: <202510031752.593HqXWM077472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 3b7da838aa8f - stable/15 - sdhci.4: Improve HARDWARE for HW Relnotes + SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3b7da838aa8fbe8d27be3807dab1417bf0b3b3d2 Auto-Submitted: auto-generated The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3b7da838aa8fbe8d27be3807dab1417bf0b3b3d2 commit 3b7da838aa8fbe8d27be3807dab1417bf0b3b3d2 Author: Warner Losh AuthorDate: 2025-10-03 13:49:32 +0000 Commit: Alexander Ziaee CommitDate: 2025-10-03 17:48:20 +0000 sdhci.4: Improve HARDWARE for HW Relnotes + SPDX MFC after: 1 hr Discussed with: ivy, olce Co-authored-by: ziaee (typed up imps suggestion, tagged spdx) Differential Revision: https://reviews.freebsd.org/D52860 (cherry picked from commit bc433a0b7b046b0412777e0f3cc8f18a233af8ff) --- share/man/man4/sdhci.4 | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/share/man/man4/sdhci.4 b/share/man/man4/sdhci.4 index 4a4e02539acd..1608d9c2fe1a 100644 --- a/share/man/man4/sdhci.4 +++ b/share/man/man4/sdhci.4 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2008 Alexander Motin .\" All rights reserved. .\" @@ -22,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 25, 2020 +.Dd October 3, 2025 .Dt SDHCI 4 .Os .Sh NAME @@ -56,21 +58,28 @@ detaches it on card removing. .Sh HARDWARE The .Nm -driver supports different specification compatible chips. -The following chips have been verified to work: +driver supports the SD Host Controller Specification. +When attaching via the PCI bus, +the controller is automatically configured. +Many SoC chips provide a SDHCI controller directly mapped to I/O memory. +For those, the controller may be configured using +.Xr fdt 4 +or +.Xr acpi 4 +methods, supplied by your board's vendor. .Pp -.Bl -bullet -compact -.It -ENE CB712 -.It -ENE CB714 -.It -RICOH R5C822 -.It -RICOH R5CE823 -.It -TI PCIXX21/XX11/XX12 -.El +Unlike most other drivers that support a generic standard, +.Nm +requires a large number of quirks to cope with hardware bugs, +proprietary registers and poorly specified power management. +While many chipsets from +Intel, Xilinx, Rockchip, Frescale, Ricoh, and TI have these entries, +suboptimal performance may result when using some controllers. +Quirks and custom configuration are most often required +when the device is configured via +.Xr fdt 4 +or +.Xr acpi 4 . .Sh SEE ALSO .Xr mmc 4 , .Xr mmcsd 4 @@ -79,8 +88,3 @@ TI PCIXX21/XX11/XX12 .Re .Sh AUTHORS .An Alexander Motin Aq Mt mav@FreeBSD.org -.Sh BUGS -Many of existing SD controller chips have some nonstandard requirements, -proprietary registers and hardware bugs, requiring additional handling. -ENE chips are handled to work fine, while some revisions of RICOH and TI -controllers still do not see cards without some additional initialization. From nobody Fri Oct 3 20:15:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdfzp4Cyxz696Jm; Fri, 03 Oct 2025 20:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdfzp3dSsz3tTF; Fri, 03 Oct 2025 20:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHzS1ABHOeskNDeOdi2PZdNjecjDeW7MylDkCEIDFBE=; b=vAfSCIitriH6TZr3KsLcRQTuGJ2pDVE4f6Bj9dm6ivufCBmbLpUFvf6KusodxRPf5EkJp+ FqF6xXiBjYacrYUdtNBG+uHG5j++/gMiK9bhCGXFu2Od4iky+6IdhnchTFwmWFwwLV6Pcl 191o3V+0VCePpfPmmzT37yYOpvDOa++rsO5IlKZGX02rA5W2BWDD10Mz6gKBSTLEWYDHx2 k1GWwgbqTNLkYhZie8PBWavfw/PxBWKW4MxWIQ9zo3utqUu0Hb0nTW+EyQ31mWeDpxYciT OSQNL+Opcqst88RvPFx7cwzVcNrUDfh8II6eHH6Zp46FIhq1lbXDGYuMaBPMeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHzS1ABHOeskNDeOdi2PZdNjecjDeW7MylDkCEIDFBE=; b=tdWz0Lw98OR1PNvTTPRq88V2ffeHXK2gaCU+K1GX71XFTSBBJaBrlW1eASngytn1ZykI9L NciFxBRz5nu54ZvEiJgIjifJ4/5RZwzyxKsbeosrQY+6Y51iZVumAp0jxsCefx8+S3QG5T 6pIKAVpxADh4KxsusVD3oqTgDHTXZjbr/3RTcSN1yGwjBuqh2/oLxdGhnbQ2QGpspuwwGM paMpqNIxa0ztcvzDiwtvrF6p+GcOy1NRU+CID4ruP06A9GrSggAh1IlmsqLQiIiSN4RVQ0 rYpSGXdn++s44i46ue/o9cgwe/JKrELeFGtknsvAKKLJKAeYsWU4Y49z90o9NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759522534; a=rsa-sha256; cv=none; b=MSGIgStGicskzFzA+BOxbJy/Jd3RReoyzwKLcfwlaRA1j/0V9Ft4PoKnZUuwyelKjzpEaS BG5NyAkwsw8w+8sFIqiq+KEpUvsZb5RZ1CIsHDsmqNJpSxZYyoWnuUF1CI+2+0WXmtLR/f FjbI5fI3Gi3NU3T+0zCVKzL+vxK3W0T3JFD0I6C6iU5AiBwxyvFISVPFufHXIiD3gn72PY 1XhwJUiKc8a0AO6Vl55hJRoYHW93eZnf+ELs/2wnUXjv2GQBi/TTFRi5+He5D5Iwi2aF7Q RlipmXooHFoUAOkE8c9sbPkHNlCtXOx2bURroPZ5IRPBGVrYosMvXLTlxXXwJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdfzp3D4Lz18h5; Fri, 03 Oct 2025 20:15: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 593KFYkm042748; Fri, 3 Oct 2025 20:15:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593KFYot042745; Fri, 3 Oct 2025 20:15:34 GMT (envelope-from git) Date: Fri, 3 Oct 2025 20:15:34 GMT Message-Id: <202510032015.593KFYot042745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: f4f0b7c34027 - stable/15 - etc, ypserv: Fix symlink creation for pkgbase List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f4f0b7c34027378a117d581aba7151b982b1defa Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=f4f0b7c34027378a117d581aba7151b982b1defa commit f4f0b7c34027378a117d581aba7151b982b1defa Author: Lexi Winter AuthorDate: 2025-10-02 01:10:28 +0000 Commit: Lexi Winter CommitDate: 2025-10-03 19:21:38 +0000 etc, ypserv: Fix symlink creation for pkgbase The Makefile logic for /etc/aliases, /var/yp/Makefile and /etc/unbound tries to avoid creating the symlink if it already exists in the target, but this breaks with pkgbase since the symlink won't be installed (and therefore won't be added to METALOG) if building with an existing worldstage, meaning it's missing from the generated package. Change the logic to forcibly install the symlink if NO_ROOT is defined, but keep the existing logic for non-package builds to avoid trashing the user's custom symlinks on non-pkgbase installworld. MFC after: 3 seconds Reported by: cperciva Reviewed by: cperciva, emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52834 (cherry picked from commit 09cd3decf0fae4b769b04c1e900ed5935c40957e) --- etc/Makefile | 23 +++++++++++++++-------- usr.sbin/ypserv/Makefile | 5 ++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/etc/Makefile b/etc/Makefile index ab799b2f6c80..93d4b489ec7d 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -64,9 +64,12 @@ distribution: ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \ ${DESTDIR}/etc/os-release .if ${MK_UNBOUND} != "no" - if [ ! -e ${DESTDIR}/etc/unbound ]; then \ - ${INSTALL_SYMLINK} -T "package=unbound" \ - ../var/unbound ${DESTDIR}/etc/unbound; \ +# If NO_ROOT is defined, we are doing a stage install and always need to +# install the /etc/unbound symlink, otherwise, don't overwrite the user's +# existing symlink. + if [ "${NO_ROOT:Dtrue}" = true -o ! -e ${DESTDIR}/etc/unbound ]; then \ + ${INSTALL_SYMLINK} -Tpackage=unbound ../var/unbound \ + ${DESTDIR}/etc/unbound; \ fi .endif .if ${MK_SENDMAIL} != "no" @@ -82,12 +85,16 @@ distribution: .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ -T "package=runtime,config" ${ETCMAIL} ${DESTDIR}/etc/mail - if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ - ! -f ${DESTDIR}/etc/aliases ]; then \ - ${INSTALL_SYMLINK} -T "package=runtime" \ - mail/aliases ${DESTDIR}/etc/aliases; \ +# If NO_ROOT is defined, we are doing a stage install and always need to +# install the /etc/aliases symlink, otherwise, don't overwrite the user's +# existing symlink. + if [ "${NO_ROOT:Dtrue}" = true -o \( -f ${DESTDIR}/etc/mail/aliases -a \ + ! -f ${DESTDIR}/etc/aliases \) ]; then \ + ${INSTALL_SYMLINK} -Tpackage=runtime mail/aliases \ + ${DESTDIR}/etc/aliases; \ fi -.endif +.endif # ${MK_MAIL} != "no" + .if ${MK_SENDMAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ -T "package=sendmail" ${ETCMAIL_SENDMAIL} ${DESTDIR}/etc/mail diff --git a/usr.sbin/ypserv/Makefile b/usr.sbin/ypserv/Makefile index ba7eb1f86267..b4e59b719692 100644 --- a/usr.sbin/ypserv/Makefile +++ b/usr.sbin/ypserv/Makefile @@ -41,7 +41,10 @@ FILESNAME= Makefile.dist FILESDIR= /var/yp SCRIPTS= ypinit.sh -.if !exists(${DESTDIR}${FILESDIR}/Makefile) +# If NO_ROOT is defined, we are doing a stage install and always need to +# install the symlink, otherwise, don't overwrite the user's existing +# symlink. +.if defined(NO_ROOT) || !exists(${DESTDIR}${FILESDIR}/Makefile) SYMLINKS= ${FILESNAME} ${FILESDIR}/Makefile .endif From nobody Fri Oct 3 20:15:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdfzq6JqWz696bT; Fri, 03 Oct 2025 20:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdfzq4ldrz3thG; Fri, 03 Oct 2025 20:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0K8R+Vb2JayCNX5jHwnzHYpJG/MNJNFOA9BMvCC3rOY=; b=AfnFIfrAjEsu9lnyCVLrC0by+T+tLOmVSmvzm45mGXaVp3fzuynmr7SdBmlbAyOPWcczS0 IVOPNp7tGY5AaoaUEpC4Nztd1GQCALNVDMhgblv7f9JHFFnqj+oEo508nT2ZHK2RT2TdRi 9jik18J6m63uL1op9al7PSWxtniZGzxFIq+14yNIIMOXlSCNMBPqe3x6jz/upo09WGeWaQ +xx9nHz8hLQvZKqIdPsxihmCkFtkVGXCBaWqGMZoy6g/n88DAkVvT9vnyTPe3Xk3vYTKwH jEP/qK3bH4XK6TF8ZSACWbrfOkQ/BqCpG7Y1qQfQjY0s4YXZbcQaGVYTb9OjbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0K8R+Vb2JayCNX5jHwnzHYpJG/MNJNFOA9BMvCC3rOY=; b=P2+RvWkL/aRWjKKSFdtJ3IyIeSjoVpr2j+AM0qfQi771fyNMvVpwb6laytTDtjis0mfnaw Qze7FU8x1B7MkDODG4UK6biioP9YbXNzpYNntOXDnLihk+UKBNTv4xz+oTLE5WB4BVnV9F 3hNbj7LGkuC8spomkr2sz0m8QlKrtKI4PvcoPi4gaOJB/OcdGkgQ06xDyESp0COT2pL7og pD6olTJ/pgx9yiMo69Xl3pcyE096bQs37iz+6ANwWEN1Wjm8+4GGEmo6tI1hJi7LqqjE6O x3LJwmehfHviHTdXwQqqYQwSKXp8LFRuFKrDORnZ1X+huAxO+lzOSqZ+Kz+FoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759522535; a=rsa-sha256; cv=none; b=rAswSwDxeToCFCCW8Y1H4weHSmOKulKDYjbHyslZn6cJkH1it/8ayZn04vSJiqmkib5s9w ZURgyJx7ViB8iDnNyYA5sXVleCs2DZGJNB9RUbDsjsGBL46veKRwpK1G2wFNGEhG0+8B9n 6dMWqoCOI8zyA319m6TA0sbP/9P1l+VrEtlthKrVGNy0UcJWwGK+4e7OAizFihHx2WAKku khJE1edz5pTAGMKvtjIBB3IYO6TVedxl/ADoXSt/8lB6SeAu1XwHLs9tujgHON1eL8E9+P ljGdtjqtihcFNShdDpB2JjE1Fy9255ue1ac49VzcWJxfMLtKj+f4QPYz/kAHvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdfzq4MChz18Q1; Fri, 03 Oct 2025 20:15: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 593KFZKQ042782; Fri, 3 Oct 2025 20:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593KFZPf042779; Fri, 3 Oct 2025 20:15:35 GMT (envelope-from git) Date: Fri, 3 Oct 2025 20:15:35 GMT Message-Id: <202510032015.593KFZPf042779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: d63d221507d1 - stable/15 - libexec: Move blacklistd-helper to the blocklist package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d63d221507d14e904d8d1a9bdbaf1ce450c5800a Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=d63d221507d14e904d8d1a9bdbaf1ce450c5800a commit d63d221507d14e904d8d1a9bdbaf1ce450c5800a Author: Lexi Winter AuthorDate: 2025-10-02 01:12:01 +0000 Commit: Lexi Winter CommitDate: 2025-10-03 19:21:50 +0000 libexec: Move blacklistd-helper to the blocklist package Reviewed by: emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52830 (cherry picked from commit 63ce00f5d0b5dc34d57fb8d3969b875732c93eb2) --- libexec/blacklistd-helper/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/blacklistd-helper/Makefile b/libexec/blacklistd-helper/Makefile index 50fd3b5c982b..d32b69c278a8 100644 --- a/libexec/blacklistd-helper/Makefile +++ b/libexec/blacklistd-helper/Makefile @@ -1,5 +1,7 @@ BLOCKLIST_DIR=${SRCTOP}/contrib/blocklist +PACKAGE= blocklist + SCRIPTS= ${BLOCKLIST_DIR}/libexec/blacklistd-helper .include From nobody Fri Oct 3 20:15:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdfzr6lZPz696hT; Fri, 03 Oct 2025 20:15: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdfzr5F7Nz3tmt; Fri, 03 Oct 2025 20:15:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cK7fCTPDxIZF+rhoCLueZoeqgHgM1LOO353R4i5f4GY=; b=vk2LrkdfiaGf1AAIwS/t7kg2Q1q0HIoimzcP6CuRBej52h+BVy4xWC+ajhB47cHBFcMi5f Erc5SpmlLXj4Ns93kcHTyCNHVz24VIOMQl8ZiITC+clYauwnLnLtSc1g+c61hCJjTCfWyb Tm7ZXwfHmLic/7VO4MLwbCOtoXWdQh7GT85/1gHpSjzKoi8qSgXhRoFdR3SI0tqN8oQFEy /66jFuSDFl4ViTWLyYeGhuQUJ5djbWLqPsyqp4n/iDpsM0plV3JBDIIwMTzWg+u2r8+0MD g4yuD/9SJunmLIcARAqeEstl9TKV77aiQKzDSEZUUcvM/79mXkoQ+E/Iz7dWNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cK7fCTPDxIZF+rhoCLueZoeqgHgM1LOO353R4i5f4GY=; b=d/OTRjesvMU1fpScO3U6LktEgixCBdTIIg/pxiFz+iIWeD4mayCIp9OzyFjfBohxNbvIK2 ND+ijd1+bLbrkiMn0M3hhto9crJdMFihFgTzouHWV0jjUyo1re8/IBjMpHUKZisBGODGLF ULvXyFkAswXWlf7thHWDxkyhYW/IrzE07VPobvzcXpGsHzYFtR/8RaP3O3TNvrm2ys6Ow8 Ow/tWR8Qpy5BoBzBoFFm/xdDJ5hrEQFd+7/TRBz60TM44M4T0HgdebH+jC8CuAx+xwhhDk L16VTK0Qve7r4l3p0sP/b8/m5LW8NJT1f3d+MU35lF2v0nKsG4WZBZUIAQHq8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759522536; a=rsa-sha256; cv=none; b=CRT1Db6RMfbpCeThL9T6hcouuw0PRNAGn7QaixxgwwDs6M6BsjwIxeeqfTjBaY1KmYL+hg 1gCY7OvbSIeT37PA3oqWiL1juARg1uYvUHYBhzyENjySOh4gSzM0oz9SdKnClV2nhCkG4X w+9AJuF7Qy28A+ph2C7azEPOXUC7THskYG13us3haYnPa/W8vpvufTOUqsyHg4NI+AW3VV qpQdDPTKrKO/a+qLMEFkApxZeK1yDkq+8U1JGpArNNe2vSaRrDCrPOfPcQNVTX4ofbCsKn 0bEVMeqK24THjMz7zscSFwMsZTi0k90Ym32OYgKELSnyWFc1ibnbAW7BkHb3hg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdfzr4qyfz18Lw; Fri, 03 Oct 2025 20:15: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 593KFaEU042819; Fri, 3 Oct 2025 20:15:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593KFa6f042816; Fri, 3 Oct 2025 20:15:36 GMT (envelope-from git) Date: Fri, 3 Oct 2025 20:15:36 GMT Message-Id: <202510032015.593KFa6f042816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 15d367160d00 - stable/15 - bsdinstall/pkgbase: Restore the kernel-dbg component List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 15d367160d000daaeef1503c6ef770a773902145 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=15d367160d000daaeef1503c6ef770a773902145 commit 15d367160d000daaeef1503c6ef770a773902145 Author: Lexi Winter AuthorDate: 2025-10-02 01:13:56 +0000 Commit: Lexi Winter CommitDate: 2025-10-03 19:21:59 +0000 bsdinstall/pkgbase: Restore the kernel-dbg component Commit 561dc357c2f5 changed the way we handle components in the prompt, and accidentally resulted in the kernel-dbg component not being listed since we now hide all components ending in "-dbg". Add an exception for kernel-dbg to bring it back. Fixes: 561dc357c2f5 ("bsdinstall: Use package sets for pkgbase install") MFC after: 3 seconds Reviewed by: emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52826 (cherry picked from commit ed6716207debca81c37a1399ecf1d799be0e688d) --- usr.sbin/bsdinstall/scripts/pkgbase.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in index d02d89b23865..14ef67723d59 100755 --- a/usr.sbin/bsdinstall/scripts/pkgbase.in +++ b/usr.sbin/bsdinstall/scripts/pkgbase.in @@ -117,7 +117,7 @@ local function select_components(components, options) -- are only offered if no_kernel is set. if component ~= "pkg" and not component:match("^minimal") and - not component:match("%-dbg$") and + not (component:match("%-dbg$") and component ~= "kernel-dbg") and not (component == "kernels") and not (not options.no_kernel and component:match("%-jail$")) then table.insert(sorted_components, component) From nobody Fri Oct 3 21:58:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdjGP1xDPz69K1p; Fri, 03 Oct 2025 21:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdjGP1Qzrz3Btg; Fri, 03 Oct 2025 21:58:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759528701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MkO4gyIcGyF9M5ERzooQR29Urq0kT2fzDoIVvP/i+s=; b=wHQ6xC8lY774vWqLBkthlwpVyrTLIijqGnbyxaAmutID7JcbCiHUFx+6oR8wtUbfdfVL0P pjybqlM/etrfDjAE+J3gvC4TH/y77oJt4U7yLWv7opm+YSrilnv23d7mxyXVZ5PivypxwJ 4JKwOjaZdN+fUUbsXTGs+ZPcQPrKLzt0nTD98q0qPWilMj0QblFpHOVJHasUpUVrq5QYVs 4jWyLdsZfumfnDyeirFx2jFXKLoPJNUffBdW1oa7gy6CB7DAKqdUsjbS4NtE/0Hg5s9KzL QIlVnHbq9iSEfzvj0YfTLxPYqRdwrjp7b4EpmVwaHxjDFfG/BfAYlwtkE6jccA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759528701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8MkO4gyIcGyF9M5ERzooQR29Urq0kT2fzDoIVvP/i+s=; b=aALx4Dq1YhEhfjPR17hRpOjpcoYNWDTufMbin1VMic2tjX/1Iv9SfsqPnCaIoNLZhEVJ10 GxST+ZKsqyEWI6+2ueLCbJ60rHsxUJD6iD5S2V/J09py9mTLauP/zGF5NinzNKCJIgwd3L NLkKm7EBHP+p7yPqPIAayjVjQrk+9BTKQrTbYbbJdDsibLiEA2czERiGMSoBW3zHJGYTZh zyaxsbZcwfux9ZxGWQgpjAkPAUgKGEvB53BcqpBYpBodAOW2vjKi0OiPYD2NtXMdQfC90z uzvDwwVCaDfnNx1qnuUFmIf0aUzjjLj/l3VRDZZCVgQsjSN4B44xmM72t63qHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759528701; a=rsa-sha256; cv=none; b=fRSBlbeT/kB/h9MG1tR6cKIqETQ5WRhijXZxfk+WNPHJEoaHluAyPYDlc64Kbe/AEfN1zP GyBDAgG+ors9liAktz/5nHXL4JBbK8cN0BKp0Kdgd+U8l5UtdeZFQ9TSjgEghEvmSMWC+y qiz3XkordVAf0NRQqSqXsqTLB/46eZL6j5Pc9sdOUgAIdih2NEUx5JHvVlrPpkHBAjGc2z gIeEwoU2/s+eJExhCG/eZnBaD7A+iOvV6nLi326coD7wrhfs6dOGR5oEMDSMWU9k9Kw3PY qDJvI8L7h4ypr3a2tU2HYTd5RcKJSvDHcLuwY+BBcCBZfdStw4xGmmrX+zp00w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdjGP11B5z1CBw; Fri, 03 Oct 2025 21:58: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 593LwLG5030745; Fri, 3 Oct 2025 21:58:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593LwLBB030742; Fri, 3 Oct 2025 21:58:21 GMT (envelope-from git) Date: Fri, 3 Oct 2025 21:58:21 GMT Message-Id: <202510032158.593LwLBB030742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: aff08d3191f4 - stable/15 - bsdinstall: Improve pkgbase handling for jails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: aff08d3191f4d70c06f95a00331a665b6cc5e62a Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=aff08d3191f4d70c06f95a00331a665b6cc5e62a commit aff08d3191f4d70c06f95a00331a665b6cc5e62a Author: Lexi Winter AuthorDate: 2025-10-03 21:36:30 +0000 Commit: Lexi Winter CommitDate: 2025-10-03 21:54:14 +0000 bsdinstall: Improve pkgbase handling for jails Add a new --jail option to the pkgbase script which installs jail-specific set variants if they exist: * "minimal" is replaced with "minimal-jail" * A kernel is not installed. * For sets shown in the component selection dialogue, only show the appropriate variant (jail or non-jail) for the target. Modify the jail script to pass --jail to the pkgbase script. Remove the redundant --no-kernel option, which was added in 15.0 and was only used to install jails. MFC after: 3000ms Reviewed by: ifreund_freebsdfoundation.org Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52829 (cherry picked from commit 8d0a90512ee35064697fbeffd0886eba4c82eb8d) --- usr.sbin/bsdinstall/bsdinstall.8 | 8 +-- usr.sbin/bsdinstall/scripts/jail | 2 +- usr.sbin/bsdinstall/scripts/pkgbase.in | 94 +++++++++++++++++++++++----------- 3 files changed, 70 insertions(+), 34 deletions(-) diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index 5ccbaef87835..527250d380d1 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -244,7 +244,7 @@ Extracts the distributions listed in .Ev DISTRIBUTIONS into .Ev BSDINSTALL_CHROOT . -.It Cm pkgbase Op Fl --no-kernel +.It Cm pkgbase Op Fl --jail Fetch and install base system packages to .Ev BSDINSTALL_CHROOT . Packages are fetched according to repository configuration in @@ -253,8 +253,10 @@ if set, or .Lk pkg.freebsd.org otherwise. If the -.Fl --no-kernel -option is passed, no kernel is installed. +.Fl --jail +option is passed, no kernel is installed, and the +.Dq jail +variant of each package set will be selected where applicable. .It Cm firmware executes .Xr fwget 8 diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail index 0c3c7e125fdd..f2c7ef2b37de 100755 --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -183,7 +183,7 @@ if [ ! "$nonInteractive" == "YES" ]; then fi if [ "$PKGBASE" == yes ]; then - bsdinstall pkgbase --no-kernel || error "Installation of base system packages failed" + bsdinstall pkgbase --jail || error "Installation of base system packages failed" else distbase fi diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in index 14ef67723d59..5299d34fcb71 100755 --- a/usr.sbin/bsdinstall/scripts/pkgbase.in +++ b/usr.sbin/bsdinstall/scripts/pkgbase.in @@ -80,7 +80,9 @@ local function select_components(components, options) ["kernel-dbg"] = "Debug symbols for the kernel", ["devel"] = "C/C++ compilers and related utilities", ["optional"] = "Optional software (excluding compilers)", + ["optional-jail"] = "Optional software (excluding compilers)", ["base"] = "The complete base system (includes devel and optional)", + ["base-jail"] = "The complete base system (includes devel and optional)", ["src"] = "System source tree", ["tests"] = "Test suite", ["lib32"] = "32-bit compatibility libraries", @@ -91,6 +93,7 @@ local function select_components(components, options) -- by default. local defaults = { ["base"] = "on", + ["base-jail"] = "on", ["kernel-dbg"] = "on", } -- Enable compat sets by default. @@ -101,40 +104,66 @@ local function select_components(components, options) -- Sorting the components is necessary to ensure that the ordering is -- consistent in the UI. local sorted_components = {} + + -- Determine which components we want to offer the user. + local show_component = function (component) + -- "pkg" is always installed if present. + if component == "pkg" then return false end + + -- Don't include individual "-dbg" components, because those + -- are handled via the "debug" component, except for kernel-dbg + -- which is always shown for non-jail installations. + if component == "kernel-dbg" then + return (not options.jail) + end + if component:match("%-dbg$") then return false end + + -- Some sets have "-jail" variants which are jail-specific + -- variants of the base set. + + if options.jail and components[component.."-jail"] then + -- If we're installing in a jail, and this component + -- has a jail variant, hide it. + return false + end + + if not options.jail and component:match("%-jail$") then + -- Otherwise if we're not installing in a jail, and + -- this is a jail variant, hide it. + return false + end + + -- "minimal(-jail)" is always installed if present. + if component == "minimal" or component == "minimal-jail" then + return false + end + + -- "kernel" (the generic kernel) and "kernels" (the set) are + -- never offered; we always install the kernel for a non-jail + -- installation. + if component == "kernel" or component == "kernels" then + return false + end + + -- If we didn't find a reason to hide this component, show it. + return true + end + for component, _ in pairs(components) do - -- Decide which sets we want to offer to the user: - -- - -- "minimal" is not offered since it's always included, as is - -- "pkg" if it's present. - -- - -- "-dbg" sets are never offered, because those are handled - -- via the "debug" component. - -- - -- "kernels" is never offered because we only want one kernel, - -- which is handled separately. - -- - -- Sets whose name ends in "-jail" are intended for jails, and - -- are only offered if no_kernel is set. - if component ~= "pkg" and - not component:match("^minimal") and - not (component:match("%-dbg$") and component ~= "kernel-dbg") and - not (component == "kernels") and - not (not options.no_kernel and component:match("%-jail$")) then + if show_component(component) then table.insert(sorted_components, component) end end + table.sort(sorted_components) local checklist_items = {} for _, component in ipairs(sorted_components) do - if component ~= "kernel" and not - (component == "kernel-dbg" and options.no_kernel) then - local description = descriptions[component] or "" - local default = defaults[component] or "off" - table.insert(checklist_items, component) - table.insert(checklist_items, description) - table.insert(checklist_items, default) - end + local description = descriptions[component] or "" + local default = defaults[component] or "off" + table.insert(checklist_items, component) + table.insert(checklist_items, description) + table.insert(checklist_items, default) end local bsddialog_args = { @@ -162,7 +191,12 @@ local function select_components(components, options) -- to work. The base set depends on minimal, but it's fine to install -- both, and this way the user can remove the base set without pkg -- autoremove then trying to remove minimal. - local selected = {"minimal"} + local selected = {} + if options.jail then + table.insert(selected, "minimal-jail") + else + table.insert(selected, "minimal") + end -- If pkg is available, always install it so the user can manage the -- installed system. This is optional, because a repository built @@ -171,7 +205,7 @@ local function select_components(components, options) table.insert(selected, "pkg") end - if not options.no_kernel then + if not options.jail then table.insert(selected, "kernel") end @@ -264,8 +298,8 @@ end local function parse_options() local options = {} for _, a in ipairs(arg) do - if a == "--no-kernel" then - options.no_kernel = true + if a == "--jail" then + options.jail = true else io.stderr:write("Error: unknown option " .. a .. "\n") os.exit(1) From nobody Sat Oct 4 00:28:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdmbG276kz69bly; Sat, 04 Oct 2025 00:28: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdmbG1VlCz3Sgy; Sat, 04 Oct 2025 00:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759537690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EnYe2JsfeZNTk5MNw7qdPYKYdHCUh08XQIkm5Pcj6IY=; b=P95Sfi70Wv6eeS9zZk6AO0F8vwL09Hqkyyv+Uno6F6RwLzpS7h6DQzoCOi4qIsN6/MGd1H 6g7/a9wm2aUQbZP3NuGpa9gkZmbTO5JB7sv9gjRQNvo37wdxLlfUjxIO8gh6LdcEooLilR 6FseuFAs33tZMoJP5TI2xaCpcJv8MwJ7YxMptQP2+g9UaqI3rDIjXOTXBEJ4uz7mgU0+Zb JMfsJdVCRUYp06tqfRqba77z++w2esMIsVvUhVjyldtyDInRrNecv/NYmhqt4jqEP95xuM VGeS98e1JWFx6Tv2LaX8IqH+xPI7LJd52irHHPtLJE3OTAzGDqEK96AjukiskQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759537690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EnYe2JsfeZNTk5MNw7qdPYKYdHCUh08XQIkm5Pcj6IY=; b=HvbN9lWBdpLeYDaQlN+OV/LpoTYVGAJqocwPvPMn0dEfsE6txPl9Sm1MWGdX+kkttonLlR 7HQNyXiG8kXTJtNvwQidh06PMH8Y6LQ0xOTQ7VM8RkVxrcNWl/eFWTgvHyvTDlVTMFiUWi 29uUHS9WQQnJEelEdyYJYlKeo0ej8T1l6DzpH26WcrtMCLjcw1EFRPPgLDNUhmmwvQvdEz wdT1a0W9hTF5Vvcqt0yUPrYtnW2XAw31jPFULWuIO+WpuuZigfu6pEejEXFh4vz+Hq/+Xd +qNP3jTB1twWo5mVVDiomAUR1oDiFSLzgYJKHjF+BUq65VbXuGwetqOdg0xZtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759537690; a=rsa-sha256; cv=none; b=ZIwael8FoW0afSYdBysxQS46ruTy9KzhqeSjpXDxU926V4w5UMcBTObNJaO0Mb5gZyC18B NJFb6U5sqo2IPneOJtoCv9pVnbEMHYPLlA0QY57c29c/kmr2kOaqfet4Jmn9tMTMhz8ZcG 9bbGtP+zK0Mv/8QQZHX8R5kuOkdUzhsFvscS6jHJ27tVjCs/Oh13slzBXcLYpQDOAG0vyG YzRY4e62KNE04bcHVyQwDj193yAt0hxrlqgEvdQ/ejjWF312eD6gwVcZwp25lUHrxvRpBh FVKSuZF08pwp4uhoDF0fEfngp/px1Rf2/6mawV0O306F73NTLw2TIrTDWi92UQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdmbG101qz35g; Sat, 04 Oct 2025 00:28: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 5940SAn1011753; Sat, 4 Oct 2025 00:28:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5940SAlh011750; Sat, 4 Oct 2025 00:28:10 GMT (envelope-from git) Date: Sat, 4 Oct 2025 00:28:10 GMT Message-Id: <202510040028.5940SAlh011750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4b734c477446 - stable/15 - bsdinstall: Add loader.efi to all ESPs we create List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 4b734c47744611d1d2bd61d15045b7903d4c35be Auto-Submitted: auto-generated The branch stable/15 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4b734c47744611d1d2bd61d15045b7903d4c35be commit 4b734c47744611d1d2bd61d15045b7903d4c35be Author: Warner Losh AuthorDate: 2025-09-30 02:46:57 +0000 Commit: Warner Losh CommitDate: 2025-10-04 00:27:07 +0000 bsdinstall: Add loader.efi to all ESPs we create For proper redundancy, add copies of loader.efi to each of the ESPs we create when we create multi-volume ZFS datasets. zfsboot creates a list of secondary ESPs, while bootpart doesn't create any (it's the UFS partitioning tool) because we don't supporg UFS over gmirror. The primary ESP is mounted and is what we use efibootmgr to boot from. The redundant copies allow the system to boot if the primary disks fails. Sponsored by: Netflix MFC After: 2 days PR: 208802 Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D52780 (cherry picked from commit 494de51bc0074472d1b01604f085daea0844f240) --- usr.sbin/bsdinstall/scripts/auto | 3 ++ usr.sbin/bsdinstall/scripts/bootconfig | 61 ++++++++++++++++++++++------------ usr.sbin/bsdinstall/scripts/zfsboot | 28 +++++++++------- 3 files changed, 59 insertions(+), 33 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index 0b47d496fdbd..61d52065af2a 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -178,6 +178,9 @@ environment_save rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC +# Reset the ESP list +: > ${TMPDIR:-"/tmp"}/bsdinstall-esps + # With pkgbase, pkg OOM has been observed with QEMU-default 128 MiB memory size. # Ensure we have at least about 256 MiB (with an allowance for rounding etc.). physmem=$(($(sysctl -n hw.physmem) / 1048576)) diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 41243ad14b9b..6736e78b450a 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -63,6 +63,24 @@ dialog_uefi_entryname() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD } +# Copy to the normal FreeBSD location. Also copy to the default location if it +# doesn't exist. This covers setups where UEFI NV variables can't be set and +# some buggy firmware, while preserving complex UEFI setups for multiple booting +# (rEFInd, etc). +uefi_copy_loader() +{ + local ldr=$1 + local freebsd_dir=$2 + local default_dir=$3 + local dest=$4 + + mkdir -p "${freebsd_dir}" "${default_dir}" + cp "${ldr}" "${freebsd_dir}" + if [ ! -f "${default_dir}/${dest}" ]; then + cp "${ldr}" "${default_dir}/${dest}" + fi +} + update_uefi_bootentry() { nentries=$(efibootmgr | grep -c "${EFI_LABEL_NAME}$") @@ -113,6 +131,7 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then *) die "Unsupported arch $(uname -m) for UEFI install" esac + # Support the weird 32-bit firmware loading 64-bit kernels if [ `sysctl -n machdep.efi_arch` == i386 ]; then ARCHBOOTNAME=ia32 file=loader_ia32.efi @@ -120,31 +139,31 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then file=loader.efi fi - BOOTDIR="/efi/boot" - BOOTNAME="${BOOTDIR}/boot${ARCHBOOTNAME}.efi" - FREEBSD_BOOTDIR="/efi/freebsd" - FREEBSD_BOOTNAME="${FREEBSD_BOOTDIR}/${file}" + # Copy the boot loader mntpt="$BSDINSTALL_CHROOT/boot/efi" - f_dprintf "Installing ${file} onto ESP" - mkdir -p "${mntpt}/${FREEBSD_BOOTDIR}" "${mntpt}/${BOOTDIR}" - cp "$BSDINSTALL_CHROOT/boot/${file}" "${mntpt}/${FREEBSD_BOOTNAME}" - - # - # UEFI defines a way to specifically select what to boot - # (which we do via efibootmgr). However, if we booted from an ia32 - # UEFI environment, we wouldn't have access to efirt. In addition, - # virtual environments often times lack support for the NV variables - # efibootmgr sets, and some UEFI implementations have features that - # interfere with the setting of these variables. To combat that, we - # install the default removable media boot file if it doesn't exist. - # We don't install it all the time since that can interfere with other - # installations on the drive (like rEFInd). - # - if [ ! -f "${mntpt}/${BOOTNAME}" ]; then - cp "$BSDINSTALL_CHROOT/boot/${file}" "${mntpt}/${BOOTNAME}" + uefi_copy_loader "$BSDINSTALL_CHROOT/boot/${file}" \ + "${mntpt}/efi/freebsd" "${mntpt}/efi/boot" \ + boot${ARCHBOOTNAME}.efi + + # zfsboot records the extra esp partitions it creates to -esps. These + # are newfs'd at the time of creation. We don't support installing ufs + # over gmirror, so we only do this for ZFS. + esps=${TMPDIR:-"/tmp"}/bsdinstall-esps + if [ -f "$esps" ]; then + mntpt=$(mktemp -d -t bsdinstall-esp) + for dev in $(cat $esps); do + f_dprintf "Installing ${file} onto redundant ESP ${dev}" + mount -t msdos "$dev" "$mntpt" + uefi_copy_loader "$BSDINSTALL_CHROOT/boot/${file}" \ + "${mntpt}/efi/freebsd" "${mntpt}/efi/boot" \ + boot${ARCHBOOTNAME}.efi + umount "$mntpt" + done + rmdir "${mntpt}" fi + # Try to set the UEFI NV BootXXXX variables to recod the boot location if [ "$BSDINSTALL_CONFIGCURRENT" ] && [ "$ARCHBOOTNAME" != ia32 ]; then update_uefi_bootentry fi diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 5fbf56ea59ac..95cbba3fa131 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -760,6 +760,7 @@ zfs_create_diskpart() { local funcname=zfs_create_diskpart local disk="$1" index="$2" + local efibootpart # Check arguments if [ ! "$disk" ]; then @@ -867,18 +868,22 @@ zfs_create_diskpart() $disk || return $FAILURE # We'll configure the ESP in bootconfig - if [ -z "$efibootpart" ]; then - efibootpart="/dev/gpt/efiboot$index" - f_dprintf "$funcname: configuring ESP at [%s]" \ - "${efibootpart}" - - f_eval_catch $funcname newfs_msdos "$NEWFS_ESP"\ - "$efibootpart" \ - || return $FAILURE + # Note: This will always be p1 + efibootpart="/dev/gpt/efiboot$index" + f_dprintf "$funcname: configuring ESP at [%s]" \ + "${efibootpart}" + + f_eval_catch $funcname newfs_msdos "$NEWFS_ESP"\ + "$efibootpart" \ + || return $FAILURE + if [ $index -eq 0 ]; then f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - $efibootpart /boot/efi msdosfs \ - rw 2 2 "$BSDINSTALL_TMPETC/fstab" \ - || return $FAILURE + $efibootpart /boot/efi msdosfs \ + rw 2 2 "$BSDINSTALL_TMPETC/fstab" \ + || return $FAILURE + else + # Record the extra ones + echo "${efibootpart}" >> ${TMPDIR:-"/tmp"}/bsdinstall-esps fi fi @@ -1021,7 +1026,6 @@ zfs_create_boot() local isswapmirror local bootpart targetpart swappart # Set by zfs_create_diskpart() below local create_options - local efibootpart # # Pedantic checks; should never be seen From nobody Sat Oct 4 00:36:59 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdmnR25hCz69cPm; Sat, 04 Oct 2025 00:36: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdmnR1SyMz3VGy; Sat, 04 Oct 2025 00:36:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759538219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12XWZD1d/NpHmQafyVChRPOMUaaeAwFoMc4If8lXmrg=; b=F/UUIX8mg6iNeleQmbnCNT5H08nV62sq/qoZL2Kb4lbsOeZGLDktJe80oXZoXg6OxlROB8 6ZNTl6cfUs+MnOkseVd6IuR5qhvrqsRBnCJ0CTz4JWSmTQnrG9YxgFrMg9vYILYvl74Sti XnMylyutjMSvgjmQWEuytX7nqa8eqlIEv8ZRv4xjlz4hsNUt8cC5Okv00P5rsY5QJYINaL 1kyModEvJpYzlCNQn/JkjwcRHLj+NHT0NlBBy3Seus0Gkw6t1z+8Ba0ZdakG/CX+jnzb7G ncoONmtZZEti1lywrtbwnocTEWsWDJq+bvOIYgrEGtqdxFlBJbdjTFLPAhQ32g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759538219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12XWZD1d/NpHmQafyVChRPOMUaaeAwFoMc4If8lXmrg=; b=HRSOwfM/n4lcpqdvq2mfjPDi/NygP4jn0LqE1Xo1RIG/Te2CGDBm9RPhXFo5xOAgwDb3hS pUgXNfufZqKZMnFSAr3Bi1Xvh76xq6CkdFGnjtvzRRzAdP/ibntoFD6JQmglkSgrTthXbY 9gDG5+WJIYHbRX2fWmcOcnXmhP8Hj4Nr4csYB3OZ0AhpvRneXUHPqUvwAlj/fQ7Wm7U68j WEZLjsibbaAVNb401pfNo0kLDuqPmOLTgCG4Ljl/l9tbvK/5Jw6BWJmzVGC0xEV95EaKzc o22jWG0XCL+P59JhY+o26Wk324OkX+sqbsOCLXRxGZ/Rw6cdtE5nEtArZZfWnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759538219; a=rsa-sha256; cv=none; b=tSxCes9jrJDVwxOYMV4rj44fiP71+IcmBzEIbhTyIxg/RfHYZfBlDg5A4tTqhocrgbVgV5 Uq0G21YBgy5s5WCQtGvPKsmH8syJ7/JhzSt5KS4g7BcSuTbRqwhJnZ3ChIJxqWQrn72bK+ 2/KoB9hA0Ux7r8xksn9nIQpG8Nwoh9YU/hoezGLX1NazHo/z4xm0rE0blwk88BiBObTR5V StN6tNthkixExsh27JZLwORvSICMw4n5gxMm3mGl1w89T4h2lTNcjfvw/dexdv5D0T0otW BuiK3vggqJi/gnARUYJS5vKf9HkjDya7YlPd+EiHUmvZrUHHXu/AXrEHJD2oUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdmnR0lqfz3JJ; Sat, 04 Oct 2025 00:36: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 5940ax2Y030471; Sat, 4 Oct 2025 00:36:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5940ax1T030467; Sat, 4 Oct 2025 00:36:59 GMT (envelope-from git) Date: Sat, 4 Oct 2025 00:36:59 GMT Message-Id: <202510040036.5940ax1T030467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: afdc022deb91 - stable/15 - release: Publish pkgbase-repo.tar List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: afdc022deb9124e47a8d623417fb487d6ea89862 Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=afdc022deb9124e47a8d623417fb487d6ea89862 commit afdc022deb9124e47a8d623417fb487d6ea89862 Author: Colin Percival AuthorDate: 2025-10-03 23:57:33 +0000 Commit: Colin Percival CommitDate: 2025-10-04 00:36:51 +0000 release: Publish pkgbase-repo.tar This is a tarball containing the pkgbase repository for the release. Note: This is an uncompressed tarball, because all of its constituent .pkg files are already compressed; there's no point adding another layer of compression. Reviewed by: ivy MFC after: 1 minute Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D52899 (cherry picked from commit d0ff67db2908a56b2f146963bb79f1a8e6283131) --- release/Makefile | 14 +++++++++++++- release/Makefile.mirrors | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/release/Makefile b/release/Makefile index f7ce537cb4c4..fb95deb76b68 100644 --- a/release/Makefile +++ b/release/Makefile @@ -132,6 +132,9 @@ RELEASE_TARGETS+= mini-memstick.img IMAGES+= memstick.img IMAGES+= mini-memstick.img .endif +.if !defined(NOPKGBASE) || empty(NOPKGBASE) +RELEASE_TARGETS+= pkgbase-repo.tar +.endif CLEANFILES= packagesystem *.txz MANIFEST release ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) @@ -142,7 +145,7 @@ CLEANFILES+= ${I}.xz .if defined(WITH_DVD) && !empty(WITH_DVD) CLEANFILES+= pkg-stage .endif -CLEANDIRS= dist pkgdb-dvd pkgdb-disc1 pkgbase-repo pkgbase-repo-dir ftp disc1 disc1-disc1 disc1-memstick bootonly bootonly-bootonly bootonly-memstick dvd +CLEANDIRS= dist pkgdb-dvd pkgdb-disc1 pkgbase-repo pkgbase-repo-dir ftp disc1 disc1-disc1 disc1-memstick bootonly bootonly-bootonly bootonly-memstick dvd pkgbase-repo.tar beforeclean: chflags -R noschg . .include @@ -213,6 +216,9 @@ pkgbase-repo: ( ${IMAKE} -C ${WORLDDIR} packages REPODIR=${.OBJDIR}/pkgbase-repo \ INCLUDE_PKG_IN_PKGBASE_REPO=YES BOOTSTRAP_PKG_FROM_PORTS=YES ) +pkgbase-repo.tar: pkgbase-repo + tar -cf pkgbase-repo.tar -C pkgbase-repo . + pkgbase-repo-dir: pkgbase-repo mkdir -p pkgbase-repo-dir printf "FreeBSD-base: { url: "file://%s", enabled: yes }" \ @@ -457,6 +463,12 @@ release-install: ( cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512 ) ( cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 ) .endif +.if !defined (NOPKGBASE) || empty(NOPKGBASE) + mkdir -p ${DESTDIR}/pkgbase + cp -p pkgbase-repo.tar ${DESTDIR}/pkgbase/ + ( cd ${DESTDIR}/pkgbase && sha256 pkgbase-repo.tar > CHECKSUM.SHA256 ) + ( cd ${DESTDIR}/pkgbase && sha512 pkgbase-repo.tar > CHECKSUM.SHA512 ) +.endif .include "${.CURDIR}/Makefile.inc1" .include "${.CURDIR}/Makefile.vm" diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors index 5e65bfbe8b3f..958ac7717616 100644 --- a/release/Makefile.mirrors +++ b/release/Makefile.mirrors @@ -63,6 +63,11 @@ STAGE_TARGETS+= oci-images-stage OCI_DIR= ${TLD}/OCI-IMAGES/${REVISION}-${BRANCH}/${TARGET_ARCH} .endif +.if !defined(NOPKGBASE) || empty(NOPKGBASE) +STAGE_TARGETS+= pkgbase-repo-stage +PKGBASE_DIR= ${TLD}/PKGBASE-REPOS/${REVISION}-${BRANCH}/${TARGET_ARCH} +.endif + CLEANFILES+= ${STAGE_TARGETS} CHECKSUM_FILES?= SHA512 SHA256 SNAP_SUFFIX!= echo ${_SNAP_SUFFIX:S,^-,,1} | tr -d ' ' @@ -366,5 +371,44 @@ oci-images-stage: . endfor .endif +pkgbase-repo-stage: + mkdir -p ${PKGBASE_DIR} +.if defined(SNAPSHOT) && !empty(SNAPSHOT) +. if exists(${PKGBASE_DIR}/Latest) + rm -rf ${PKGBASE_DIR}/Latest +. endif + mkdir -p ${PKGBASE_DIR}/Latest + mkdir -p ${PKGBASE_DIR}/${BUILDDATE} + cd ${RELEASEDIR}/pkgbase && \ + mv pkgbase-repo.tar pkgbase-repo-${SNAP_SUFFIX}.tar + cp -p ${RELEASEDIR}/pkgbase/pkgbase-repo-${SNAP_SUFFIX}.tar \ + ${PKGBASE_DIR}/${BUILDDATE}/pkgbase-repo-${SNAP_SUFFIX}.tar + cd ${PKGBASE_DIR}/Latest && \ + ln -s ../${BUILDDATE}/pkgbase-repo-${SNAP_SUFFIX}.tar \ + pkgbase-repo.tar + cd ${RELEASEDIR}/pkgbase && rm -f CHECKSUM.* +. for CHECKSUM in ${CHECKSUM_FILES} + cd ${RELEASEDIR}/pkgbase && \ + ${CHECKSUM:tl} pkgbase-repo-*.tar > CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} + cp -p ${RELEASEDIR}/pkgbase/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \ + ${PKGBASE_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} + cd ${PKGBASE_DIR}/Latest && \ + ln -s ../${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \ + CHECKSUM.${CHECKSUM} +. endfor +.else # not snapshot +. if exists(${PKGBASE_DIR}/Latest) + rm -rf ${PKGBASE_DIR}/Latest +. endif + mkdir -p ${PKGBASE_DIR}/Latest + cp -p ${RELEASEDIR}/pkgbase/pkgbase-repo.tar \ + ${PKGBASE_DIR}/Latest/pkgbase-repo.tar +. endfor +. for CHECKSUM in ${CHECKSUM_FILES} + cp -p ${RELEASEDIR}/pkgbase/CHECKSUM.${CHECKSUM} \ + ${PKGBASE_DIR}/Latest/CHECKSUM.${CHECKSUM} +. endfor +.endif + ftp-stage: remove-old-bits ${STAGE_TARGETS} From nobody Sat Oct 4 03:48:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cds2P4X8xz69VLx; Sat, 04 Oct 2025 03:48: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cds2P3lX4z3wBp; Sat, 04 Oct 2025 03:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759549709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gB39oE2o57LLyuDTuzmiRTAgt1Lmq6yebgcupmbLX0c=; b=dGoUTVPjvWpKEq3Ikvo5Ud4mq85a8fLA9c69LVL6Mo/za0JtuFVzdCJrEaAW8x26AiTngi 0jJrOXxcMyfok5CL3vyCQsqkKANNNzqa0IcFTnM3ZM0P8p6M8wb0KkGwM8DUQNZJ88JzBy U86gNBMnkruhQBnrTqzYSI43aDczVCVVVzh3ELGw2H8Vujp3eIVMiQ2Q0ZnTyTVuqomZl3 QSq/7S9tmdwpLkHO4PfEU+mzKQZwlb7Dhk8ZNQ9LRltf4VhpyCM8S5Z/g9JsGIGl/JqgXs AwPNPEv7WbLgWAe8ozbOcc9HSlL7i/9nCl2iEaLyCAQmurCi6j43uVfGuJXFgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759549709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gB39oE2o57LLyuDTuzmiRTAgt1Lmq6yebgcupmbLX0c=; b=tbzci4wzU67qyEwplrhuu8HfpS/Q5Fc9nfxMaZNPOihtRCYl28Dnh3lUQam+x4LtGLIxVa 9blz38ELSM/HnWtli0bTXELei5cAc2nxNscisD4vZVJwWcXD/9iEJfwYaqQZNRw+3P6pUO q0jcevBXmmeoIwQdvCEAd0vnP8ie935ptHgl7E8ej1C1vyNXBcIh3F7g0WuXB8lgOaYbsz WRdYvKUUReAGxf3UmlaTjJiY9gpL4fX/7sbk701/IVL2fhbBONLymRh7NH3AN95wS5it/K 9deJ8zjvZixo2WfIq9B2ZDIf84a77fb1qDpABdysC5HUKldlxiYTUF05tSgiXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759549709; a=rsa-sha256; cv=none; b=XTCNFQvaC2cwXcA+yA5yYgbkUA5VToudzpeS+4AgImSy7ma1pIpH52jhsQqHus6B5G8TGZ ZLKRKKVYr0bPhTMQqhZdqUwXw7p/DTLOBR2YUAX6aoTZ4G2CTDpt2IYMCe0BEZiPUHjt+e yXv7QZckf+UqKnDb8GAgLPM0+/LRgJQxA9XgCw1LI80HPWqErdaSDbF0BS9fK6JezwvpeG cIyTFDhXXhKTwr8hdKAP/VCM1uMfC9c5IH9t9rFAxQYpwaGhoulEE4wUxZRreHTYFW9Vpt Rd6Z1Is+0ov8cJBDiDulT0MJQksg9yM7EYG9v7cxBW70rAcIfRDqRfzKYtwX4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cds2P3LDmz8bq; Sat, 04 Oct 2025 03:48: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 5943mTXX091290; Sat, 4 Oct 2025 03:48:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5943mTZ9091287; Sat, 4 Oct 2025 03:48:29 GMT (envelope-from git) Date: Sat, 4 Oct 2025 03:48:29 GMT Message-Id: <202510040348.5943mTZ9091287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 5f20a4333b45 - stable/15 - trim.8: update the manual with references to zpool-trim and fsck_ffs -E List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 5f20a4333b450e02d9242b6df8f3c9b4bcdd9713 Auto-Submitted: auto-generated The branch stable/15 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=5f20a4333b450e02d9242b6df8f3c9b4bcdd9713 commit 5f20a4333b450e02d9242b6df8f3c9b4bcdd9713 Author: Eugene Grosbein AuthorDate: 2025-10-01 04:05:54 +0000 Commit: Eugene Grosbein CommitDate: 2025-10-04 03:48:10 +0000 trim.8: update the manual with references to zpool-trim and fsck_ffs -E (cherry picked from commit 5d8fde850768d31f722de6177204ec7cab199bd1) --- usr.sbin/trim/trim.8 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/usr.sbin/trim/trim.8 b/usr.sbin/trim/trim.8 index a4874c54c183..eef369703715 100644 --- a/usr.sbin/trim/trim.8 +++ b/usr.sbin/trim/trim.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 20, 2025 +.Dd October 1, 2025 .Dt TRIM 8 .Os .Sh NAME @@ -48,9 +48,16 @@ The .Nm utility erases specified region of the device. -It is mostly relevant for storage that implement trim (like flash based, +It is mostly relevant for a storage that implements trim (like flash based, or thinly provisioned storage). .Sy All erased data is lost. +Alternatively, refer to the +.Xr fsck_ffs 8 +command having a flag +.Fl E +to trim populated UFS, and to the +.Xr zpool-trim 8 +command to trim existing ZFS pool. .Pp The following options are available: .Bl -tag -width indent @@ -156,7 +163,9 @@ is special device file not supporting DIOCGMEDIASIZE .Xr sysexits 3 , .Xr ada 4 , .Xr da 4 , -.Xr nda 4 +.Xr nda 4 , +.Xr fsck_ffs 8 , +.Xr zpool-trim 8 .Sh HISTORY The .Nm From nobody Sat Oct 4 04:15:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdsdd3bzBz69Yd4; Sat, 04 Oct 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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdsdd2L4fz41j9; Sat, 04 Oct 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=1759551333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vi9oiW0aplHIuNEt/hzjMj7GbN7GlYClqsyKkpiwy2o=; b=Y2AVTXZneVD1kkv0DNf/0ySLf2hb6DWJIPduOOVmtUqTnPYoH1wk9RUYuzA3uDYccTl6nk kBL2VXK4SpL9R0lpoOQGEBl/Y1CieKd88mamFtjv9zdlWjrLCdMTMgiptz/hsqC3rcAqRR li+/VzKRNqS6q0iptm3zWnb/0DkJurUo0Qc3vy0fdU0rtRNuE50PNSSivuPqyO+yddyyCW DUBuv/k74IE8YQgFC06ii+M/FS9jRDZscf2HumyqRolcszZ8zdTN+uMkusPWUmeqG4vVu+ 2zHeMVpK79ck8eKWlUPq10juDJHIg1fRWzcJW8wxxbGhSjWUpbvqDMm0qBpBeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759551333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vi9oiW0aplHIuNEt/hzjMj7GbN7GlYClqsyKkpiwy2o=; b=vSQdDTO+PqTaLykmPqbbj+vBi+YSdzbrrgVu43OR6ouuNkiX/P9sIRONfr79MOD00OlsAV nNu5GjA5p1rt81+CL3/jrTFAdo6Sj9OFvBJ+/Z/VQWD9jPOvQsN2SmskSRekn8nAL7v3rb sB1puFtbCILIWFoopmJW0iHwMxcKWN5rYXaM8QMTzc82cT5caDrIXQIMwwAD5lHuPup4VD XMBMVyii4b41V9XRSfBHbATOGv76ohLGlMPdug2GQ7U18Ror7K2HMHnNH5QoiAaZDHIfH8 yFAbjC+KEgEWI7Z80/23H89fq8XRNZd8EtZKx+11ivrkIBZdElojfiWjyA6Bjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759551333; a=rsa-sha256; cv=none; b=gAmBUsIpNu3z/u7n5oTDxeTt1gCYCeRtgHS5VJlq63aAK6yTHNdn0VZa4wt6a/mhBbupwa vbnboiWjo2topP0v+RHgPT7uNNMiviXC2VqIP9cV4vx8N/e/0aNaKiaCzBEi8tv3YFunVX P4dOY2PNIw7gvudKjJuhDJJWGe6L3WoXLfBfM49J8OEOaR/MC3s+ex6QOSJzPAAkBoHe0O pFmpWf4Rs/7dQia9NT9V+1MKVUsWWTYuXNsiH9tKEuzZW2VKWgss4bHXd2rlJ7/jDgA+gf 7HOEg7Jy7hHnz13v/7qdhA5e+StqM7ApOCSnsC5TNh9wqhFfMNddkKZ9eIQZbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdsdd1w79z9GW; Sat, 04 Oct 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 5944FXbW048775; Sat, 4 Oct 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 5944FXP1048772; Sat, 4 Oct 2025 04:15:33 GMT (envelope-from git) Date: Sat, 4 Oct 2025 04:15:33 GMT Message-Id: <202510040415.5944FXP1048772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: b363362abe61 - stable/14 - trim.8: update the manual with references to zpool-trim and fsck_ffs -E List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b363362abe61862be87b681dec3246a0e688532f Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=b363362abe61862be87b681dec3246a0e688532f commit b363362abe61862be87b681dec3246a0e688532f Author: Eugene Grosbein AuthorDate: 2025-10-01 04:05:54 +0000 Commit: Eugene Grosbein CommitDate: 2025-10-04 04:15:05 +0000 trim.8: update the manual with references to zpool-trim and fsck_ffs -E (cherry picked from commit 5d8fde850768d31f722de6177204ec7cab199bd1) --- usr.sbin/trim/trim.8 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/usr.sbin/trim/trim.8 b/usr.sbin/trim/trim.8 index 1ac10d7e3d46..ebb8b927cd91 100644 --- a/usr.sbin/trim/trim.8 +++ b/usr.sbin/trim/trim.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 18, 2019 +.Dd October 1, 2025 .Dt TRIM 8 .Os .Sh NAME @@ -48,9 +48,16 @@ The .Nm utility erases specified region of the device. -It is mostly relevant for storage that implement trim (like flash based, +It is mostly relevant for a storage that implements trim (like flash based, or thinly provisioned storage). .Sy All erased data is lost. +Alternatively, refer to the +.Xr fsck_ffs 8 +command having a flag +.Fl E +to trim populated UFS, and to the +.Xr zpool-trim 8 +command to trim existing ZFS pool. .Pp The following options are available: .Bl -tag -width indent @@ -154,7 +161,9 @@ is special device file not supporting DIOCGMEDIASIZE .Xr sysexits 3 , .Xr ada 4 , .Xr da 4 , -.Xr nda 4 +.Xr nda 4 , +.Xr fsck_ffs 8 , +.Xr zpool-trim 8 .Sh HISTORY The .Nm From nobody Sat Oct 4 04:18:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdsjG2cfdz69Yln; Sat, 04 Oct 2025 04:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdsjG1mSGz4228; Sat, 04 Oct 2025 04:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759551522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tSAkLXq5KU+544KTDsVV8g4a04WpywytdMvDWnJeGok=; b=nI95JiRNSWDuiHpqLe9P9HqSJoJnd9fjZgDuuta45Xctva4UEXu9rMnJ+sTutBJjCyHcUb +u7XPynnAA0O0UnxilWxhWh2LtrNkf8fZYLxyDoEgx46e85hKGh2VOT7hSTo5N+XSV6zGm +HhCAGUEW4wpR+Ir7jWGh3sRTFyGrs5g+rjzzZWKK5cegmv7r9bBb5zg6maVPq5CNCWpYH vJGwG++YwiCnephtEZ7DKlbUWWwbGEAdovEq8Sv8W2jyJr7dccH48cNwkBopNqwZRUwavt Yqbtiu18wEQKnaY2/ERZkniPOlO7L9lx9nCbWvUQpVowHJJgHsx3qxNOzgeKTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759551522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tSAkLXq5KU+544KTDsVV8g4a04WpywytdMvDWnJeGok=; b=jvSs97nji6E7LLaHZVZkMyAHJeRweV0LUyHF9gvqgXDGtp313p5reGOCmWHyzY/8YcdG3H aRXTkUhlx8yXWRqg4bXYClUTdlHH+d73ZJggUmGtm1oFqU2AvIKjYqlOTeKza/ogMsHg44 1lv9OrIXMarJ5E00gYG6EFjwdPIAIo+VTDhxzFrbTkNTPghBjMzoJLOYGXRRwXCn+MuhEu XXXDTPTIRVCCvMBZCdVw5d4gZv8wYIomJlNLanY1t5QwQL/316fEYVkaaYM/Kb0V6+QmGO DMTyuipSahRVWyDoXHRHrkRBk3y+8KGFVR8Srbi/afBnMIlBoPFaz7vQCVV/rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759551522; a=rsa-sha256; cv=none; b=cAzz3eWmaVY0FS07ryxfjz0U4A3If4lU9ZgSJ/1fADpQpdKafzp5Vg8/NWBFgbdsSxmiZy 216huj+FpNVIlqYXVcS2BD8XrJl3tL+hw5DgtuA9nvIBDe7toLobtSHAU5SxWOfnnmQztD WVSkSA96nwrl51UC7rwPXAcsBUw8KbDwtBD/QXzuIkG8WZdWsWrYnbPwSyLHJxpBQh5aQ+ RVtPRl2aEY1DxqnZGp2Qe3pgAVSy7WIfWHtUdCi7ofKflJJZUwrJhes9ZlOslpCI3YJAGJ ZLpuloPWf/qyl9cfB1LE5VgClcJVaEFhhB30wUqBKZXGciHf5pZPVqb2FRcJCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdsjG19tnz9Rn; Sat, 04 Oct 2025 04:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5944Ig97049814; Sat, 4 Oct 2025 04:18:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5944Igcc049811; Sat, 4 Oct 2025 04:18:42 GMT (envelope-from git) Date: Sat, 4 Oct 2025 04:18:42 GMT Message-Id: <202510040418.5944Igcc049811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 40497eda791e - stable/13 - trim.8: update the manual with references to zpool-trim and fsck_ffs -E List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40497eda791e513ebfc8a7969f9c3e7246ff47b8 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=40497eda791e513ebfc8a7969f9c3e7246ff47b8 commit 40497eda791e513ebfc8a7969f9c3e7246ff47b8 Author: Eugene Grosbein AuthorDate: 2025-10-01 04:05:54 +0000 Commit: Eugene Grosbein CommitDate: 2025-10-04 04:18:17 +0000 trim.8: update the manual with references to zpool-trim and fsck_ffs -E (cherry picked from commit 5d8fde850768d31f722de6177204ec7cab199bd1) --- usr.sbin/trim/trim.8 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/usr.sbin/trim/trim.8 b/usr.sbin/trim/trim.8 index 1ac10d7e3d46..ebb8b927cd91 100644 --- a/usr.sbin/trim/trim.8 +++ b/usr.sbin/trim/trim.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 18, 2019 +.Dd October 1, 2025 .Dt TRIM 8 .Os .Sh NAME @@ -48,9 +48,16 @@ The .Nm utility erases specified region of the device. -It is mostly relevant for storage that implement trim (like flash based, +It is mostly relevant for a storage that implements trim (like flash based, or thinly provisioned storage). .Sy All erased data is lost. +Alternatively, refer to the +.Xr fsck_ffs 8 +command having a flag +.Fl E +to trim populated UFS, and to the +.Xr zpool-trim 8 +command to trim existing ZFS pool. .Pp The following options are available: .Bl -tag -width indent @@ -154,7 +161,9 @@ is special device file not supporting DIOCGMEDIASIZE .Xr sysexits 3 , .Xr ada 4 , .Xr da 4 , -.Xr nda 4 +.Xr nda 4 , +.Xr fsck_ffs 8 , +.Xr zpool-trim 8 .Sh HISTORY The .Nm From nobody Sat Oct 4 06:39:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdwr54fmXz69rDx; Sat, 04 Oct 2025 06:39: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdwr53qcyz4Ggd; Sat, 04 Oct 2025 06:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759559989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CpydW4uUVA6xUnDKspGxTj2tVH61tbi04IK9MEqQ8Xg=; b=BGhU07sx9OEenWfmD5ntJ1INIYx/mZRdazxRPD91KKbw2qRxQKjrCMLbLMyCRgPwAA+ZK6 RgiMDbZnaWvpDjUvqzTpDxAguWC7KPvFouPopO2qGppIOmFbO5rX3TzKVOdmuBIgDD6lGD 34Vwo7+LWeJ7hxUi7sTixHMUvIcupixPq1iFc37nCek42Li3xUNJFp1WLFqC8Yx36zCGrZ sARcdnSLkGyudWy0mdGbY5hpiKePeaN22d3P1XVJvVSqBd8XD8VaY2oe8bH46iommqEGii TgycoU0cLy3OjvkhSzREqC+gHoexuvVj6RpN2QAkpRMVDJomF2MUcz9ljF3oIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759559989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CpydW4uUVA6xUnDKspGxTj2tVH61tbi04IK9MEqQ8Xg=; b=jdGTEHVtldknW2bL/hVm6Mjl/JkePHWceQP7cdAyiOiJaMDKw9HOifA/A24udBXR22yH70 dXECBgbOkUgf3mYzTJ/59Xy4kF6JH1X2JvzL8hOE5wfnuCia/hBepUEhfrGJz5/aaAlBrC 0gRO9V01hEve3k1zXpUSATqCCmPWyEvJZsC1QpIFoP8K7ejPeTmrm4ezfty8Gh6ovgwE2x fmhOu4fi/VafvmamWLUVWkGcGzU+E9ze79Rwaxdd3cf+0u1H0sGnXbo1qO9JZDmNcyzPCZ r+VhmeVgp6Je5LLSxFfN8M0LrsLZ3vtBMMUcIbf6dt9heGFO94OG2lVPPgIyPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759559989; a=rsa-sha256; cv=none; b=pQ1ekCq7IsI4O+8jrurQmLxUn367739aRNyl34/q+TOUE33GsIMEdF1ybmKgD1zLvLHg5s QiKS41ekAhpUQzVcVYy/611Espcng+OUt0dtqEP+pZWuIZV6uJczk1RWdoqNWQbHLfWRdq +c3/CUaxXs2+nB4TgUTIoQMtlxZu+ha0/Oize/thJezGFvRI+5LMjVKLIdu7x0EZiFSYEQ R+B+V+wlIPWzdPwcMJbQTYZW+O2bLdj2yn7TPIyKhLjNrR3Q2OvsRgAg9TF7/c0PhJCgl7 Lk/LAIegxyBGSP4bFfQAKIWl7Ad+E4IkR0mj9qlPsGydFTHEqMDT739RG1u/xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdwr53RCCzDTF; Sat, 04 Oct 2025 06:39: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 5946dneX012537; Sat, 4 Oct 2025 06:39:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5946dnHa012534; Sat, 4 Oct 2025 06:39:49 GMT (envelope-from git) Date: Sat, 4 Oct 2025 06:39:49 GMT Message-Id: <202510040639.5946dnHa012534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 1c0898edf28f - stable/15 - 15.0: Update to ALPHA5 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 1c0898edf28fefe414b0a1e44e5144f5c29b03ac Auto-Submitted: auto-generated The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=1c0898edf28fefe414b0a1e44e5144f5c29b03ac commit 1c0898edf28fefe414b0a1e44e5144f5c29b03ac Author: Colin Percival AuthorDate: 2025-10-04 01:21:53 +0000 Commit: Colin Percival CommitDate: 2025-10-04 05:23:02 +0000 15.0: Update to ALPHA5 Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index dfbb24de3969..0b9080f43fdc 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -51,7 +51,7 @@ TYPE="FreeBSD" REVISION="15.0" -BRANCH="ALPHA4" +BRANCH="ALPHA5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Sat Oct 4 09:09:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cf08w4zGKz6B8Zw; Sat, 04 Oct 2025 09:09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cf08w4KpYz3L2y; Sat, 04 Oct 2025 09:09:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759568976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQfGPju5G/WmBHQ+zH5CwjS/pP+YU3q6Ds+8aaPIRL4=; b=fH960dJaJ37uAUX0SwoY/GDbsk968tswOQfg00m83aI2bWFp+Y5TPkG87PfmfIkt6yt4zj m5G1JMFF1ofU4Rv4wgwKr4jMlna66rTKrfVnKo1OsQ+mysjMvDv5WL2ZxvqNjBqcgrZG3k Yjtf5v8HHqg4Rdoy8ACm4cj95maCgzMUvBLMo6Z3uUKozvyDRxBSkTuf1WnOQa6mNA+46n BXhM6SyqVpiPDRwUuShO9kp642R4VmonTKtGtXzeiogtucB8MzMcwXqyykhE/1tTXCzbrz ihLekTMczDwI515z37kKmaRLbZ0LH3j5nhSOxR9ohZofNFaV7b0io+Ud+uj1VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759568976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UQfGPju5G/WmBHQ+zH5CwjS/pP+YU3q6Ds+8aaPIRL4=; b=Ojnfd4KFq94s10T+r22V1ybTU82Gsz6m867OkT6W+0Vx3P6AZii5a14ttCmVqjSyfn22k+ pi2lVVNwNQN+zWOaKIlQ844+l+2ChyTVMhswceVRqula8SXMU/mwSZuX0EnFUEydyusJ69 ynuKdxv/wGgTc6uNnoQe3SgdLIjnSMyPNwFlxbqZCQQIVLsj2rCMe+mqOHRu9OfkEeEh6k tBaE6SyV5tgAds8cCU6FlYndANo+se34XRrAG2vQ8MPfX0ApgR9RUtzqJV0hpOtrV2C7YD wtbZH5Av+7c9XNW9XABD6Xuh5FvzSYi5HR17P9IC8y7gON/Ntq2HLcJAsx+85g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759568976; a=rsa-sha256; cv=none; b=AfzU8AFUrPichKIpE6MPgS19pzdWMlwE8CxdiNtKN5HcDZsGb/UuADeuvY0z21Lr0mhEVS ch3Lgke1XffnNJg/b1OgxTLwAcHsuGXMarLj5HuLHIvT08C75NhvGEs7hiUupWIIN7q3Ga x/Kw4lvweesuvYMpcU2tuMqY7efX1QN9vOioKXbiiADA8K/5UWc5bG3RpE61l3od5lGlqE 9Mnow30+cBSsc/7Pg5mThHwbI913H3nw/2ErH8YwmEywhbXTMPesimtUtGz+LRdIM0aABA SwTcvtPcJZEiBHbI7saBmZEA/ezwW5VjTDkKmk/EJ9si5SOMQ/oOErOBQw1JnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cf08w3t0PzbGk; Sat, 04 Oct 2025 09:09: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 59499anD095001; Sat, 4 Oct 2025 09:09:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59499aeO094998; Sat, 4 Oct 2025 09:09:36 GMT (envelope-from git) Date: Sat, 4 Oct 2025 09:09:36 GMT Message-Id: <202510040909.59499aeO094998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 5f0155e497fc - stable/15 - kern/vfs_vnops.c: generalize the lock primitive for file foffset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 5f0155e497fc747d09caad5e624465f4f206b21e Auto-Submitted: auto-generated The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5f0155e497fc747d09caad5e624465f4f206b21e commit 5f0155e497fc747d09caad5e624465f4f206b21e Author: Konstantin Belousov AuthorDate: 2025-09-10 16:35:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-04 09:09:16 +0000 kern/vfs_vnops.c: generalize the lock primitive for file foffset (cherry picked from commit 94a0f9f63e164e4f3791bc7d105d6f267b4d47bc) --- sys/kern/vfs_vnops.c | 148 +++++++++++++++++++++++++++++++-------------------- sys/sys/file.h | 6 +-- 2 files changed, 94 insertions(+), 60 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index a4f41192f684..f81c2033d95e 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -798,58 +798,82 @@ vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base, size_t len, } #if OFF_MAX <= LONG_MAX -off_t -foffset_lock(struct file *fp, int flags) +static void +file_v_lock(struct file *fp, short lock_bit, short lock_wait_bit) { - volatile short *flagsp; - off_t res; + short *flagsp; short state; - KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); - - if ((flags & FOF_NOLOCK) != 0) - return (atomic_load_long(&fp->f_offset)); - - /* - * According to McKusick the vn lock was protecting f_offset here. - * It is now protected by the FOFFSET_LOCKED flag. - */ - flagsp = &fp->f_vnread_flags; - if (atomic_cmpset_acq_16(flagsp, 0, FOFFSET_LOCKED)) - return (atomic_load_long(&fp->f_offset)); + flagsp = &fp->f_vflags; + state = atomic_load_16(flagsp); + if ((state & lock_bit) == 0 && + atomic_cmpset_acq_16(flagsp, state, state | lock_bit)) + return; - sleepq_lock(&fp->f_vnread_flags); + sleepq_lock(flagsp); state = atomic_load_16(flagsp); for (;;) { - if ((state & FOFFSET_LOCKED) == 0) { + if ((state & lock_bit) == 0) { if (!atomic_fcmpset_acq_16(flagsp, &state, - FOFFSET_LOCKED)) + state | lock_bit)) continue; break; } - if ((state & FOFFSET_LOCK_WAITING) == 0) { + if ((state & lock_wait_bit) == 0) { if (!atomic_fcmpset_acq_16(flagsp, &state, - state | FOFFSET_LOCK_WAITING)) + state | lock_wait_bit)) continue; } DROP_GIANT(); - sleepq_add(&fp->f_vnread_flags, NULL, "vofflock", 0, 0); - sleepq_wait(&fp->f_vnread_flags, PRI_MAX_KERN); + sleepq_add(flagsp, NULL, "vofflock", 0, 0); + sleepq_wait(flagsp, PRI_MAX_KERN); PICKUP_GIANT(); - sleepq_lock(&fp->f_vnread_flags); + sleepq_lock(flagsp); state = atomic_load_16(flagsp); } - res = atomic_load_long(&fp->f_offset); - sleepq_release(&fp->f_vnread_flags); - return (res); + sleepq_release(flagsp); } -void -foffset_unlock(struct file *fp, off_t val, int flags) +static void +file_v_unlock(struct file *fp, short lock_bit, short lock_wait_bit) { - volatile short *flagsp; + short *flagsp; short state; + flagsp = &fp->f_vflags; + state = atomic_load_16(flagsp); + if ((state & lock_wait_bit) == 0 && + atomic_cmpset_rel_16(flagsp, state, state & ~lock_bit)) + return; + + sleepq_lock(flagsp); + MPASS((*flagsp & lock_bit) != 0); + MPASS((*flagsp & lock_wait_bit) != 0); + atomic_clear_16(flagsp, lock_bit | lock_wait_bit); + sleepq_broadcast(flagsp, SLEEPQ_SLEEP, 0, 0); + sleepq_release(flagsp); +} + +off_t +foffset_lock(struct file *fp, int flags) +{ + KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); + + if ((flags & FOF_NOLOCK) == 0) { + file_v_lock(fp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); + } + + /* + * According to McKusick the vn lock was protecting f_offset here. + * It is now protected by the FOFFSET_LOCKED flag. + */ + return (atomic_load_long(&fp->f_offset)); +} + +void +foffset_unlock(struct file *fp, off_t val, int flags) +{ KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); if ((flags & FOF_NOUPDATE) == 0) @@ -859,21 +883,10 @@ foffset_unlock(struct file *fp, off_t val, int flags) if ((flags & FOF_NEXTOFF_W) != 0) fp->f_nextoff[UIO_WRITE] = val; - if ((flags & FOF_NOLOCK) != 0) - return; - - flagsp = &fp->f_vnread_flags; - state = atomic_load_16(flagsp); - if ((state & FOFFSET_LOCK_WAITING) == 0 && - atomic_cmpset_rel_16(flagsp, state, 0)) - return; - - sleepq_lock(&fp->f_vnread_flags); - MPASS((fp->f_vnread_flags & FOFFSET_LOCKED) != 0); - MPASS((fp->f_vnread_flags & FOFFSET_LOCK_WAITING) != 0); - fp->f_vnread_flags = 0; - sleepq_broadcast(&fp->f_vnread_flags, SLEEPQ_SLEEP, 0, 0); - sleepq_release(&fp->f_vnread_flags); + if ((flags & FOF_NOLOCK) == 0) { + file_v_unlock(fp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); + } } static off_t @@ -882,7 +895,35 @@ foffset_read(struct file *fp) return (atomic_load_long(&fp->f_offset)); } -#else + +#else /* OFF_MAX <= LONG_MAX */ + +static void +file_v_lock_mtxp(struct file *fp, struct mtx *mtxp, short lock_bit, + short lock_wait_bit) +{ + mtx_assert(mtxp, MA_OWNED); + + while ((fp->f_vflags & lock_bit) != 0) { + fp->f_vflags |= lock_wait_bit; + msleep(&fp->f_vflags, mtxp, PRI_MAX_KERN, + "vofflock", 0); + } + fp->f_vflags |= lock_bit; +} + +static void +file_v_unlock_mtxp(struct file *fp, struct mtx *mtxp, short lock_bit, + short lock_wait_bit) +{ + mtx_assert(mtxp, MA_OWNED); + + KASSERT((fp->f_vflags & lock_bit) != 0, ("Lost lock_bit")); + if ((fp->f_vflags & lock_wait_bit) != 0) + wakeup(&fp->f_vflags); + fp->f_vflags &= ~(lock_bit | lock_wait_bit); +} + off_t foffset_lock(struct file *fp, int flags) { @@ -894,12 +935,8 @@ foffset_lock(struct file *fp, int flags) mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); if ((flags & FOF_NOLOCK) == 0) { - while (fp->f_vnread_flags & FOFFSET_LOCKED) { - fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; - msleep(&fp->f_vnread_flags, mtxp, PRI_MAX_KERN, - "vofflock", 0); - } - fp->f_vnread_flags |= FOFFSET_LOCKED; + file_v_lock_mtxp(fp, mtxp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); } res = fp->f_offset; mtx_unlock(mtxp); @@ -922,11 +959,8 @@ foffset_unlock(struct file *fp, off_t val, int flags) if ((flags & FOF_NEXTOFF_W) != 0) fp->f_nextoff[UIO_WRITE] = val; if ((flags & FOF_NOLOCK) == 0) { - KASSERT((fp->f_vnread_flags & FOFFSET_LOCKED) != 0, - ("Lost FOFFSET_LOCKED")); - if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) - wakeup(&fp->f_vnread_flags); - fp->f_vnread_flags = 0; + file_v_unlock_mtxp(fp, mtxp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); } mtx_unlock(mtxp); } diff --git a/sys/sys/file.h b/sys/sys/file.h index cc3c733580fd..9a072121e25f 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -197,7 +197,7 @@ struct file { struct vnode *f_vnode; /* NULL or applicable vnode */ struct ucred *f_cred; /* associated credentials. */ short f_type; /* descriptor type */ - short f_vnread_flags; /* (f) Sleep lock for f_offset */ + short f_vflags; /* (f) Sleep lock flags for members */ /* * DTYPE_VNODE specific fields. */ @@ -220,8 +220,8 @@ struct file { #define f_cdevpriv f_vnun.fvn_cdevpriv #define f_advice f_vnun.fvn_advice -#define FOFFSET_LOCKED 0x1 -#define FOFFSET_LOCK_WAITING 0x2 +#define FILE_V_FOFFSET_LOCKED 0x0001 +#define FILE_V_FOFFSET_LOCK_WAITING 0x0002 #endif /* __BSD_VISIBLE */ #endif /* _KERNEL || _WANT_FILE */ From nobody Sat Oct 4 09:10:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cf09Y2Ywxz6B8Gy; Sat, 04 Oct 2025 09:10: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cf09Y0T6rz3LTd; Sat, 04 Oct 2025 09:10:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759569009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bKA04UsMozzvekcShg96Vc3A6pik5zs6Yv4QQ8GG+s8=; b=AP25+CPznefPg2NubXQd8xlBmwEiNVu+BQ4jThtkuS937LQ60xtsVB7UnHDa+yCugXxKN4 UL5AnbWxmsCY7zZcEM/3Cyy4CkJrCii+RCHqxEMcDhKAwhVqke7N35zRsROCrGZ1rSTjt5 h/KtkkEm5Oq1FkUGXY/BsHfZi9KiXM1dt7SWMH+1N/X9CH5bMHf6yva2TlVriKifD4VipU PYQmk6iASiqgss0CF743ECkvB+jhAzyvubaUwLQdfbBGirB3POOqLu733zfiI+7ILtETdp 2A3BFiPce7iOtXKUnwe3qEEB8n2K0o/fDi6uOiBpPs2q3XYhzhk2L3p3QRg0/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759569009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bKA04UsMozzvekcShg96Vc3A6pik5zs6Yv4QQ8GG+s8=; b=aE+CqYtjkGnaZ7KbzL3/yUItI20iSR4IixNhQxw1ZR3heZnlzYGN03JR5Ga5jYoIpGnBnA w+YfJdYShodSUvGnsiIF4R5x+6M3ul9On3+92QqwEmnVpNf/oZZpmp0iK1bpjqSPNGJ6a8 mRJROE63YIWL7R5isyRu5tFBcCci4JxUQCUohF00XeCwaHTwcIbZat5aYIA3Sm3QiFL3h1 YdU4o9FDb3G/PxmZzH4NCBE9wjTxw0aPcY9m20FJvUdbPSgDE855T8X3nu0YBvuLqbmrop PHX/dSMD8EKJEYeb33q3ZO0p7uno7svprgCjgp1hCFAJyE9iLN0fAaLn4lSBdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759569009; a=rsa-sha256; cv=none; b=Tz4Y0B/l24CaZ1jGsSSI9tQiTEd7zCNHv4oHsEDsqNsG/QIquK8MvU+1XjlwNTCPBIxzoN o97zRSczZQ/K8KRLlG7KnrxrEoTl4GHS+eEP1fzK+BUVoHkrhBNdHI4CkZWynKqlI3dWEF a7W6A47/GNIsHcAZiOZA663ZPtOiIgX8rjBgBLqFQEO53+NphSU9qiw73pMshctOQ7i5iL SV4nHYe16LaQYKKRsx9qxYX1l0Q3wiT8sIhnUlU2zh2S7jqrlbpyY2pNnJyo4HJTRbryX/ eKncHd1PrQPcvqOrYSwF65QNZf+aD+JkkJE7ua5Jm1uxZd/Bd4RIpLGcEmgOWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cf09Y0414zbfM; Sat, 04 Oct 2025 09:10: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 5949A8me098796; Sat, 4 Oct 2025 09:10:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5949A80e098791; Sat, 4 Oct 2025 09:10:08 GMT (envelope-from git) Date: Sat, 4 Oct 2025 09:10:08 GMT Message-Id: <202510040910.5949A80e098791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7b980bf5e526 - stable/14 - kern/vfs_vnops.c: generalize the lock primitive for file foffset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b980bf5e5262332c8f5679ad4dd7b17fd5db8a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7b980bf5e5262332c8f5679ad4dd7b17fd5db8a9 commit 7b980bf5e5262332c8f5679ad4dd7b17fd5db8a9 Author: Konstantin Belousov AuthorDate: 2025-09-10 16:35:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-10-04 09:09:45 +0000 kern/vfs_vnops.c: generalize the lock primitive for file foffset (cherry picked from commit 94a0f9f63e164e4f3791bc7d105d6f267b4d47bc) --- sys/kern/vfs_vnops.c | 148 +++++++++++++++++++++++++++++++-------------------- sys/sys/file.h | 6 +-- 2 files changed, 94 insertions(+), 60 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 79fee79295fb..5b25e2680ee4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -759,58 +759,82 @@ vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base, size_t len, } #if OFF_MAX <= LONG_MAX -off_t -foffset_lock(struct file *fp, int flags) +static void +file_v_lock(struct file *fp, short lock_bit, short lock_wait_bit) { - volatile short *flagsp; - off_t res; + short *flagsp; short state; - KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); - - if ((flags & FOF_NOLOCK) != 0) - return (atomic_load_long(&fp->f_offset)); - - /* - * According to McKusick the vn lock was protecting f_offset here. - * It is now protected by the FOFFSET_LOCKED flag. - */ - flagsp = &fp->f_vnread_flags; - if (atomic_cmpset_acq_16(flagsp, 0, FOFFSET_LOCKED)) - return (atomic_load_long(&fp->f_offset)); + flagsp = &fp->f_vflags; + state = atomic_load_16(flagsp); + if ((state & lock_bit) == 0 && + atomic_cmpset_acq_16(flagsp, state, state | lock_bit)) + return; - sleepq_lock(&fp->f_vnread_flags); + sleepq_lock(flagsp); state = atomic_load_16(flagsp); for (;;) { - if ((state & FOFFSET_LOCKED) == 0) { + if ((state & lock_bit) == 0) { if (!atomic_fcmpset_acq_16(flagsp, &state, - FOFFSET_LOCKED)) + state | lock_bit)) continue; break; } - if ((state & FOFFSET_LOCK_WAITING) == 0) { + if ((state & lock_wait_bit) == 0) { if (!atomic_fcmpset_acq_16(flagsp, &state, - state | FOFFSET_LOCK_WAITING)) + state | lock_wait_bit)) continue; } DROP_GIANT(); - sleepq_add(&fp->f_vnread_flags, NULL, "vofflock", 0, 0); - sleepq_wait(&fp->f_vnread_flags, PRI_MAX_KERN); + sleepq_add(flagsp, NULL, "vofflock", 0, 0); + sleepq_wait(flagsp, PRI_MAX_KERN); PICKUP_GIANT(); - sleepq_lock(&fp->f_vnread_flags); + sleepq_lock(flagsp); state = atomic_load_16(flagsp); } - res = atomic_load_long(&fp->f_offset); - sleepq_release(&fp->f_vnread_flags); - return (res); + sleepq_release(flagsp); } -void -foffset_unlock(struct file *fp, off_t val, int flags) +static void +file_v_unlock(struct file *fp, short lock_bit, short lock_wait_bit) { - volatile short *flagsp; + short *flagsp; short state; + flagsp = &fp->f_vflags; + state = atomic_load_16(flagsp); + if ((state & lock_wait_bit) == 0 && + atomic_cmpset_rel_16(flagsp, state, state & ~lock_bit)) + return; + + sleepq_lock(flagsp); + MPASS((*flagsp & lock_bit) != 0); + MPASS((*flagsp & lock_wait_bit) != 0); + atomic_clear_16(flagsp, lock_bit | lock_wait_bit); + sleepq_broadcast(flagsp, SLEEPQ_SLEEP, 0, 0); + sleepq_release(flagsp); +} + +off_t +foffset_lock(struct file *fp, int flags) +{ + KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); + + if ((flags & FOF_NOLOCK) == 0) { + file_v_lock(fp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); + } + + /* + * According to McKusick the vn lock was protecting f_offset here. + * It is now protected by the FOFFSET_LOCKED flag. + */ + return (atomic_load_long(&fp->f_offset)); +} + +void +foffset_unlock(struct file *fp, off_t val, int flags) +{ KASSERT((flags & FOF_OFFSET) == 0, ("FOF_OFFSET passed")); if ((flags & FOF_NOUPDATE) == 0) @@ -820,21 +844,10 @@ foffset_unlock(struct file *fp, off_t val, int flags) if ((flags & FOF_NEXTOFF_W) != 0) fp->f_nextoff[UIO_WRITE] = val; - if ((flags & FOF_NOLOCK) != 0) - return; - - flagsp = &fp->f_vnread_flags; - state = atomic_load_16(flagsp); - if ((state & FOFFSET_LOCK_WAITING) == 0 && - atomic_cmpset_rel_16(flagsp, state, 0)) - return; - - sleepq_lock(&fp->f_vnread_flags); - MPASS((fp->f_vnread_flags & FOFFSET_LOCKED) != 0); - MPASS((fp->f_vnread_flags & FOFFSET_LOCK_WAITING) != 0); - fp->f_vnread_flags = 0; - sleepq_broadcast(&fp->f_vnread_flags, SLEEPQ_SLEEP, 0, 0); - sleepq_release(&fp->f_vnread_flags); + if ((flags & FOF_NOLOCK) == 0) { + file_v_unlock(fp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); + } } static off_t @@ -843,7 +856,35 @@ foffset_read(struct file *fp) return (atomic_load_long(&fp->f_offset)); } -#else + +#else /* OFF_MAX <= LONG_MAX */ + +static void +file_v_lock_mtxp(struct file *fp, struct mtx *mtxp, short lock_bit, + short lock_wait_bit) +{ + mtx_assert(mtxp, MA_OWNED); + + while ((fp->f_vflags & lock_bit) != 0) { + fp->f_vflags |= lock_wait_bit; + msleep(&fp->f_vflags, mtxp, PRI_MAX_KERN, + "vofflock", 0); + } + fp->f_vflags |= lock_bit; +} + +static void +file_v_unlock_mtxp(struct file *fp, struct mtx *mtxp, short lock_bit, + short lock_wait_bit) +{ + mtx_assert(mtxp, MA_OWNED); + + KASSERT((fp->f_vflags & lock_bit) != 0, ("Lost lock_bit")); + if ((fp->f_vflags & lock_wait_bit) != 0) + wakeup(&fp->f_vflags); + fp->f_vflags &= ~(lock_bit | lock_wait_bit); +} + off_t foffset_lock(struct file *fp, int flags) { @@ -855,12 +896,8 @@ foffset_lock(struct file *fp, int flags) mtxp = mtx_pool_find(mtxpool_sleep, fp); mtx_lock(mtxp); if ((flags & FOF_NOLOCK) == 0) { - while (fp->f_vnread_flags & FOFFSET_LOCKED) { - fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; - msleep(&fp->f_vnread_flags, mtxp, PRI_MAX_KERN, - "vofflock", 0); - } - fp->f_vnread_flags |= FOFFSET_LOCKED; + file_v_lock_mtxp(fp, mtxp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); } res = fp->f_offset; mtx_unlock(mtxp); @@ -883,11 +920,8 @@ foffset_unlock(struct file *fp, off_t val, int flags) if ((flags & FOF_NEXTOFF_W) != 0) fp->f_nextoff[UIO_WRITE] = val; if ((flags & FOF_NOLOCK) == 0) { - KASSERT((fp->f_vnread_flags & FOFFSET_LOCKED) != 0, - ("Lost FOFFSET_LOCKED")); - if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) - wakeup(&fp->f_vnread_flags); - fp->f_vnread_flags = 0; + file_v_unlock_mtxp(fp, mtxp, FILE_V_FOFFSET_LOCKED, + FILE_V_FOFFSET_LOCK_WAITING); } mtx_unlock(mtxp); } diff --git a/sys/sys/file.h b/sys/sys/file.h index 7d1a191b4374..349605939d30 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -194,7 +194,7 @@ struct file { struct vnode *f_vnode; /* NULL or applicable vnode */ struct ucred *f_cred; /* associated credentials. */ short f_type; /* descriptor type */ - short f_vnread_flags; /* (f) Sleep lock for f_offset */ + short f_vflags; /* (f) Sleep lock flags for members */ /* * DTYPE_VNODE specific fields. */ @@ -217,8 +217,8 @@ struct file { #define f_cdevpriv f_vnun.fvn_cdevpriv #define f_advice f_vnun.fvn_advice -#define FOFFSET_LOCKED 0x1 -#define FOFFSET_LOCK_WAITING 0x2 +#define FILE_V_FOFFSET_LOCKED 0x0001 +#define FILE_V_FOFFSET_LOCK_WAITING 0x0002 #endif /* __BSD_VISIBLE */ #endif /* _KERNEL || _WANT_FILE */ From nobody Sat Oct 4 13:38:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cf66w4wcYz6Bd79; Sat, 04 Oct 2025 13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cf66w4TGQz3sR9; Sat, 04 Oct 2025 13: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=1759585096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X1lc1I+OxuHnbOeIl7dlYVhIqDw/X6qHbwvey+k1/OI=; b=ah/Lo1W95IrpEI7Wuf+9JxPEyYq+IIzypwaZw7+0QqBszXSwojTBZfyoMwy/viTGFxz6m+ xLIziYa+TNZ1qLremvbay6C9mtLp54JC671qR10zY9ia8+2yAXNpC+XXlwEitE9pD+01iu ZfuOpIjwSuYBY3oiV1aR3NAfu0ZP0aCI5Yxrf9XU2WfCJ+N4cbdU8m53uZ0W/041Zm1Rx9 g4ybyMSIhk/YOyrDO1MqDLESUSG+V5tJZmZTpp84xuUtF5dJS3V/WWed4Dm2jVq9Rec3w/ JdlaGTIQv6YoNZQeOwqv/96jv9UgUnHY5/ldd3pkAMS8lMO5mKg0X3Xc8wqZ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759585096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X1lc1I+OxuHnbOeIl7dlYVhIqDw/X6qHbwvey+k1/OI=; b=B7S09WusKqsA4vKQwhnsb24xaJcsu1pjaSeThlRL0LaG7zhVecINkF1NDh46jJ8ehyYNO9 ydgc5tXHE8+LC+bgHCrkgSA5eVK7VcS3mzsxMTTTNzz3V5Avg3G66ixpx0IG6d0tmNW2qH xlHyrPRrzIO8lwFan4p/mC/tZ2vcsrfnRi0oyyZ4rfTRfUagh/E0M0mZx6LVHOaIx6UyUv ePzIhmeS7gzqJRJjEE/bV2UeRP+o+oagnhSAjnhzcSSBVZd9YW51cr60wV/no1zQtU0NlX Wgp0RLaI2X7kpMgu7RTKxTMzx+ktN7HKJjo6jVlG5D3Z6RCjRw0gSCkpboYejA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759585096; a=rsa-sha256; cv=none; b=GIQg/4LbjVPjtVzpzEnFrVZUmynGpYbsi94gWTjRdvoOiHLcR7cCPv3KzrCaEnXumIQU06 1VTw+9+ilExXkxWKWGPrrKBnDnIRtJbzhvNEPavN3Jq5gwqlh1SPCjoHOKJlezL8Un5hRr VfUxi+SahsWzWygnDuYPSrIqVsujDXPKtNo3PSaj3fBPlxnXlp92YftThh3SiCwvl/xfzK GtGL2eq0EbuEwRUB37JPCScB00n0CQWO4NWB+JyfKC60dJPTUD1+83rDojJSN5URb+/9nl TdoGPz/FpI+WclrjjztIbWLkVfIfs7FX9NkzJStHq+HYVeAWybEQiw0mqH//pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cf66w3x5pzkvH; Sat, 04 Oct 2025 13: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 594DcGQX000738; Sat, 4 Oct 2025 13: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 594DcG4x000734; Sat, 4 Oct 2025 13:38:16 GMT (envelope-from git) Date: Sat, 4 Oct 2025 13:38:16 GMT Message-Id: <202510041338.594DcG4x000734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a7931987d609 - stable/15 - usbhid.4: Note that it was enabled by default for 15.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a7931987d609e2284ef649849c53b941a38e3b39 Auto-Submitted: auto-generated The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a7931987d609e2284ef649849c53b941a38e3b39 commit a7931987d609e2284ef649849c53b941a38e3b39 Author: Ed Maste AuthorDate: 2025-10-02 16:14:35 +0000 Commit: Ed Maste CommitDate: 2025-10-04 13:38:06 +0000 usbhid.4: Note that it was enabled by default for 15.0 Also add cross-references to hkbd.4 and hms.4. Sponsored by: The FreeBSD Foundation (cherry picked from commit 7b18bf2a225af348c2d56ad345862fe0f1055839) --- share/man/man4/usbhid.4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man4/usbhid.4 b/share/man/man4/usbhid.4 index e5ba370cd025..4c7f254bdace 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 July 30, 2025 +.Dd October 2, 2025 .Dt USBHID 4 .Os .Sh NAME @@ -70,6 +70,8 @@ Default is 0. .El .Sh SEE ALSO .Xr ehci 4 , +.Xr hkbd 4 , +.Xr hms 4 , .Xr ohci 4 , .Xr uhci 4 , .Xr usb 4 , @@ -80,6 +82,8 @@ The .Nm driver first appeared in .Fx 13.0 . +It was enabled by default in +.Fx 15.0 . .Sh AUTHORS .An -nosplit The From nobody Sat Oct 4 16:09:22 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cf9TH0n3Hz69DtM; Sat, 04 Oct 2025 16:09: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cf9TH0DXwz3FQg; Sat, 04 Oct 2025 16:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759594163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TLJjyHvaZURQGwmmJR5wjA23ZYQ/5nKIMC5s//ymkcE=; b=t0IdWwBDSqJzL5K2Q/3Ghpjpq7hdb+6w3g7qDI8UVA4c2Nyv/mD3Gra7pW5aJyOxMGsKDr BGQOb7spRhZBRn2jIkxCWPZfc99yqwkh7ZY6SEn6i5XmhzbbjqvjSB1PLW0yQrWSTdT2KG KqnV+PVZaNsMmXaQNNN6zif4RNsI7BabK49uiQ1epMKBqh7ZdP6P4YXmVWssDWyhaVLRJ/ oYfYmdAVcgXm9Ulp4wxm258vopF+C9b1n6NEkDmPoQRsottd0JWM3eHFMidTuuaaCApBQP vwsutRyt4msnhye0+2t6ZL7OaALi86OAUwhTUOZoYrqpnMErez2MagnooQbaUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759594163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TLJjyHvaZURQGwmmJR5wjA23ZYQ/5nKIMC5s//ymkcE=; b=cvx1u1eGwM5kQnYn2rvgvmbVWiaaXeQHuCzYYw215n9oWXNh7A0b4M01I9a27drYrvaesX TR/91/eIhZzSBxwqfNm57gGKviaAzM0K9kDP1erMXwI0IaYoegjTPDcG3rG6mdE667xcv4 eX/5mJzIgwz2qplXA0ZaSI5dx6XYsU7Q38v7hQt4P9UMaHK0jNaCpcx2x8nA9/8P9Awnbg PuEX6hsOi+WG83KRcBdG6KQCvnILPyBsBuzjJv2cVbq9la5tgajgPo0zV31Kspwj+IfBVH SC1iJ1ZCpUJOFmkdCvsfvGfbrafmxRtn8rZE1h47quAY9tpUddNHTX9gqgZndg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759594163; a=rsa-sha256; cv=none; b=JXhOnoSlbNFvTAgA6r+zQ3c3N/MlPWQ8L3m07r36tj2VEjrJASrG00JSoM7MHjr5ZFIwdn FnGMIJ9NZnAf2Av+dNg3bOOyWNgpjpFOawCsdGwdZXZjahsf5kJFzjTMBqPtltWxrWcJVG edYksugrYueW3lQaaVeweRsMHBgEF1Xipg9jCqCGKbBXE15HjSkA+v6IpMlfvCOJ8ykftX 9fPvWrDGStJxwi9VPVWNyr/olQhYWozt9YkvWLH8PG+WJjs1Ygg9h/IUjOe4nF2N+dgaD2 tdXdW6sCJBTx9Kl6jRcNDlKgDx6zpaCfxANl3rrcwfVnbYKO5PLjm4YD0lOkWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cf9TG6XNXzp8N; Sat, 04 Oct 2025 16:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 594G9MqO084753; Sat, 4 Oct 2025 16:09:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594G9MOL084750; Sat, 4 Oct 2025 16:09:22 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:09:22 GMT Message-Id: <202510041609.594G9MOL084750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: bc4a85b69dea - stable/13 - Cirrus-CI: Bump to FreeBSD 13.5 image List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc4a85b69deac23c811af9db81fd819213234a6f Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bc4a85b69deac23c811af9db81fd819213234a6f commit bc4a85b69deac23c811af9db81fd819213234a6f Author: Ed Maste AuthorDate: 2025-10-04 13:18:40 +0000 Commit: Ed Maste CommitDate: 2025-10-04 16:08:51 +0000 Cirrus-CI: Bump to FreeBSD 13.5 image It is currently the oldest supported FreeBSD 13 release. Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 52266dd1674f..627ec8fe6e8b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-4-release-amd64 + image: freebsd-13-5-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Sat Oct 4 16:44:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFp37p3z69Jv1; Sat, 04 Oct 2025 16:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFp1WDbz3Knc; Sat, 04 Oct 2025 16:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dbJhDG1UiB/GUhKr8UgCUUAym6QeD7H1WmCZHPx45q0=; b=PLaq3Lls9zeB3OlRohwgWCrLNAu5gVqYLaHLu25sAGL4S0+BSKX1y4+eDPz/0+AlU129pX tHbs9ky0j5HAbp5n20arOHj4eDqzZx9pE0sSJe5KrEiEmZaIjHbTRfPbUovrAMOHbvcequ rDPZmStP0srae1NSptCqwGx0XT2+fSClGAJvtPYUxd5Wz7pwwYvtBis7kgA+03f+rvkXDx Fbf3w1dugiynPs+5S5+LJEzwuAVRw+gF1DfG+tCcTccBkgTyCTOAwhnhYYGZyfoZmrzopp QPiIQfV06va0CoGTTyQG2HR2RSJuLKiiac+y8zoGr6mcX2rst+2IiqnAs6szUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dbJhDG1UiB/GUhKr8UgCUUAym6QeD7H1WmCZHPx45q0=; b=mIujRoLh6bzsdN3PrC//ZmAUkp3Y8bePm34knk0e6yt/0NeZOvPc+HlhbGd+SiYYKCoNSV ddxJOCGM/WEajYKp0SO08Hn0HQk104lboSoPbyRpsX+ieUjd4eukmeB/QLHJ2QT55a1B4x KjI9OXqsNwnXqdXVo/p8m3dl3Rd3pxiTMitYVwptZX7z8C/vcznn7kI3f5caP2Z580ZpN6 wv8hM2b9/2GSE4iT3LaEc0nH6U61U0MT8NYzx5bRxIboFWK6YsGsYFdpbq7I+lj6f4WF4m dKbFR0ECcGjoqyHEq1sgWQqE03unEl97X60JIl951Da4hAu+O08Oun0fRUWViA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596270; a=rsa-sha256; cv=none; b=MTWdT+e2JpJJk4bBM3xJbX5cCudwr0JgaPEth2kUTiMbOanFLema0mFiGJtIYYr0c+l8R3 ygPwrL1c4ZLICCaTsPLmBA+gNYPtOUfMPNFLgMw8d5hejrOqHc1MEkeq+pGoUOTIlrmk9S /BLK591nyCgqynjCHySDwZaEWHw9NXroHpKWLK9TK8lzF/lu5Yws37U9f9HgrHuEAXFxEg GP3gF8nee7cC90ZTJC6fj6lse2pqocvb6WnpOH5haUoTXg8oDoi/yuP3JFjgWYxxFY51x3 QY4POGFK8wPh3xblURunByQcrjQrO+DRLfh7q+NGF2UECaDIhBEj6TmSNASG/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFp0ygNzqbp; Sat, 04 Oct 2025 16:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 594GiUFu057966; Sat, 4 Oct 2025 16:44:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiUnZ057963; Sat, 4 Oct 2025 16:44:30 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:30 GMT Message-Id: <202510041644.594GiUnZ057963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a3fbecac6879 - stable/13 - tests: gif(4): Add regression tests for setup with EtherIP List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a3fbecac6879990afd88bbe95aad84abbbe8c2c8 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a3fbecac6879990afd88bbe95aad84abbbe8c2c8 commit a3fbecac6879990afd88bbe95aad84abbbe8c2c8 Author: Zhenlei Huang AuthorDate: 2025-08-08 10:17:51 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:20 +0000 tests: gif(4): Add regression tests for setup with EtherIP Tunnel IPv[46] traffic over IPv[46] should still function when the gif(4) interface is member of a if_bridge(4) interface, aka the EtherIP setup. PR: 227450 Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51682 (cherry picked from commit 04d0dc4c0c65592a21225cff43f25e0a0da64eb9) (cherry picked from commit e5f01421ddbfee935546271121e6254472dcc7f5) --- tests/sys/net/if_gif.sh | 154 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/tests/sys/net/if_gif.sh b/tests/sys/net/if_gif.sh index 5c7278d17e8f..bff88f9e75b6 100644 --- a/tests/sys/net/if_gif.sh +++ b/tests/sys/net/if_gif.sh @@ -202,10 +202,164 @@ atf_test_case "6in6" "cleanup" vnet_cleanup } +atf_test_case "etherip" "cleanup" +etherip_head() +{ + atf_set descr 'EtherIP regression' + atf_set require.user root +} + +etherip_body() +{ + vnet_init + vnet_init_bridge + + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + gone=$(jexec one ifconfig gif create) + jexec one ifconfig ${epair}a 192.0.2.1/24 up + jexec one ifconfig $gone tunnel 192.0.2.1 192.0.2.2 + jexec one ifconfig $gone 198.51.100.1/24 198.51.100.2 up + jexec one ifconfig $gone inet6 no_dad 2001:db8:1::1/64 + + bone=$(jexec one ifconfig bridge create) + jexec one ifconfig $bone addm $gone + jexec one ifconfig $bone 192.168.169.253/24 up + jexec one ifconfig $bone inet6 no_dad 2001:db8:2::1/64 + + vnet_mkjail two ${epair}b + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig ${epair}b 192.0.2.2/24 up + jexec two ifconfig $gtwo tunnel 192.0.2.2 192.0.2.1 + jexec two ifconfig $gtwo 198.51.100.2/24 198.51.100.1 up + jexec two ifconfig $gtwo inet6 no_dad 2001:db8:1::2/64 + + btwo=$(jexec two ifconfig bridge create) + jexec two ifconfig $btwo addm $gtwo + jexec two ifconfig $btwo 192.168.169.254/24 up + jexec two ifconfig $btwo inet6 no_dad 2001:db8:2::2/64 + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.0.2.2 + + # EtherIP tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.168.169.254 + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8:2::2 + atf_check -s exit:0 -o ignore \ + jexec two ping -c 1 192.168.169.253 + atf_check -s exit:0 -o ignore \ + jexec two ping -6 -c 1 2001:db8:2::1 + + # EtherIP should not affect normal IPv[46] over IPv4 tunnel + # See bugzilla PR 227450 + # IPv4 in IPv4 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 + + # IPv6 in IPv4 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 +} + +etherip_cleanup() +{ + vnet_cleanup +} + +atf_test_case "etherip6" "cleanup" +etherip6_head() +{ + atf_set descr 'EtherIP over IPv6 regression' + atf_set require.user root +} + +etherip6_body() +{ + vnet_init + vnet_init_bridge + + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + gone=$(jexec one ifconfig gif create) + jexec one ifconfig ${epair}a inet6 no_dad 2001:db8::1/64 up + jexec one ifconfig $gone inet6 tunnel 2001:db8::1 2001:db8::2 + jexec one ifconfig $gone 198.51.100.1/24 198.51.100.2 up + jexec one ifconfig $gone inet6 no_dad 2001:db8:1::1/64 + + bone=$(jexec one ifconfig bridge create) + jexec one ifconfig $bone addm $gone + jexec one ifconfig $bone 192.168.169.253/24 up + jexec one ifconfig $bone inet6 no_dad 2001:db8:2::1/64 + + vnet_mkjail two ${epair}b + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig ${epair}b inet6 no_dad 2001:db8::2/64 up + jexec two ifconfig $gtwo inet6 tunnel 2001:db8::2 2001:db8::1 + jexec two ifconfig $gtwo 198.51.100.2/24 198.51.100.1 up + jexec two ifconfig $gtwo inet6 no_dad 2001:db8:1::2/64 + + btwo=$(jexec two ifconfig bridge create) + jexec two ifconfig $btwo addm $gtwo + jexec two ifconfig $btwo 192.168.169.254/24 up + jexec two ifconfig $btwo inet6 no_dad 2001:db8:2::2/64 + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8::2 + + # EtherIP tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.168.169.254 + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8:2::2 + atf_check -s exit:0 -o ignore \ + jexec two ping -c 1 192.168.169.253 + atf_check -s exit:0 -o ignore \ + jexec two ping -6 -c 1 2001:db8:2::1 + + # EtherIP should not affect normal IPv[46] over IPv6 tunnel + # See bugzilla PR 227450 + # IPv4 in IPv6 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 + + # IPv6 in IPv6 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 +} + +etherip6_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "4in4" atf_add_test_case "6in4" atf_add_test_case "4in6" atf_add_test_case "6in6" + atf_add_test_case "etherip" + atf_add_test_case "etherip6" } From nobody Sat Oct 4 16:44:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFn2t8Cz69Jdq; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFn1dgcz3KQp; Sat, 04 Oct 2025 16:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jAcXlOUYd7CAVMVrr5SLHRhITIzDJ6mlFUFuUsB7Ri8=; b=UPmr2xmB0JigUif0kEdwaYHMIvYpPECUJGARBmKG+tsAHj7x2V/ecexY6HraxW66US9xpf B1fSDQEAtJTn9MhbC0p6YXhW0lQASsfSoE5Uq7RWzmHcrzNw9OzbGRNsrhoRre3rNt2+AG 59HEGzH55IQT2aTVikEaR2Aop6KvRWOoG44jKB/BqJ1KQvO7s2iV9mhDRN0wO0xb4n4yF4 /70FNj/RW6y/xsfC3oASYCWfEXXXFAuH+jFUAwRZonVc1rx7vYuvr04iCMvrJGzS1f5uta 9lswhTSLoLxbYvkvSaOoy/1hk0M4dWEoKAiy1KEwQ8OcZTegz2x1N41SZgLxww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jAcXlOUYd7CAVMVrr5SLHRhITIzDJ6mlFUFuUsB7Ri8=; b=aKEb0MlY0I9AZ1lBZis7cD5QCIdCoHFNOoXdlM4rufu8HUQCpLOn37FZ/6FDsa6n9uzeQZ p7nZzTMmH9cB7b22wds8DGKyHjX9AZdfzhrcAGUXTUcQrsdbv3B1I6xKY+ldZWmDCxrhvB XRZVW0F6ZgSr6WCDC7+dSLDKxT8qjei51mQqJQRzJXEr5D6/DP28+zrwrDT/TjIuBmExkY uc7cJDHrmEfCc8Ls4ewWeulMEDoL0YUkuRvM3KAD1M88rp4aUHp+yxMsL+0IjGQ5QMajQF 407/aHfLYkL8LT7ZkTODe67V4BtICQRlasnOlapdBGHdSt6y59HkndMZn66YLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596269; a=rsa-sha256; cv=none; b=y2mjg4GAQjp3VQ9BBorFrwtlGPn6FYUHFkqiHAOt/fjXSliefRB4I+FFCXoX56mYmHPgvq Gej+IOgj8z+4XWYBtPztRXoaUjxTRjPZvW3t3aoAoGxv7ZkPfmhrhvJG+LnaCQhPHEcM5T ChCXEbInhDtGJQDm80yAFIBcb+fWR4dsRqNOL8LE1DShccScpAoF0L8YCkYX8OrrApvM8U aaJG3iFSYc1S+r4UL+Ygh+bkSBe1X7c6+IZusBeptNdvnmbdcbJFIlB5LUB9nHz+3sfFOH rU4ftx09OwNNbWgu5dcIeMgXmniGcOx/0KCw/o1E8BsdZgozPbA6rQafJwRZOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFn0xDXzqpl; Sat, 04 Oct 2025 16:44: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 594GiSUH057933; Sat, 4 Oct 2025 16:44:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiS49057930; Sat, 4 Oct 2025 16:44:28 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:28 GMT Message-Id: <202510041644.594GiS49057930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 767db004475a - stable/13 - tests: gif(4): Add tests to cover all IPv[46] in IPv[46] setups List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 767db004475a4b6dacde2cc4fa6ce392e63df59d Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=767db004475a4b6dacde2cc4fa6ce392e63df59d commit 767db004475a4b6dacde2cc4fa6ce392e63df59d Author: Zhenlei Huang AuthorDate: 2025-08-01 16:33:10 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:19 +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 (cherry picked from commit 62439516cc9bba32ed2406f340326c4d37e4cc59) (cherry picked from commit c2806cddc64766b69daa42b4fb192f767e4b4705) --- 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 Sat Oct 4 16:44:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFq4nMmz69JXn; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFq2hRSz3Knd; Sat, 04 Oct 2025 16:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+WVr7KYx9fMdwhThMVqhUD9HINY0ElrdtEeOvq2TpI=; b=tcNTvyjUWbsrk8XiNK6WEosjTUTM0/LI4eWEEsbmUsriAartXSgKGZwzZ4eRJP6oU6rUnx xgDSUJlw23xAM8NRdiZ/t7SGwM6ahPy7C1Si/YS54iT8vJDro4W0S0n75m8BlK29qQCfXW xHVSQqME/mgIrDBE7TUnpWvfb6dd8sGusDfZ3EJ8CLNMY2FTDAoDK3hgluTi/sPfnX5paF 6Npyt+ldVVLhYCI6pO6WMmB9yodcIB5b4yVuIvfCsR1cBvoRRANJ867LQVHljvOFEfIGJ1 RzpcopAFxKXMuyL6GShyaC694yKCK3xTMKUScJkv5AW6eXtm01PRs3dmagq+gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z+WVr7KYx9fMdwhThMVqhUD9HINY0ElrdtEeOvq2TpI=; b=B0lgBOBEMhV5BNTN3ssuaRBAdBr2XDW8t/f6YhesW/7ef9cBJKTJu9Z0AGTJHu/IDMPra9 0dbS41OCeg2n66doqb17/fZZ3sQZC7C7/VhZcfDB4o+ivdoj8NMjN7shzsNlZgj3rMfzWh +lcGo5xz7AMZT9VD0tl5W73FSTW2u4FSIGVVDkIe4lW6lL46SBN5zOxbs8eiGMYb6Nlqf1 AytfDyQNTq9mTsAki4MO6HAolcyCqH2LGbb+I+6LX9GZDlFeY8qfv0t23QwW1edxoBlYJR bh1sp53UmOEg86EwjQ3+VkKJgccwOgA0TSwYi3T1nVg+jv1nPblt3NeHwjMqlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596271; a=rsa-sha256; cv=none; b=DA1SzyXABLGry6ygb13WId4xFqsmmqAbIZyjAwoyAvKaCmfKywiN/mfCFwgdagdk38cWHg HnPiO8SC3FwAatFwtVdjwDfXOnIfIpyBx2UhyIjxCDwYdNlYRNdpm8hQblli+eD1FihPSn P+NHh1D3B4sta+52/Ch5vMacOJI4jMnJqhLAZDPsRXfYkw0VMmdlrtRkJaJs4i9NjvJ+0R BMXmk1gpRFf9ht4f2CrLGJOiI+hGXZGHqxISSZokDdVLWaVBiOAGGmfDBbN9G9Tc03Pzwu N/sbQGcZoG3nf/8pIr6pAaRrXsVWzqzVLlLrQF+9A3q8CONQc7AgYKIQS3fbZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFq2BjMzqbq; Sat, 04 Oct 2025 16:44: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 594GiVkI058001; Sat, 4 Oct 2025 16:44:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiVF8057998; Sat, 4 Oct 2025 16:44:31 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:31 GMT Message-Id: <202510041644.594GiVF8057998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 6e605ed6df40 - stable/13 - EtherIP: Fix passing the address family from if_bridge(4) to gif(4) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6e605ed6df40c91120f8d64924652f8565bc05f0 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6e605ed6df40c91120f8d64924652f8565bc05f0 commit 6e605ed6df40c91120f8d64924652f8565bc05f0 Author: Zhenlei Huang AuthorDate: 2025-08-08 10:17:51 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:20 +0000 EtherIP: Fix passing the address family from if_bridge(4) to gif(4) Given IPPROTO_IPV4, IPPROTO_IPV6 and IPPROTO_ETHERIP have different protocol numbers, then it is perfect valid to tunnel IPv4, IPv6 and Ethernet traffic over IPv[46] by the same interface. Since gif(4) has already utilized the inbound csum_data field to carry address family, also teach if_bridge(4) to do that, rather than checking if a gif(4) interface is member of a if_bridge(4) interface. Without this fix, tunnel IPv[46] over IPv[46] will not work when the gif(4) interface is member of a if_bridge(4) interface, aka the EtherIP setup, as the address family passed from gif_output() will be overwritten with the wrong one AF_LINK by gif_transmit(), and end up with incorrectly encapsulated packets. PR: 227450 Reviewed by: kp Tested by: meta Fixes: 8a0308722372 gif(4): Assert that gif_output() isn't called for EtherIP MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D51682 (cherry picked from commit f4744b8acb932fbb3e48b71d31b7cd585566b668) (cherry picked from commit aeb8f341ad20b5f49561fff688e8bee601b0e15a) --- sys/net/if_bridge.c | 6 ++++++ sys/net/if_gif.c | 10 +++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index e7c98958d2b1..5c0dad8b1468 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -2074,6 +2074,12 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m) } M_ASSERTPKTHDR(m); /* We shouldn't transmit mbuf without pkthdr */ + /* + * XXXZL: gif(4) requires the af to be saved in csum_data field + * so that gif_transmit() routine can pull it back. + */ + if (dst_ifp->if_type == IFT_GIF) + m->m_pkthdr.csum_data = AF_LINK; if ((err = dst_ifp->if_transmit(dst_ifp, m))) { int n; diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 022896c17965..bbb633fb7d3f 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -311,10 +311,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) goto err; } /* Now pull back the af that we stashed in the csum_data. */ - if (ifp->if_bridge) - af = AF_LINK; - else - af = m->m_pkthdr.csum_data; + af = m->m_pkthdr.csum_data; m->m_flags &= ~(M_BCAST|M_MCAST); M_SETFIB(m, sc->gif_fibnum); BPF_MTAP2(ifp, &af, sizeof(af), m); @@ -354,6 +351,8 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) break; #endif case AF_LINK: + KASSERT(ifp->if_bridge != NULL, + ("%s: bridge not attached", __func__)); proto = IPPROTO_ETHERIP; M_PREPEND(m, sizeof(struct etherip_header), M_NOWAIT); if (m == NULL) { @@ -404,9 +403,6 @@ gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, { uint32_t af; - KASSERT(ifp->if_bridge == NULL, - ("%s: unexpectedly called with bridge attached", __func__)); - if (dst->sa_family == AF_UNSPEC) memcpy(&af, dst->sa_data, sizeof(af)); else From nobody Sat Oct 4 16:44:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFr6Nfkz69JXt; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFr3tVHz3Knq; Sat, 04 Oct 2025 16:44:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0XfgHcvKzgmEQN2clQqO4/Us0T6iS0cgLvDFbyTbTXg=; b=r4LbSRxBuMFb38Cuwt7CL5bJKMt6McAJOzRlV5dmiupnN6WHwFcS49etR9ncHpDwTbnxM9 YSZP0DeFCy+KuBzI4nZ/4V2IBTUA6/kECfu8RISLVK7+HxRkxxn9eOox3t+bBh2xyKxiqq V7lerwpVUxkHWkaP1w2CGvoFvGYRLclNSvXqxEzt1PXzYmxr6mUvtHNK6PdwvyY92sYJUR cf2hZYPBeoNil11X/fi2f2OSY89mGY4qbx+DuK8DJiuHplzxi59LRuasZ33ZJQ8g5F15AN ThJyyigplGbPpol/ia+RfoqaOv8UV+GmdrvFjuAhM9AUrDzHzvcBIrKbcQFBFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0XfgHcvKzgmEQN2clQqO4/Us0T6iS0cgLvDFbyTbTXg=; b=WlG9A/248f5BK35V7/xRi6FSPC2FOyOgm39gQWALKjXoX0SCEdAipqDdBTq1n8/V4HONXs V0jIwFSfxVBcyFrDpFOfYv3qKod5WAYFMLCYvcnzLV3BAY8xg3towdQILAhVgDPHdMaUyy LuenFwuh60QgAspUj0REwxvqubd4PgSaY7c/t+jyXWuB1Ik9AZJjfX92GGMWF9s5xqMPHU 1ch9P0ixI3/M831kmcxvqyRYmRVJ5+G2+TrAy0DqgFleCE/bdT56UAD2dxNjClkAe8/iUi PK83L2HeijOPpTvCvwZSoDZWd1i6VuJ6aDh7kowpPW3WqcwkTAZ/jBXZk8sZ+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596272; a=rsa-sha256; cv=none; b=vPB51fkk99oAJAQPH/5C7dX53UdW5T4Q/GoESZxtwDJWcMLhfuj6EVmxh5eOms8I25RHd3 4+97GIT634Qi1RPjBr8lozs96e5574K4HVa8aHH6hvlpIz+dSqQWDPkbh2jmEk0SavvUl7 XjE61PoDBTaXw5jKD7p33ZSOxajj9x0G6+RADkj9FzQ+JsYpLWgPjBfnpeBtSnD2SUJxti z32yLgByr70gVysNcspM88Wcf9E2XFnPJDLJ6yFyYhD4FSqERelF8FmO/BjZSbfetNAx07 XXWk/JZgEpgdn7mfQgM2PZFJWDztN7Cqbx3LEJx7dl2D6gK7eYaTzdny6iaCZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFr2plxzqdN; Sat, 04 Oct 2025 16:44: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 594GiWvt058035; Sat, 4 Oct 2025 16:44:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiWm3058032; Sat, 4 Oct 2025 16:44:32 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:32 GMT Message-Id: <202510041644.594GiWm3058032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 7cbb184bbfa3 - stable/13 - gif.4: Mention that gif(4) can tunnel Ethernet traffic List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7cbb184bbfa3ffab031aca864647ddb387094e27 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7cbb184bbfa3ffab031aca864647ddb387094e27 commit 7cbb184bbfa3ffab031aca864647ddb387094e27 Author: Zhenlei Huang AuthorDate: 2025-08-27 15:55:22 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:21 +0000 gif.4: Mention that gif(4) can tunnel Ethernet traffic Ideally this manpage shall have examples for the EtherIP setup, but there has been one in if_bridge(4) since the introduction of EtherIP [1], so direct the setup to if_bridge(4) at this moment. While here, add RFC 3378 to the reference section. [1] 73ff045c575b Add RFC 3378 EtherIP support Reviewed by: meta MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51781 (cherry picked from commit bf6027df0955cb79c9c56c47cc96709b2215c82a) (cherry picked from commit 1b42526ce9f4e4587f4179a7e78655ce34b95110) --- share/man/man4/gif.4 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/share/man/man4/gif.4 b/share/man/man4/gif.4 index 959510451011..03fc712bf2a6 100644 --- a/share/man/man4/gif.4 +++ b/share/man/man4/gif.4 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 21, 2018 +.Dd August 27, 2025 .Dt GIF 4 .Os .Sh NAME @@ -54,6 +54,16 @@ does not perform GRE encapsulation; use .Xr gre 4 for GRE encapsulation. .Pp +The +.Nm +interface can also tunnel Ethernet traffic over IPv4 or IPv6 +when combined with a +.Xr if_bridge 4 +interface using EtherIP protocol. +See +.Xr if_bridge 4 +for detailed setup. +.Pp Each .Nm interface is created at runtime using interface cloning. @@ -169,6 +179,7 @@ variable to the desired level of nesting. .Sh SEE ALSO .Xr gre 4 , +.Xr if_bridge 4 , .Xr inet 4 , .Xr inet6 4 , .Xr ifconfig 8 @@ -188,6 +199,13 @@ to the desired level of nesting. .%D December 1999 .%O draft-ietf-ipsec-ecn-02.txt .Re +.Rs +.%A R. Housley +.%A S. Hollenbeck +.%T EtherIP: Tunneling Ethernet Frames in IP Datagrams +.%R RFC 3378 +.%D September 2002 +.Re .\" .Sh HISTORY The From nobody Sat Oct 4 16:44:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFv2XP2z69K01; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFt5DVRz3KjP; Sat, 04 Oct 2025 16: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=1759596274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lblLhZSEOiZ6qen21snBSFqvJFvhIy/WWtP2b03Z8aY=; b=iM8RAqmyZRuwIAFEQvn5HAX4TcvEWo49r5uUufMFjIzIsBr2m4rHOKNPX6MuSQm2zFj1Ie pLys9yNpG9ohvuE0A28vzlX7p2NfvBglu3kQGtLoUOd7ad2imw0ETbypF0C90avni8o44V oNs+b9r2gamMF8ZhYTN3pCLWc2HJtAflZqcaIuzp+vXtqxd060WsrLByGbDec0jz0akthx bUtWpNeKe+KmpgD1SDgS1ozgKZtIKqBZ0lt+vpH2aG9AbScGQJ6OEhgmbfXXHKBVYHCFpQ dQZh3mdxBzX/8zFMD2qAeiXkkcPYlimatHbMKN+RbSQWqik5j+oR8MdWmPn5uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lblLhZSEOiZ6qen21snBSFqvJFvhIy/WWtP2b03Z8aY=; b=g4+ldRLU99PM9LAetYUjhNNwCDE2aj+NNPtqB4eOQDz7ntHhkJG7yx03zLn6CnQrM19he7 /iqPmokryeO/FghCR2bf3AeyHXvEgWytoDbb2FamZ/KYAa5NtSwI/yjZW9xMOwVDJISJPl +0c5ZqbpkxHSdOkLgImA5lFs78/P9Pbb0pytvtaktPDEAFFqy7+NN+sBKIPkfSc59yOdow H0boFeb3wttBnlK0PUV8nb7UFh1mnFbIslz8OYMdnJQRq93kjiOV+KNDcy0SPV7DY+dTI9 4yss22Vm13t2LD05SndFUcv3/UfZP/3iF4Gg5rGium5Iu0IvkZRjBrZ4RNVFWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596274; a=rsa-sha256; cv=none; b=xYRPkM1N2Vda7UyqeR2OsVSQOfhjHbmLi0Lij76hFbkOjBLSx31OYSu88QuZ8yp+BHj05H 8eOJXEEjwxIa033EEDmcCRAwRZk8FKtdYSyLinfR8d971lHYRJLNcOsWBfPJCMRw7gfP/5 4JktF1cQqAl8iFQBqOMRQb/W1pGATuQ0Vgsst3YIzReEquFcfm4Aev6bxLqI0LEtN1K1Sc wN6S2R77el8VLf12rPRN4h7Khgj2eq0Vt+BaPattwSqpWlCbk8QfKJ5hdlnwhrN4mnfVbY nFRuyvi9lbVIFvWN09XroFw0Bc6El8LN0R/H2NTMbFol7/9+3Ids9BxCDuQLLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFt46bnzqYd; Sat, 04 Oct 2025 16: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 594GiYGV058114; Sat, 4 Oct 2025 16: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 594GiYjK058110; Sat, 4 Oct 2025 16:44:34 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:34 GMT Message-Id: <202510041644.594GiYjK058110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 4dc6c65704de - stable/13 - init_main: Fix logging the subsystem of pre-loaded kernel modules List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4dc6c65704de05ed4bf74585d28b106fcb50452c Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4dc6c65704de05ed4bf74585d28b106fcb50452c commit 4dc6c65704de05ed4bf74585d28b106fcb50452c Author: Zhenlei Huang AuthorDate: 2025-09-03 10:14:21 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:22 +0000 init_main: Fix logging the subsystem of pre-loaded kernel modules The pre-load, aka linker_preload() runs at the order of SI_SUB_KLD, but a pre-loaded module may have SYSINITs that have startup order prior to SI_SUB_KLD, e.g. TUNABLE_INT() / TUNABLE_LONG(), hence it is possible that we run into abnormal orders. Without this change, the subsystem of the pre-loaded kernel modules will be melted into previous one. That is mostly harmless but confusing. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47904 (cherry picked from commit 11f1dd193af57dfa5128eadc62b084502292a784) (cherry picked from commit b2293f7f60c238e7a83551472aed9452cd017769) --- sys/kern/init_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index f827000d9200..438b2fd5c996 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -284,7 +284,7 @@ restart: continue; #if defined(VERBOSE_SYSINIT) - if ((*sipp)->subsystem > last && verbose_sysinit != 0) { + if ((*sipp)->subsystem != last && verbose_sysinit != 0) { verbose = 1; last = (*sipp)->subsystem; printf("subsystem %x\n", last); From nobody Sat Oct 4 16:44:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFt0HsKz69JbZ; Sat, 04 Oct 2025 16: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFs4gV3z3KpG; Sat, 04 Oct 2025 16:44:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F8XGuGEpvgFCCH9H5gtyIhB2DiL2a+AoBK8KYT5TAMQ=; b=tth+lR8ZB4jiE2vrTIvYG0l5ay+r3kAfCP/BNzgzRHarlZmwRfLay/Mn0KFh3kQ8FCRW+t EQ1TmVTRM5uAg4Uw0nNzh8ubj6BgbQx4LXD5XhvlpsTw9WgqHKVN+DY00kTI804sCPfGxl kY4SGhAb+ti9lFZoUIhxTKllsCZVpMk1sN04Qi8FY4sQKu6mg2lEVmZHsn2q+E3UbM49Fw n/G1eWWeadIUI76hJ96rpj7tdd9bMShEqDgcEDKp5w15k3MWsa+NXB3umRWEbK0R3HQtQZ kvTD7AnCKAIVZUI/S0k/lFp2Yz41bstTF8ShoUoWUdgUtri6LVuPXWEHXhiaxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F8XGuGEpvgFCCH9H5gtyIhB2DiL2a+AoBK8KYT5TAMQ=; b=SgjLfegOpe+aSQ5SSsPOlH+br/VxuMegmrDG73iFtFTf0FKqiS2shf1QxKfJi/Epy7fO6n zH+2lt/IS7AsaDvkNCy5Rl6VAJVqI5m1uwcQv2IY2mFRVw0zOsNe/2bSLdKRNekKlmKGRj wPGh2RBqpW4K00iIl06Jxi499p/SEeQS5gyXhzgii30/DsZsf3tzTnfb4Y1vfQruiuZ4I0 ux4ieIzUS0MAsRN3ulx8HqR8bSUXGXcKkEnZ0VppnRegwmTwXmnjh1cyIBHdTmWeq/ZkwO GvjN4vb+wdPhCU0ngPR/y1uubR9KTz1annHCh1bBIlVDe6bRhmJ+iOl5Vs509A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596273; a=rsa-sha256; cv=none; b=vCVM9Rb8o+1xi2+sf+jQQA+9uGGWr+qJtt73X1bntkIV542DguSO83q+qArXVNtddg4prh rq7R3H34zj8MYZ7fxCePalhq5TK2ihefyOkxCcw6dOc7xYvfakgvyZffc4vHs1oKxZxVQ7 aSNgAwsWRw38szcOQ1Kj1SfqhrWz7SgYVxzHOE2tNi5gUIPpFuM072BrefaxLzTTZRWNVV hYeWNatp0PgxevCVzAejsjlb5+eJ7h63e9Jb9v/LXHMoRkyzfNvw6748rITnHxUKMUEUuH gH7nFj1QoT4RNa+kyDR9fTplbJ7uZns/QnHDgScXC3vjmkvpdvXCaacZhJK3Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFs3mN9zqdP; Sat, 04 Oct 2025 16:44: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 594GiXt9058073; Sat, 4 Oct 2025 16:44:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiXip058070; Sat, 4 Oct 2025 16:44:33 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:33 GMT Message-Id: <202510041644.594GiXip058070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1a9f9b4e38c3 - stable/13 - ipfw: Teach ipfw that EtherIP is an upper layer protocol List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a9f9b4e38c370eb505554edba6041542b8ba701 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1a9f9b4e38c370eb505554edba6041542b8ba701 commit 1a9f9b4e38c370eb505554edba6041542b8ba701 Author: Zhenlei Huang AuthorDate: 2025-09-16 15:58:24 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:21 +0000 ipfw: Teach ipfw that EtherIP is an upper layer protocol so that we do not discard EtherIP packets ( over IPv6 network ) when net.inet6.ip6.fw.deny_unknown_exthdrs is set to 1 ( which is the default value ). PR: 227450 Reviewed by: ae, #network MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52566 (cherry picked from commit 0418e6690e91aa6c38dd9af9da43c4c5a9dc1cd2) (cherry picked from commit b1c96e54b906d0cdea0b5a9c74cc295803dfe50e) (cherry picked from commit b4c6c3db0379a5b3d34143325805cd7e68cf3d9a) --- sys/netpfil/ipfw/ip_fw2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index 2e306d9e291c..efcb269a4831 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -66,6 +66,7 @@ #include #include #include +#include #include @@ -1702,6 +1703,12 @@ do { \ PULLUP_TO(hlen, ulp, struct ip); break; + case IPPROTO_ETHERIP: /* RFC 3378 */ + PULLUP_LEN(hlen, ulp, + sizeof(struct etherip_header) + + sizeof(struct ether_header)); + break; + default: if (V_fw_verbose) printf("IPFW2: IPV6 - Unknown " From nobody Sat Oct 4 16:44:35 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFw2VNbz69Jdx; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFv5wsTz3KRr; Sat, 04 Oct 2025 16:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FV3mUSXckI6YrtSWqPngO3dAy/sEP8VsjbUATiSXpQ4=; b=aQdoXyOz3TKcunOedMglCUh6k4q0jpeqV6OZzjw8ep2AJImuasEtS9YXZIVG9dbKDDJv+y IJPTPRYfJFsUAHsfL2Xcoy+iy5yuQtERKiPg0gaMLx/tpHaqqfpC7Zy1Le3KAmrehi1+Jc zyzu3mcV6i9N3W1DXIx3tMfX6r1RldeQkvuIVD01cdDs54iorjUuocLrLs60+aiK3hgjbl STYOJn5tXmu2/NnGXgG909zaNP3YOEHgHnCNKCRgjpamdzgbJsWCbcWJxFzGnx33rUh2LE H73d8Dk3L3MQt9IGLafyonfF/eGzwL6DW/MJ9PBMBTvrSWQjYdihEFJtY5Z1MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FV3mUSXckI6YrtSWqPngO3dAy/sEP8VsjbUATiSXpQ4=; b=RV58U/JwyQDLOOuW+d0dfyrbGHLNrj1dXsj3XtrrnL9SFhZiPG743e/LtX7+D9w+Vb/e/M lJ6Fci/pfeqWbBOU4wFw1Mw6Oj8rREy+yBDnDdgmfWZkX0viQga1kxzaYEsuP7ZeO8IQ3n X9/7EafbhDub/ZFehO/J9y2B3sYwRyVf8Yb/DfmewetfCsRWgruOkUVOehe9TVprbPnW7n 2E+7cRYtiCbziAZVVQYKrTCvaMvaL87agdl14LUcg3aqR1jpHnSmP3zNGbvGrTVRIGctnY Xl3no2eHTaJjx+bvkgZQOPbZ7IhlJUGX04L6oTkd5kJbVYvIwWc5SVvkUoFxug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596275; a=rsa-sha256; cv=none; b=lamCnZwARUIG02Smb+9Hi6nR6CqlkHDMOdsapJDgRGkrfQOAoeS/2RVSZIh5fmz4l/WG7/ yM5LGw4xo2aBMOVgycfAlA0bZ7H0iRTcK7yN076JsL7i6o4z53PCW3OqhdE78lETJWQRsT p+uvV/pfS52T0ivRPknuCr6AHbp6f2YklQR1krK5LtkQhow390X1l7cVGxFbHHbzmr8P9f pcFa6eNrAPlxBXvpY1UHrsskyOkmnSqiCl1DvVuofRvfqNmH8sYjFtXSKATqyVOLExONzb o6umjKUXrf8eHKAdEjBg2hXUAY16muBYd5PBsa223xD/3nYG3FdCrJr+x5msKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFv57KGzqdQ; Sat, 04 Oct 2025 16:44: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 594GiZ5O058149; Sat, 4 Oct 2025 16:44:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiZaP058146; Sat, 4 Oct 2025 16:44:35 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:35 GMT Message-Id: <202510041644.594GiZaP058146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ad08006c7fd5 - stable/13 - qlnxe: Fix advertising the IFCAP_LINKSTATE capability List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad08006c7fd504f75ed2f672fc25d86955be8563 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ad08006c7fd504f75ed2f672fc25d86955be8563 commit ad08006c7fd504f75ed2f672fc25d86955be8563 Author: Zhenlei Huang AuthorDate: 2025-07-22 04:11:02 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:22 +0000 qlnxe: Fix advertising the IFCAP_LINKSTATE capability The following up advertising of IFCAP_HWCSUM capability unconditionally overwrite IFCAP_LINKSTATE. Reviewed by: kbowling MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51450 (cherry picked from commit c18860339d5051dea99cb5cee7e322ffa5dd2a81) (cherry picked from commit cdd97f3aacf1e509858207a0caa085b9c47e5e9e) --- sys/dev/qlnx/qlnxe/qlnx_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index fe6ccc538c26..66c715a7bfc7 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2346,7 +2346,6 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) else if (device_id == QLOGIC_PCI_DEVICE_ID_1644) ifp->if_baudrate = IF_Gbps(100); - ifp->if_capabilities = IFCAP_LINKSTATE; #else ifp->if_mtu = ETHERMTU; ifp->if_baudrate = (1 * 1000 * 1000 *1000); @@ -2401,6 +2400,7 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) ifp->if_capabilities |= IFCAP_TSO4; ifp->if_capabilities |= IFCAP_TSO6; ifp->if_capabilities |= IFCAP_LRO; + ifp->if_capabilities |= IFCAP_LINKSTATE; ifp->if_hw_tsomax = QLNX_MAX_TSO_FRAME_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); From nobody Sat Oct 4 16:44:36 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFx2RcGz69Jw2; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFw6Fslz3Kv8; Sat, 04 Oct 2025 16:44:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tEcHw1j1Fo8JBFNtnp0jLf9eFR9BTCUAbGZA3Q/3s4w=; b=aGEgGSuzKvmIDIdvI9TydHQJo3A7JGGrp5A0F0jypUkX8c+ALiQM75YZpmwEEX7NBlKfxC AAcdnDD8lLMx0dpKRK5oMC5W2GQAxxu6ds/UvS3s9AJqlrDMwLONB12aNik5u8SpCipA3A 2KHy71b/hh3mGvpMN9xViJEZsoeAqdO6mXOp7SWq84P3h5lY3W+jxxRhXIzFNiII8KR8KX ti65pmyiWMFH3BZwvI3uvrek9AqtdUwlsnXrCM4ddGZj6aXVjmbPY7Kp5GjeVfh/cynRJT fExXKflpnu9KVOzWcbYzhM/WKVXl6/tzW9CDgzKraTg5W0AiJw90P1a4NgN4Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tEcHw1j1Fo8JBFNtnp0jLf9eFR9BTCUAbGZA3Q/3s4w=; b=r1esFWkjG9ozSyaEN6YWE7HSIyhApbwMHopTI/B9EYFQdob4nVXchB0UCVP0wr3cSofU1G LD19VTAPxenAPpy0yTJzYmN9Ef1YuY6cVuer0YFZlpRtZJWL/UqjVutNlYdvyQapEtgjkr HRnoJ5N7tipUvGJBrWrlmxVABVJtnHnCco2BmcPmfxB9RL6S/uSV7J9y/8KWDZKyT0vRGs kA/v9OEWmXQT/6Ew9IC3v6ui4iv01/y3jpy1yQ5qmwyvUwSi1X6DNyOgTq6l6g/zf2wv7N NDMXXonK3vWWgBOOoS3edw5d3GZmjPJFDizaxxP515P5f8pF+dQs3B1nfG99OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596276; a=rsa-sha256; cv=none; b=FnlG3QKV/7wktorBK9/aam8HrNuVVRegrrDOm1MrZQJ9mF98LfC9YDcpQzoDzBkcIPtVaD lOUdCNUYsDriRHHNHEAyvbdPWMf/PcVtQI1S5DtLqZOgtc2EUySGBL0fmBz6oungAThO/+ Hnl9W+K0SEuom3i5UhBrsjaC36OAAi3sTjo7EPcfPQUL3sppFhgUxGACsyXOGUJPig2XZx YAAZss663kEFBZ5kHBJLH+QED+8E2C/77a194wDlV+Vu7jzLAYi+6wZoJdF2rwmS05jiA1 04eYacu7+grvwnjC+GNel8vtCQUzJTQLp7/lxVDn1lojS6FXnewjE1DsAfeldA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFw5YfdzqWp; Sat, 04 Oct 2025 16:44: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 594Gia54058187; Sat, 4 Oct 2025 16:44:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiaMw058184; Sat, 4 Oct 2025 16:44:36 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:36 GMT Message-Id: <202510041644.594GiaMw058184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 49fbc8dcf77d - stable/13 - qlnxe: Unconditionally enable extended media types List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 49fbc8dcf77d4ef21b7e93986ff5fcd8f0e53c1d Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=49fbc8dcf77d4ef21b7e93986ff5fcd8f0e53c1d commit 49fbc8dcf77d4ef21b7e93986ff5fcd8f0e53c1d Author: Zhenlei Huang AuthorDate: 2025-09-09 10:04:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:23 +0000 qlnxe: Unconditionally enable extended media types Those extended media types are available since about 2015 [1]. All supported branches already have them defined. No functional change intended. [1] eb7e25b22f1c ifmedia changes: Extend the number of available subtypes for Ethernet media ... Reviewed by: kbowling MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52374 (cherry picked from commit 08356a733eb7a7bef1afe20ded2d983b55310de7) (cherry picked from commit 5aa49c98edfc48fbe96f7aba0e0631d4c0f29493) (cherry picked from commit 2cb20b25a5739fb542513571e3f6d7ffd607f346) --- sys/dev/qlnx/qlnxe/qlnx_def.h | 16 ---------------- sys/dev/qlnx/qlnxe/qlnx_os.c | 21 +++++++++------------ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/qlnx_def.h b/sys/dev/qlnx/qlnxe/qlnx_def.h index 276804c08ab5..898d85fdba89 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_def.h +++ b/sys/dev/qlnx/qlnxe/qlnx_def.h @@ -696,22 +696,6 @@ extern int qlnx_alloc_mem_sb(qlnx_host_t *ha, struct ecore_sb_info *sb_info, * Some OS specific stuff */ -#if (defined IFM_100G_SR4) -#define QLNX_IFM_100G_SR4 IFM_100G_SR4 -#define QLNX_IFM_100G_LR4 IFM_100G_LR4 -#define QLNX_IFM_100G_CR4 IFM_100G_CR4 -#else -#define QLNX_IFM_100G_SR4 IFM_UNKNOWN -#define QLNX_IFM_100G_LR4 IFM_UNKNOWN -#endif /* #if (defined IFM_100G_SR4) */ - -#if (defined IFM_25G_SR) -#define QLNX_IFM_25G_SR IFM_25G_SR -#define QLNX_IFM_25G_CR IFM_25G_CR -#else -#define QLNX_IFM_25G_SR IFM_UNKNOWN -#define QLNX_IFM_25G_CR IFM_UNKNOWN -#endif /* #if (defined IFM_25G_SR) */ #if __FreeBSD_version < 1100000 diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 66c715a7bfc7..0b0b653ab90d 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2425,18 +2425,15 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) ifmedia_add(&ha->media, (IFM_ETHER | IFM_40G_CR4), 0, NULL); } else if ((device_id == QLOGIC_PCI_DEVICE_ID_1656) || (device_id == QLOGIC_PCI_DEVICE_ID_8070)) { - ifmedia_add(&ha->media, (IFM_ETHER | QLNX_IFM_25G_SR), 0, NULL); - ifmedia_add(&ha->media, (IFM_ETHER | QLNX_IFM_25G_CR), 0, NULL); + ifmedia_add(&ha->media, (IFM_ETHER | IFM_25G_SR), 0, NULL); + ifmedia_add(&ha->media, (IFM_ETHER | IFM_25G_CR), 0, NULL); } else if (device_id == QLOGIC_PCI_DEVICE_ID_1654) { ifmedia_add(&ha->media, (IFM_ETHER | IFM_50G_KR2), 0, NULL); ifmedia_add(&ha->media, (IFM_ETHER | IFM_50G_CR2), 0, NULL); } else if (device_id == QLOGIC_PCI_DEVICE_ID_1644) { - ifmedia_add(&ha->media, - (IFM_ETHER | QLNX_IFM_100G_LR4), 0, NULL); - ifmedia_add(&ha->media, - (IFM_ETHER | QLNX_IFM_100G_SR4), 0, NULL); - ifmedia_add(&ha->media, - (IFM_ETHER | QLNX_IFM_100G_CR4), 0, NULL); + ifmedia_add(&ha->media, (IFM_ETHER | IFM_100G_LR4), 0, NULL); + ifmedia_add(&ha->media, (IFM_ETHER | IFM_100G_SR4), 0, NULL); + ifmedia_add(&ha->media, (IFM_ETHER | IFM_100G_CR4), 0, NULL); } ifmedia_add(&ha->media, (IFM_ETHER | IFM_FDX), 0, NULL); @@ -3860,11 +3857,11 @@ qlnx_get_optics(qlnx_host_t *ha, struct qlnx_link_output *if_link) case MEDIA_MODULE_FIBER: case MEDIA_UNSPECIFIED: if (if_link->speed == (100 * 1000)) - ifm_type = QLNX_IFM_100G_SR4; + ifm_type = IFM_100G_SR4; else if (if_link->speed == (40 * 1000)) ifm_type = IFM_40G_SR4; else if (if_link->speed == (25 * 1000)) - ifm_type = QLNX_IFM_25G_SR; + ifm_type = IFM_25G_SR; else if (if_link->speed == (10 * 1000)) ifm_type = (IFM_10G_LR | IFM_10G_SR); else if (if_link->speed == (1 * 1000)) @@ -3874,11 +3871,11 @@ qlnx_get_optics(qlnx_host_t *ha, struct qlnx_link_output *if_link) case MEDIA_DA_TWINAX: if (if_link->speed == (100 * 1000)) - ifm_type = QLNX_IFM_100G_CR4; + ifm_type = IFM_100G_CR4; else if (if_link->speed == (40 * 1000)) ifm_type = IFM_40G_CR4; else if (if_link->speed == (25 * 1000)) - ifm_type = QLNX_IFM_25G_CR; + ifm_type = IFM_25G_CR; else if (if_link->speed == (10 * 1000)) ifm_type = IFM_10G_TWINAX; From nobody Sat Oct 4 16:44:37 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFy2KMmz69JW1; Sat, 04 Oct 2025 16: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFx6yJrz3KhD; Sat, 04 Oct 2025 16:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wM6HpxF+9ieV7eX9pN2LDeWLQhPA3mSU3Z0ERyJiWns=; b=b2PwVAv7+1lZnwFOVnzC9QG3wwAIrv1cAaLkhwSC0zM3BTcLr13Uc/Hqgqp6Lw7iuy7Qig bhb90etkcJ1ZEl0BJcFXUWMp0Z7zdeO2m2+wz+qrcEDp1uYlAZaAXZQ2fw+yNGSs2JcL4S Smcv3n3rWKjnWUzsyMhgKVBlf8CBeY3BzgEky1XMKwFxi3khcNeVYUkwOc+zYuJoPeGHva wN6n+IqkiZ2wNTXUJsMUfzMU2PZLZwoKK6GqTx0y39dewiPu0PjAWN4ZOCcz8Uj4jRKDcG Te/SpDO5tyoQzYsHoMMYAOf7HlpoVMbSMsH9G1ucTbVlekgHy+J5MmnB6aMGKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wM6HpxF+9ieV7eX9pN2LDeWLQhPA3mSU3Z0ERyJiWns=; b=yomtHmN6xj+olcPauDqLYvtSrU6GPralCp6QXu8A36wdKuCrd0wYXAyXxL2QNfHELnmmb2 34ai+MCIIJhXikgg1RFiwT5p3CbXO70kKhBABjKSuTg03QUo+bcpw1jgbWfCol9NBmGI2p t8sPGIYbS7eEy1nujD7yClPYauXXyJha9sFlc/To4ItfOlgchnawerEw6WlB4RmImDjRXa 7KlD7QCjvKzPn+tyvqHPNcAJ5f8EG02EcgRZzTaKY/e6Ef1CL2i7MYDOUu65+QJGmAvQJ5 XPyQM8LfYO3b+Ca7UYDIqSqAOjQ9e+GMbIfr26O88cXJi7EcODqz0KwqvvHhYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596278; a=rsa-sha256; cv=none; b=Zhl68d54NFOuG2sbeUEtmygw9NyHnUV20LHZEm15GqSgaR7e8c9IwVKUWkxsjgwW/4Ae7x 1+vzVYqnr02C/hgfrlIXalp/ywt1fP1nSBuHZ25QpMRcwAejlcQK5nUgkiCxfwG+o6iUZu s6ctFbKSJn1sVoyDMLBvS2GDqPkp2pWxOp0w3Dz7jOBcoSxPn8t/51Qm2FHq9NIgDchm0J 5d8P+l/8Z8J0OtVzEES62OZhbUNSaRE5OdISVBInK4rWRn+Wk+NHGUtS1e2Og2nulxQRzN FCc4tQK2RBi1n3h+aaRJu/mbR0cKnJfNSOhRct72pdNBRNQ2OIucUlu+OyZ4JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFx6VWBzqYf; Sat, 04 Oct 2025 16:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 594GibUE058221; Sat, 4 Oct 2025 16:44:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GibpX058218; Sat, 4 Oct 2025 16:44:37 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:37 GMT Message-Id: <202510041644.594GibpX058218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: f30da24e9d6a - stable/13 - qlnxe: Support SIOCGIFXMEDIA ioctl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f30da24e9d6ae87c096544b4b68c7c35dbf21c66 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f30da24e9d6ae87c096544b4b68c7c35dbf21c66 commit f30da24e9d6ae87c096544b4b68c7c35dbf21c66 Author: Zhenlei Huang AuthorDate: 2025-09-09 10:04:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:23 +0000 qlnxe: Support SIOCGIFXMEDIA ioctl ifconfig(8) will try SIOCGIFXMEDIA first and then retry SIOCGIFMEDIA if that fails. Since the driver reports extended media types, support SIOCGIFXMEDIA ioctl directly rather than doing another round. Reviewed by: kbowling MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52375 (cherry picked from commit 6e3c8c0f709ab0b9d70e2725e58f4a4ba7a4404e) (cherry picked from commit 817bc700927087a52d0dd34c43e45736a867240e) (cherry picked from commit ac4b48b6ad34a83406054c5badd0f835136ffd88) --- sys/dev/qlnx/qlnxe/qlnx_os.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 0b0b653ab90d..745bd44e5b7f 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2753,7 +2753,9 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFMEDIA: case SIOCGIFMEDIA: - QL_DPRINT4(ha, "SIOCSIFMEDIA/SIOCGIFMEDIA (0x%lx)\n", cmd); + case SIOCGIFXMEDIA: + QL_DPRINT4(ha, + "SIOCSIFMEDIA/SIOCGIFMEDIA/SIOCGIFXMEDIA (0x%lx)\n", cmd); ret = ifmedia_ioctl(ifp, ifr, &ha->media, cmd); break; From nobody Sat Oct 4 16:44:40 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG05vCrz69Jbm; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG02KmTz3L0l; Sat, 04 Oct 2025 16:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t4d7MUHg6cCmDRtMTxuibATEogIFGXEjKkz8WPyPDds=; b=ZpzPbayncT84eNWDvnEqHtJpdgI2ONQlJ61vODbVBaC5n9a5o2aJ5QUrjPKq+LJSM2l5vN criSsC8w2RxweVnm4ylWGsy8byGKprkdPyE+S1R0NsFGMGbp08fhRsiMyuOuMVbWX0XISb vT3EnwXWaG3dP4keg496ow02m473hzho0QxyoxJGpL0sKIA4/MGornLnCrX7QoyoUDBjh5 Qu06e0R02Iio1yu5EYzx1eEh6dt+U4CG0zgFdbP70Rx3ZKW0kIdmDo83SZ7CSXgTXXNLCO oq4BV7DuMQhljjd2R9z5TAVe5Z7QmhE5PkUXBT2MyhM5PzsrpnVdG/iWCIhGLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t4d7MUHg6cCmDRtMTxuibATEogIFGXEjKkz8WPyPDds=; b=ZhsqSRY2VNav+5yIUXvuz6K2dzuUzmVaPTLgD/B6f/AbQLBmaehuT8T9sLBZA+GNKTIXt+ 6JGXmVD9qGeZF2VJwRgse1Iv/eWp+yf0vlNPobzyhk9LrAUyWwss3HQTzaGi2L8ZqseLfn GQNY16sTNdcH1SrGAq5Xk5m/2AsSWpC+h8PEAmnfTURRZzs8uMed4lRFgJtr55PjExkOpl awDoB9v4efAC7RO8B4/qEG2+H9EnvE6L9GAAF/rwnkXBEGHN8NA9yFo9kw640s7k5jRgvE M+JsE7vGUuexvRzGY5CCebhVaFAw1YBY6VG648Z84BDv0N7La40BaMSMOO8e5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596280; a=rsa-sha256; cv=none; b=mRP6jTC6JxXX7DWRKkfqasP6McWYtqx6e/YGVqR6TeXIokmPnO9PUmshswkN9xauDr+p9i JG36KVargjOAnve3EY4azrsscksWXr9T7vDp+tsv/ccH0R4XBdnXVGJZKxV6etFGt2ndPT FWu5QG8MEr83dGVbGVFrwTuYduJ23lnz8sg575nos0cm/lVGrUwfKr/iG4lNepnwN4AiK0 covE8DGJThXzj99e/2RK2jdt1kTrwlmuZtIF6lvwPEWoQ2J3ojkiHuoq+cSsIkXWN7Nb/0 GedHNmknwTajwCtkHQxTjm+qGSsmmXAiYteghPJexnoptVe1gUJ7M9YVzveEXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG01d9VzqdR; Sat, 04 Oct 2025 16:44: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 594GiefX058295; Sat, 4 Oct 2025 16:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GieEv058292; Sat, 4 Oct 2025 16:44:40 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:40 GMT Message-Id: <202510041644.594GieEv058292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d59a8f27fc07 - stable/13 - tslog: Move sysinit_tslog_shim() into kern_tslog.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d59a8f27fc07cd52797b7d0974f5958d1fc21819 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d59a8f27fc07cd52797b7d0974f5958d1fc21819 commit d59a8f27fc07cd52797b7d0974f5958d1fc21819 Author: Zhenlei Huang AuthorDate: 2025-09-10 14:44:36 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:24 +0000 tslog: Move sysinit_tslog_shim() into kern_tslog.c struct sysinit's func pointer requires its address, thus a real function is generated in every translation unit when the source file has SYSINITs declared. That results in plenty of identical sysinit_tslog_shim in the final kernel file, in which only one is used and others are left useless. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52413 (cherry picked from commit 5f9a05e574050c8b3f6b444311a12e8fb293ad1a) (cherry picked from commit bd721f6e8040f0b9d0546c293954290844b6a070) (cherry picked from commit 112d1a5f5df0edb1e530348143413407b2659325) --- sys/kern/kern_tslog.c | 10 ++++++++++ sys/sys/kernel.h | 11 ++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_tslog.c b/sys/kern/kern_tslog.c index bb4f24c631e3..a9158c887050 100644 --- a/sys/kern/kern_tslog.c +++ b/sys/kern/kern_tslog.c @@ -217,3 +217,13 @@ SYSCTL_PROC(_debug, OID_AUTO, tslog_user, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_SKIP, 0, 0, sysctl_debug_tslog_user, "", "Dump recorded userland event timestamps"); + +void +sysinit_tslog_shim(const void *data) +{ + const struct sysinit_tslog *x = data; + + tslog(curthread, TS_ENTER, "SYSINIT", x->name); + (x->func)(x->data); + tslog(curthread, TS_EXIT, "SYSINIT", x->name); +} diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index e1ef7ff10dfa..63846950215e 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -242,15 +242,8 @@ struct sysinit_tslog { const void *data; const char *name; }; -static inline void -sysinit_tslog_shim(const void *data) -{ - const struct sysinit_tslog *x = data; - - TSRAW(curthread, TS_ENTER, "SYSINIT", x->name); - (x->func)(x->data); - TSRAW(curthread, TS_EXIT, "SYSINIT", x->name); -} +void sysinit_tslog_shim(const void *); + #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ static struct sysinit_tslog uniquifier ## _sys_init_tslog = { \ func, \ From nobody Sat Oct 4 16:44:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBFz3vqjz69Jw4; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFz0zvrz3KVF; Sat, 04 Oct 2025 16:44:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1Jd+caQVfJtcfupm0n6H0UTQ+lzQo3yd4aFKYt8Z98=; b=OuoTt3oXXQ42VbnSEELt8sgvesiKr8W1chay1xJfb2Rau/HXl6W4Va7AnX1hkJNgeST1LA mZT07VDT0aiIDK+UwE0Ed9XHDNiscZ2Xul7Y0Om9pQhJBPVzJhSo4qfpEUqh3RTDw5UMn1 IU2X3iD1m2pAOwGiL9mHG9U10VVSqGfrOAzpSBHXRZsrdvpO2+//DWbJz10MXfMTF2Vu4A 3ezch2OvSpJu0sSK4KXMBxObXIPjrR4zSE4uIWfejBCsfiBFxzUyC31VUXS1FCIVNy9kJo VVpUoAq2rsJSqqRZcWjj7EUIfUnIhJIug+eoHfwwE6KmLn20kauMj2Wyg82r2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1Jd+caQVfJtcfupm0n6H0UTQ+lzQo3yd4aFKYt8Z98=; b=rwBWfed1uERgEhHgBA9Ob4SLujnrxE+yUHJQ2hb4wpP1o/l7K+/OYCkOKWniO3agYa2kTV 5woucJH+fV9rqmJF4XBGM99hD1i/zuMSEsOYlciWTMuYHr010j5gWU7S4Stglh9vx6TBAI T0U8806XLBb8Ktn4af6kdgRIGHKzzRILZL0bReGb7J3+6U0nF/C8SzOx8V2BaeeUUU/cqq oJMDpWZXGB/e7Me+Y3s6daog15OLz/GPBBJj39wcktLvns3ReQkVelOyZtA6Lkh4WEISjx GlxNOotvFMzLIs/Ial1kGAU4OeVd2rIZg/8BC+n5PXw9fnRrQYC4NnBi5OL+uA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596279; a=rsa-sha256; cv=none; b=wCph+DoaunpB+tEx2BnKP+/rZtWTrdzNESakXRsJ80W4zp+zLDwFXDa5rpNVyNxG1lDqtb MXot/5bUvHE09oy7HWs6beGJJtrZut8SlcuWtRRL5dE+elh9fR1Rq8u4sQCszkd2wJbnu+ PD7MS9T/UqjUBjYH3jy1aE83iJK4wM0W89OZCK5pmWsPlTe6nUKC2/JzvPNo2tLU2Bbs5P V4DHNnkKG16ryoq/sZoaslCUQQsePc4l3HLSnIRPsN0W4M4RzGRClRio5amp/pR/3VpGBY MzY7SxMeWl7/HXbLYnsJoxRffvhg7IiFWV2kDoq/YQ5sWZfm0pmqX2ldSOQ3FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBFz0Yl4zqpm; Sat, 04 Oct 2025 16:44: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 594Gicvx058255; Sat, 4 Oct 2025 16: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 594GicQx058252; Sat, 4 Oct 2025 16:44:38 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:38 GMT Message-Id: <202510041644.594GicQx058252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 1d101415d7ec - stable/13 - qlnxe: Report speeds in decimal format List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1d101415d7eca95276f88a9ebbedcb50039da2a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1d101415d7eca95276f88a9ebbedcb50039da2a7 commit 1d101415d7eca95276f88a9ebbedcb50039da2a7 Author: Zhenlei Huang AuthorDate: 2025-09-09 10:04:55 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:24 +0000 qlnxe: Report speeds in decimal format It is more natural to read the speed in decimal format than hexadecimal one. Spotted this while diagnosing PR 287445, ``` [__ecore_configure_pf_max_bandwidth:6864(qlnx-0)]Configured MAX bandwidth to be 000061a8 Mb/sec [__ecore_configure_pf_min_bandwidth:6922(qlnx-0)]Configured MIN bandwidth to be 750 Mb/sec ``` Reviewed by: kbowling MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52376 (cherry picked from commit e1c5e043961ab3a5429a0c6e727265dfa819cf00) (cherry picked from commit 6fb046515ea6005b3958e0c3220d0e6e630af292) (cherry picked from commit 94d3be2b547c133f42730e6c8692590ea32adab0) --- sys/dev/qlnx/qlnxe/ecore_dev.c | 6 +++--- sys/dev/qlnx/qlnxe/ecore_mcp.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/ecore_dev.c b/sys/dev/qlnx/qlnxe/ecore_dev.c index 6187ecdbc446..389a95a4164c 100644 --- a/sys/dev/qlnx/qlnxe/ecore_dev.c +++ b/sys/dev/qlnx/qlnxe/ecore_dev.c @@ -5268,7 +5268,7 @@ ecore_hw_get_nvm_info(struct ecore_hwfn *p_hwfn, } DP_VERBOSE(p_hwfn, ECORE_MSG_LINK, - "Read default link: Speed 0x%08x, Adv. Speed 0x%08x, AN: 0x%02x, PAUSE AN: 0x%02x EEE: %02x [%08x usec]\n", + "Read default link: Speed %u Mb/sec, Adv. Speeds 0x%08x, AN: 0x%02x, PAUSE AN: 0x%02x EEE: %02x [%u usec]\n", link->speed.forced_speed, link->speed.advertised_speeds, link->speed.autoneg, link->pause.autoneg, p_caps->default_eee, p_caps->eee_lpi_timer); @@ -6860,7 +6860,7 @@ int __ecore_configure_pf_max_bandwidth(struct ecore_hwfn *p_hwfn, p_hwfn->qm_info.pf_rl); DP_VERBOSE(p_hwfn, ECORE_MSG_LINK, - "Configured MAX bandwidth to be %08x Mb/sec\n", + "Configured MAX bandwidth to be %u Mb/sec\n", p_link->speed); return rc; @@ -6918,7 +6918,7 @@ int __ecore_configure_pf_min_bandwidth(struct ecore_hwfn *p_hwfn, rc = ecore_init_pf_wfq(p_hwfn, p_ptt, p_hwfn->rel_pf_id, min_bw); DP_VERBOSE(p_hwfn, ECORE_MSG_LINK, - "Configured MIN bandwidth to be %d Mb/sec\n", + "Configured MIN bandwidth to be %u Mb/sec\n", p_link->min_pf_rate); return rc; diff --git a/sys/dev/qlnx/qlnxe/ecore_mcp.c b/sys/dev/qlnx/qlnxe/ecore_mcp.c index ab14b1eb5186..6d1e5fe24d06 100644 --- a/sys/dev/qlnx/qlnxe/ecore_mcp.c +++ b/sys/dev/qlnx/qlnxe/ecore_mcp.c @@ -1638,7 +1638,7 @@ enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn, if (b_up) DP_VERBOSE(p_hwfn, ECORE_MSG_LINK, - "Configuring Link: Speed 0x%08x, Pause 0x%08x, adv_speed 0x%08x, loopback 0x%08x\n", + "Configuring Link: Speed %u Mb/sec, Pause 0x%08x, adv_speed 0x%08x, loopback 0x%08x\n", phy_cfg.speed, phy_cfg.pause, phy_cfg.adv_speed, phy_cfg.loopback_mode); else From nobody Sat Oct 4 16:44:41 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG20ZP9z69Jbs; Sat, 04 Oct 2025 16:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG12wSLz3L8Y; Sat, 04 Oct 2025 16:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K7TcMQaJtwj+9TJALIxgptdJWo5OP8c9NhRGKxIVPx8=; b=lMAXihPCW6fpYAJXhbwt18etBVwQQLkjO+mXsIFa4MildQGrcHkOnqsmuVnYFtI/LcWjF2 hNGUB92gYhOYS0zeZZi3itzRsdP9PZehe5ufYXfjxSRp3/MA/K0Lvh5O0tDdKfwmCTWsjY PpcVTLUDz4G73vJx/ShuReS0NEkqN2SI+0ZfGwEV/r9UY3shRS6tpFlSDMP4MrWMrlHbAj WqIcDdmw1t/yzu6YH5GnUH0jof4bCcgalqduWBDDCzKoHfvXdjJWhPRU4VHSFYCTfiK+8j X8zrtPBzCXD9dn3l482Cxagg379jE0SYpwKsVY1URmcC+3W8YBTB1yZRSoKEEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K7TcMQaJtwj+9TJALIxgptdJWo5OP8c9NhRGKxIVPx8=; b=eaGWVV6lKDwdqOH7dF0zGC0HnX5WgRGqnhUohOyCmhDIA84ZTL42Kc3X+zu+Xz8cYAQqKl c/rqView9IlURrHu1WguYQ3l/T6AbGOsRUrEtn0Gj331cjRg7zXHEse7LnJLsi53dsHYSa FmltvnksweMJATzvJ+LLpwuxdnJpRGrWohUIwTwIx+rePvYXkfJaa5BZ0/vnAWZVuREOSz D+q2331UX2LXrEaa36r6Hmyfh6+EP9QKDZyK+LaLZfCudepA7ipS02yXoc+twk8GcyRbM4 P1aeM8EQUlow+1Z5tHoiZQV+tPGZT91xSrSsT70AZtFVJ91ZHIev74sEuWuEMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596281; a=rsa-sha256; cv=none; b=cTkT0fxg5yNg88SXLc9UZ7wHDW5h+QJyTjZqYNCNWi8Oy4Ng1oyYaOkWmI++LJbL7rHQGs 0aNBY5tAzqFX5LkO0yQkeG1I4JhbRNQ9vRTVc2wSNywQNIEeouN4r4EMgTNTc9QjbRoyOO uiwZPh+09XQ8ifMDI3nRQazSiRsXyBwcs8eQCqlQGk6LN23v9+NT6RizvKt1eJ8bzTMmqg XtVPfgCfImAAQjwpYh6NHFPujAU05uWoaE8B7gm73iKCwfFTmvdtMjOXwYKsVZx5TexnDx OSPzu/lL6Uh1E48bRBqYWcW5syDzsY8vQ4B0EOCAs3hcfc/QHjnZ5+df9lv4Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG12Sm8zqR5; Sat, 04 Oct 2025 16:44: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 594GifFM058333; Sat, 4 Oct 2025 16:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GifXK058330; Sat, 4 Oct 2025 16:44:41 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:41 GMT Message-Id: <202510041644.594GifXK058330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 4b92e54c9b5a - stable/13 - tcp: Fix expiring and purging hostcache entries of vnet jails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4b92e54c9b5a531c12ac50add5da6eaf39b19380 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4b92e54c9b5a531c12ac50add5da6eaf39b19380 commit 4b92e54c9b5a531c12ac50add5da6eaf39b19380 Author: Zhenlei Huang AuthorDate: 2025-09-24 01:16:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:25 +0000 tcp: Fix expiring and purging hostcache entries of vnet jails A jailed process, `sysctl -j foo` or `jexec foo sysctl`, do not have privilege to write to non-vnet sysctls but only to those marked as jail writable, aka sysctls those marked with CTLFLAG_VNET flag. Without this change we will get EPERM when trying to expire and purge hostcache entries of vnet jails via the net.inet.tcp.hostcache.purgenow sysctl. Fix that by adding a CTLFLAG_VNET flag. Reviewed by: tuexen, #transport, #network Fixes: 264563806496 Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to expire ... MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52692 (cherry picked from commit 33ceb31e256e386da5a42cc7ca2ef8d4b81b6eda) (cherry picked from commit fa30199a3dbfe1d4994e7e4e63ad9c582c6f8a1a) (cherry picked from commit 79d114544fabd5a80198e925e4dc34f47a9f9e3a) --- sys/netinet/tcp_hostcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index d40b27a251f5..6e987fd4b521 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -174,7 +174,7 @@ SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, histo, "Print a histogram of hostcache hashbucket utilization"); SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, purgenow, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_tcp_hc_purgenow, "I", "Immediately purge all entries"); From nobody Sat Oct 4 16:44:42 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG30FVjz69Jw8; Sat, 04 Oct 2025 16:44:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG243WJz3L3f; Sat, 04 Oct 2025 16:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rht+RUDWHzBkRzvd6ghTm4kqCD4Lsk7+dSFlAE5DLNk=; b=BHrszrgMD61HAyjTgZbqS37wStVfZqeWkP8uyRkZdtNZipy0EkQANJkyBikXBYfjAEe6+L BlxzioxwO5ja9z5Fz7lBMojNzZwFBKzEIIInr/yhr1Vrbu1ww56QkiM8IAgDU00nSxVSK7 MhRGMLqilFa7InkwIYRJ8b+dGudhG/c9M3XbBP19Ywr94iEj6LkmmIc5tlRae8e/EPiUZg 4dfvuuo/XzsygCBOhekdz4Hi9yb48PvZB1l95dHZXibTBOxyB9xEtwPNrZrw5NAxCxjfkn vwh7PcHSRjyf1sZd5aB5May5x21fs4HlYYynP5YDNAjOID1YM0RSci99Zx1DXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rht+RUDWHzBkRzvd6ghTm4kqCD4Lsk7+dSFlAE5DLNk=; b=SCOxPbabNdi9It19ROXT2XnqE3ea3R+iNNgXIKY1CXhKGACHvwxbCoVw24Fw2kyQgEpKtm Cgj6B6SpPop2UUpEWEZzJBIM0R7OIQQ+cTM6kHgSdO0VnaL0puT+xiRO55+kZKy7eO4ZA3 zcjprKPkYDaJdrs7dCq0RTUl5RN5qHEaDXzR2KUKS/9Wqn+oRDgXdpbrt9Gz7PaW0WgWb9 DXgBUkiJ/ysoL0fpueijExNBnrTCgyA6Vw/KJHPgpJ9/xEOk0uYFnbt9hq/KxTti/eagPQ +XKP01Uwn3eryMzlMfw7JA+eMBybnXNjJ0usMZ4s1cZrjSTwoqfhWIlhQWE6Xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596282; a=rsa-sha256; cv=none; b=m9Vz9PMW5j98tGjuNOFe84Pgz8jwCGWuVoRxHRSd6a3ws1wEzO3zMyrio5o/z5w52ZNaG7 b6GTRvabAvWkoLpNmhqf6RwhfS+dPYezYmudsZ2u4nO/uOoZR/WfZWebZSzIfRGJoVI+3v /+wWMC428SBf3E9IDqZNbOstz96RqcLP8DVJH3bjnBVeezBDuRe5rYZxAg6OBh6Asv/UrW dec1cLXez3Qb+awTVwzGeM9WwC8jXh1eVXSvqW2OjdNYNyeCq2MTbyCYlRsE1YtPjN25sN Dwk9mVlRnBMOTsrMelNtwhHI2xQwccPKbMqrk9RtzXcqlRbTR+LZXV1/EoTUsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG23ZjVzqdS; Sat, 04 Oct 2025 16:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 594GigLQ058366; Sat, 4 Oct 2025 16:44:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594Gig6r058363; Sat, 4 Oct 2025 16:44:42 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:42 GMT Message-Id: <202510041644.594Gig6r058363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: ce95ba8ae530 - stable/13 - tcp: Add CTLFLAG_VNET flag to some sysctls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ce95ba8ae530e47103d765e76cc3547613ee22ce Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ce95ba8ae530e47103d765e76cc3547613ee22ce commit ce95ba8ae530e47103d765e76cc3547613ee22ce Author: Zhenlei Huang AuthorDate: 2025-09-24 01:16:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:26 +0000 tcp: Add CTLFLAG_VNET flag to some sysctls The two sysctls net.inet.tcp.hostcache.list and net.inet.tcp.hostcache.histo are readonly and are to operate hostcache of vnet jails. Add CTLFLAG_VNET flag to them since they are per-vnet sysctls. This change does not have any impact on reading the two sysctls, but `sysctl -ANV net.inet.tcp.hostcache` will report them correctly. Reviewed by: tuexen, #transport, #network MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52693 (cherry picked from commit b1f96169cfb50a7b65aee115b2c9ad2f00797bbf) (cherry picked from commit 032918dfd155936a79847f17ac355439e6b59027) (cherry picked from commit ccbc722a19450df2981049777d4930deae94a840) --- sys/netinet/tcp_hostcache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index 6e987fd4b521..cde2157ec237 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -164,12 +164,12 @@ SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, purge, CTLFLAG_VNET | CTLFLAG_RW, "Expire all entries on next purge run"); SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, list, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, + CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, 0, 0, sysctl_tcp_hc_list, "A", "List of all hostcache entries"); SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, histo, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, + CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, 0, 0, sysctl_tcp_hc_histo, "A", "Print a histogram of hostcache hashbucket utilization"); From nobody Sat Oct 4 16:44:43 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG40kb5z69JY8; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG35Tqpz3Kyh; Sat, 04 Oct 2025 16:44:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ozsv/3XEkZZK/sj3Iv2HYf7kH+NPKX82RFzvXBFxuXM=; b=RnaKeXeOWIv8YcHblRq4D4qUq5aT28ficFyx/FkVYmtBWszSKBc0mzBRI9dMbG1MNL4GHd QULYP3qOfEj9rioC/tbmaCPYdqxra2gvO79lNLaSAJyKxM/2XxClvpr+OuqSprTV75uklL +38gLlvBMaLNNG+i0CNS8bbKNVlOAHhi5ptT/1S6BT5lmRQ1fqfbVCwhZPaGseJ2VQM9MB ysUfH17QPkoYX0xyqyAy/f/A/EYv7dsSZ+oppOuhUwKYalhV1Gw0TG8RAWWbHPyM/xi5BS +gBFJIc6aWVWvF7vC6zjzLjMPlzIKaWabBG4iaZ8n6V8idTnWsSVgsyn5OLzSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ozsv/3XEkZZK/sj3Iv2HYf7kH+NPKX82RFzvXBFxuXM=; b=GnIqCYl5MZGWblmiqS04G02uQfX6PqEf/rshuqwwtUKvRcgWR/Z4tYQjBwLetTblYO0vXB WKgQWC3y/Q06q/jgsVMuadULStzUUHhIcDvIKCx8FfxHNAKNMa8kG7NE6f7Jj0xYTvYx+x iwxUD5J6hA8n4dfxvxctAqorwUBOGS216BtCi5Itddmu2IGNOFpTZlOGrpl1eCQwcTiQBs LSrF+gsfnhC9C/mabAEkjhNikfETU1QRMVndEALLDzDz6I+fcJv8hBd/NIQ3kK9NsVHowP 5Ou66Hpj4of8M6dSHLgFsW3boJp1O6lfKSpX/49DllocEu4jDb8hPg5oLc8kVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596283; a=rsa-sha256; cv=none; b=JRzqWG9ffX2ioUS2ipD1kjrbKZ1D+9HZmFxLeyF89C7+xkmW9Z+wi/Z5ql7LSdjQoJF9CX TuW4MZsM2o1vbJfwgeofw88KNmEWXL9eD55zrwxYKIlWwSonbd267b9BubpqfIHLvbH1M2 4gfimTgdthtU/GTRGAztzPG05IaNFDIiKZcx/pRrTtMa9/a9FONdmQtQc8/lqcnsgm8L2p XYhFKVeEuEwMtqOHCjh+B7JgoQwgc+QinQYeufK1BfO6O2wfk5Zary2uQlyUiICr6c0NeF X3Yv9ujUz2V96zQgx1ERfwdUr8zIKzy8JcodmKU2cZpbZ1FbM9vC1VxHzVzAjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG354bTzq4j; Sat, 04 Oct 2025 16:44:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 594GihjQ058399; Sat, 4 Oct 2025 16:44:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GihUT058396; Sat, 4 Oct 2025 16:44:43 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:43 GMT Message-Id: <202510041644.594GihUT058396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 22f26eb3b897 - stable/13 - ifconfig: Garbage collect unused parameter swabips List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 22f26eb3b89798e06aa8941d945bf1059bc5e569 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=22f26eb3b89798e06aa8941d945bf1059bc5e569 commit 22f26eb3b89798e06aa8941d945bf1059bc5e569 Author: Zhenlei Huang AuthorDate: 2025-08-01 16:33:09 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:26 +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 (cherry picked from commit 8632e4e73a6934f3f9996a18932e36b04e6a3faf) (cherry picked from commit 878d3bdb59d70b2ce077f4bbdefea0ec875d6e82) --- sbin/ifconfig/ifconfig.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 74dfb73f565f..59a12de855d6 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1678,11 +1678,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, setifflags), -#endif DEF_CMD_ARG("netmask", setifnetmask), DEF_CMD_ARG("metric", setifmetric), DEF_CMD_ARG("broadcast", setifbroadaddr), From nobody Sat Oct 4 16:44:44 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG52pzlz69JfH; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG46lJtz3LC3; Sat, 04 Oct 2025 16:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=17XA34glujcLpQifhTRbX10HUbCTuuf0omNeveHd0bw=; b=LqeHc9nWpw6nWyW/kirqwYe15mSjgIjKtL8UygtcG3/owGDy1D+CqJEG1mqbxy3b/Tp6WP NjFUNWFyITTV4DJJwHK8ZX8oC3BYkl3f0E+dbrWSRkDSnN2bpGEtSHsLYi3mqLyhHm5KY2 GuVX9PCBmg2ISHGV5X7f35oSqeEQ4H/U6liLpcc6tDB/W/FJhHPNlnXwp4WL5DCBezK7BE i5xyjavfWbEiCYrv0+MBDwXrRxNwZ/Py8OhuPtBMBJdwvIWD9eOoB5Xr+7yIe5rbBnMXjQ mA+ZktrO91QcSkJH0zWH5SLrU9wO3aOBCMcvyWa51L/yadqVse3ZFAVCnuSGaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=17XA34glujcLpQifhTRbX10HUbCTuuf0omNeveHd0bw=; b=cggw3ElIAEjyWHm1TXsZoe/biiIzxcXUojmYlCaBNoN+jcqwuI3kbOc7mFN/3zsmdKa7FC 1ZvjgYhtr6A+LXlVW/0QQjBlOrPXpK81vfux9UxivmldWp20d1hwFKXJuMQ1qhULHvTmmN gKueObk6exRsgxhGor6QMR4YMQPFewxd0s7q7c83xW1CnuQe8EkLjb78wY2Mlhl5h6+/tV 51X7zQTWA76Yl7PBzOxNGoYG/A+Aocng2mRLZ2lfpdbJXeP5/zEErywZ0pg1zV4ds9vBlH emO37ILoMZWVQeggF2BG1jLgTwIawSV3i+nSIE4w2CvArdFjRiNAGKato6cgUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596285; a=rsa-sha256; cv=none; b=p64BqD5RMBIGNP+7zxveJhJ2zvjwXshcTtrblr0otqdWqMp3wYfFWklhsG7PKimedPF+p2 3TEfVx3MtNOGvI1PN5CzqsoXMhL6QO4L7fraixBrDvi4xnsqJt6kcYpCGxAxdBO1S05dcw zMUaFYrQJg7cjm0zfIRVIMNFuSGkq3AC0kZ/tsimdlLuiGKO0bz/4N+9Rzjtp1k3hBuXhg 1vI3EiYjFgf4EDZtWacIsLwxFtt6PyVuTzrkJXwMnLXrMpqDF1YqdLB45YLXfrNJje85Qe thmL+b0Enuh4+a1eN4SnfPCisPD9r2pQnUyvwyDwMkLktqsxTIDqYzQdC+Gm6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG46D6xzqMD; Sat, 04 Oct 2025 16:44: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 594Gii7t058432; Sat, 4 Oct 2025 16:44:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiiWg058429; Sat, 4 Oct 2025 16:44:44 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:44 GMT Message-Id: <202510041644.594GiiWg058429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d334e045a471 - stable/13 - ifconfig: Fix the display of the IFCAP_MEXTPG capability List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d334e045a471d2bb0db2f9bb750eb7e67ef0823f Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d334e045a471d2bb0db2f9bb750eb7e67ef0823f commit d334e045a471d2bb0db2f9bb750eb7e67ef0823f Author: Zhenlei Huang AuthorDate: 2025-09-19 19:18:27 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:27 +0000 ifconfig: Fix the display of the IFCAP_MEXTPG capability Historically this capability is IFCAP_NOMAP but it was renamed to IFCAP_MEXTPG. Catch up with the change 3f43ada98c89. This is a direct commit to stable/13. PR: 289545 Fixes: 3f43ada98c89 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG --- sbin/ifconfig/ifconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 59a12de855d6..9a52f4512993 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1398,7 +1398,7 @@ unsetifdescr(const char *val, int value, int s, const struct afswtch *afp) "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6" \ +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33MEXTPG\34TXTLS4\35TXTLS6" \ "\36VXLAN_HWCSUM\37VXLAN_HWTSO\40TXTLS_RTLMT" /* From nobody Sat Oct 4 16:44:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG764p2z69JW8; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG71Cvnz3L2g; Sat, 04 Oct 2025 16:44:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+N+N56aKfUbl4kljlbatnOV+neRuUDdRX68vjTwgym8=; b=ZKqZWfxX0ohYuqlNbgmQi3KVWcWFY1cQDiDFlQnh6/XqpVsdB1GTeRthYQGJenliLdccs8 aHGq+het8g5MBQFBTDvCX4BFH8E2lLKMSvV4UD+TgGulZrh5+Q6rSaTO2FK7w8+xfn/dbi jY5TGPc2FkaXTBz+x7gNySI9wBELvvXUZPdlFv8oc8EMBA1Kdtl0LSF7Zn5Z7ZfaAq/RJR 4x+TqwbskfnFvPeyjY/a6w4c+FoBMiEhkEPT7F3SpETYiCVmcwpzllaNZXDX+njqj6jJun 0NWRwhTmoFU6l1/Qpg87wEqV7oAnq6SNLOACITyTeLn0zaUBzDgFHvJe72jcHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+N+N56aKfUbl4kljlbatnOV+neRuUDdRX68vjTwgym8=; b=xfIlpljkMQM2RDf/pgW4F2Z6glqcluXFhz6UExaPcpVuJRJv6TK/kkOrsKqxZg6NIwByaE TI++ZJv6dc2c4iKvGDpK9liHVpOGACwuldJL9fVk3erowWOiBZf6LKaFSzCoqZzWNtVfde 5fKkeyX58wL//BjSMEnOJ3XzsQZCXVy7apPUcrWvCGszW97CDPKjz9CLlUBiV4jSDomU1T 2i/kODPjTZiyYgatd/oWi75nFvYi7Gi6CSaBUba0czYfZYWJckTZS/BaI+EtEuSVhNloU0 PhaiiwStxWby70n9j6DRXLarlaBesCD8UWt5s8AhLSaOX36aQjGcM1zsyITajw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596287; a=rsa-sha256; cv=none; b=MSaxahKtx5vADaR1jcRI+xsAPHgGF0DQ70S4ZRQTm46v3w+myhD81yBtKjj0vW3lNQFCiN nXCLvzdzfWMV+Z71WeikHYDXFMcllirDvFTD46ZjfjI0/7oYj/HDqKiDN92UrEyJSmoj/2 416sb9xaTZcS7t997iedELriS3+GJGGCrrWeEYtovHZ1RV6kmEFY/J70N3LiKffhntYlZZ y8m8HY1q54kRHyg+1gm2jEshtR4cbBo6pA2hOXe+fsDKMA1JAb+LqDF2bg/K964PXrtpLA 6m4grRkS3HfK2W1mYaL2q5UyTDbIdPtpD0GW2CEczMqfPA/chfP6A1Q3uxZMgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG70kqmzqdT; Sat, 04 Oct 2025 16:44: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 594GilxY058505; Sat, 4 Oct 2025 16:44:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GilnM058502; Sat, 4 Oct 2025 16:44:47 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:47 GMT Message-Id: <202510041644.594GilnM058502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: b4a079dd78a6 - stable/13 - witness: White space cleanup and some style(9) tweeks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4a079dd78a6de64dcc072a43cea41a1eb96df17 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a079dd78a6de64dcc072a43cea41a1eb96df17 commit b4a079dd78a6de64dcc072a43cea41a1eb96df17 Author: Zhenlei Huang AuthorDate: 2025-08-29 10:00:57 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:28 +0000 witness: White space cleanup and some style(9) tweeks MFC after: 3 days (cherry picked from commit f5377665253b2b107ee8a4690ad2e6682375b304) (cherry picked from commit 91c0ef0f5a2afa17489b603a2f82edaa28e3cce7) --- sys/kern/subr_witness.c | 134 ++++++++++++++++++++---------------------------- 1 file changed, 56 insertions(+), 78 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 2ad5e78daf9f..5ee72e68ac26 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -57,7 +57,7 @@ * b : public affirmation by word or example of usually * religious faith or conviction - * 6 capitalized : a member of the Jehovah's Witnesses + * 6 capitalized : a member of the Jehovah's Witnesses */ /* @@ -132,7 +132,7 @@ #define LI_SLEEPABLE 0x00040000 /* Lock may be held while sleeping. */ #ifndef WITNESS_COUNT -#define WITNESS_COUNT 1536 +#define WITNESS_COUNT 1536 #endif #define WITNESS_HASH_SIZE 251 /* Prime, gives load factor < 2 */ #define WITNESS_PENDLIST (512 + (MAXCPU * 4)) @@ -159,20 +159,18 @@ * These flags go in the witness relationship matrix and describe the * relationship between any two struct witness objects. */ -#define WITNESS_UNRELATED 0x00 /* No lock order relation. */ -#define WITNESS_PARENT 0x01 /* Parent, aka direct ancestor. */ -#define WITNESS_ANCESTOR 0x02 /* Direct or indirect ancestor. */ -#define WITNESS_CHILD 0x04 /* Child, aka direct descendant. */ -#define WITNESS_DESCENDANT 0x08 /* Direct or indirect descendant. */ -#define WITNESS_ANCESTOR_MASK (WITNESS_PARENT | WITNESS_ANCESTOR) -#define WITNESS_DESCENDANT_MASK (WITNESS_CHILD | WITNESS_DESCENDANT) -#define WITNESS_RELATED_MASK \ - (WITNESS_ANCESTOR_MASK | WITNESS_DESCENDANT_MASK) -#define WITNESS_REVERSAL 0x10 /* A lock order reversal has been - * observed. */ -#define WITNESS_RESERVED1 0x20 /* Unused flag, reserved. */ -#define WITNESS_RESERVED2 0x40 /* Unused flag, reserved. */ -#define WITNESS_LOCK_ORDER_KNOWN 0x80 /* This lock order is known. */ +#define WITNESS_UNRELATED 0x00 /* No lock order relation. */ +#define WITNESS_PARENT 0x01 /* Parent, aka direct ancestor. */ +#define WITNESS_ANCESTOR 0x02 /* Direct or indirect ancestor. */ +#define WITNESS_CHILD 0x04 /* Child, aka direct descendant. */ +#define WITNESS_DESCENDANT 0x08 /* Direct or indirect descendant. */ +#define WITNESS_ANCESTOR_MASK (WITNESS_PARENT | WITNESS_ANCESTOR) +#define WITNESS_DESCENDANT_MASK (WITNESS_CHILD | WITNESS_DESCENDANT) +#define WITNESS_RELATED_MASK (WITNESS_ANCESTOR_MASK | WITNESS_DESCENDANT_MASK) +#define WITNESS_REVERSAL 0x10 /* A lock order reversal has been observed. */ +#define WITNESS_RESERVED1 0x20 /* Unused flag, reserved. */ +#define WITNESS_RESERVED2 0x40 /* Unused flag, reserved. */ +#define WITNESS_LOCK_ORDER_KNOWN 0x80 /* This lock order is known. */ /* Descendant to ancestor flags */ #define WITNESS_DTOA(x) (((x) & WITNESS_RELATED_MASK) >> 2) @@ -219,20 +217,18 @@ struct lock_list_entry { * (for example, "vnode interlock"). */ struct witness { - char w_name[MAX_W_NAME]; - uint32_t w_index; /* Index in the relationship matrix */ + char w_name[MAX_W_NAME]; + uint32_t w_index; /* Index in the relationship matrix */ struct lock_class *w_class; - STAILQ_ENTRY(witness) w_list; /* List of all witnesses. */ - STAILQ_ENTRY(witness) w_typelist; /* Witnesses of a type. */ - struct witness *w_hash_next; /* Linked list in hash buckets. */ - const char *w_file; /* File where last acquired */ - uint32_t w_line; /* Line where last acquired */ - uint32_t w_refcount; - uint16_t w_num_ancestors; /* direct/indirect - * ancestor count */ - uint16_t w_num_descendants; /* direct/indirect - * descendant count */ - int16_t w_ddb_level; + STAILQ_ENTRY(witness) w_list; /* List of all witnesses. */ + STAILQ_ENTRY(witness) w_typelist; /* Witnesses of a type. */ + struct witness *w_hash_next; /* Linked list in hash buckets. */ + const char *w_file; /* File where last acquired */ + uint32_t w_line; /* Line where last acquired */ + uint32_t w_refcount; + uint16_t w_num_ancestors; /* direct/indirect ancestor count */ + uint16_t w_num_descendants; /* direct/indirect descendant count */ + int16_t w_ddb_level; unsigned w_displayed:1; unsigned w_reversed:1; }; @@ -266,7 +262,7 @@ struct witness_lock_order_data { /* * The witness lock order data hash table. Keys are witness index tuples * (struct witness_lock_order_key), elements are lock order data objects - * (struct witness_lock_order_data). + * (struct witness_lock_order_data). */ struct witness_lock_order_hash { struct witness_lock_order_data *wloh_array[WITNESS_LO_HASH_SIZE]; @@ -296,7 +292,6 @@ struct witness_order_list_entry { static __inline int witness_lock_type_equal(struct witness *w1, struct witness *w2) { - return ((w1->w_class->lc_flags & (LC_SLEEPLOCK | LC_SPINLOCK)) == (w2->w_class->lc_flags & (LC_SLEEPLOCK | LC_SPINLOCK))); } @@ -305,7 +300,6 @@ static __inline int witness_lock_order_key_equal(const struct witness_lock_order_key *a, const struct witness_lock_order_key *b) { - return (a->from == b->from && a->to == b->to); } @@ -416,7 +410,7 @@ SYSCTL_INT(_debug_witness, OID_AUTO, skipspin, CTLFLAG_RDTUN, &witness_skipspin, int badstack_sbuf_size; int witness_count = WITNESS_COUNT; -SYSCTL_INT(_debug_witness, OID_AUTO, witness_count, CTLFLAG_RDTUN, +SYSCTL_INT(_debug_witness, OID_AUTO, witness_count, CTLFLAG_RDTUN, &witness_count, 0, ""); /* @@ -757,7 +751,6 @@ static int witness_spin_warn = 0; static const char * fixup_filename(const char *file) { - if (file == NULL) return (NULL); while (strncmp(file, "../", 3) == 0) @@ -832,7 +825,7 @@ witness_startup(void *mem) w_free_cnt--; for (i = 0; i < witness_count; i++) { - memset(w_rmatrix[i], 0, sizeof(*w_rmatrix[i]) * + memset(w_rmatrix[i], 0, sizeof(*w_rmatrix[i]) * (witness_count + 1)); } @@ -986,16 +979,16 @@ witness_ddb_display_descendants(int(*prnt)(const char *fmt, ...), { int i; - for (i = 0; i < indent; i++) - prnt(" "); + for (i = 0; i < indent; i++) + prnt(" "); prnt("%s (type: %s, depth: %d, active refs: %d)", w->w_name, w->w_class->lc_name, w->w_ddb_level, w->w_refcount); - if (w->w_displayed) { - prnt(" -- (already displayed)\n"); - return; - } - w->w_displayed = 1; + if (w->w_displayed) { + prnt(" -- (already displayed)\n"); + return; + } + w->w_displayed = 1; if (w->w_file != NULL && w->w_line != 0) prnt(" -- last acquired @ %s:%d\n", fixup_filename(w->w_file), w->w_line); @@ -1076,7 +1069,6 @@ witness_ddb_display(int(*prnt)(const char *fmt, ...)) int witness_defineorder(struct lock_object *lock1, struct lock_object *lock2) { - if (witness_watch == -1 || KERNEL_PANICKED()) return (0); @@ -1254,7 +1246,7 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file, w->w_reversed = 1; mtx_unlock_spin(&w_mtx); witness_output( - "acquiring duplicate lock of same type: \"%s\"\n", + "acquiring duplicate lock of same type: \"%s\"\n", w->w_name); witness_output(" 1st %s @ %s:%d\n", plock->li_lock->lo_name, fixup_filename(plock->li_file), plock->li_line); @@ -1740,7 +1732,7 @@ found: /* * In order to reduce contention on w_mtx, we want to keep always an - * head object into lists so that frequent allocation from the + * head object into lists so that frequent allocation from the * free witness pool (and subsequent locking) is avoided. * In order to maintain the current code simple, when the head * object is totally unloaded it means also that we do not have @@ -1778,7 +1770,7 @@ witness_thread_exit(struct thread *td) n++; witness_list_lock(&lle->ll_children[i], witness_output); - + } kassert_panic( "Thread %p cannot exit while holding sleeplocks\n", td); @@ -1945,7 +1937,6 @@ found: static void depart(struct witness *w) { - MPASS(w->w_refcount == 0); if (w->w_class->lc_flags & LC_SLEEPLOCK) { w_sleep_cnt--; @@ -1996,18 +1987,18 @@ adopt(struct witness *parent, struct witness *child) child->w_num_ancestors++; } - /* - * Find each ancestor of 'pi'. Note that 'pi' itself is counted as + /* + * Find each ancestor of 'pi'. Note that 'pi' itself is counted as * an ancestor of 'pi' during this loop. */ for (i = 1; i <= w_max_used_index; i++) { - if ((w_rmatrix[i][pi] & WITNESS_ANCESTOR_MASK) == 0 && + if ((w_rmatrix[i][pi] & WITNESS_ANCESTOR_MASK) == 0 && (i != pi)) continue; /* Find each descendant of 'i' and mark it as a descendant. */ for (j = 1; j <= w_max_used_index; j++) { - /* + /* * Skip children that are already marked as * descendants of 'i'. */ @@ -2018,7 +2009,7 @@ adopt(struct witness *parent, struct witness *child) * We are only interested in descendants of 'ci'. Note * that 'ci' itself is counted as a descendant of 'ci'. */ - if ((w_rmatrix[ci][j] & WITNESS_ANCESTOR_MASK) == 0 && + if ((w_rmatrix[ci][j] & WITNESS_ANCESTOR_MASK) == 0 && (j != ci)) continue; w_rmatrix[i][j] |= WITNESS_ANCESTOR; @@ -2026,16 +2017,16 @@ adopt(struct witness *parent, struct witness *child) w_data[i].w_num_descendants++; w_data[j].w_num_ancestors++; - /* + /* * Make sure we aren't marking a node as both an - * ancestor and descendant. We should have caught + * ancestor and descendant. We should have caught * this as a lock order reversal earlier. */ if ((w_rmatrix[i][j] & WITNESS_ANCESTOR_MASK) && (w_rmatrix[i][j] & WITNESS_DESCENDANT_MASK)) { printf("witness rmatrix paradox! [%d][%d]=%d " "both ancestor and descendant\n", - i, j, w_rmatrix[i][j]); + i, j, w_rmatrix[i][j]); kdb_backtrace(); printf("Witness disabled.\n"); witness_watch = -1; @@ -2044,7 +2035,7 @@ adopt(struct witness *parent, struct witness *child) (w_rmatrix[j][i] & WITNESS_DESCENDANT_MASK)) { printf("witness rmatrix paradox! [%d][%d]=%d " "both ancestor and descendant\n", - j, i, w_rmatrix[j][i]); + j, i, w_rmatrix[j][i]); kdb_backtrace(); printf("Witness disabled.\n"); witness_watch = -1; @@ -2121,7 +2112,6 @@ _isitmyx(struct witness *w1, struct witness *w2, int rmask, const char *fname) static int isitmychild(struct witness *parent, struct witness *child) { - return (_isitmyx(parent, child, WITNESS_PARENT, __func__)); } @@ -2131,7 +2121,6 @@ isitmychild(struct witness *parent, struct witness *child) static int isitmydescendant(struct witness *ancestor, struct witness *descendant) { - return (_isitmyx(ancestor, descendant, WITNESS_ANCESTOR_MASK, __func__)); } @@ -2179,7 +2168,7 @@ witness_get(void) STAILQ_REMOVE_HEAD(&w_free, w_list); w_free_cnt--; index = w->w_index; - MPASS(index > 0 && index == w_max_used_index+1 && + MPASS(index > 0 && index == w_max_used_index + 1 && index < witness_count); bzero(w, sizeof(*w)); w->w_index = index; @@ -2191,7 +2180,6 @@ witness_get(void) static void witness_free(struct witness *w) { - STAILQ_INSERT_HEAD(&w_free, w, w_list); w_free_cnt++; } @@ -2216,11 +2204,10 @@ witness_lock_list_get(void) bzero(lle, sizeof(*lle)); return (lle); } - + static void witness_lock_list_free(struct lock_list_entry *lle) { - mtx_lock_spin(&w_mtx); lle->ll_next = w_lock_list_free; w_lock_list_free = lle; @@ -2294,7 +2281,6 @@ witness_voutput(const char *fmt, va_list ap) static int witness_thread_has_locks(struct thread *td) { - if (td->td_sleeplocks == NULL) return (0); return (td->td_sleeplocks->ll_count != 0); @@ -2566,14 +2552,12 @@ witness_setflag(struct lock_object *lock, int flag, int set) void witness_norelease(struct lock_object *lock) { - witness_setflag(lock, LI_NORELEASE, 1); } void witness_releaseok(struct lock_object *lock) { - witness_setflag(lock, LI_NORELEASE, 0); } @@ -2581,7 +2565,6 @@ witness_releaseok(struct lock_object *lock) static void witness_ddb_list(struct thread *td) { - KASSERT(witness_cold == 0, ("%s: witness_cold", __func__)); KASSERT(kdb_active, ("%s: not in the debugger", __func__)); @@ -2646,7 +2629,6 @@ DB_SHOW_ALIAS(alllocks, db_witness_list_all) DB_SHOW_COMMAND(witness, db_witness_display) { - witness_ddb_display(db_printf); } #endif @@ -2666,9 +2648,9 @@ sbuf_print_witness_badstacks(struct sbuf *sb, size_t *oldidx) /* Allocate and init temporary storage space. */ tmp_w1 = malloc(sizeof(struct witness), M_TEMP, M_WAITOK | M_ZERO); tmp_w2 = malloc(sizeof(struct witness), M_TEMP, M_WAITOK | M_ZERO); - tmp_data1 = malloc(sizeof(struct witness_lock_order_data), M_TEMP, + tmp_data1 = malloc(sizeof(struct witness_lock_order_data), M_TEMP, M_WAITOK | M_ZERO); - tmp_data2 = malloc(sizeof(struct witness_lock_order_data), M_TEMP, + tmp_data2 = malloc(sizeof(struct witness_lock_order_data), M_TEMP, M_WAITOK | M_ZERO); stack_zero(&tmp_data1->wlod_stack); stack_zero(&tmp_data2->wlod_stack); @@ -2743,12 +2725,12 @@ restart: sbuf_printf(sb, "\nLock order reversal between \"%s\"(%s) and \"%s\"(%s)!\n", - tmp_w1->w_name, tmp_w1->w_class->lc_name, + tmp_w1->w_name, tmp_w1->w_class->lc_name, tmp_w2->w_name, tmp_w2->w_class->lc_name); if (data1) { sbuf_printf(sb, "Lock order \"%s\"(%s) -> \"%s\"(%s) first seen at:\n", - tmp_w1->w_name, tmp_w1->w_class->lc_name, + tmp_w1->w_name, tmp_w1->w_class->lc_name, tmp_w2->w_name, tmp_w2->w_class->lc_name); stack_sbuf_print(sb, &tmp_data1->wlod_stack); sbuf_printf(sb, "\n"); @@ -2756,7 +2738,7 @@ restart: if (data2 && data2 != data1) { sbuf_printf(sb, "Lock order \"%s\"(%s) -> \"%s\"(%s) first seen at:\n", - tmp_w2->w_name, tmp_w2->w_class->lc_name, + tmp_w2->w_name, tmp_w2->w_class->lc_name, tmp_w1->w_name, tmp_w1->w_class->lc_name); stack_sbuf_print(sb, &tmp_data2->wlod_stack); sbuf_printf(sb, "\n"); @@ -2816,7 +2798,6 @@ sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS) static int sbuf_db_printf_drain(void *arg __unused, const char *data, int len) { - return (db_printf("%.*s", len, data)); } @@ -3061,7 +3042,7 @@ witness_lock_order_get(struct witness *parent, struct witness *child) & WITNESS_LOCK_ORDER_KNOWN) == 0) goto out; - hash = witness_hash_djb2((const char*)&key, + hash = witness_hash_djb2((const char *)&key, sizeof(key)) % w_lohash.wloh_size; data = w_lohash.wloh_array[hash]; while (data != NULL) { @@ -3082,7 +3063,6 @@ out: static int witness_lock_order_check(struct witness *parent, struct witness *child) { - if (parent != child && w_rmatrix[parent->w_index][child->w_index] & WITNESS_LOCK_ORDER_KNOWN && @@ -3108,7 +3088,7 @@ witness_lock_order_add(struct witness *parent, struct witness *child) & WITNESS_LOCK_ORDER_KNOWN) return (1); - hash = witness_hash_djb2((const char*)&key, + hash = witness_hash_djb2((const char *)&key, sizeof(key)) % w_lohash.wloh_size; w_rmatrix[parent->w_index][child->w_index] |= WITNESS_LOCK_ORDER_KNOWN; data = w_lofree; @@ -3128,7 +3108,6 @@ witness_lock_order_add(struct witness *parent, struct witness *child) static void witness_increment_graph_generation(void) { - if (witness_cold == 0) mtx_assert(&w_mtx, MA_OWNED); w_generation++; @@ -3137,7 +3116,6 @@ witness_increment_graph_generation(void) static int witness_output_drain(void *arg __unused, const char *data, int len) { - witness_output("%.*s", len, data); return (len); } From nobody Sat Oct 4 16:44:45 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG64Qxsz69JYD; Sat, 04 Oct 2025 16:44: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG60WVSz3L9T; Sat, 04 Oct 2025 16:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+RHztK1eop5/w6wJdpzB9qebzKPkA1ncHtrjQVkYFU=; b=tUhvcLvDQNjrUuy/PTwXmZ8TgtJqJBZa2idPCOWhBjxHMxtES+QZmYkkTbMMTYEVSZ9JnP p740JtwHh2EaqwxfUoNwcXXcYon+CRRRGdCL+afoRAtQdTd4ynmKC0ckXs00ydCLzKbQCo MJ18535gXB+dnes+HXu97uxskcuqsSQyKR6xDqNqGqy9p91g4YrC+b5kCRddcf+3YnvbZI FD4Mu0Mg+tQ8VQE7NNgqF/zYvhnfWlxX2gWKylK3VRyvj5x3pjpyNdzYGvsb1ZPQox27nU RnIEnbeipic++H5YjZl0uhsIDH6qPWaKptUiSov9euLESeDwGkT/CWlmesIQLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G+RHztK1eop5/w6wJdpzB9qebzKPkA1ncHtrjQVkYFU=; b=rqiU9wbS2Yd1fxnqe8/3W16p4A283uEFvI3YmXDgR6AHDZHBXzAmQZbkAc2iNNT7StaKGY 9jaI4mwkU6iZCAChi+YZFntPlJ0yAzNSGVOTNGAr2InpFNjHyXa4ThvHDU4KNTci3JAjcW mGo7lKlIO8+LY0V+XzVMhEJWZfD4neEB7YpuzMTq+TwC5c7678eOQ8TaoM4JghCDnRHm+N UYZsR3lQCArTDnelfF6XGBeEQUEgToiIm8Q6l/dR66k/rMcbuVNGnkChmVEZsOjabYcwXE QW0ofRnWqcuEWejQ575EMIfHfHKzf8LqB8f1fCMDiwODrH1e8ALvxihMT+YoCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596286; a=rsa-sha256; cv=none; b=aaxfNOXvb6oPJd4e/c+JFH+de3dSvMJcXdzdb960vygONenlZeGbdu4YmMDUK+vOPD0NSJ ZPQe51EvOjYrwCEMnDL7sEHWlH3a+9Wij0kPCtGY1g6Fa54pQ0VCWJpvT9rIw+GwctIYId L3YK+ShmVSUa/Yj1dGghF2br0o3pusTU8057CTriaLh4fFENgG+7lyG6cQgKmVzIL4c1XB wXjmtqr1/AMTSbHzHv4TAW+uXYpbvWl7hyhSXk+k7sharIOfsFcKz6j5g+HIex1s2dPhKQ UQKme5XMfjZ0IJXartopHqkGclknoyHiCFAidIl1wQLv5lLKxEQeFYmsj+/9vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG602LMzqWq; Sat, 04 Oct 2025 16:44: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 594GijlC058472; Sat, 4 Oct 2025 16:44:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GijUW058469; Sat, 4 Oct 2025 16:44:45 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:45 GMT Message-Id: <202510041644.594GijUW058469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a08e8da2745d - stable/13 - ifconfig: Display the IFCAP_HWSTATS capability List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a08e8da2745dd80f944c08a30e37a45471e636ba Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a08e8da2745dd80f944c08a30e37a45471e636ba commit a08e8da2745dd80f944c08a30e37a45471e636ba Author: Zhenlei Huang AuthorDate: 2025-09-21 16:47:45 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:27 +0000 ifconfig: Display the IFCAP_HWSTATS capability This follows the commit 4cdc1f5421c5, which introduces the IFCAP_HWSTATS capability. This is a direct commit to stable/13. Fixes: 4cdc1f5421c5 There are some high performance NICs that count statistics in hardware --- sbin/ifconfig/ifconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 9a52f4512993..bbfe7bb8adab 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1398,8 +1398,8 @@ unsetifdescr(const char *val, int value, int s, const struct afswtch *afp) "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33MEXTPG\34TXTLS4\35TXTLS6" \ -"\36VXLAN_HWCSUM\37VXLAN_HWTSO\40TXTLS_RTLMT" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\30HWSTATS\31TXRTLMT\32HWRXTSTMP\33MEXTPG" \ +"\34TXTLS4\35TXTLS6\36VXLAN_HWCSUM\37VXLAN_HWTSO\40TXTLS_RTLMT" /* * Print the status of the interface. If an address family was From nobody Sat Oct 4 16:44:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfBG840bQz69JfR; Sat, 04 Oct 2025 16: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBG820xRz3LNj; Sat, 04 Oct 2025 16: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=1759596288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JTOuatFHYjrtXy/2a8/2CCR2lOfWn5c18NnLHsbs/98=; b=kzhFq5G2NTw83gxvNjpCOo8wjZGg+85oPQazbBqSrSkYSYFZyOicm1qKnLQfj5cj3w4IEM LztDRW/RuvuTFYTqBX3N85npZVv7fgr80xnVs2ztg65W1PIb1iKUCRtdpKkCN2MD2TZgxl nabwOvc926c7Ccmyd1HSbmbsjcDDl3lg+OByGClTsPmht3HLsdQN3PCBqsFBcKSd1lRItg ZA+cZP4ic0B+k8/wMZ3eK+wZbb0UKjhdriLH5M9AurIYLHB80NTzHMZ8vV+EQA/WJjxZP4 v5rtHqs7q/WdQbTsi6pMW1zhR31G9D05pQtGN3QKPFpXH1kPHLTm5+doIINXug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JTOuatFHYjrtXy/2a8/2CCR2lOfWn5c18NnLHsbs/98=; b=qN7AYkmUGB+F7hOiyHlVPlZGdFBX9hXSmLMiOQ1c+YXcb0KrekBxI5aH/UoJJchDaiVE5u sLzF3Jb3qPBjIjkZ74n5Sp99sPopYDyNhCvxYyYH8cwMWG9WWjCpia+y50F8pWExWrV0a4 UZAUdCs9my4Iaa9wtIm9GZ3OwS6cLhJAtaWOz4OOe1VyH8D0MtLqRJH9cdfB7dSWNxKdBy uHOAIjyOrFVLvF6n3SjvB6WBHt8CEg28Fsvw+KWu6bHhVTexk/sQTp5OPPkGpq8aw77wSw USKERuGqzjcHn8572unWeoP146slZSJhuH5lXwHsY9EsmR5dfTxFBn3Sh/PyyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596288; a=rsa-sha256; cv=none; b=O17Qh7Xsyke9BPgsn5dXrws9Mohpk7A8ViBdBVnkfThZyrcDurmOWnnC66pRHwdWbP5RSF +LsXV7lu+cMJGZ8LHs0BfLPzPh6KR1Tqa/0oBB3vapk2OT8jqAP6PrjLOUXe07aS+HyMOe nyKAW8eRuYxbYwWrKzDMCnLWAWqY5HxytlmU+JKD+xbt1yIrF1nOFH2M6LvguuGSOoinVV xsst1upMCakv8muiZFsM8pY2Zpr6kz7Q9qSighiinEDEmXyC0FT0Ovnfd3nCx+2YKxs1tw mwnZLgmStAolKmohjJr1T1UwUZ6yHS+AXl7XWB7hvVrYH3lpBCAT1dpF1z1UGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfBG81d0xzq4k; Sat, 04 Oct 2025 16: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 594Gimje058538; Sat, 4 Oct 2025 16: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 594Gims4058535; Sat, 4 Oct 2025 16:44:48 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:48 GMT Message-Id: <202510041644.594Gims4058535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 8583840cfb92 - stable/13 - witness: Record the first acquired file and line for recursable locks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8583840cfb925eeafac8eff171029a56f7c9c133 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=8583840cfb925eeafac8eff171029a56f7c9c133 commit 8583840cfb925eeafac8eff171029a56f7c9c133 Author: Zhenlei Huang AuthorDate: 2025-09-17 16:48:54 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:28 +0000 witness: Record the first acquired file and line for recursable locks and the last acquired file and line to witness object. For recursable locks, unfortunately current implementation records only the recurse count and the last acquired file and line, but does not restore the previous acquired file and line on unlock. Hence it is possible to report false acquired file and line, and that may mislead developers and make the report by users a little harder to analyse. Since subsequent recurse locks do not affect how witness order check, record the first acquired file and line so that the logic is much clear. Reported by: bz Reviewed by: kib (previous version), markj See also: https://lists.freebsd.org/archives/freebsd-current/2025-June/007944.html MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D52496 (cherry picked from commit 2d85bc89294baa04daf509e81ec3880bff79cc10) (cherry picked from commit 3dc9f96a489cd53710af8205a1f3901c11b760a5) (cherry picked from commit 7838ad85fb1a75464e53525b4cdb064ca1e97a47) --- sys/kern/subr_witness.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 5ee72e68ac26..91055b604a5c 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -1512,6 +1512,10 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) else lock_list = PCPU_PTR(spinlocks); + /* Update per-witness last file and line acquire. */ + w->w_file = file; + w->w_line = line; + /* Check to see if we are recursing on a lock we already own. */ instance = find_instance(*lock_list, lock); if (instance != NULL) { @@ -1519,15 +1523,9 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) CTR4(KTR_WITNESS, "%s: pid %d recursed on %s r=%d", __func__, td->td_proc->p_pid, lock->lo_name, instance->li_flags & LI_RECURSEMASK); - instance->li_file = file; - instance->li_line = line; return; } - /* Update per-witness last file and line acquire. */ - w->w_file = file; - w->w_line = line; - /* Find the next open lock instance in the list and fill it. */ lle = *lock_list; if (lle == NULL || lle->ll_count == LOCK_NCHILDREN) { From nobody Sat Oct 4 18:17:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfDKR0xPbz69Vx7; Sat, 04 Oct 2025 18:17: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfDKR04tjz3gQ4; Sat, 04 Oct 2025 18:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759601867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9f/bxTjd4sB+ucDbnO/sDM9fYK4U0MSqk1syOeRi4w=; b=lZx6NI9dlnFWFReJPZuXz3FI5xqaFEs8xuutPOWgD175rdU9h2hCp4wXoswlzIQHgASQBd 98ZgVZLrZYRyCTADd5ovGzb8bDq2Q504cSzmkKOboF34F81BdfcoyMIM6xQipa5Me23ScE tFj7J/XK3XyN//V2V00ZoQPCmMGFmdnKok62kWxP2PyjUVYqzJgRzXMX51fXYPDYebfLob BTvC97e3fYZRhCxSuL4EsW01DvkSChu1vOFmtfPtkchPep46hykVgX8focjlLygVFXlHER HIlgidLRsDZvISCeYnL3Fq0l7GEP7t4CiuQyfTFrxcMd9jYTEvXr/Wn0fRWViQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759601867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p9f/bxTjd4sB+ucDbnO/sDM9fYK4U0MSqk1syOeRi4w=; b=YYCh8hBOJYe/OJ73WaZZKFhSgJkvFZp8p5uxJhjosjUfUvUzkzHgp8mOZ+qtYRAXZiFBBi WAINnrRGWt476gI+sXIZu88WkY1EOwI+ot8rcAnM3XrOWkkO1uFRyKbyjgJUmW+ptbR4/j 7KFEwFgsv5HorJ1JhsNtZ8YqPsYnraURQZCGvCBtm3/iYQXbpp5Z3xyb7DGAd6kiguCvkK atSbFhwl2XB9JQAxWTJkRi0FhdC7D2qqXPHDdxFy7ME8D/NGUIlHmuY9c1OQ6Mo2l3rJmJ 6XqIgp3kbw5FeMFonsa+Vr2nH3HAcFa1evdGLvGt1VdgaA/feXvCA0iRj7K0SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759601867; a=rsa-sha256; cv=none; b=m631RNRZt+u65gqoej6LScjkS8HG3YQY83iDTwwls9dF/M1N5t2KrtsS9w6v1GwQC9qc+0 dmQUWY6/bVK+K9Mec/rdvjJBBLEa8l4Awg9V4vmcvLmFcgPZ1+simHOTCsdrxi7w4gDKsN 1cZbHyGRLhcpeG6u0+te5yoLVGu10p2mVXH2jAz+fOXWu/2t4571aTOTmQbfJKN6GDGSc8 82C4p274GHFHdLBOEDcsQuERpS6NQq/aetPYeHEDiCs/aaPTIvHtkdEuPvP2jvtb4NDyu+ Zgn6TWw4ZOtOtTk6dPEbMjuuSUjj3AVJWRRIEXrNWFqgBwmGvLi7pWbDTU0P3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfDKQ6ndQzsmW; Sat, 04 Oct 2025 18:17: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 594IHkFN029123; Sat, 4 Oct 2025 18:17:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594IHki2029120; Sat, 4 Oct 2025 18:17:46 GMT (envelope-from git) Date: Sat, 4 Oct 2025 18:17:46 GMT Message-Id: <202510041817.594IHki2029120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brad Davis Subject: git: e991ca922a32 - stable/15 - vnet.9: Remove references to non-existant macros and update how to virtualize sysctls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e991ca922a32857b95cd7b24da7a023fe09b693e Auto-Submitted: auto-generated The branch stable/15 has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=e991ca922a32857b95cd7b24da7a023fe09b693e commit e991ca922a32857b95cd7b24da7a023fe09b693e Author: Brad Davis AuthorDate: 2025-09-19 14:38:20 +0000 Commit: Brad Davis CommitDate: 2025-10-04 18:17:17 +0000 vnet.9: Remove references to non-existant macros and update how to virtualize sysctls Approved by: bcr, ziaee MFC after: 1 week MFC to: stable/14, stable/15 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52620 (cherry picked from commit 22886d3af0657dae3b547b21e612642bb47e0321) --- share/man/man9/VNET.9 | 52 ++++----------------------------------------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/share/man/man9/VNET.9 b/share/man/man9/VNET.9 index 28e28bfd3242..679ccc3f9a06 100644 --- a/share/man/man9/VNET.9 +++ b/share/man/man9/VNET.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 10, 2020 +.Dd September 19, 2025 .Dt VNET 9 .Os .Sh NAME @@ -162,26 +162,6 @@ .Fa "int priority" .Fc .\" ------------------------------------------------------------ -.Ss "Sysctl Handling" -.Fo SYSCTL_VNET_INT -.Fa parent nbr name access ptr val descr -.Fc -.Fo SYSCTL_VNET_PROC -.Fa parent nbr name access ptr arg handler fmt descr -.Fc -.Fo SYSCTL_VNET_STRING -.Fa parent nbr name access arg len descr -.Fc -.Fo SYSCTL_VNET_STRUCT -.Fa parent nbr name access ptr type descr -.Fc -.Fo SYSCTL_VNET_UINT -.Fa parent nbr name access ptr val descr -.Fc -.Fo VNET_SYSCTL_ARG -.Fa req arg1 -.Fc -.\" ------------------------------------------------------------ .Sh DESCRIPTION .Nm is the name of a technique to virtualize the network stack. @@ -250,9 +230,6 @@ The .Fn VNET_NAME macro returns the offset within the memory region of the virtual network stack instance. -It is usually only used with -.Fn SYSCTL_VNET_* -macros. .\" ------------------------------------------------------------ .Ss "Virtual Instance Selection" .\" @@ -459,30 +436,9 @@ call will be ignored. .\" A .Xr sysctl 9 -can be virtualized by using one of the -.Fn SYSCTL_VNET_* -macros. -.Pp -They take the same arguments as the standard -.Xr sysctl 9 -functions, with the only difference, that the -.Fa ptr -argument has to be passed as -.Ql &VNET_NAME(foo) -instead of -.Ql &foo -so that the variable can be selected from the correct memory -region of the virtual network stack instance of the caller. -.Pp -For the very rare case a sysctl handler function would want to -handle -.Fa arg1 -itself the -.Fn VNET_SYSCTL_ARG req arg1 -is provided that will translate the -.Fa arg1 -argument to the correct memory address in the virtual network stack -context of the caller. +can be virtualized by adding the +.Dv CTLFLAG_VNET +control flag to the ctlflags bitmask of the macros. .\" ------------------------------------------------------------ .Sh SEE ALSO .Xr jail 2 , From nobody Sat Oct 4 18:19:02 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfDLv2JMLz69WQ1; Sat, 04 Oct 2025 18:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfDLv0jDdz3gTy; Sat, 04 Oct 2025 18:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759601943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+BOvwhTiTqqEKyTBw7FISPvC8ESd2NIGZCq24R5u9Lo=; b=r5f6ZWCfjcYtPWoUMORFsLMHmT6bryuKJRZBA10fMytrFpe4jSOeE2lYtwYPb9Vz8nK4lw aNsppU/Pyf/ZKqilYtaiawaj6aOqdEs/NMClU3XfTxWG/QHzgp2ZrJuLtzcCPOd41ovNxX fu++QLfP74bh5/+0SVTNh0miKOpv3+ltmP7q63FSusB/nR+cjXrQUZgpvFfc4yVEibUVbN c3WQ+8rnxod2/a9EAF7969R4DeQqB5fxN73mmAPqAHcDHMR0w366i+tXFMQ4UZ+f1QyYN0 GoQohF6IHAaqX1lQBGAbMcH9MkTP3DXhZnM2pfdc4jPvIdR2te6Ewpn2j2alhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759601943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+BOvwhTiTqqEKyTBw7FISPvC8ESd2NIGZCq24R5u9Lo=; b=UI4LPlLORJui7hfeGPmD00omwxTu6+JCh/B1TDVhSNl/DEvmd8R8sYnRe0eRYCniSMEVx4 rPNZAUnA/yY2EKBrNRJoOw3j5IdDOdCe8AEkA+/ag+/FqL4gNzgk0F6skzxeyegJbv5i+M s6Izg2J5lQM26eF3cx/XLwX9O7Rp8CcVK+kNt3e2SlsehGZ87ADWObtFf0WaXEYy+MCjb2 wNkZ2tL8Nq8bDJJ57B784QVFAhvh58rbISufnxy7BjY34tdZfIHoBXgz6KFGTshZCIcu+J mM+jcm9o9mhIx80NG00wOeFe1bsujBG0CGMpxs2oIgq2gkgiwWRygTHG7dkauA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759601943; a=rsa-sha256; cv=none; b=mnDhRfocm+D7yb6T2mBzc/OZNzdVeUK3tWDEWhB8U0NaLJcRSU4TF79PC4ujCHc10XZgOX DAW1a2jz+Yb4l+xm46STCvrMEuA9zmIOYBUb97nZffy03ElCWA+WQDKsJkjuloXHmsAdma AWyoVULEJNK8KGcdwi5L19uA6Zs+dJrneYVX2D9OTygHQ072GrTundRn8XNyOD3sdALMAg UnRg0SCWzWhqOueMz2JvD1QLBMxwcORAIGQlDbakgvZQe7FGd5YuR7/fflGSDF5JxkdEo2 TVLw4yQERW8lNB3ngznRke7988fzTT1Ym5J97O79ZuuPNrdxJ6ZXae0oupBkJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfDLv067Hzt8D; Sat, 04 Oct 2025 18:19: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 594IJ2Tr029606; Sat, 4 Oct 2025 18:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594IJ2qw029603; Sat, 4 Oct 2025 18:19:02 GMT (envelope-from git) Date: Sat, 4 Oct 2025 18:19:02 GMT Message-Id: <202510041819.594IJ2qw029603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brad Davis Subject: git: f591fd26ca8e - stable/14 - vnet.9: Remove references to non-existant macros and update how to virtualize sysctls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f591fd26ca8e4a32048287c880bac1f7e12301e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=f591fd26ca8e4a32048287c880bac1f7e12301e7 commit f591fd26ca8e4a32048287c880bac1f7e12301e7 Author: Brad Davis AuthorDate: 2025-09-19 14:38:20 +0000 Commit: Brad Davis CommitDate: 2025-10-04 18:18:39 +0000 vnet.9: Remove references to non-existant macros and update how to virtualize sysctls Approved by: bcr, ziaee MFC after: 1 week MFC to: stable/14, stable/15 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52620 (cherry picked from commit 22886d3af0657dae3b547b21e612642bb47e0321) --- share/man/man9/vnet.9 | 52 ++++----------------------------------------------- 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/share/man/man9/vnet.9 b/share/man/man9/vnet.9 index 28e28bfd3242..679ccc3f9a06 100644 --- a/share/man/man9/vnet.9 +++ b/share/man/man9/vnet.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 10, 2020 +.Dd September 19, 2025 .Dt VNET 9 .Os .Sh NAME @@ -162,26 +162,6 @@ .Fa "int priority" .Fc .\" ------------------------------------------------------------ -.Ss "Sysctl Handling" -.Fo SYSCTL_VNET_INT -.Fa parent nbr name access ptr val descr -.Fc -.Fo SYSCTL_VNET_PROC -.Fa parent nbr name access ptr arg handler fmt descr -.Fc -.Fo SYSCTL_VNET_STRING -.Fa parent nbr name access arg len descr -.Fc -.Fo SYSCTL_VNET_STRUCT -.Fa parent nbr name access ptr type descr -.Fc -.Fo SYSCTL_VNET_UINT -.Fa parent nbr name access ptr val descr -.Fc -.Fo VNET_SYSCTL_ARG -.Fa req arg1 -.Fc -.\" ------------------------------------------------------------ .Sh DESCRIPTION .Nm is the name of a technique to virtualize the network stack. @@ -250,9 +230,6 @@ The .Fn VNET_NAME macro returns the offset within the memory region of the virtual network stack instance. -It is usually only used with -.Fn SYSCTL_VNET_* -macros. .\" ------------------------------------------------------------ .Ss "Virtual Instance Selection" .\" @@ -459,30 +436,9 @@ call will be ignored. .\" A .Xr sysctl 9 -can be virtualized by using one of the -.Fn SYSCTL_VNET_* -macros. -.Pp -They take the same arguments as the standard -.Xr sysctl 9 -functions, with the only difference, that the -.Fa ptr -argument has to be passed as -.Ql &VNET_NAME(foo) -instead of -.Ql &foo -so that the variable can be selected from the correct memory -region of the virtual network stack instance of the caller. -.Pp -For the very rare case a sysctl handler function would want to -handle -.Fa arg1 -itself the -.Fn VNET_SYSCTL_ARG req arg1 -is provided that will translate the -.Fa arg1 -argument to the correct memory address in the virtual network stack -context of the caller. +can be virtualized by adding the +.Dv CTLFLAG_VNET +control flag to the ctlflags bitmask of the macros. .\" ------------------------------------------------------------ .Sh SEE ALSO .Xr jail 2 , From nobody Sat Oct 4 19:35:06 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2f3Z6vz69fxQ; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2f2Wbvz3qWk; Sat, 04 Oct 2025 19:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yiV1zozBvbnE5f55ojuskOstAjyYnIsXm+nNMamTP5E=; b=eSaTVSoH0Un3lc9dg66HyNOb1KHjdBES06WnMDYAI0Gntfm1/sULm2C8AuOQhOgGwx9v/X XwRNL6Obce7YoBCZoTUx1Xpx4xNcCinXEyeakJDqlcAt8L5772yyKr0D9hXVnTWZSzS9iF VxX0qJ2HKOO+69z+r/cpdhW92NcYKZSNSC2/xMKGJbjuhdZa8wWYRZXKUjRu/TAjlYP2MC EpPG80ApSbE/wSvP1oeJuJTg8BCbzPhnbwLC4N33asUPLQJeknEwsKiOzhLjZPBqJgchhU ws0rltGi6lS3mUguuM9aGaC0KxOU9XDXpnYDcQsBotw8JvFx/aUJ0v5sYaF4mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yiV1zozBvbnE5f55ojuskOstAjyYnIsXm+nNMamTP5E=; b=P5udXRyOKQFEC9Ku5daYpjbKsNi88DpNzvnF2YY90jkWPZG3J+z8V1ZF0Y1Ybi4umu7mfx JFEHtpA3bK9yJL0q5YDEDOAj8xkDDxsAjt2JM/0SiZp/g5xd/uh8npapkNz9snqbodoetG fVgiW/sLKL1jaEenzixyp+DfIrlfQN+/QtaDwh9EawMlfV/1tVLB/2KetIMhInVUlxou7H L4vfTTEb8euBCaXht9v3M38x24I9VuWyCqGzvlYizogMqrpgQGQuIorBu8dbvzJ9891jwo jconyPqcNRSH+lxzDI/f1bmkOPq6/yMbqLUqYrqQ4Tu9wtBGBtUzfdnp0enmrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606506; a=rsa-sha256; cv=none; b=p1V4uZ1joPx4ZM+0mXn1yCM6gWZPXG2/2TpAz+tYjUaBXBkJpQCuIVy+E0QYJuduiLfLfd hjg7kYnuuabY9xmcAWeUHL7NTh8GMe/ORAyxS3NQ/43Up35Q7oyMduqMr0dT2Ocf++6Prx 1ZnMlRMTDLbgxqd8f5auTo+8/QCtbCjSuTvk4apsYahnoKr1zuTkVuQ8mUHvyXIZCm1K4h x7LNQGGtJI4vKWu5XCCR7sZRhROUJ6ex6TUbLKZKu4tjC4YJffjjNWMzAtgb7f6OM0uQFB J4UtjWUgN/3+bAhBVfaFY9r5mEwPv06SMrA9VLfSGloLGcDptxzPLw9p31ZFDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2f25vszwDF; Sat, 04 Oct 2025 19:35: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 594JZ6a5078904; Sat, 4 Oct 2025 19:35:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZ6dY078901; Sat, 4 Oct 2025 19:35:06 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:06 GMT Message-Id: <202510041935.594JZ6dY078901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 33b5c3d97ae9 - stable/15 - dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 33b5c3d97ae9683c2eb43fd47b83f40667b85fbe Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=33b5c3d97ae9683c2eb43fd47b83f40667b85fbe commit 33b5c3d97ae9683c2eb43fd47b83f40667b85fbe Author: Mark Johnston AuthorDate: 2025-09-17 15:29:48 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations dtrace_xcall() is just a thin wrapper around smp_rendezvous_cpus(). There's no need for six identical implementations to live in MD layers. No functional change intended. MFC after: 2 weeks (cherry picked from commit bf115203bb8a61bd03ba23931ff0b5bf931b7d1b) --- .../contrib/opensolaris/uts/common/dtrace/dtrace.c | 25 ++++++++++++++++++++ sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 27 ---------------------- sys/cddl/dev/dtrace/amd64/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/arm/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/i386/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/powerpc/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/riscv/dtrace_subr.c | 27 ---------------------- 7 files changed, 25 insertions(+), 154 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 8078f3f6d4b1..853cfb845878 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -707,6 +707,31 @@ dtrace_error(uint32_t *counter) } while (dtrace_cas32(counter, oval, nval) != oval); } +void +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) +{ + cpuset_t cpus; + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + CPU_SETOF(cpu, &cpus); + + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); +} + +static void +dtrace_sync_func(void) +{ +} + +void +dtrace_sync(void) +{ + dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); +} + /* * Use the DTRACE_LOADFUNC macro to define functions for each of loading a * uint8_t, a uint16_t, a uint32_t and a uint64_t. diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index 32e84d8fbfe9..ff880e804770 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -124,33 +124,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, (uintptr_t)VM_MIN_KERNEL_ADDRESS); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ - -} - -void -dtrace_sync(void) -{ - - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - static uint64_t nsec_scale; #define SCALE_SHIFT 25 diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c index 81aa53d00bd8..877d52fe18a7 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c @@ -142,31 +142,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, la57 ? (uintptr_t)addr_P5Tmap : (uintptr_t)addr_P4Tmap); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - #ifdef notyet void dtrace_safe_synchronous_signal(void) diff --git a/sys/cddl/dev/dtrace/arm/dtrace_subr.c b/sys/cddl/dev/dtrace/arm/dtrace_subr.c index bb42044aa477..10e9281709b6 100644 --- a/sys/cddl/dev/dtrace/arm/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/arm/dtrace_subr.c @@ -138,31 +138,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) */ } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - /* * DTrace needs a high resolution time function which can * be called from a probe context and guaranteed not to have diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c index 026581f5a899..ebe2194a4b2f 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c @@ -139,31 +139,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, kernelbase); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - #ifdef notyet void dtrace_safe_synchronous_signal(void) diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c index 5dd083310e6f..ee8be8da642f 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c @@ -123,31 +123,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) */ } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - static int64_t tgt_cpu_tsc; static int64_t hst_cpu_tsc; static int64_t timebase_skew[MAXCPU]; diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_subr.c b/sys/cddl/dev/dtrace/riscv/dtrace_subr.c index 3a6aacd86fcd..ed2c0bdba7e2 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_subr.c @@ -127,33 +127,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, (uintptr_t)VM_MIN_KERNEL_ADDRESS); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ - -} - -void -dtrace_sync(void) -{ - - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - /* * DTrace needs a high resolution time function which can * be called from a probe context and guaranteed not to have From nobody Sat Oct 4 19:35:07 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2g4nrXz69g7d; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2g3ctHz3qlR; Sat, 04 Oct 2025 19:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hii3IeQyl8mHkyg+JujZDw6KagO2GMnsZOmoUfFMlMg=; b=lAtIr1VBVuZJlFADsl/wrK8xQZWlj62dajkSfPLEqsVrUcbRAaLfH9Lj35kQwjiVG3DoJY gsZes3CYAjP7l/Q757vkO5Ls1uXoXg+s1ceC/r6CpmeEqkQ4RWu3s5XoLEgPpOMcXaMLko KUI/VHHvJG7Gtwih8KpKPimP9elUHQfRvLDyIYmhFL581FRw+2h6/7bRWvUJRp/W/VEdhH 5bBRgI4iCrGuLtwJKmmawVfH7x54JkCdJKNfZRwPIUr4JvTt1ZF4IqfA6qgbJz/zykxZrP KlK2jxo94ZjPNxQHeWO5XBm36bM/mnr8AFQqByjqxCsf+BNNY2844KkLFpA4Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hii3IeQyl8mHkyg+JujZDw6KagO2GMnsZOmoUfFMlMg=; b=I7Avp7kV0SPiPxxm41zleFuhFVj2h7jI1jJZEyzQiA6VS58elWxzFigHiq0RdOnJppEiGF OrkTaFWDnJ52IE6/OhjS34Bd9cx64whMoM2z9Ar7vQVEkrjtc2CbqihX6y7w8e0TIqM3h5 iK7+pjkZIOEv2JLYScYKwrqLga6hMgRX1bPfYpvwbeTYzLMXN2L/Gu3gM5pDClLJtyv+J8 LOR3yzH3KyGUMJfmaFo74d+AqaXFoE0QIUwDi83IUFvbo2qj5iWKIEn2QeA8ib6sFZnr0G H5lPkuS8w43PCQiHl5ov9b/a8cyqtlaNvjz979bKFtlD3Bp/yK1UbK3KWwnWKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606507; a=rsa-sha256; cv=none; b=Ahb3/Vb/XMxlrM7D0ErF13MCp88GZpSoQy3mjSDvIF8r5jIIV7tIWi4RmHCmSzwOXjE6J/ slv0kKWuaGMXsZHDj9LNuVqWnJu9f0HbMNMXk0emOjlc7Im8HGWqjC3iYEdccSPh2espOS 8eWoyn0DqeLgn63uFhOcl1TkU5xX5FOs7ZAC0ZMzjJR2HJFqcxYKkh+CweWgmJniW/Ri22 uS1xqMVUoKDbYDBEvuWHvpME7Ufwtnpslg6NvdBn0GIhaqhPp4UPiw2nbrWFchyaKcsrJX AX8LR1dVuFNFrKpuEdMGN7ktK2WmrwDk0UQksN3qljYlY9S7v27FWOP6d0hSbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2g34QWzw3j; Sat, 04 Oct 2025 19:35: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 594JZ70A078946; Sat, 4 Oct 2025 19:35:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZ7BH078943; Sat, 4 Oct 2025 19:35:07 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:07 GMT Message-Id: <202510041935.594JZ7BH078943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e309119ae1d6 - stable/15 - OptionalObsoleteFiles.inc: Add more ATF libraries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e309119ae1d69b267b7233c787e9cae85b7b0fb2 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e309119ae1d69b267b7233c787e9cae85b7b0fb2 commit e309119ae1d69b267b7233c787e9cae85b7b0fb2 Author: Mark Johnston AuthorDate: 2025-09-22 14:04:30 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 OptionalObsoleteFiles.inc: Add more ATF libraries PR: 289653 Reported by: Trond Endrestøl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52676 (cherry picked from commit ceb5792d1e2e58646dd291a2dc3877aaeb73122b) --- tools/build/mk/OptionalObsoleteFiles.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 7626c69a4526..13d7703148d2 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -8196,7 +8196,11 @@ OLD_FILES+=usr/include/atf-c/tc.h OLD_FILES+=usr/include/atf-c/tp.h OLD_FILES+=usr/include/atf-c/utils.h OLD_LIBS+=usr/lib/libprivateatf-c++.so.2 +OLD_FILES+=usr/lib/libprivateatf-c++.so +OLD_FILES+=usr/lib/libprivateatf-c++.a OLD_LIBS+=usr/lib/libprivateatf-c.so.1 +OLD_FILES+=usr/lib/libprivateatf-c.so +OLD_FILES+=usr/lib/libprivateatf-c.a OLD_FILES+=usr/share/examples/kyua/kyua.conf OLD_FILES+=usr/share/examples/kyua/Kyuafile.top OLD_FILES+=usr/share/kyua/misc/context.html From nobody Sat Oct 4 19:35:08 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2j1Rkfz69fnj; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2h49Rzz3qlm; Sat, 04 Oct 2025 19:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VZuOpMig1N3lIR2v31p1E7B1XiRxsmALCpLVGgsK+6s=; b=Z8Vx2KSYv5xrBk7dW6Ln54gocclJLFzGaOtnnCDBtZJg1cCBJOwT+awoc9Ucw84A/1fDiP QMOxGz1r9UHquvj4h8wvayCAjLukuO/W4eY2Pbjb7YSUzGg4wZMAy/aXZGUJ0pf9mK/FMj 8Bid+qwHibI7Tta8mx755W7K1KRidYm4uHkf9iqeEl9Z8VSVuAOoUWOt/Djx4izkTSndi0 qW2BeAm7colaPf1tdj7dgjLtdDk0rEzgOV4xaEtXTSgw2fRyfX/n0wpobATU6hBT8Dw18J yyN/QLY9mSHBm+bqyjZv/O4BTJ6cyLwWiJOk+BlPeGx5gGlxSSD3Iuyl4/xGFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VZuOpMig1N3lIR2v31p1E7B1XiRxsmALCpLVGgsK+6s=; b=wNel6paOPb0yW0CbGGt/Pisq014D11owAH5omTKC6acnRj6eo6yXRgYJ1S5Xx1T3Dt3q/V pKN6xymuvwX1fdTkwB8s/py0lwDZYY1v6VKsMwQWYySszLpN10qH+xcJngS1TxqIvY9i5y AmaRYjkjE4tOTCzkzAozdZv7wZKizlYWhTtDuvch3o3DUNRjUfLIRqZqBt50dWJoFJ/fqW D530JCosmory9VjEdA8s2oIBWpEqJPcZB2nIvCZEBXKrHutNGwpxTWudAStDU8U7+soCwd VYz69N51GHpCHpP3WbUD/fXvpMXKjaDySsbyZYr+yoKjVVd6fuAYdmdTvIq9iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606508; a=rsa-sha256; cv=none; b=ytwEeap1rN6vlwmZPhvkuGnF0P+Z/hAQnzkGLwpx85dv5Pqlt1xW5a4+qJ7hnAPFmnzQne UAhgSq8toJsQhW5urENdXb2IP2aOfCtjzg6pbp+TFgc/ep5cqqtetGez3rTlwSRUKlfxHq OVHqrGuRjXB0IJ2sANa89LVf07NyBxHm1pWMwLtaEwxq/Y/BtYqhij0+5NQpZb5aoQXN0a 80Ph2gv7z35GuNcEJuxK8q5Kg0HdOSRxxV1Wgof1DjrIcxFTUhKDLX8lQ9YXRa8hQ7/5C5 CNKXIe2GhSf6nFslXEF372+iFLd8aO3YjhUaUgPbywjIrJTxvW0Oa/HoqrDN6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2h3k4mzw0l; Sat, 04 Oct 2025 19:35: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 594JZ8VO078979; Sat, 4 Oct 2025 19:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZ8iA078976; Sat, 4 Oct 2025 19:35:08 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:08 GMT Message-Id: <202510041935.594JZ8iA078976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 92a00264b7ed - stable/15 - sanitizers: Provide wrappers for atomic_testandset_acq_long List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 92a00264b7edfdad3171151b9a03a197860e71e8 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=92a00264b7edfdad3171151b9a03a197860e71e8 commit 92a00264b7edfdad3171151b9a03a197860e71e8 Author: Mark Johnston AuthorDate: 2025-09-19 22:54:20 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 sanitizers: Provide wrappers for atomic_testandset_acq_long Noticed when building a kernel with options RANDOM_FENESTRASX. MFC after: 1 week (cherry picked from commit 7ea59a07046a0bf25d4fccb456715dffaae52021) --- sys/kern/subr_asan.c | 1 + sys/kern/subr_msan.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 464efda1e91a..fee6c1a844e2 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -835,6 +835,7 @@ ASAN_ATOMIC_FUNC_TESTANDSET(32, uint32_t); ASAN_ATOMIC_FUNC_TESTANDSET(64, uint64_t); ASAN_ATOMIC_FUNC_TESTANDSET(int, u_int); ASAN_ATOMIC_FUNC_TESTANDSET(long, u_long); +ASAN_ATOMIC_FUNC_TESTANDSET(acq_long, u_long); ASAN_ATOMIC_FUNC_TESTANDSET(ptr, uintptr_t); ASAN_ATOMIC_FUNC_SWAP(32, uint32_t); diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index a3238b61482b..883dbd2b7604 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -1301,6 +1301,7 @@ MSAN_ATOMIC_FUNC_TESTANDSET(32, uint32_t); MSAN_ATOMIC_FUNC_TESTANDSET(64, uint64_t); MSAN_ATOMIC_FUNC_TESTANDSET(int, u_int); MSAN_ATOMIC_FUNC_TESTANDSET(long, u_long); +MSAN_ATOMIC_FUNC_TESTANDSET(acq_long, u_long); MSAN_ATOMIC_FUNC_TESTANDSET(ptr, uintptr_t); MSAN_ATOMIC_FUNC_SWAP(32, uint32_t); From nobody Sat Oct 4 19:35:09 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2k16Z5z69ftm; Sat, 04 Oct 2025 19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2j5GwZz3qpc; Sat, 04 Oct 2025 19: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=1759606509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHllunrHPhtNOZw1lkS9oZ7sKF6TDiDMHpi+BYy1Tns=; b=j6vcncQkzrl0vOoRhD7gl/y1gqc7aXNLktnKCQ1WW6alZ1W9MVhS94x6fdMrhBFNmUnAgk DnekMw7zhLD6LaTLMtsvOeREYJNt2m5K4RFahQzrGCTU6gcnGVkjx8AViE+L444Je02qI+ AF7X+ywvM3axee9hf/alBm/i9Qy1nipxrk2yP6rAyjmOySeOiHHvQHU5N+wefIiiGC1GeO fe14fGPwmQVCHateGXEJeACFDVevm6qN6eQ3KIXNwnKDdxKvjkAMCogN6ckGRoN4QZ2EiH /0pcJis+IBWV8jjyltObsbLZEqsDqNmnzyh1FhEvRO4f79KavwBlh4wlGz7BlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHllunrHPhtNOZw1lkS9oZ7sKF6TDiDMHpi+BYy1Tns=; b=hKnlwiWYQtNnyG8efO8zdusEJZ6lqXWDee842PeoN8z8U727fyfeqrsdRbHndxeS4SD3OQ Zs2yJu2HsR2HVC+jQ5gdWlP+ikHKq8RyGihe/9YAXhPnfdpn853gHWHe+n9WnNn4qUedK6 MOMAwjgbCZir4aGI/Ak6h/qo1FTgJiyB6Ho2rp/HvzhDOEpNlVcZnqUMNu1AP8527VzDbg ZNrEInM6rEqScsEMgIdXq1CW//BQX8QzuqlRP9vpFAqQe3Axklj7D//O8Uyy/kzfFOhRON ESDuKQM26wXVCvy0ILot697aS3Y5a1Og16hlGeCnk605q2wZHn4/Ae8a3n23Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606509; a=rsa-sha256; cv=none; b=osCrq1kwcoQUPGKnuRly3Eg6291tRaxkfkrmUYWwQVlh1xUvQ91Dt755w/jGdM5n76W9aP Ogd/B5ymPv2fu05dZnvqQwedFVOCPsqTzRMEKK9sObJBigxmJrrAoMyN3BBOoiuIaZqTCo B1FUBX4z9IPUF9TdV+CyTygytrDBgphoEflXEEu39kVbjeDkBwnCagP95eNIlLqRa2ALvo PvmlfDRL5DUD8CZRc0Pa+41E7ldIuEU91XK9j291MPft3dBKiWBjUHJtWKqC5CWPpYCM5o imPOL9EgJ2aAkdG5V4Z9C0enucyqo6SI+WwupxX8Oj3uCDRN5O6SVS1EwQUAow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2j4b71zwDG; Sat, 04 Oct 2025 19: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 594JZ9mA079011; Sat, 4 Oct 2025 19: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 594JZ9Sp079008; Sat, 4 Oct 2025 19:35:09 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:09 GMT Message-Id: <202510041935.594JZ9Sp079008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1809c29d8d0a - stable/15 - pw: Remove duplicate lines from the pw useradd usage message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1809c29d8d0a0ea2a419cfc6f7b24d58c1907512 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1809c29d8d0a0ea2a419cfc6f7b24d58c1907512 commit 1809c29d8d0a0ea2a419cfc6f7b24d58c1907512 Author: Mark Johnston AuthorDate: 2025-09-18 15:13:26 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 pw: Remove duplicate lines from the pw useradd usage message No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit 4784ca87441093328cec4e9b133608e172343f64) --- usr.sbin/pw/pw.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index a4c95258f3bb..fc778b16c7e5 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -257,8 +257,6 @@ cmdhelp(int mode, int which) "\t-Y update NIS maps\n" "\t-N no update\n" " Setting defaults:\n" - "\t-V etcdir alternate /etc location\n" - "\t-R rootdir alternate root directory\n" "\t-D set user defaults\n" "\t-b dir default home root dir\n" "\t-e period default expiry period\n" From nobody Sat Oct 4 19:35:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2l0x6Hz69ftp; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2k5y0rz3qpv; Sat, 04 Oct 2025 19:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8PUOwFBj9ayjhbwtqDmgxsWcf9bfmBITQxArf7tTf4I=; b=TIMUQBkGInPIMoTI6w6zOXJVsSASmIMX9C37RdYTTlt4zAn3Z7xjwHI9nsgDdgy/zNv9B+ PT0zbh3LIXZ96OQlDDjZCEDHsEn24ZsdZmmf3pUJOnWeUhliBznvY9gBTdD1yk691nZxUn x79gK1hP6W/pb3pRe8ca+KTZY1IYvVsIyBOsLWnKE7Oks9OJFdwBtQjHr8ucO/RZSOZtMA Dp3pxeIe81wVHKjIKPFsV99Rn3fCzhXwDTRe5SqyQeEWzQUSrsBRHw9PExuC9BjNFyPUNq C5Th1veiUG9JjtznmfHWNDv4/BKeiIAJckbtdR/Gc6CiI/M262L2Qi3Zlan8Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8PUOwFBj9ayjhbwtqDmgxsWcf9bfmBITQxArf7tTf4I=; b=bA5z1UJaMwa8Itlw2Cdy+iikAkFfIhp9VZghhrwr9Z55b9BDVztt58xDBoxcydz/XLLly0 WL+/Iyu+hlKcyd1xHnXIENVMNeRHAcG0WbA7pxP79NwJxn4g4GYIZjXNzYiilwVi5i/fIP nRJFl+rkO1FS3kwMFYjsP+WbvkNEc8PbigMo8GtH3j7s2fXnIpQiSuwSRY4GIQVmbysw0c e/UBvneEiGLZeGvXuOkj2UvcCRoKxUXqKNugNr0s89mckpsPFY5qpktxA1gP/PKN8LJfns QFRoVFcHyRW3AFIyxs03AhbvvlLc1ZjH/R03cHlYWw5IMb18MCdI0sKGX57J/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606510; a=rsa-sha256; cv=none; b=HlCuDqQOemKc7G9pXqWCnw1sVBumGqnFb5wiSq5pOp6C+tYrblirhGTByX172Tlj+jriiJ dijzSCAToOB1ukLkjFiopH6PQ0gcj+CSNZQdlCSyMZg8l8wMmuHsN6oupp4+/EMXWLpOC+ gyfL2rIlJfR4TGm3oiNvgf4OSHFnsPtAckP6jp8teGMbMkox1IuYdhpYO/tD5JxxeyDLwq JSHgy4ZICV8Pu47yvLyeoLgJGeXENDYSFTkiwenzlkZf/eUWJ62PvLkw5KI4ZrgKI+usob fB5TIy+2QwRmDMnFqowPx26t1MkCSwUjV0COi5SUA9jhfFZpnL96rZI9eu0yzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2k5Xx1zvh1; Sat, 04 Oct 2025 19:35: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 594JZATo079043; Sat, 4 Oct 2025 19:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZARS079040; Sat, 4 Oct 2025 19:35:10 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:10 GMT Message-Id: <202510041935.594JZARS079040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8b6d7e8fe396 - stable/15 - pw: Print warnings when metadata updates fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8b6d7e8fe3967db29527a32206349dc954e83a26 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8b6d7e8fe3967db29527a32206349dc954e83a26 commit 8b6d7e8fe3967db29527a32206349dc954e83a26 Author: Mark Johnston AuthorDate: 2025-09-18 22:38:33 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 pw: Print warnings when metadata updates fail We do this in most places already, but not consistently. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit daa63c9417a28ad08881ff03df828fd8180dad12) --- usr.sbin/pw/cpdir.c | 6 ++++-- usr.sbin/pw/pw_user.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c index 3dee8f7c43ac..63068cab000c 100644 --- a/usr.sbin/pw/cpdir.c +++ b/usr.sbin/pw/cpdir.c @@ -127,8 +127,10 @@ copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid, /* * Propagate special filesystem flags */ - fchown(destfd, uid, gid); - fchflags(destfd, st.st_flags); + if (fchown(destfd, uid, gid) != 0) + warn("chown(%s)", p); + if (fchflags(destfd, st.st_flags) != 0) + warn("chflags(%s)", p); close(destfd); } closedir(d); diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 8a9a4342f5ef..9f5cfb0f4473 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -123,7 +123,8 @@ mkdir_home_parents(int dfd, const char *dir) if (fstatat(dfd, dirs, &st, 0) == -1) { if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); - fchownat(dfd, dirs, 0, 0, 0); + if (fchownat(dfd, dirs, 0, 0, 0) != 0) + warn("chown(%s)", dirs); } free(dirs); From nobody Sat Oct 4 19:35:11 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2m1mRMz69ftq; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2l6n6Fz3r5K; Sat, 04 Oct 2025 19:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=um9GzLSHTGl+N5CyFeUP8YJWK7nhLRTLR5crEQ54wNg=; b=k5Qia4kkP1ADDLBmwi7Jkt+REp8XnWOEPOl8c9goN6c4kewbOv+FtS79diGUBz/ccfQfgb oWR3xmPLI3MYJtUH6AKRU3ZAw9/41ZKNRgubsXgnD7vLKWeXfgFvpr3GY4UqSfYn0Re76c lzQWFDtUOozG3Tr5JpMvhlI7pqB1AfsGXVN3HP+bfyJ812gAP+QbfrcDyy49+P/Ugm+lY7 Ft0NT0TlY/1S7Odhonx06JDfuAJgSkX5r0L2RI6bc0bueFQmo9wTFhjCtsItyisNbicuit n6NYQdeJs5rb9TETzlpFQS7aW955WQmIX2Qw+icDXDEy74swDpi4CzZCFqTJkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=um9GzLSHTGl+N5CyFeUP8YJWK7nhLRTLR5crEQ54wNg=; b=MzNPUFA+chKduitH8uMrdS+5hbYkDLpL7adsbVmKJwngaZ8MC3j5h31S5Fj1/iVOJZxuBd VHO++omw0MkZ1F1MXMkSa9R0jty/PXGr3OLICCgi1wtwgrxVuCLqTVklnjArCuIb09kaB6 RoQaGHhYeHxsYU6pRvnHeqdY5dlQ9rAHv0041ITdA2ruvN9fmuJx0I47Dxya7IY+KPR43K wDsOaxzXyUjWSETQ9MZQ3umShyQQ8eUlAjttTZYNuj0ZWc3zdo2jyh/Egj2i65LujgeFms 3UjXsd5t5IFACBy7f/rQpwf3ZQR5+G7V7tZMR0OjwpoBpdh60Qj5UnlyIv7TQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606512; a=rsa-sha256; cv=none; b=qrWWa2+qraoTNrzlY13mOAMqCX//cgpJNSTHxUjeibkP5SESsORu3GVHa0iA/R9vnVrr2F tQZVM6XMTsntuHi3/83Hs0Jnp2M4VoFr+aj+NUL3iTUDRcdMFsBcQ5oDIbuS/2sdZ/t2R7 Av2ftR2e1H6XffjVZ1Wy6wPyVCL+ZL1XzmwaeFpt64L2B1GF+0NuPIRw1xjoCa1/8tWj1p kv3gWD+qpFvEfROoHwuVngwaKYDMO0n3MkXs5Y2s0pN1UqMhSFrLt5Pk8GF5szQCZ78pcg tdjQ4tLRRtLymRW8FXhgk7lpcwity6Ig09ESKg/YDSQ6AfsqQC+iancBOi+Gaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2l6NV3zwDH; Sat, 04 Oct 2025 19:35: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 594JZBDf079075; Sat, 4 Oct 2025 19:35:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZBJ7079072; Sat, 4 Oct 2025 19:35:11 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:11 GMT Message-Id: <202510041935.594JZBJ7079072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 240acee90234 - stable/15 - pw: Clean up a couple of errx() calls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 240acee902341371aa73687f6ae22dcb36cb643b Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=240acee902341371aa73687f6ae22dcb36cb643b commit 240acee902341371aa73687f6ae22dcb36cb643b Author: Mark Johnston AuthorDate: 2025-09-18 22:38:45 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 pw: Clean up a couple of errx() calls - Remove a stray backslash. - Make an error message fit on one line. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit bc69d5dffa21cdf228e481b5502fd0f053d65e6d) --- usr.sbin/pw/pw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index fc778b16c7e5..18f1a17ba942 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -143,12 +143,13 @@ main(int argc, char *argv[]) optarg = &argv[1][2]; if (*optarg == '\0') { if (stat(argv[2], &st) != 0) - errx(EX_OSFILE, \ + errx(EX_OSFILE, "no such directory `%s'", argv[2]); if (!S_ISDIR(st.st_mode)) - errx(EX_OSFILE, "`%s' not a " - "directory", argv[2]); + errx(EX_OSFILE, + "`%s' not a directory", + argv[2]); optarg = argv[2]; ++argv; --argc; From nobody Sat Oct 4 19:35:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2n4Knxz69fxW; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2n0rHSz3r0k; Sat, 04 Oct 2025 19:35:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhbI7uT5jh+02KOhGUioHzyfluRCyFqjgylyWDOgE9o=; b=wPRX7JKi0pKM/D/z++QVBwmxTyPMsyJ9fw8ukl7zDQ10kg4pH1/i3r6IuuEq8Zur/9ciQg DqFWzatEeQQDGotiMTJy9NxzfJK981CfHMzZm8e/JSCqnGQPPpaS2kjBKW9kpHKPp3utOR 7ri2fi4D/F85DhTk7ve62S6PjfMTXQD4N9/qhsM03QEX+01L4tOQYmWvcOMOHodbL8RHO0 2R8+DpvCB5+n9+RcPT7+PTgV4E7Q9qMfKC8XB+LcvYAwgwmeny2zRHazYqw8cUG1Ti41c2 9McqpjqZ8H1ica/ZAH4/KAC3cOsn2SzsnXqvQqObEWyZYfsSjLsDGm3Mlgqt9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhbI7uT5jh+02KOhGUioHzyfluRCyFqjgylyWDOgE9o=; b=gKYZkgoeWKb+LrJfqqGANERS46ZgLGCRdYEA7feTGHqPd4A/PBtt0jq/BBuesxZ/qElLrq Ilm34Pt4WKI6iD3BKMJqEB5QR7mDO2XHtFYIh/Budzq8LALMZfPkKdYZ1RmutUqhOe6mgb 8BF8aV0xi6/14UA2BZvymA86v/xug06FvUkNQYyAFMCDTnQV6iFpChmzMKKKPvsVAjNuI+ mTWf+k9mkKl0XPD5IR/0PDem2dhcYQLA+G3f+ZtQSH+70dqMSaZ5AmL8mQnCYzYjtsb9Lj WvOSbvr2x1wPDujw5E+kzqPYvl7IP3XIjfSgdmwCME+5t0foTrG2ptcY0c1nQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606513; a=rsa-sha256; cv=none; b=co+RqjUlYTqHCvyQktLSW5pW1IBwTlA53iGNZPZJuqMyThDpxGp/qY3Jo+DhEUi6571dI1 UCsNnNEJgQ+SDbB31vO136ArmOMkUCd3kc2YaHZlzPok+wZf+ear6v6ichf4bXWich/2OR sRH3KNDRfrfRx2KiNMF2hpFUI5NKli4fzBEeYuzfykmVN8doCELs2hifyF9sD+3ab2/eHa erJeDLztj34HftGyxgSAK2xNgBM+YLQ7JHm9a3+Z134svpkaMqluVgtBXrvN5LaOKhEtgz bd3WnbSMrF87K/y4HyUxuUNbJLZCh2E+wbkUD7pTKMG+PoRWCPlccotQgL53yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2n0Jgnzw3k; Sat, 04 Oct 2025 19:35: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 594JZCw9079107; Sat, 4 Oct 2025 19:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZCKJ079104; Sat, 4 Oct 2025 19:35:12 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:12 GMT Message-Id: <202510041935.594JZCKJ079104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a288670287f4 - stable/15 - pw: Style List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a288670287f404ce15ba81a94fb5344fb287fe91 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a288670287f404ce15ba81a94fb5344fb287fe91 commit a288670287f404ce15ba81a94fb5344fb287fe91 Author: Mark Johnston AuthorDate: 2025-09-18 22:38:58 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 pw: Style No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit 42dc71a544a4d78d0068f70b6d4089a8c9e07cb1) --- usr.sbin/pw/pw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 18f1a17ba942..6f59e392bdd0 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -166,8 +166,7 @@ main(int argc, char *argv[]) conf.altroot = true; } else break; - } - else if (mode == -1 && (tmp = getindex(Modes, argv[1])) != -1) + } else if (mode == -1 && (tmp = getindex(Modes, argv[1])) != -1) mode = tmp; else if (which == -1 && (tmp = getindex(Which, argv[1])) != -1) which = tmp; @@ -179,7 +178,7 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "help") == 0 && argv[2] == NULL) cmdhelp(mode, which); else if (which != -1 && mode != -1) - arg1 = argv[1]; + arg1 = argv[1]; else errx(EX_USAGE, "unknown keyword `%s'", argv[1]); ++argv; From nobody Sat Oct 4 19:35:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2p45Ctz69gB1; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2p1nnhz3qsS; Sat, 04 Oct 2025 19:35:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wcrt2ecBMnu15/vJNqqGdUdUtErGaVAad0Zsjw3J2ME=; b=Vo7/hBE5uSUYNSMF1dli4vQyiIcuiLrk8gQ/Q8EByhmkahRxhtK+k2ySQUtdZbk5DWUb8u cwillyWCKLc35PON8plpRhhC8DxDs88BEY/kc12s0Gi1ZPQEoJ9uN4q0DbOKztO6SDwiHB W/FQT1AogXDjYFDqDvFSMb6zcJzCKS64xGaUPRSV4pip1jrmABiqGG4FhZ7YwYYARH6HNB kGq7uwubne96RGwJvE9Vr2UWaeAbg4aTV0bZ8B10Dc/TLgZB32ycBxnW3x4fpt7CNUrhxF AR50e6MgVWOgqXs8FLUyT5SqKJ5Toho+myFet748xmGJ4T7N5Tqg/fNVbkAbEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wcrt2ecBMnu15/vJNqqGdUdUtErGaVAad0Zsjw3J2ME=; b=iRXQkhDNeCMMNRkMhtp/vjqbztLN4Sc/+u+DRjPRVgxUsSFUr9kPoNTZToX8WKXn6v9QCQ ugUybWvUwJl9l3oIIElfzwHh/tOvNm7xxoNNYXL7t7G5OK1efMlq+5x3iZHkodh3vC63Ka YaSMpqfY9moLeJVB+LVechKbqT8WYMWmC+EbrmwPvTZidzIRcg3JLt0S9/n2G5xjgEyBVj oJ/pAnrWSZPJuWBtdg4zGcfJd+txGD723xT7QDP/uRPleLTYsQcmGopFVSRRR0wLsNSoxO KraBkrlXFX/Yo5xD3kQ6A/dAW0LMDI8EZ8rg9nzPTKZjMzDt9Xif8RJ754qVUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606514; a=rsa-sha256; cv=none; b=S0yHsBEFlY5t+fsjvrAVOQ85tSAfIuFMvu7btP+1SbSIm6K3Y/qLH5pbvoNGlhmT+6HOY9 rxr2FOaAyIEwRJ7iJ8GOqOo2rGQonSq4RL+W1AOP/GVU22xpWrdKr0zgaqSPMDsZr6iiFj 1bXpKafNKEdTm7Mp9hwubIR6i1AzO1+GanpM8CjB6V7uvnTxNDQaEGBI2qxwcg16ZFXKGl KzIX30MmUDqiHYhVg3Pg3NeYnVTQHNqpo5AywOktd2n0/Wi0+ou5wPvemdXiwxkVP3yALC 6QExcvn8VLoDoPmCl+Ev4nI/sZSSlndA1c+/pOr1q4Ut2wqq9aszlDLP5Tg0Bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2p1Lhrzw8w; Sat, 04 Oct 2025 19:35: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 594JZEeV079145; Sat, 4 Oct 2025 19:35:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZEJD079142; Sat, 4 Oct 2025 19:35:14 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:14 GMT Message-Id: <202510041935.594JZEJD079142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 350784b01cb5 - stable/15 - pw: Add a missing chown() when creating dirs in mkdir_home_parents() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 350784b01cb5f74713c054d6060da75566a88340 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=350784b01cb5f74713c054d6060da75566a88340 commit 350784b01cb5f74713c054d6060da75566a88340 Author: Mark Johnston AuthorDate: 2025-09-18 22:39:11 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 pw: Add a missing chown() when creating dirs in mkdir_home_parents() mkdir_home_parents() effectively performs a mkdir -p of the root home directory. It chowns the home directory to 0, 0, but doesn't do so for the intermediate directories. Add an explicit chown() call for those too. Fix a long line while here. Reviewed by: bapt MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52587 (cherry picked from commit 41b2a80353e0dd04939cc260d5763854a264c158) --- usr.sbin/pw/pw_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 9f5cfb0f4473..007f750c7d1a 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -115,7 +115,11 @@ mkdir_home_parents(int dfd, const char *dir) *tmp = '\0'; if (fstatat(dfd, dirs, &st, 0) == -1) { if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) - err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); + err(EX_OSFILE, + "'%s' (home parent) is not a directory", + dirs); + if (fchownat(dfd, dirs, 0, 0, 0) != 0) + warn("chown(%s)", dirs); } *tmp = '/'; } From nobody Sat Oct 4 19:35:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2q3wFNz69fsm; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2q2lzxz3r5s; Sat, 04 Oct 2025 19:35:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mLk2ygABJUwMv1lJ5Jxg9dCXhAUgEgyWh1M0bAqNnrE=; b=QFoFSTSyYB79U3mqcQfYu2gQ25gj+dAubxiz0gI5Q2ox8Rbw71y7jqSLIrJ4hLmWThg+ul 2G/zZoIGLe8mHpYFK+JMsIERjUOP5pEV1fIGeCoaARGc8tvcIfIMWlkBFGFn8mN/OaXW2s XjFnxCGN4Y0x8nM/3KVf54VQGK1VcWNg9hSOD1Y0LkSkWrshLCG71+Gt27a/MzKQ7xsoDH pVWOFv28KfjUVf7JGmt0Vta5kXPipYZdH+PMQnB3JKqDnRNhFbewW0ltZ8Z1WTHaTR5BCH iQpxjII0FnFCxYYooSrg2qpfd1He/Ji54iVhOfMUzEG133m3U+Fn+bQOaYfwvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mLk2ygABJUwMv1lJ5Jxg9dCXhAUgEgyWh1M0bAqNnrE=; b=L0fQ1ewi9PyRFhWv9U89D09fAeQkylSMwV0Ftor9Im9u8to9aqcPBMiXF2qH5US5y29kR8 /OO9BSHldezFVIIKlWHMwRfdFGx3LTxgGp7QsLuUkRIDhqZQVp2YGJjn/Sg/xijworwXtJ lhSjuAJpDidRfinVRQzwX1Xa5HppDb428PaZTRBijnZ9I27XJ/yjx5NlVjopAMaUeCVY2Z ta625rj94uh9NaOxhdllmK1YbT0jkjEgWfUVuUOLfRrNhv9Ha+g6aRV8Yhl7FghhW+pB7W DFPf0HgWp3lvBUaKC8exXY3krpc97LvGtiMWGFZCZjaOJCE3I/9zJhhTv3cq8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606515; a=rsa-sha256; cv=none; b=bHY/bMQN/XNk2Tzt7Oo9H9xN9nLccZv889+CEVkK4VOLMbv1p86ZxgRS7E0WjtQrvmK1t0 JA/yNC97zBmlunlpYeek65hwYStPub4WBFN87IhbsqAH9+hlC/kGEcCBSbMDhITFO9sUlz r3TzuzxDFOa+CQkq1IsdedocsgCa/HG1A2Lt9OhKnl+LjUgNF3kAPNY8hcGIwQh57i2wts BA6K/GnlRtKYxwhIDU8SbkqBvJrMKxndqjjwThBEHuvxo2ATNPKsv/OX79clj2vOZeVPE4 /Mosx5TIYaox9bvIvG9J7b9UM01x3ChGnX8QeJAdIMyp4R4HF8o/F3eRtLIxwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2q2Jzjzw3l; Sat, 04 Oct 2025 19:35: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 594JZFwL079179; Sat, 4 Oct 2025 19:35:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZFMq079176; Sat, 4 Oct 2025 19:35:15 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:15 GMT Message-Id: <202510041935.594JZFMq079176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d114dc0e2260 - stable/15 - pw: Use copy_file_range() when copying skeleton files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d114dc0e226011272738bcf35b72ce9ae2bfb98d Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d114dc0e226011272738bcf35b72ce9ae2bfb98d commit d114dc0e226011272738bcf35b72ce9ae2bfb98d Author: Mark Johnston AuthorDate: 2025-09-18 22:39:39 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 pw: Use copy_file_range() when copying skeleton files As a bonus, check for I/O errors and print them to standard error. Reviewed by: bapt, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52588 (cherry picked from commit a03d150a3d44c49344ebd0862defd1a5ad1f524e) --- usr.sbin/pw/cpdir.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c index 63068cab000c..3839a039495a 100644 --- a/usr.sbin/pw/cpdir.c +++ b/usr.sbin/pw/cpdir.c @@ -36,10 +36,10 @@ #include "pw.h" void -copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid, +copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, gid_t gid, int flags) { - char *p, lnk[MAXPATHLEN], copybuf[4096]; + char *p, lnk[MAXPATHLEN]; int len, homefd, srcfd, destfd; ssize_t sz; struct stat st; @@ -120,8 +120,12 @@ copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid, continue; } - while ((sz = read(srcfd, copybuf, sizeof(copybuf))) > 0) - write(destfd, copybuf, sz); + do { + sz = copy_file_range(srcfd, NULL, destfd, NULL, + SSIZE_MAX, 0); + } while (sz > 0); + if (sz < 0) + warn("copy_file_range"); close(srcfd); /* From nobody Sat Oct 4 19:35:16 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfG2r6Qqxz69ftx; Sat, 04 Oct 2025 19:35: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfG2r3slqz3r40; Sat, 04 Oct 2025 19:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XbiAry+8thT0nLJLSoZvDTmTcTVYU1JMbq0j+UhcULE=; b=rKRPggExqwIbWvTxI4TQFJtPrMGVtkh53TSXL3c+djvVoBHr9vCsmlrPiCEPs2nyEX4HLN p3GvqQSy5eI4NW1BLNsvRhJA0mC7/QfOKCQdN45Fic7eSfj9oqysnyRvxsZAfCI6LAKaU6 xkhVusOKLTraIjo1df0z/MrVN7A+n58VditsVbWqwjaWnzNxpDVnGmn4gunG9eVBauhFWw Pfq9HMaJKqu+HU6KkZyqGcH+Mi/n+7k1lbLQ3CdXOjrWu9ZOkwhVxbi8ZdBls4W8T7GPUn UFL4pey+m1z2tTQAL/mgna/t/6MsIwMKQy3pXn0bsQyYW1fZ/FeUKqJbBFZcAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759606516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XbiAry+8thT0nLJLSoZvDTmTcTVYU1JMbq0j+UhcULE=; b=sN9bmBYAskVpeI7hpByE00lgFK4QSJHxlVlSe+yfT2zwTVrqLqCbayl54qNNiX8rODRLdR 5ZQvG+TwCNtEwRMXqBGOpTu3t4E165Kj9Y4ZHntOo85pxBjrg95vpKIs9NPvFfJ6fQDgsl 3cKIC3CjIOXa9qUFLcsOpdO4xQS6jDNg4Bm4DVijBSi/FJTHljUJElmm+POmfEtnMcgJT2 yuNdGUtO1RXjE61sPAkMHeYQ99CUfQRIY2CJZ129DSsO8rwEIdq4QFxbbXmj/XWz8j1HUW vBsqdsVXojFUclPMIJBnAkKORxPSIuGN9r3EmtYvADk1rhW3uQuIlo1mN96csQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759606516; a=rsa-sha256; cv=none; b=pRYJJIDg3hgkY5B+AqBedSrXtYW6rxFMgtKrfU2a4FJmbOx+oU0LMvZco2L88qt3ignJPc DB9nq9kl95S6SMw1bKC+Z2qtTApRoA1y5+rtnXfh90/kCTAlATCB2OPK/1WUX/i8tAxS0s zJDuISZ+xW+sXTQmfZtuEiJAtEomGm2vf2FGvb9UPjLBOi7ytsVM20S19A6v1qnnWlji8d PmTM4Y36kRzRLer8NqtXy1UnXStznB7nsk8kw2F0Lkp3R2riAkRGQohvBeEen9ixOCQgKN vuz3Y5SCRIN/6isOC55JJAxKVyMGrqDc6mEd9d01NOLVP6OBPCNwcCTCEeMFZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfG2r3QFwzvkg; Sat, 04 Oct 2025 19:35: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 594JZGDX079211; Sat, 4 Oct 2025 19:35:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594JZG5M079208; Sat, 4 Oct 2025 19:35:16 GMT (envelope-from git) Date: Sat, 4 Oct 2025 19:35:16 GMT Message-Id: <202510041935.594JZG5M079208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1efb9810ba8c - stable/15 - pw: Add a metalog output mode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1efb9810ba8caa550e0b8459117a36fde0daaec9 Auto-Submitted: auto-generated The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1efb9810ba8caa550e0b8459117a36fde0daaec9 commit 1efb9810ba8caa550e0b8459117a36fde0daaec9 Author: Mark Johnston AuthorDate: 2025-09-18 22:40:00 +0000 Commit: Mark Johnston CommitDate: 2025-10-04 19:34:57 +0000 pw: Add a metalog output mode When creating OS images as a non-root user, it may be useful to pre-create users in the staged tree. The useradd operation adds files to the new user's home directory, copied from the skeleton directory (/usr/share/skel), which makes it inconvient for use in this scenario since the added files are not recorded in the mtree metalog. To cover this gap, this change adds a new -M option to pw's useradd operation, causing pw to add mtree entries for newly added files. Extend an existing regression test to validate this mode. Reviewed by: bapt, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52590 (cherry picked from commit 182ed3c0755f1bf161d8be02016b5f6cf9b57556) --- usr.sbin/pw/cpdir.c | 43 +++++++++++++++++++++------------ usr.sbin/pw/pw.8 | 16 +++++++++++++ usr.sbin/pw/pw.c | 30 +++++++++++++++++++++-- usr.sbin/pw/pw.h | 5 ++++ usr.sbin/pw/pw_user.c | 9 ++++++- usr.sbin/pw/pw_utils.c | 46 ++++++++++++++++++++++++++++++++++++ usr.sbin/pw/pwupd.h | 1 + usr.sbin/pw/tests/pw_useradd_test.sh | 20 ++++++++++++---- 8 files changed, 148 insertions(+), 22 deletions(-) diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c index 3839a039495a..979323d64342 100644 --- a/usr.sbin/pw/cpdir.c +++ b/usr.sbin/pw/cpdir.c @@ -40,49 +40,48 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, gid_t gid, int flags) { char *p, lnk[MAXPATHLEN]; - int len, homefd, srcfd, destfd; + int len, srcfd, destfd; ssize_t sz; struct stat st; struct dirent *e; DIR *d; + mode_t pumask; if (*dir == '/') dir++; + pumask = umask(0); + umask(pumask); + if (mkdirat(rootfd, dir, mode) != 0) { - mode_t pumask; if (errno != EEXIST) { warn("mkdir(%s)", dir); return; } - pumask = umask(0); - umask(pumask); - if (fchmodat(rootfd, dir, mode & ~pumask, AT_SYMLINK_NOFOLLOW) == -1) warn("chmod(%s)", dir); } - if (fchownat(rootfd, dir, uid, gid, AT_SYMLINK_NOFOLLOW) == -1) warn("chown(%s)", dir); - if (flags > 0 && chflagsat(rootfd, dir, flags, AT_SYMLINK_NOFOLLOW) == -1) warn("chflags(%s)", dir); + metalog_emit(dir, (mode | S_IFDIR) & ~pumask, uid, gid, flags); if (skelfd == -1) return; - homefd = openat(rootfd, dir, O_DIRECTORY); if ((d = fdopendir(skelfd)) == NULL) { close(skelfd); - close(homefd); return; } while ((e = readdir(d)) != NULL) { + char path[MAXPATHLEN]; + if (strcmp(e->d_name, ".") == 0 || strcmp(e->d_name, "..") == 0) continue; @@ -92,19 +91,32 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, if (strncmp(p, "dot.", 4) == 0) /* Conversion */ p += 3; + (void)snprintf(path, sizeof(path), "%s/%s", dir, p); if (S_ISDIR(st.st_mode)) { - copymkdir(homefd, p, openat(skelfd, e->d_name, O_DIRECTORY), - st.st_mode & _DEF_DIRMODE, uid, gid, st.st_flags); + int fd; + + fd = openat(skelfd, e->d_name, O_DIRECTORY); + if (fd == -1) { + warn("openat(%s)", e->d_name); + continue; + } + copymkdir(rootfd, path, fd, st.st_mode & _DEF_DIRMODE, + uid, gid, st.st_flags); continue; } if (S_ISLNK(st.st_mode) && - (len = readlinkat(skelfd, e->d_name, lnk, sizeof(lnk) -1)) + (len = readlinkat(skelfd, e->d_name, lnk, sizeof(lnk) - 1)) != -1) { lnk[len] = '\0'; - symlinkat(lnk, homefd, p); - fchownat(homefd, p, uid, gid, AT_SYMLINK_NOFOLLOW); + if (symlinkat(lnk, rootfd, path) != 0) + warn("symlink(%s)", path); + else if (fchownat(rootfd, path, uid, gid, + AT_SYMLINK_NOFOLLOW) != 0) + warn("chown(%s)", path); + metalog_emit_symlink(path, lnk, st.st_mode & ~pumask, + uid, gid); continue; } @@ -113,7 +125,7 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, if ((srcfd = openat(skelfd, e->d_name, O_RDONLY)) == -1) continue; - destfd = openat(homefd, p, O_RDWR | O_CREAT | O_EXCL, + destfd = openat(rootfd, path, O_RDWR | O_CREAT | O_EXCL, st.st_mode); if (destfd == -1) { close(srcfd); @@ -135,6 +147,7 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, warn("chown(%s)", p); if (fchflags(destfd, st.st_flags) != 0) warn("chflags(%s)", p); + metalog_emit(path, st.st_mode & ~pumask, uid, gid, st.st_flags); close(destfd); } closedir(d); diff --git a/usr.sbin/pw/pw.8 b/usr.sbin/pw/pw.8 index 5eae810b6732..f6d9ebca6308 100644 --- a/usr.sbin/pw/pw.8 +++ b/usr.sbin/pw/pw.8 @@ -30,6 +30,7 @@ .Nd create, remove, modify & display system users and groups .Sh SYNOPSIS .Nm +.Op Fl M Ar metalog .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Cm useradd @@ -464,6 +465,21 @@ option, bearing the name of the new account. This can be overridden by the .Fl d option on the command line, if desired. +.It Fl M Ar metalog +Specify a path to a +.Xr mtree 5 +metalog file. +.Nm +will add entries for all files added to a user's home directory. +This is useful when building images as a non-root user, as the +metalog can be used as input to +.Xr tar 1 +or +.Xr makefs 8 . +Note that this option must precede the +.Ql useradd +string on the command line, otherwise it will be interpreted as the mode +option. .It Fl M Ar mode Create the user's home directory with the specified .Ar mode , diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 6f59e392bdd0..7cb5dd160e12 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -132,7 +132,11 @@ main(int argc, char *argv[]) while (argc > 1) { if (*argv[1] == '-') { /* - * Special case, allow pw -V

[args] for scripts etc. + * Special case, allow pw -V [args] for + * scripts etc. + * + * The -M option before the keyword is handled + * differently from -M after a keyword. */ arg = argv[1][1]; if (arg == 'V' || arg == 'R') { @@ -164,6 +168,23 @@ main(int argc, char *argv[]) "%s%s", optarg, arg == 'R' ? _PATH_PWD : ""); conf.altroot = true; + } else if (mode == -1 && which == -1 && arg == 'M') { + int fd; + + optarg = &argv[1][2]; + if (*optarg == '\0') { + optarg = argv[2]; + ++argv; + --argc; + } + fd = open(optarg, + O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, + 0644); + if (fd == -1) + errx(EX_OSERR, + "Cannot open metalog `%s'", + optarg); + conf.metalog = fdopen(fd, "ae"); } else break; } else if (mode == -1 && (tmp = getindex(Modes, argv[1])) != -1) @@ -195,6 +216,10 @@ main(int argc, char *argv[]) if (conf.rootfd == -1) errx(EXIT_FAILURE, "Unable to open '%s'", conf.rootdir); + if (conf.metalog != NULL && (which != W_USER || mode != M_ADD)) + errx(EXIT_FAILURE, + "metalog can only be specified with 'useradd'"); + return (cmdfunc[which][mode](argc, argv, arg1)); } @@ -233,10 +258,11 @@ cmdhelp(int mode, int which) static const char *help[W_NUM][M_NUM] = { { - "usage: pw useradd [name] [switches]\n" + "usage: pw [-M metalog] useradd [name] [switches]\n" "\t-V etcdir alternate /etc location\n" "\t-R rootdir alternate root directory\n" "\t-C config configuration file\n" + "\t-M metalog mtree file, must precede 'useradd'\n" "\t-q quiet operation\n" " Adding users:\n" "\t-n name login name\n" diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index c3725693f91d..ceb843d79503 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -70,6 +70,11 @@ struct userconf *get_userconfig(const char *cfg); struct userconf *read_userconfig(char const * file); int write_userconfig(struct userconf *cnf, char const * file); +void metalog_emit(const char *path, mode_t mode, uid_t uid, gid_t gid, + int flags); +void metalog_emit_symlink(const char *path, const char *target, mode_t mode, + uid_t uid, gid_t gid); + int pw_group_add(int argc, char **argv, char *name); int pw_group_del(int argc, char **argv, char *name); int pw_group_mod(int argc, char **argv, char *name); diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 007f750c7d1a..413eac4882cc 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -86,10 +86,13 @@ mkdir_home_parents(int dfd, const char *dir) { struct stat st; char *dirs, *tmp; + mode_t pumask; + + pumask = umask(0); + umask(pumask); if (*dir != '/') errx(EX_DATAERR, "invalid base directory for home '%s'", dir); - dir++; if (fstatat(dfd, dir, &st, 0) != -1) { @@ -120,6 +123,9 @@ mkdir_home_parents(int dfd, const char *dir) dirs); if (fchownat(dfd, dirs, 0, 0, 0) != 0) warn("chown(%s)", dirs); + metalog_emit(dir, + (_DEF_DIRMODE | S_IFDIR) & ~pumask, 0, 0, + 0); } *tmp = '/'; } @@ -129,6 +135,7 @@ mkdir_home_parents(int dfd, const char *dir) err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); if (fchownat(dfd, dirs, 0, 0, 0) != 0) warn("chown(%s)", dirs); + metalog_emit(dirs, (_DEF_DIRMODE | S_IFDIR) & ~pumask, 0, 0, 0); } free(dirs); diff --git a/usr.sbin/pw/pw_utils.c b/usr.sbin/pw/pw_utils.c index 9be1656bcfe1..87dd421ca8a3 100644 --- a/usr.sbin/pw/pw_utils.c +++ b/usr.sbin/pw/pw_utils.c @@ -92,3 +92,49 @@ nis_update(void) { errx(i, "make exited with status %d", i); return (i); } + +static void +metalog_emit_record(const char *path, const char *target, mode_t mode, + uid_t uid, gid_t gid, int flags) +{ + const char *flagstr, *type; + int error; + + if (conf.metalog == NULL) + return; + + if (target != NULL) + type = "link"; + else if (S_ISDIR(mode)) + type = "dir"; + else if (S_ISREG(mode)) + type = "file"; + else + errx(1, "metalog_emit: unhandled file type for %s", path); + + flagstr = fflagstostr(flags & + (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)); + if (flagstr == NULL) + errx(1, "metalog_emit: fflagstostr failed"); + + error = fprintf(conf.metalog, + "./%s type=%s mode=0%03o uid=%u gid=%u%s%s%s%s\n", + path, type, mode & ACCESSPERMS, uid, gid, + target != NULL ? " link=" : "", target != NULL ? target : "", + *flagstr != '\0' ? " flags=" : "", *flagstr != '\0' ? flagstr : ""); + if (error < 0) + errx(1, "metalog_emit: write error"); +} + +void +metalog_emit(const char *path, mode_t mode, uid_t uid, gid_t gid, int flags) +{ + metalog_emit_record(path, NULL, mode, uid, gid, flags); +} + +void +metalog_emit_symlink(const char *path, const char *target, mode_t mode, + uid_t uid, gid_t gid) +{ + metalog_emit_record(path, target, mode, uid, gid, 0); +} diff --git a/usr.sbin/pw/pwupd.h b/usr.sbin/pw/pwupd.h index a39a022ca309..605c51dcec2a 100644 --- a/usr.sbin/pw/pwupd.h +++ b/usr.sbin/pw/pwupd.h @@ -76,6 +76,7 @@ struct userconf { struct pwconf { char rootdir[MAXPATHLEN]; char etcpath[MAXPATHLEN]; + FILE *metalog; int fd; int rootfd; bool altroot; diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index 6413c063d482..75e96a64ba8e 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -1,4 +1,3 @@ - # Import helper functions . $(atf_get_srcdir)/helper_functions.shin @@ -357,15 +356,28 @@ user_add_skel_body() { echo "c" > ${HOME}/skel/c/d/dot.c mkdir ${HOME}/home ln -sf /nonexistent ${HOME}/skel/c/foo - atf_check -s exit:0 ${RPW} useradd foo -k /skel -m + atf_check -s exit:0 ${RPW} -M METALOG useradd foo -k /skel -m test -d ${HOME}/home/foo || atf_fail "Directory not created" test -f ${HOME}/home/foo/.a || atf_fail "File not created" atf_check -o file:${HOME}/skel/.a -s exit:0 cat ${HOME}/home/foo/.a atf_check -o file:${HOME}/skel/b -s exit:0 cat ${HOME}/home/foo/b - test -d ${HOME}/home/foo/c || atf_fail "Dotted directory in skel not copied" - test -d ${HOME}/home/foo/.plop || atf_fail "Directory in skell not created" + test -d ${HOME}/home/foo/c || atf_fail "Directory in skel not copied" + test -d ${HOME}/home/foo/.plop || atf_fail "Dotted directory in skel not created" atf_check -o inline:"/nonexistent\n" -s ignore readlink -f ${HOME}/home/foo/c/foo atf_check -o file:${HOME}/skel/c/d/dot.c -s exit:0 cat ${HOME}/home/foo/c/d/.c + + cat <<__EOF__ >METALOG.expected +./home/foo type=dir mode=0755 uid=1001 gid=1001 +./home/foo/.a type=file mode=0644 uid=1001 gid=1001 +./home/foo/.plop type=dir mode=0755 uid=1001 gid=1001 +./home/foo/b type=file mode=0644 uid=1001 gid=1001 +./home/foo/c type=dir mode=0755 uid=1001 gid=1001 +./home/foo/c/d type=dir mode=0755 uid=1001 gid=1001 +./home/foo/c/d/.c type=file mode=0644 uid=1001 gid=1001 +./home/foo/c/foo type=link mode=0755 uid=1001 gid=1001 link=/nonexistent +__EOF__ + atf_check -o save:METALOG.out sort METALOG + atf_check diff METALOG.out METALOG.expected } atf_test_case user_add_uid0 From nobody Sat Oct 4 23:19:10 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfM1B2ZdNz6B7dn; Sat, 04 Oct 2025 23:19: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfM1B1yyQz3MyQ; Sat, 04 Oct 2025 23:19:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759619950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Mg2gbphbL4ral0pPK4xtrzw7tvahtJpaUhSr4jCjYw=; b=ooACTp8VApDQwA7Dib1ebG/OQ2pWwhkU+9okielzLj1YWwgCuT9SDBVmITDwTyx0+Vjws7 QHsp0jyi6iCOGGS9e0UXcmd2RGgAZtJj+fSfu1oqrkC0ThhG19dO987f8UtPoJGA/fTJdZ eS1VkXTk16If0BGUT0rWCwmEYuilej1ENT5Lf9o86ze5iZUG/92A/sZm//XsH6U/gfdmVD eB60ny3B+69/2ThFFaiq6iMbUy8sN+70K3vFYm6toANpCmDvO7d5sQn9y+m8vA7P4sEkr6 TO3QWa8AvyHK8vWDJp7hzhPQ4glsdxtiNpz8XU0pwS6CZLksT13CJ1RIqh4YGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759619950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Mg2gbphbL4ral0pPK4xtrzw7tvahtJpaUhSr4jCjYw=; b=iKfrvwQftfWEfTLgvjx0uThTNFRWP8K4LC4HNTfzkDbIdfJCwRo2imZonDkXRPE2zZH1xj Pt9iuoAbQwl5wEEruf6rp+VgwoabRH9HnZNj1Dj/BwCYVD0rI5HlyMZr3thh55uB1xgLNV nL8VAqT4i6hPFgg8v0GYvUxXwXeFF/C5mdLFWyn01lo2yFXMR8Knfs3Ear4qqKHCzyvLDx bKKkBz2B06xgOgWLdw5hbGnGsNykk1zTdZbN1c3dmpxmyFCOyY9GE+u8jKBdNDr6cNx+ED l0V/iEyCEDYJ0/ERJi5YlFDi9SCEtdrrwuIgk3r4Xvp3pnDmUyqco710H/CeCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759619950; a=rsa-sha256; cv=none; b=L42Y4nmL186eJ3RrYgtoxxrzIatsV5OirC/k0hR7c+pnVsw3bcF0rTXeHATu2bI0FYx7lh Sx/6rJDMREILXfLXno4lbfAxlfl36wymY1/FTjYD6bWLGRSwpEGK3KTC2kH/Oo/bWcBUV8 gqKNDYVul7lj79c0R1oYGk9CTlviaRObfGbCJf5pthOB/TVuK0/btIlhiFwDYltnfEJ/7d v8zXhcBsl0qQ5u06edUKXowYaaTk1v6/qtTyOCOGyEPvH35MQWjl1mYdc9lYE6++/RJ+8b nZH8ndm9XMnU8g3h8XGRHXsJZ8KSHG9Ge0rvV2PiXM3NRCcEvMw0F89hlY6jlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfM1B1YRDz12sX; Sat, 04 Oct 2025 23:19: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 594NJAYY095110; Sat, 4 Oct 2025 23:19:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594NJANn095107; Sat, 4 Oct 2025 23:19:10 GMT (envelope-from git) Date: Sat, 4 Oct 2025 23:19:10 GMT Message-Id: <202510042319.594NJANn095107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: d8e73f45fc5f - stable/14 - bsdinstall: Add loader.efi to all ESPs we create List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d8e73f45fc5fe736ad398d15f547af593cc84e6f Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d8e73f45fc5fe736ad398d15f547af593cc84e6f commit d8e73f45fc5fe736ad398d15f547af593cc84e6f Author: Warner Losh AuthorDate: 2025-09-30 02:46:57 +0000 Commit: Warner Losh CommitDate: 2025-10-04 23:17:36 +0000 bsdinstall: Add loader.efi to all ESPs we create For proper redundancy, add copies of loader.efi to each of the ESPs we create when we create multi-volume ZFS datasets. zfsboot creates a list of secondary ESPs, while bootpart doesn't create any (it's the UFS partitioning tool) because we don't supporg UFS over gmirror. The primary ESP is mounted and is what we use efibootmgr to boot from. The redundant copies allow the system to boot if the primary disks fails. Sponsored by: Netflix MFC After: 2 days PR: 208802 Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D52780 (cherry picked from commit 494de51bc0074472d1b01604f085daea0844f240) --- usr.sbin/bsdinstall/scripts/auto | 3 ++ usr.sbin/bsdinstall/scripts/bootconfig | 61 ++++++++++++++++++++++------------ usr.sbin/bsdinstall/scripts/zfsboot | 28 +++++++++------- 3 files changed, 59 insertions(+), 33 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index 5375b73e57d4..1b9b047dae0e 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -178,6 +178,9 @@ environment_save rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC +# Reset the ESP list +: > ${TMPDIR:-"/tmp"}/bsdinstall-esps + # With pkgbase, pkg OOM has been observed with QEMU-default 128 MiB memory size. # Ensure we have at least about 256 MiB (with an allowance for rounding etc.). physmem=$(($(sysctl -n hw.physmem) / 1048576)) diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 6438f7ef1fca..1d8fb8657135 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -60,6 +60,24 @@ dialog_uefi_entryname() 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD } +# Copy to the normal FreeBSD location. Also copy to the default location if it +# doesn't exist. This covers setups where UEFI NV variables can't be set and +# some buggy firmware, while preserving complex UEFI setups for multiple booting +# (rEFInd, etc). +uefi_copy_loader() +{ + local ldr=$1 + local freebsd_dir=$2 + local default_dir=$3 + local dest=$4 + + mkdir -p "${freebsd_dir}" "${default_dir}" + cp "${ldr}" "${freebsd_dir}" + if [ ! -f "${default_dir}/${dest}" ]; then + cp "${ldr}" "${default_dir}/${dest}" + fi +} + update_uefi_bootentry() { nentries=$(efibootmgr | grep -c "${EFI_LABEL_NAME}$") @@ -110,6 +128,7 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then *) die "Unsupported arch $(uname -m) for UEFI install" esac + # Support the weird 32-bit firmware loading 64-bit kernels if [ `sysctl -n machdep.efi_arch` == i386 ]; then ARCHBOOTNAME=ia32 file=loader_ia32.efi @@ -117,31 +136,31 @@ if [ -n "$(awk '{if ($2=="/boot/efi") printf("%s\n",$1);}' $PATH_FSTAB)" ]; then file=loader.efi fi - BOOTDIR="/efi/boot" - BOOTNAME="${BOOTDIR}/boot${ARCHBOOTNAME}.efi" - FREEBSD_BOOTDIR="/efi/freebsd" - FREEBSD_BOOTNAME="${FREEBSD_BOOTDIR}/${file}" + # Copy the boot loader mntpt="$BSDINSTALL_CHROOT/boot/efi" - f_dprintf "Installing ${file} onto ESP" - mkdir -p "${mntpt}/${FREEBSD_BOOTDIR}" "${mntpt}/${BOOTDIR}" - cp "$BSDINSTALL_CHROOT/boot/${file}" "${mntpt}/${FREEBSD_BOOTNAME}" - - # - # UEFI defines a way to specifically select what to boot - # (which we do via efibootmgr). However, if we booted from an ia32 - # UEFI environment, we wouldn't have access to efirt. In addition, - # virtual environments often times lack support for the NV variables - # efibootmgr sets, and some UEFI implementations have features that - # interfere with the setting of these variables. To combat that, we - # install the default removable media boot file if it doesn't exist. - # We don't install it all the time since that can interfere with other - # installations on the drive (like rEFInd). - # - if [ ! -f "${mntpt}/${BOOTNAME}" ]; then - cp "$BSDINSTALL_CHROOT/boot/${file}" "${mntpt}/${BOOTNAME}" + uefi_copy_loader "$BSDINSTALL_CHROOT/boot/${file}" \ + "${mntpt}/efi/freebsd" "${mntpt}/efi/boot" \ + boot${ARCHBOOTNAME}.efi + + # zfsboot records the extra esp partitions it creates to -esps. These + # are newfs'd at the time of creation. We don't support installing ufs + # over gmirror, so we only do this for ZFS. + esps=${TMPDIR:-"/tmp"}/bsdinstall-esps + if [ -f "$esps" ]; then + mntpt=$(mktemp -d -t bsdinstall-esp) + for dev in $(cat $esps); do + f_dprintf "Installing ${file} onto redundant ESP ${dev}" + mount -t msdos "$dev" "$mntpt" + uefi_copy_loader "$BSDINSTALL_CHROOT/boot/${file}" \ + "${mntpt}/efi/freebsd" "${mntpt}/efi/boot" \ + boot${ARCHBOOTNAME}.efi + umount "$mntpt" + done + rmdir "${mntpt}" fi + # Try to set the UEFI NV BootXXXX variables to recod the boot location if [ "$BSDINSTALL_CONFIGCURRENT" ] && [ "$ARCHBOOTNAME" != ia32 ]; then update_uefi_bootentry fi diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 918e77db6a9d..fe1c522c5399 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -760,6 +760,7 @@ zfs_create_diskpart() { local funcname=zfs_create_diskpart local disk="$1" index="$2" + local efibootpart # Check arguments if [ ! "$disk" ]; then @@ -867,18 +868,22 @@ zfs_create_diskpart() $disk || return $FAILURE # We'll configure the ESP in bootconfig - if [ -z "$efibootpart" ]; then - efibootpart="/dev/gpt/efiboot$index" - f_dprintf "$funcname: configuring ESP at [%s]" \ - "${efibootpart}" - - f_eval_catch $funcname newfs_msdos "$NEWFS_ESP"\ - "$efibootpart" \ - || return $FAILURE + # Note: This will always be p1 + efibootpart="/dev/gpt/efiboot$index" + f_dprintf "$funcname: configuring ESP at [%s]" \ + "${efibootpart}" + + f_eval_catch $funcname newfs_msdos "$NEWFS_ESP"\ + "$efibootpart" \ + || return $FAILURE + if [ $index -eq 0 ]; then f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - $efibootpart /boot/efi msdosfs \ - rw 2 2 "$BSDINSTALL_TMPETC/fstab" \ - || return $FAILURE + $efibootpart /boot/efi msdosfs \ + rw 2 2 "$BSDINSTALL_TMPETC/fstab" \ + || return $FAILURE + else + # Record the extra ones + echo "${efibootpart}" >> ${TMPDIR:-"/tmp"}/bsdinstall-esps fi fi @@ -1021,7 +1026,6 @@ zfs_create_boot() local isswapmirror local bootpart targetpart swappart # Set by zfs_create_diskpart() below local create_options - local efibootpart # # Pedantic checks; should never be seen From nobody Sun Oct 5 05:21:07 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfW2q6f3Vz6BbjJ; Sun, 05 Oct 2025 05:21: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfW2q63pvz45L6; Sun, 05 Oct 2025 05:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759641667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lV17zDdj3zfzuIwWUBNvZPGu1SylquiTRLvtOYP/FtM=; b=BV+FrGJqeSjfmbIXuct33uYTabxwgpHvNG3QVlD5EyoIJoNiSmcCqmR98dFlHNmHzORK6c HdtEnZc1cNHycpHMXzq2TKIc79j08X9JL3wAL/VYlZJA43hOYpcXJlK0cGxbxKvsT204ma Ec0kcNWA75M8AZtV4QoLJOPxtPtXtfDBYfTWcgGXnhcXSUBl8hiRkxUcVYj+xZ36KKPOl4 mR3fswb3//GvaeA1fRzCi0j7V2giL5g1PRKFIcvCeuqQzfgu7SXuS1GrCUmMmbv4AJinBp +hFc/cZwvKG2TmYYALKT/BGDHQFyA+sVLEXTm4QG4gumn/tql8JEVFtovOGKjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759641667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lV17zDdj3zfzuIwWUBNvZPGu1SylquiTRLvtOYP/FtM=; b=PZLX4CU154SVFJfG0mdEJx9iZ/JivlLNVn/K6jqbtAkPGK6Kz4Du+Kepl0m/eXZfkcPPKu 4sXw7JZ/1hN/K8uEbFg26zE7iBlAW4/Gx9PfOj4Nuq05akt49wcTeGFTyp9nVZZaaTlvHx vztxoC1xd/0hHxsDYwVZLl8ihMJ4r0jTWntfasyiG/gYprVYfULp3ntMzPDZJ0HMXLzyOT a42fe64FWKyUUyeZzKzgemBtoaL2lGsCbbC8w6Hxh/uwn18Qxst50k9OVEJUHff6e1QcPn 3u3qfQlw4sv+urvO9hsNM6GOyrpR/kXXnL3ln9tiYqzNALE4OGIE4xM+R7aEwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759641667; a=rsa-sha256; cv=none; b=wZ9XvUehkA5ece0ErM8annKvW6VUkMJTGA07AaPvgahCWhqWVi+WPWx1+zOLqTz6/61o6T arqpFHoauq46233GYjnJW8POfqq5Xn5LerRcczpaT7PNWDgPBzDKp3NiYa0IMmAGtMv7eo ee4Xs99EmmDOdsdd18C2LiiVw8SwJMY+pkRQpzdQMR2BL0vd4ly3DnpVLcq+HD/HxafVc4 dxlaVbwVHb9u0rXeh5CWwUun0lSd8hj4cR6pjRAD/seLDj7B3I2oozHfUcJrRWRIYVnx8f K4KM5QzaHYSlubIUhTX4AtzUKbV7V7isn4aR/WX3+gyBg3h0XoUEtWRx4WyFQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfW2q5frQz1D6W; Sun, 05 Oct 2025 05:21: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 5955L7es085287; Sun, 5 Oct 2025 05:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5955L7Q7085284; Sun, 5 Oct 2025 05:21:07 GMT (envelope-from git) Date: Sun, 5 Oct 2025 05:21:07 GMT Message-Id: <202510050521.5955L7Q7085284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: cfcd89e6cc15 - stable/15 - libc: Move NLS catalogues to the locales packages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cfcd89e6cc15c17d323416f26dbf634f99a96b02 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=cfcd89e6cc15c17d323416f26dbf634f99a96b02 commit cfcd89e6cc15c17d323416f26dbf634f99a96b02 Author: Lexi Winter AuthorDate: 2025-10-05 05:03:21 +0000 Commit: Lexi Winter CommitDate: 2025-10-05 05:14:15 +0000 libc: Move NLS catalogues to the locales packages We don't want to put these in clibs (where libc is) since they are not critical to system operation. Move them to locales, since anyone who is interested in translated versions of strerror() is going to have that installed anyway. While here, add some more documentation to bsd.nls.mk, particularly the NLSPACKAGE option. MFC after: 3 seconds Reviewed by: manu, kib Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52898 (cherry picked from commit 0242d4c3aea4b56ba76da440d1948d9e3d19ae87) --- lib/libc/nls/Makefile.inc | 5 +++++ share/mk/bsd.nls.mk | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/libc/nls/Makefile.inc b/lib/libc/nls/Makefile.inc index f26e04c187a5..c211026aba72 100644 --- a/lib/libc/nls/Makefile.inc +++ b/lib/libc/nls/Makefile.inc @@ -12,6 +12,11 @@ MAN+= catclose.3 catgets.3 catopen.3 # for translators. NLSNAME= libc +# We don't want libc's NLS catalogues to be installed in the clibs package. +# Put them in locales instead, since anyone interested in NLS will have +# that installed. +NLSPACKAGE= locales + NLS+= be_BY.UTF-8 NLS+= ca_ES.ISO8859-1 NLS+= de_DE.ISO8859-1 diff --git a/share/mk/bsd.nls.mk b/share/mk/bsd.nls.mk index bd13fe56679d..5a28e1cdd026 100644 --- a/share/mk/bsd.nls.mk +++ b/share/mk/bsd.nls.mk @@ -1,6 +1,8 @@ # -# This include file handles building and installing Native -# Language Support (NLS) catalogs +# Handle building and installing Native Language Support (NLS) catalogs. +# This is implemented using a files group called "NLS", +# so any per-group options that bsd.files.mk supports can be used here +# with the prefix "NLS". # # +++ variables +++ # @@ -17,6 +19,9 @@ # NLSMODE National Language Support files mode. [${NOBINMODE}] # # NLSOWN National Language Support files owner. [${SHAREOWN}] +# +# NLSPACKAGE Package to install the NLS files in. +# [${PACKAGE}, or "utilities" if not set] .if !target(____) .error bsd.nls.mk cannot be included directly. From nobody Sun Oct 5 05:33:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfWKX0pxTz6BdBG; Sun, 05 Oct 2025 05:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfWKW4C58z48kx; Sun, 05 Oct 2025 05:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759642431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3TflpYGBqEKDW0pjCFFbcXEhKXAmt55G9Ln3Rs76y2k=; b=pU13YFTEqvOKbxoPizzbuTttD6Rn+mtD+PzDW7bMhGk55dcGMgjS0ZbyuMIc4djgaWkAX2 gLfYCYuRqUw0FFZoSHsJX4/GebW0vVLySnQxrnr8iMnUcNDwHIGmRe5GgriGfIpfQRBrmy 57/4san45HYWuGWWHgJmLU50cl+nB+aUUrjw+9bQ7P9I0ZrxeBzNWU1tOn/L57ic7IMPDR cEd5CXGXD40ZGjCCkq0MkjfRe6c2hFKkTzldAaeIj9PJ7jeQYgA4QLGxMyLIwZ9pqR/I10 QlrG2ytml0FitQKVVCXBzvvMeWb+Y6Arl3vYzmh6xutum0a9GrQneworLoL3eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759642431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3TflpYGBqEKDW0pjCFFbcXEhKXAmt55G9Ln3Rs76y2k=; b=cWGFo5CG7dWZPLTmDcIdegYKLoFSTPK9aXgM3jLkYqmXU8cImS7IC5Ms9EegsRKAecJBGY BkyYkda6XjsOHiJN/bJIBF54RgdgflAOEtWapXglIyCWHVe0qQtltnP1KH71uVjvRMe0MU Iz8bUdnnxHErNa2SycsGbzFVIuqEXLkkRIFsvEO0oeO4azz8XHps/G5dqghFnNO0avNCV6 zyK6ZwCMBOZEtoQCiJAa/zGnTMGAOmBueTskDBEf8JEORMzGy1QMqXLt9K9NOzixqvoapP myFjgNuXJGzlfXC1XHRvY6Cbn2D5OS+s1AI5Ym//tet7lByQY7gmTRRNdzbhnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759642431; a=rsa-sha256; cv=none; b=j/AioGLmfMbzgm/U0xPYSVoi48JktENJGuyH5vzKffYXqrSY+YzUyaJEj1JmY/6RLKSXho PDkcHiUmlBOXFWLXxC3xzWMjeZSDTGjEs8RzwztDY/Y4Z0Wd2cSpOvoWCXs/g3LB1/1LYk BQjhJcef/9vNwdyeYpHQCb2jKinvZLkAoWznPab6UiE5VxPEQXSI+EalmkVmqBaj++axfp zN+xMikx2deukn8ExDXNPLs4PiKCu5/nTnrafwcKYbNx8ViJ+FFaAGJ1i713A2LCrh6/C7 THJXduW5JQJwGa6DtkiIvE1GrQafTumpleK9UYDzRKpAxRSFQk9cZJjxsfLpVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfWKW3mSGz1DMS; Sun, 05 Oct 2025 05:33: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 5955XpN5010560; Sun, 5 Oct 2025 05:33:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5955XpxB010557; Sun, 5 Oct 2025 05:33:51 GMT (envelope-from git) Date: Sun, 5 Oct 2025 05:33:51 GMT Message-Id: <202510050533.5955XpxB010557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: 830684a523e4 - stable/15 - Makefile: Fix ordering for (update-)packages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 830684a523e43219ff1094b6009e2d7338e5b2dd Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=830684a523e43219ff1094b6009e2d7338e5b2dd commit 830684a523e43219ff1094b6009e2d7338e5b2dd Author: Lexi Winter AuthorDate: 2025-10-03 05:43:15 +0000 Commit: Lexi Winter CommitDate: 2025-10-05 05:24:54 +0000 Makefile: Fix ordering for (update-)packages The (update-)packages targets require buildworld and buildkernel to run first. Add some .ORDER statements to ensure this happens. This fixes 'make -j8 buildworld buildkernel packages'. PR: 289969 Reported by: yasu MFC after: 3 days Reviewed by: yasu, emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52877 (cherry picked from commit dfc9da6248491072e31f924f5ae6b6238603089a) --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 383430307495..664f31a48abf 100644 --- a/Makefile +++ b/Makefile @@ -219,6 +219,8 @@ META_TGT_WHITELIST+= build${libcompat} .ORDER: buildworld distribute .ORDER: buildworld distributeworld .ORDER: buildworld buildkernel +.ORDER: buildworld packages +.ORDER: buildworld update-packages .ORDER: distrib-dirs distribute .ORDER: distrib-dirs distributeworld .ORDER: distrib-dirs installworld @@ -232,6 +234,8 @@ META_TGT_WHITELIST+= build${libcompat} .ORDER: buildkernel installkernel.debug .ORDER: buildkernel reinstallkernel .ORDER: buildkernel reinstallkernel.debug +.ORDER: buildkernel packages +.ORDER: buildkernel update-packages .ORDER: kernel-toolchain buildkernel # Only sanitize PATH on FreeBSD. From nobody Sun Oct 5 05:33:52 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfWKY0fdFz6BdM7; Sun, 05 Oct 2025 05:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfWKX5Rwpz48WY; Sun, 05 Oct 2025 05:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759642432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/WeKxaCOKgF/pYQkDqMqf69g6Oii/OkaEwpfdrPlsns=; b=dwymMiLyx65HKl4gS10HCbPqL8oRIyGqLssWvI+OYZfQ4DHliT7AMGXM/60OQB5sQ7VlEE 6fybI5TaGmy3orY9mKeys5llFV2ubHdmu0xPrIm/W2o+EbbpibCkEJL2wrZEo4bknJhJ+S EwCnESjAQeXCnpkmxsyLeTLpkf1JC8BkOOp6h815MoW4yxBc78vvEep/X6NKKNrK48oRV9 8P6d45I8sML6YYx8x4ktEDkJGT0j14WLe52r19/XCLoe1X46n+zhlL/EDXEfysiQe0NBSl 7rdo/JRLcJi5qEcEQCLY12ow0lcXaeWmaaOhM3qhPPSSCsNRyaxeQVEmTKXlZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759642432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/WeKxaCOKgF/pYQkDqMqf69g6Oii/OkaEwpfdrPlsns=; b=eWo2oSgqJSviNz6cXZsbc8+vyrVD33T9fMIQSuU5COIWFlj+fIxaffI22s2Ouafd4YL4ni BLR4gS5yhqQTVZb77FrRih0RwvuTGMxVSegD4qm1daLFJkGK8JU+T0drb6Jr01gRz1dLrN b8Y+T+Xmn5j5WSJbTuGUc5cfwtGE2YhbvnQ0TLIEDkUQKpddVntLVUVEmvmLJgakhoFUIb SJmBTEYBAM3bOroqBWbtIIXFv+8Jtx4aBObJW3L+CxxYq/7S0bQSv5cyu4qF3Rmsq85I0/ DIF4u4jM+a4Q4P/ZBvD3Lg6lItBtAmejA6vZHHVrdDJHiUbDGlzznzHTVpK4PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759642432; a=rsa-sha256; cv=none; b=F/ghoCRxaAJQBMaagjXAOsxYD7NpFFpAGdWAxStPwmwLgmLN1SW7Q4KCuObJE55NREHo01 jc6SeqcO4ZVMFG/YL+jlTxS7YkKXlhZjcNxtWBp93hx6TVZkGuVlNm+hs7TkkJFlFWg/LI lIsdNe4bRYFID9LngiZPTM/f32QZ+Lo1HF8Kn5RyNRYopN4eU+Rp1j99m2CZzsENihD3Sc AGRWDr3WNBpoV5pQ8C6OhD5BHJApF5l3gglrS+HaLLg3oCAVjB4EEui6NrAQnCR55ZWqPj gigTjbSAfrhobQOMdYyPXLHDOrAs7Gyb1TcsD2ytNmkqbukjQpG3Mrcwkkse2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfWKX4ySpz1DPt; Sun, 05 Oct 2025 05:33: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 5955XqBd010600; Sun, 5 Oct 2025 05:33:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5955XqmI010597; Sun, 5 Oct 2025 05:33:52 GMT (envelope-from git) Date: Sun, 5 Oct 2025 05:33:52 GMT Message-Id: <202510050533.5955XqmI010597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: e42935e5871b - stable/15 - Makefile.inc1: Fix package-pkg with CROSS_TOOLCHAIN List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e42935e5871be01246133674427c682fa152a5fd Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=e42935e5871be01246133674427c682fa152a5fd commit e42935e5871be01246133674427c682fa152a5fd Author: Lexi Winter AuthorDate: 2025-10-04 16:50:56 +0000 Commit: Lexi Winter CommitDate: 2025-10-05 05:25:04 +0000 Makefile.inc1: Fix package-pkg with CROSS_TOOLCHAIN CROSS_TOOLCHAIN is used to build src with a different toolchain than the bundled one. Ports also has a CROSS_TOOLCHAIN option, but it has a different meaning. When building ports-mgmt/pkg from ports for the package-pkg target, unset CROSS_TOOLCHAIN to prevent ports from being confused. This fixes 'make CROSS_TOOLCHAIN=llvm19 package-pkg' for the native target, but cross-building (e.g., targetting powerpc from amd64) is still broken due to an issue in pkg itself. MFC after: 3 seconds Reviewed by: emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52902 (cherry picked from commit b09dd586518aaa0ac24b70ca522f4054165c8031) --- release/scripts/make-pkg-package.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release/scripts/make-pkg-package.sh b/release/scripts/make-pkg-package.sh index a1e006bd6964..3a1b163bd591 100755 --- a/release/scripts/make-pkg-package.sh +++ b/release/scripts/make-pkg-package.sh @@ -8,6 +8,13 @@ PKG_ABI=$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI) unset PKG_VERSION unset MAKEFLAGS unset PKGBASE +# Ports interprets CROSS_TOOLCHAIN differently from src, and having this set +# breaks the package-pkg build. For now, forcibly unset this and hope ports +# can find a working compiler. +if [ -n "$CROSS_TOOLCHAIN" ]; then + printf >&2 '%s: WARNING: CROSS_TOOLCHAIN will be ignored for the pkg build.\n' "$0" + unset CROSS_TOOLCHAIN +fi export WRKDIRPREFIX=/tmp/ports.${TARGET} export DISTDIR=/tmp/distfiles export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg I_DONT_CARE_IF_MY_BUILDS_TARGET_THE_WRONG_RELEASE=YES -V WRKDIR) From nobody Sun Oct 5 05:58:12 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfWsc6MTfz6BgHZ; Sun, 05 Oct 2025 05:58: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfWsc5jclz4D2Q; Sun, 05 Oct 2025 05:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759643892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0txu9W9iqiFnkyYMZQEGfJ2JxliBDlTcBTsfVP6S50=; b=wypzhebq5eMyyEFG4jBhWxu5oRgW0RWmOfGP2eS77HcHnS+4LsiCWG28YnrWsU7zRHmBMC 8BplYEZWbRNYOqi3EsjB/QSwRmp/ohzXojITO+6ZgYStj1xhFTYFhNO1Fd1TiZf0JS5ZXb P2wUOCZSqFTflw2bJjSo1AJUnVLGNpNaUY+x1x1vq3LUwCfjkGuFdVYAbS+AuQqj3qQgLd mC/o4ywvUXP9ZeTsxSpNAaeUqEPxI8KoDS13nSlIGZjj6ObRt3WGoik8Y5UKQgHXdImF9X r0KL6e2D9YOKHpQ9mt60xeFIhdZofIIL4b1K746TwLl6wpfEzY7c3lqCN8EOkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759643892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/0txu9W9iqiFnkyYMZQEGfJ2JxliBDlTcBTsfVP6S50=; b=vibWgCuR+zooi+69rhcV45BCnpSnttpFVbrjkiHYr3EApOaWQgIzi1UzX2tVlAZMb5N+NW hMLl2nEx+exoaN2eX/IfGo+m/7VZKVgyOEq9iKxrOsYlGeaiKLCw8KU55LvtV3iIyFpWl4 ib+st1sXs83MQhq84oWjjR5oJ5WrPw8jwNLPX9Y6Ljn97JtkpNHQbxSA0skl9GPA0eZ0SF nMhuS/w0E+vSThMs6zPoN4h9A4CkoiYhJWZKJ3zRJf88fVUVauVxeM6QZl/dfapAcAqpse a/QkHuy4nc6BBhGHYFJewqHksjTQ213+gB+yuhhP+0bVD05ICyKfVvs/5mdhNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759643892; a=rsa-sha256; cv=none; b=ZUxKEioqfu4g0Gghd0Xm/3e+RviR01GzuSDteKs5PTVUDIrpyGsehhVOIDwHhnW1iSkTzz AMDLvdcqH/HgU0orNSRtUwLpC6+A9Ah6dS2qBIPw+L+weFut/eE2AVoJtuaHeald1DAgqG xpz52H9MF+dHN4teuwEhhBLw6/rr3wzWB+f9yiy8vX7Pqw7SiaLUc422XNB80jd3UT+BL6 FOAJ3hnB8WtmuJhX1404kLYzmembI+t2Y+n56XwQVXtFj5yEsrNkeWYvd9k/w6nsW7YEX6 3QVRrYo6y4glSiecv+ewWDSkx0cUkcwDtQ2oGgbdqPggUvzPC47f3Q+mmBU+Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfWsc524yz1FJl; Sun, 05 Oct 2025 05:58: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 5955wCAP048995; Sun, 5 Oct 2025 05:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5955wCOv048992; Sun, 5 Oct 2025 05:58:12 GMT (envelope-from git) Date: Sun, 5 Oct 2025 05:58:12 GMT Message-Id: <202510050558.5955wCOv048992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: ca538dd7afed - stable/14 - Makefile: Fix ordering for (update-)packages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ca538dd7afeddfdc7be10fecafc5cc1f226c2de7 Auto-Submitted: auto-generated The branch stable/14 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=ca538dd7afeddfdc7be10fecafc5cc1f226c2de7 commit ca538dd7afeddfdc7be10fecafc5cc1f226c2de7 Author: Lexi Winter AuthorDate: 2025-10-03 05:43:15 +0000 Commit: Lexi Winter CommitDate: 2025-10-05 05:44:21 +0000 Makefile: Fix ordering for (update-)packages The (update-)packages targets require buildworld and buildkernel to run first. Add some .ORDER statements to ensure this happens. This fixes 'make -j8 buildworld buildkernel packages'. PR: 289969 Reported by: yasu MFC after: 3 days Reviewed by: yasu, emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52877 (cherry picked from commit dfc9da6248491072e31f924f5ae6b6238603089a) --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index c2449c1fd29b..1cf7dc888f6b 100644 --- a/Makefile +++ b/Makefile @@ -223,6 +223,8 @@ META_TGT_WHITELIST+= build${libcompat} .ORDER: buildworld distribute .ORDER: buildworld distributeworld .ORDER: buildworld buildkernel +.ORDER: buildworld packages +.ORDER: buildworld update-packages .ORDER: distrib-dirs distribute .ORDER: distrib-dirs distributeworld .ORDER: distrib-dirs installworld @@ -236,6 +238,8 @@ META_TGT_WHITELIST+= build${libcompat} .ORDER: buildkernel installkernel.debug .ORDER: buildkernel reinstallkernel .ORDER: buildkernel reinstallkernel.debug +.ORDER: buildkernel packages +.ORDER: buildkernel update-packages .ORDER: kernel-toolchain buildkernel # Only sanitize PATH on FreeBSD. From nobody Sun Oct 5 13:13:24 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWn0Gvgz69sDV; Sun, 05 Oct 2025 13:13:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWm6jBrz3pVP; Sun, 05 Oct 2025 13:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMhnhScBYAmTJpjM6qmKvDdzfUbY2UKeXXsaR8UYEoo=; b=kiMezAPgn7Aa/Pkhjh8sA3ihZK8uKn8CpsDP+o2WpfQeP5y3UcPQXNwf/bYzZVMTKXU7LV ck8S5fBOpF+LQirZO71AmsrdHIsh27tTm7dn1m6dmcUydqZGVnn4/GhhcG2yz065XIsqpH /HjZeUvKUWXRZIMh3DvxL5JYckxJGFIRYEWFdMd9BogcvF9FX9RHEi1ezmL1qjGRe1+bzn djFKDc/b/AGcua/OCTyKfD8XBlRhxLMZrlAO44Ug6xyIA4Dd2/iQBkbevd9u6oGxWx5nOU 4s6JyLlvdsZJkBSGB6U+2Zb4UT24VGFIsXDwtqtclcVRvpCVimnnColMFoiNaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iMhnhScBYAmTJpjM6qmKvDdzfUbY2UKeXXsaR8UYEoo=; b=lRlMNlcSsijF7ADjGbp8sv3Qzh5V6uc2s1wtVw8DrRtcltY6BjuuirthTys+LEK1dv6Csr arszncP7cZ/A+IVffyoBRBxzHoRXG3SpJrHciFfZH2KOLlYGK+1QSBxoh2O0MQQRTDMlP1 ICrQdXasLS4UZNo61tJdAThzjdbj1yLBEIRqHRUv01mPg7sM1KJMrL8XD8kn4JoqZJNF+u cbXThtS66cKmdDcpoVLut40lUODxblgZYez2gWk/P8oqCv5z8cEC6K0/bCJyFKoY/8IxAT 5TQkB0SzwOYcYeXmdQ/pUrr5vMLFRBVhqM0RwARxE3zPoMOYlVAoAECwOqSmkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670005; a=rsa-sha256; cv=none; b=RQ2rYisraK3N1bVlHWwL/omf8e5n5J5IkKEb3B8EW7d8q2ywYdibqK7iZhnyLz+jPjyA8A CEO4t1+f785n30rzwNUv5+fSY6ku8ghcIY4hafkciZeSVWd4cGpo2+OXRa69/MmnIU3Et7 bvOE6skVOLFVYAxJpibFrv8kYJF4hzDkK5W254qLtHzEH41UyNgeAIosPe6STQgT8KrNtu cFNUMVQRM7lnhTDt58/oWospD2fd3rjoa8YhQTYhhOpAu15kMwmhcH5mVM2mHoIOIluqSg HhLVO1EzNOtQyFZjxaYbKAAmWtND8ZB9tXYVhluOmgymu1T6fJldP6ax3nt8FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWm6DF0z3k; Sun, 05 Oct 2025 13:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 595DDOts074992; Sun, 5 Oct 2025 13:13:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDOix074990; Sun, 5 Oct 2025 13:13:24 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:24 GMT Message-Id: <202510051313.595DDOix074990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 88767665cf92 - stable/14 - dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88767665cf92b196261fe305f022c272ddcce9ea Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=88767665cf92b196261fe305f022c272ddcce9ea commit 88767665cf92b196261fe305f022c272ddcce9ea Author: Mark Johnston AuthorDate: 2025-09-17 15:29:48 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations dtrace_xcall() is just a thin wrapper around smp_rendezvous_cpus(). There's no need for six identical implementations to live in MD layers. No functional change intended. MFC after: 2 weeks (cherry picked from commit bf115203bb8a61bd03ba23931ff0b5bf931b7d1b) --- .../contrib/opensolaris/uts/common/dtrace/dtrace.c | 25 ++++++++++++++++++++ sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 27 ---------------------- sys/cddl/dev/dtrace/amd64/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/arm/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/i386/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/powerpc/dtrace_subr.c | 25 -------------------- sys/cddl/dev/dtrace/riscv/dtrace_subr.c | 27 ---------------------- 7 files changed, 25 insertions(+), 154 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 8078f3f6d4b1..853cfb845878 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -707,6 +707,31 @@ dtrace_error(uint32_t *counter) } while (dtrace_cas32(counter, oval, nval) != oval); } +void +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) +{ + cpuset_t cpus; + + if (cpu == DTRACE_CPUALL) + cpus = all_cpus; + else + CPU_SETOF(cpu, &cpus); + + smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, + smp_no_rendezvous_barrier, arg); +} + +static void +dtrace_sync_func(void) +{ +} + +void +dtrace_sync(void) +{ + dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); +} + /* * Use the DTRACE_LOADFUNC macro to define functions for each of loading a * uint8_t, a uint16_t, a uint32_t and a uint64_t. diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index 32e84d8fbfe9..ff880e804770 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -124,33 +124,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, (uintptr_t)VM_MIN_KERNEL_ADDRESS); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ - -} - -void -dtrace_sync(void) -{ - - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - static uint64_t nsec_scale; #define SCALE_SHIFT 25 diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c index 81aa53d00bd8..877d52fe18a7 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c @@ -142,31 +142,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, la57 ? (uintptr_t)addr_P5Tmap : (uintptr_t)addr_P4Tmap); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - #ifdef notyet void dtrace_safe_synchronous_signal(void) diff --git a/sys/cddl/dev/dtrace/arm/dtrace_subr.c b/sys/cddl/dev/dtrace/arm/dtrace_subr.c index bb42044aa477..10e9281709b6 100644 --- a/sys/cddl/dev/dtrace/arm/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/arm/dtrace_subr.c @@ -138,31 +138,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) */ } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - /* * DTrace needs a high resolution time function which can * be called from a probe context and guaranteed not to have diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c index 026581f5a899..ebe2194a4b2f 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c @@ -139,31 +139,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, kernelbase); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - #ifdef notyet void dtrace_safe_synchronous_signal(void) diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c index 5dd083310e6f..ee8be8da642f 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c @@ -123,31 +123,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) */ } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ -} - -void -dtrace_sync(void) -{ - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - static int64_t tgt_cpu_tsc; static int64_t hst_cpu_tsc; static int64_t timebase_skew[MAXCPU]; diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_subr.c b/sys/cddl/dev/dtrace/riscv/dtrace_subr.c index 3a6aacd86fcd..ed2c0bdba7e2 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_subr.c @@ -127,33 +127,6 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit)) (*func)(0, (uintptr_t)VM_MIN_KERNEL_ADDRESS); } -void -dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) -{ - cpuset_t cpus; - - if (cpu == DTRACE_CPUALL) - cpus = all_cpus; - else - CPU_SETOF(cpu, &cpus); - - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, func, - smp_no_rendezvous_barrier, arg); -} - -static void -dtrace_sync_func(void) -{ - -} - -void -dtrace_sync(void) -{ - - dtrace_xcall(DTRACE_CPUALL, (dtrace_xcall_t)dtrace_sync_func, NULL); -} - /* * DTrace needs a high resolution time function which can * be called from a probe context and guaranteed not to have From nobody Sun Oct 5 13:13:25 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWp0xqgz69sBG; Sun, 05 Oct 2025 13:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWp0N1Tz3pLp; Sun, 05 Oct 2025 13:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEUK6RYd0pj7WbHMvS/o7KbD9XLDVCqTmSqJLwsse7g=; b=nZ5ZYq0J4KQV1tr5vbxQCDgNO42AxcE+heiKnT5CQhQPTYIfDxJ/0h3S+zh/tPbHawhIT7 I3BtWC1CVfhdNDuHj/nQH+JhPqAXP81LdfEgmYpSE4Hn66gWvuCVVDDR/n47R2Y6C92RSO FwOgazGQAo82kkBR74mPCzVWXFlY/XE/GrexDnx7muwWNvTwQc1kX8ag2OmIcxsDWF4vT/ SN4CgGmCo09uDJLfKy626dYPq6gSS57Lmdxp747KrzZcnIQDZy4jsedPiTsH30ONxPLEE4 rVhTp/wfIL690ebosu+JbfDahVb1R+3p1q74nc3tQa824e835INOu9s56Bf7Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEUK6RYd0pj7WbHMvS/o7KbD9XLDVCqTmSqJLwsse7g=; b=AF+DYiS1ialu7kWFibjawV6b7Chcjb3ePAKfeKRX4/VS4Z0RYH/Ak+Mv4rP853CJ7QQsBd 4NLZcsQLRWwuKr0n1IJTXgxL/frzqvNEGNXc13afBycSjOsNovP0sewqpLp1F2TFptEgEs 9n3KGRfiVG/sX9gTOe70nsyR/cASdTrxe51Ih8NhE9aecpJfLWNawYR3w0T0EWj0VWWlBJ xDO1kPA/13logZd1TGT8xwOSj4ddjbLH4IomhEJs2DliiYEykwBOgV0rscHp4spI/Mltkq D8gmUGK5kN0SNOP+Ow0+CXLtrh/3NHeglclGUa7osKiN1JVZpo9KeCaEGBibvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670006; a=rsa-sha256; cv=none; b=ihIJ1Loq8PGEJWMeckxnzRKOttYL7xjn4wnEBEKKckM2tpny6pINyENSGarxa/ToyopUk7 Yzsoyx7QHzeG4laGH1g+3cmOhyOYFmUl7C4AJcTClZmsGYR3QcIc82ldtEWOvCjbwNk9R5 pVLeMjqvdzD0sYa/rN3QnuH8ITKLTB/QxqV3T+0kitD0Znj5YuieNHUsItn0jykb2Mz/XZ TIfXU6BRB4Z4awZ1v0jpeJTmg7bo4lM46Kkx0awAx60FZTIfRTZlrkE8sgHaRYByWYhrqr tgLxld6OYBKOfQrN58vvvOgy4eAPtfZVvjUc8If2zWKBUnyhxV86yGMHhsMk+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWn6tzyz80; Sun, 05 Oct 2025 13:13: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 595DDPOD075026; Sun, 5 Oct 2025 13:13:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDP8o075022; Sun, 5 Oct 2025 13:13:25 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:25 GMT Message-Id: <202510051313.595DDP8o075022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: fc3914742891 - stable/14 - OptionalObsoleteFiles.inc: Add more ATF libraries List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fc39147428914cd25db9396a15f4eaf9ad9b1162 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fc39147428914cd25db9396a15f4eaf9ad9b1162 commit fc39147428914cd25db9396a15f4eaf9ad9b1162 Author: Mark Johnston AuthorDate: 2025-09-22 14:04:30 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 OptionalObsoleteFiles.inc: Add more ATF libraries PR: 289653 Reported by: Trond Endrestøl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52676 (cherry picked from commit ceb5792d1e2e58646dd291a2dc3877aaeb73122b) --- tools/build/mk/OptionalObsoleteFiles.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 5ee0f64e4129..331c88c0619b 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -8237,7 +8237,11 @@ OLD_FILES+=usr/include/atf-c/tc.h OLD_FILES+=usr/include/atf-c/tp.h OLD_FILES+=usr/include/atf-c/utils.h OLD_LIBS+=usr/lib/libprivateatf-c++.so.2 +OLD_FILES+=usr/lib/libprivateatf-c++.so +OLD_FILES+=usr/lib/libprivateatf-c++.a OLD_LIBS+=usr/lib/libprivateatf-c.so.1 +OLD_FILES+=usr/lib/libprivateatf-c.so +OLD_FILES+=usr/lib/libprivateatf-c.a OLD_FILES+=usr/share/examples/kyua/kyua.conf OLD_FILES+=usr/share/examples/kyua/Kyuafile.top OLD_FILES+=usr/share/kyua/misc/context.html From nobody Sun Oct 5 13:13:27 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWq2mbqz69rgD; Sun, 05 Oct 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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWq1JD9z3pm6; Sun, 05 Oct 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=1759670007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNfW6TNmLFrqharlvkCDbCxW8ZNL/fpGBpYBKUSSMa8=; b=RhEVMWuvMg2RU16g04l+njfQOnqlcfn7Hc8hMTUHnJcDN1vTlhsQH++7L1WScAJN0WBOZy B3qoMFG+MEfnR04fKlM7LQLcaEWnBAUb4mJPgWgFmEpcLJ+tHgHq1qCE55qba14ZP8WNsh f6Vbbrn0iixVBY87SdFZ3R57d9o5XjqH0gQLuXmzS6hjxLRy/XbmZhoWHP3i6h/l4NfWHh 7d8LaoXi3g8bwDLIHAGZ6MIIhnfxHtezW7cRaymL2SvFdx2ZmdiBBLoRHkffU6QP9gsaVn tq8pAhTg+Ehb7gkpKhh4YH6o55Xh6Lla39ne4nqH5Xao/RBLsAILKCEsJAE3HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PNfW6TNmLFrqharlvkCDbCxW8ZNL/fpGBpYBKUSSMa8=; b=M8QQz3vOUD/KAvGOx44FPMQl82GDpeF2ZuOvq/AF/pSMTueopwBjQHwLfvmQXH3ea0GuMB ma14srhEvWZb+Vq7W0w1jZWZSlNSCMpdzGmo3gunfOLZ26wWFNskJf2YAjXC/4mOco27Ux wYLNWArmrf5VarUmLHZklC3VymUhGCd9VC5QgdLFmqXdpybemH3OFfKMyeS9Em5gsLzkRl Acx4pHMqf8nW/Kz2GBB78+D4RjGXJ91Y+W6crR2bF0TpmPibz0h4jzBqzIpKqKsVH2hxlr Dx5cNznL7N2thQywXr4FqHnd80YEXfZg+NcWkEuLkVizuY64MNyt9WIcBzifRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670007; a=rsa-sha256; cv=none; b=ak0oNDWGvOTmKIJfD/lZ5hNg1sKxWTcd8LZZhNiZdOrufKClZkXrdZZA9x3VA/f7np9Day 3UjRoWdpWYcmx7dCcOV6bxVfBVNvL+yq7KmOaD8m82NSFp9PUXUEU4VlU2WSv7PVTi9Vj7 IDt7xPP7fbXM0S5IWyRIoqNN4681Aw9eC6GFn8e4MBAdkTFLzLbT4p/64IdAvnXSQuneft GCMcZe1VZiLt8+0+AU9fHSMaStnBUuALCgnuYFXJ38sQDNOkQqI0bDSqLIpFsBC2rE6qXc qHTSR+38bFtAmFOjSsTzPOv6OgjDczqrkrIO4aeg8TO8saJFMa4832r++4sZ8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWq0t5xz1SXG; Sun, 05 Oct 2025 13:13: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 595DDRb6075064; Sun, 5 Oct 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 595DDREO075060; Sun, 5 Oct 2025 13:13:27 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:27 GMT Message-Id: <202510051313.595DDREO075060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ede06b0ef3d0 - stable/14 - sanitizers: Provide wrappers for atomic_testandset_acq_long List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ede06b0ef3d03d9b30b6bad42c966d979aefea00 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ede06b0ef3d03d9b30b6bad42c966d979aefea00 commit ede06b0ef3d03d9b30b6bad42c966d979aefea00 Author: Mark Johnston AuthorDate: 2025-09-19 22:54:20 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 sanitizers: Provide wrappers for atomic_testandset_acq_long Noticed when building a kernel with options RANDOM_FENESTRASX. MFC after: 1 week (cherry picked from commit 7ea59a07046a0bf25d4fccb456715dffaae52021) --- sys/kern/subr_asan.c | 1 + sys/kern/subr_msan.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index 464efda1e91a..fee6c1a844e2 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -835,6 +835,7 @@ ASAN_ATOMIC_FUNC_TESTANDSET(32, uint32_t); ASAN_ATOMIC_FUNC_TESTANDSET(64, uint64_t); ASAN_ATOMIC_FUNC_TESTANDSET(int, u_int); ASAN_ATOMIC_FUNC_TESTANDSET(long, u_long); +ASAN_ATOMIC_FUNC_TESTANDSET(acq_long, u_long); ASAN_ATOMIC_FUNC_TESTANDSET(ptr, uintptr_t); ASAN_ATOMIC_FUNC_SWAP(32, uint32_t); diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index 07e894e4c3db..42d4f684b304 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -1301,6 +1301,7 @@ MSAN_ATOMIC_FUNC_TESTANDSET(32, uint32_t); MSAN_ATOMIC_FUNC_TESTANDSET(64, uint64_t); MSAN_ATOMIC_FUNC_TESTANDSET(int, u_int); MSAN_ATOMIC_FUNC_TESTANDSET(long, u_long); +MSAN_ATOMIC_FUNC_TESTANDSET(acq_long, u_long); MSAN_ATOMIC_FUNC_TESTANDSET(ptr, uintptr_t); MSAN_ATOMIC_FUNC_SWAP(32, uint32_t); From nobody Sun Oct 5 13:13:28 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWr3hXlz69s3b; Sun, 05 Oct 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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWr201Lz3ppy; Sun, 05 Oct 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=1759670008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOVNzaBmIsXmwiQ9g/SKqZOpJHK2Sqso4GpgKgkPj64=; b=IyWdKeF9iWt0P37gXOUNcFPqn7cwHOoJ/mXEPDi5rheUr64jwuWFJ2ahi4dYqtGEz6WDKf O692ZsLhv21qpH7e94+N4piYS3LqbZd3yR/wV0ILGhtEZqoL2ZDqZ+jO8lHEjFyN3odOOQ PvsNDzlcgf18mkovgHeLy/a6H2PKycLWswXiSHK2ZAwXXkbThiqXi6XB++RkYDLk8a9kpb fs+llCbTu1ToIOdPZhhXdg3nvyyEQ7UyrmMda4ruoR1Q2LlX68OjT+howJR4KH/8sMkmRN D0da151fDBjWZjRiqciIRx+JV0GZi48mcuaGnN2S75gNf6k1c7Dnb+Lf6N9Aow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOVNzaBmIsXmwiQ9g/SKqZOpJHK2Sqso4GpgKgkPj64=; b=fUeTy74fn3IQe0FQ4v5W4kNSwp5tjumey5+2FegFY5pYhGUPlGyrQrGumHKNLm+OIvdbO7 Z4OanzAUChj6gUuKDfEEA7uJ4AfJviYa8BHrJBeDqxAofa/uQ88NdLSNuoGCqBV5b0w2z1 9ib/3PGMO0pdou91kNVZlCfrLmQXhGP+/ztnuqGg+Wzh9rd9t6YAY7+3gUlgc60ipAtUi1 nahvzLT3iMzY7C9aiMMUBDWwZm/INdWTeEMHdYZOdShJlvQJ1/tsecoh6q+qrinTkh0wN6 1SU5k9VgIbg+WMAgW82uGB3ggVPL+hm6yA2vKqbvyLPfpA2P/6qsamfwVV3DYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670008; a=rsa-sha256; cv=none; b=W3Yz5KVDYcF7IxjjYNuhfuyF7hxv3neoy4Le4UPj8HfGkOfqhoONAw1CBJnlSrdO0whi7E i3GPaZUR/WK15i2RpuIuMFBeqTsMy34cbJO6dvxrz1wLWWfTtnE64vXRDc9+Fp+9qe9M95 BTG/hbaxthrT3lQ0Efjuw2fgqF6Ar6BEDkXIOgtkSG62nNkTnSuALvVhUwwuj8iFM/wMdR TrUh8+TtwpeemWtT1vnSiyYj9JeMS36U+HqhGL8EqKrreBdvxuvXtnLWFxvJRi0CbmY37D hf6dOvec8N+v42LkKFQDKNUVB3gpKLpKtrl2KqpFGi1gD1Vhh9KELb7qisxiaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWr1ZTMz1SFR; Sun, 05 Oct 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 595DDSWl075103; Sun, 5 Oct 2025 13:13:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDSem075100; Sun, 5 Oct 2025 13:13:28 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:28 GMT Message-Id: <202510051313.595DDSem075100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 10909308d3ed - stable/14 - pw: Remove duplicate lines from the pw useradd usage message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 10909308d3eda36a7bf52dd1fa316964854be63e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10909308d3eda36a7bf52dd1fa316964854be63e commit 10909308d3eda36a7bf52dd1fa316964854be63e Author: Mark Johnston AuthorDate: 2025-09-18 15:13:26 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 pw: Remove duplicate lines from the pw useradd usage message No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit 4784ca87441093328cec4e9b133608e172343f64) --- usr.sbin/pw/pw.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index a4c95258f3bb..fc778b16c7e5 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -257,8 +257,6 @@ cmdhelp(int mode, int which) "\t-Y update NIS maps\n" "\t-N no update\n" " Setting defaults:\n" - "\t-V etcdir alternate /etc location\n" - "\t-R rootdir alternate root directory\n" "\t-D set user defaults\n" "\t-b dir default home root dir\n" "\t-e period default expiry period\n" From nobody Sun Oct 5 13:13:29 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWs52hVz69s3g; Sun, 05 Oct 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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWs2Y9wz3pxN; Sun, 05 Oct 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=1759670009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2F4TFp2I5WcPxjLY4lHYsf/+n9xzlQEr313UQx+GPaE=; b=pOUX9nS18l7kr7oVy/f0gBoj9Fw13N6bA7xhK+mhDBV5XYBOLTYq4rZjWqb9svFwhbGOIo +1mfn4s8xQDEZgqQsb9z6nGRB11XoesU/sqT/8IGYayQ3gA12LeM2EHzIy1jnZkZ9ulXnS 9lduCOYBAFggU4HShXxXaEnuc6T4N8WPrO5KKv7qSjzPgyhEWdxtdzCup7XkXuxvh2fL0X rdRfts3tn2nOcD7oYypxa9gZqmIGnzuZ7gSuXfPhLIxjLXoBOGdaTpsjClIPlfjKYRDouR recEuwKsw+E80OeWJqKGY37iPCVZYioxmb9cGyfdfsJU2S+yCe9/zyPIZQn8yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2F4TFp2I5WcPxjLY4lHYsf/+n9xzlQEr313UQx+GPaE=; b=esRWCpxkqPBX2cfvukp5ir6rJP8dqyW9cbwCsV6BeQDeTbLuwn8X+G1vAaWy0BwNSQNpAr s1pfZWPSPPrliIgiGHODpDrL/IEe2y1SAJZWjroT8KRQnEp8IXiEfApQjwJEsAbsVMb4Uz bjIbgCLLJ7Dk68TL3/vfgDE0VSlYBgsUyqtG54r4hu6HGcJAsi0ihPCxgTBPUMkkj+dgwl 2WO9H1omMJlLv6vMRrXBpttHn09YR635ZVCVnhQvaZJAAEmoIJgz7uT5UmxBBo1e39wSht 3hsYsWtznjUS58VAyX+2vEK44QjYA/rsw0JEIvaeV5o9F6iAYIgWNIZS5Ix5sQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670009; a=rsa-sha256; cv=none; b=wlDTFVQdz6xK/1Tk6/1LoRYa8bQAh+i/oufeG4r/lL691z6rTUBuvgflFAawU2pFcmI+aQ gRGHxXYPEgfO/U9aEeshU1U2orrfduhHp4ZORye1j3LYFamF1bCn62D5p+aitF5eDDTPBY gqnksLYsZqYzed7NZNn+DxJDrwQIUkMPBCQ6wVbPQaV12LzRXisTrW3wMhOD3cVHfiqLdZ SY/i6fIfbDRUKeZORJagancbG3iUv/Ujq+00UvmWC4A+30SjpgBg2yDILfbWX1dtsvIfEa KbPVYKGKmlfJJQq72p59uU1GrhcPkCH1U8zxp2VD5fmn0XyEXXrGI+w13bzLyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWs284fz1SFS; Sun, 05 Oct 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 595DDT5P075137; Sun, 5 Oct 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 595DDT56075134; Sun, 5 Oct 2025 13:13:29 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:29 GMT Message-Id: <202510051313.595DDT56075134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 239fb1ad8e73 - stable/14 - pw: Print warnings when metadata updates fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 239fb1ad8e7336f4c9208828d926525be763d374 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=239fb1ad8e7336f4c9208828d926525be763d374 commit 239fb1ad8e7336f4c9208828d926525be763d374 Author: Mark Johnston AuthorDate: 2025-09-18 22:38:33 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 pw: Print warnings when metadata updates fail We do this in most places already, but not consistently. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit daa63c9417a28ad08881ff03df828fd8180dad12) --- usr.sbin/pw/cpdir.c | 6 ++++-- usr.sbin/pw/pw_user.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c index 3dee8f7c43ac..63068cab000c 100644 --- a/usr.sbin/pw/cpdir.c +++ b/usr.sbin/pw/cpdir.c @@ -127,8 +127,10 @@ copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid, /* * Propagate special filesystem flags */ - fchown(destfd, uid, gid); - fchflags(destfd, st.st_flags); + if (fchown(destfd, uid, gid) != 0) + warn("chown(%s)", p); + if (fchflags(destfd, st.st_flags) != 0) + warn("chflags(%s)", p); close(destfd); } closedir(d); diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 8a9a4342f5ef..9f5cfb0f4473 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -123,7 +123,8 @@ mkdir_home_parents(int dfd, const char *dir) if (fstatat(dfd, dirs, &st, 0) == -1) { if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); - fchownat(dfd, dirs, 0, 0, 0); + if (fchownat(dfd, dirs, 0, 0, 0) != 0) + warn("chown(%s)", dirs); } free(dirs); From nobody Sun Oct 5 13:13:30 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWt6mbHz69sHF; Sun, 05 Oct 2025 13:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWt3KzKz3pvX; Sun, 05 Oct 2025 13:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kfals/E45DiImkGVpUaS2iZddel6MZF1Ih9XZs7CqOo=; b=izafoVvqukpd6fOal2th5zETEt+jJbECfZqwXyN9N629IXeWratoc+DPgPW8tbTnxYGWB1 1A1fFoY24D/TwkqLvhu89Q6/ifjLxyHu2hW/ezXFA7UJGFpLKAJeH9pcr5t5tvXq0yUrrh EtBYGJwtgCZzS//JBtERpM6uPBysRPZ6sUSjUJpwvHVDDn2dLXqhPJDMX3cMv1vEknjWK/ 5y7Tnj43TG8wcNWAA4JsOTKhyGEZMh0zNq8O6kp5iMa2q8B2ncMPW3GY06hAp0I23mHyLT mK09r7Jeg1iv7sSnErww7lWskQyFFcru4lsqBp9JYjZA85QhFeWVuw3QWUo0AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kfals/E45DiImkGVpUaS2iZddel6MZF1Ih9XZs7CqOo=; b=gBsyyPh3VBwqQkoVkC4s3XU3dyUJ8kOa8Eb0aA3b2UVwXVObNr0+c1ceQbtC+7VGDMz+5E tiVhCXzgmQkNphx5jdGL/ArnSl21vY2iDhOfyipcAqMpQLdXc7euvhBRtwoPStXNJ+q+94 b6rxbnMUYcp0WBf1boS33xGg16A7TKXmDThagarL2NrQQyYQmquBoTgM/R+K+4WfAEXgmV RrGH4vLuCwXcQr5CC+TF3fA0UYm35p7T0hzx2REmI9B9zEvyLP7gpfzJ2YELYyttIqHKr5 Lf9HN+SksozA3nMDfPyIzRgfVtSwex3cPKvm+pJUk77tgJv7XdP+5Iwg6gWzNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670010; a=rsa-sha256; cv=none; b=oF6wm651q5fzFE74PDFWW0opT1je239UiS3i9M28j5HTwwZZINtUh4fRKxUWUUjro5NTo3 CDgkZ6wP6mPlZau0Z2NgFYZKp6eGeTiy2M1o8UWNg3tCV41lZ2eKbDPPFr2i0JX4jgXMxU hBNHW9VKNsrwaGXvFwYtU6q6G8W57BhhauqZk9Z7z4ia45ng530l2qW4Gc/1yoMF0nJhi7 iGWv0nkaoSivTeUV7XZJhki3/esGbWJB1jEunuhcGuMYYmvZPlfMek7ojuesWB0Zs2pr0V wK1F3VO78Ggtt2JYN33tpyfPxbPz+gs/6LVZZB+sI+JYeEp9kwsEzGf1Uj5bcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWt2hcRz3l; Sun, 05 Oct 2025 13:13: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 595DDU8n075170; Sun, 5 Oct 2025 13:13:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDUDs075167; Sun, 5 Oct 2025 13:13:30 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:30 GMT Message-Id: <202510051313.595DDUDs075167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cfffe5cacc55 - stable/14 - pw: Clean up a couple of errx() calls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cfffe5cacc5532fb3d0159e1f3478af340cf7bd0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cfffe5cacc5532fb3d0159e1f3478af340cf7bd0 commit cfffe5cacc5532fb3d0159e1f3478af340cf7bd0 Author: Mark Johnston AuthorDate: 2025-09-18 22:38:45 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 pw: Clean up a couple of errx() calls - Remove a stray backslash. - Make an error message fit on one line. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit bc69d5dffa21cdf228e481b5502fd0f053d65e6d) --- usr.sbin/pw/pw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index fc778b16c7e5..18f1a17ba942 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -143,12 +143,13 @@ main(int argc, char *argv[]) optarg = &argv[1][2]; if (*optarg == '\0') { if (stat(argv[2], &st) != 0) - errx(EX_OSFILE, \ + errx(EX_OSFILE, "no such directory `%s'", argv[2]); if (!S_ISDIR(st.st_mode)) - errx(EX_OSFILE, "`%s' not a " - "directory", argv[2]); + errx(EX_OSFILE, + "`%s' not a directory", + argv[2]); optarg = argv[2]; ++argv; --argc; From nobody Sun Oct 5 13:13:31 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWw0x7yz69s3k; Sun, 05 Oct 2025 13:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWv49Tyz3q39; Sun, 05 Oct 2025 13:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pbg2DrURof7IrVq3CCZ+e623a17CM1taLD7is1EHcwA=; b=lBE0cBTkkYnMOQ0aKo/17B9DoMbrkoe5sRPWd02a324YhgDLPoHCyNyZtamEi1x0kWIfEO QAZe7z7zOfcTFQSrgNvDsHcwbQjBDPRlRs4bDt19UitVFAjRJuWEMeHQHvDBdgtAgyJwxd +OZ8MiEy32Zd2nrfoXweZ6nxgYjpQcTDELK8Qlc/z4L37QJOUzFDXhpyiduOVi3NqtsZSm Da/1/DMc2SerM7a/wpbt0ZSvllP9lZUZchPfNuMFqQyJ2S8LgxW15p0DiOChMG23sJMI1l 0etbENc8f6V270NSFsmsdhPPZeiUq1lT/ZzOK7h0zst4ffepfCmlkKOY6IBZtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pbg2DrURof7IrVq3CCZ+e623a17CM1taLD7is1EHcwA=; b=B0DIGvLDj603djvbVTcOvyUFETRUcPVZBnO0gX9/ngXgl6BlI7qiFosD2wCuRs48tCvc4+ j6dvLXpoaeRntRcNIZJW0g6EbBKj6EDndoKheUDCSek5eCyhagXG6/fXSvjmJFOeC9NwNK jvoyDaeFNMj7gNNqVEzJFLcbWHDNQCa5XKghg7Bq7yRUnoZ33icXgebkqOOV48+uRZGyHR d8QI/4H3LzBDHAWsedYsPc4XsiWZm8posUvcfDBIq5pXf7E1eH6oMNBeLx7IlpJTsrBelp AT6G+GmAG+D2lXoLJJFka2c+H/7mT07JgD65US4rxwK/QSFWZfi0oBfhTTqOVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670011; a=rsa-sha256; cv=none; b=oiviARvL7HEUw3fMTmUqH/oO92c0i5pGO9l1NXBc4BDZQQxq/U/a29QwC2wg2IemjujhWL AFJiQAnm09zz3DgaqPWYhDXgymLSt31GvRvlNjKpWZ8iWmQLfxOwLy+FF45uNbfiyOj2iF 6Y6vKj98XvFplAAn5OPUnzUF3segejuSEXiekbm2nrMSPf2BFUYL8x1+i6Myent0pXkL29 27dRgdI9mjIBtlW56kf0eFSNEKuTbcNmdfk7D7E/Ho8hQZg4TfY8W8M6G7R6Fmr5w7rjJN D5QkkX1Clack526uhvMfyk1K1qrQjsQ3AHwSNliKkyz+v20atasbSkEa8JlT+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWv3f3Qz81; Sun, 05 Oct 2025 13:13: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 595DDVbR075204; Sun, 5 Oct 2025 13:13:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDVPD075201; Sun, 5 Oct 2025 13:13:31 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:31 GMT Message-Id: <202510051313.595DDVPD075201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f6824040125b - stable/14 - pw: Style List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f6824040125b85d049579bb6be917a1796c53da3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f6824040125b85d049579bb6be917a1796c53da3 commit f6824040125b85d049579bb6be917a1796c53da3 Author: Mark Johnston AuthorDate: 2025-09-18 22:38:58 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 pw: Style No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. (cherry picked from commit 42dc71a544a4d78d0068f70b6d4089a8c9e07cb1) --- usr.sbin/pw/pw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 18f1a17ba942..6f59e392bdd0 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -166,8 +166,7 @@ main(int argc, char *argv[]) conf.altroot = true; } else break; - } - else if (mode == -1 && (tmp = getindex(Modes, argv[1])) != -1) + } else if (mode == -1 && (tmp = getindex(Modes, argv[1])) != -1) mode = tmp; else if (which == -1 && (tmp = getindex(Which, argv[1])) != -1) which = tmp; @@ -179,7 +178,7 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "help") == 0 && argv[2] == NULL) cmdhelp(mode, which); else if (which != -1 && mode != -1) - arg1 = argv[1]; + arg1 = argv[1]; else errx(EX_USAGE, "unknown keyword `%s'", argv[1]); ++argv; From nobody Sun Oct 5 13:13:32 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWx12kXz69s61; Sun, 05 Oct 2025 13:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWw50BJz3pn7; Sun, 05 Oct 2025 13:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=od5aZZbf1uGQTScPLlUASRuc2Ag1Z0V834hfLmimubc=; b=ANbeLijgFufwMeRXU79xesifvLrs8NZcqB4s5PAcaO9OKDRL3Ziz8FDPq4NsruUu/Zt81B U1qTVVtieWhyKO5OqVKv5clbfIAg5+s+XeNbDWttYEnagjzWCHL5KZRq+E80sqbtdx55kL 4e0SefX2raQlXYWiprTlKUEPxnimL8mbDLJHF1AzWQ6FTmNj1jBm+iGm/LJ2fBqePV5v2I GFAg0dxsGEw/IQ2QyvAsN3ZPjtevuCpwNhzkh94mKdUMq4i5XgEqWUeCA3GoyS+D4c3ZUw +N9hkbHLdxs0B3153vdCakn/7mvwm1MhtciR3cNjV71XeR+JXkNje8ogRe8/bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=od5aZZbf1uGQTScPLlUASRuc2Ag1Z0V834hfLmimubc=; b=BkpPgyURgM0/Dnari2JbhW8pS4hnQprFqIucaU6Cp6p4TX/L2XvPohDUbvbManfi9ZywKp pnx2COsMqNOWy5nNen9xV8Xl5yCnjX8N1Mf/47Lxu7hnCk4qYB5LXVO+SompxbeeAKoRIq ZUAdwEIVeh5adVzgFXxMVIxGIsXi2EGs/LoaQVA9wQPJqM7RNRG9KYQqg9e2jRxQdxVLno CiJ0JVt2zrBx+NUbZH3TIWWu7Xs257h79DlFMjg5JH5BZS/UPz6N/m7LmbCIb22CVBu3Yf 93UldweHpEt1pA6gxFTFo2txPJsrrkFFxPWgE8mrhJ0kWssEFT7+/CJSDdcsPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670012; a=rsa-sha256; cv=none; b=vL3+CjQrRF1uuU0p99i4nmoPzArMzGhyAQKBQ20dQACMEBKzzP/W5TaNtoynNSjFxaCuqu Db1DD9PTaAu+pStwkMa82K6fE79pikkfwulGDSXQSYhFNV6PngDiwCMA3yDmipKFnKuM4W B6FYMP0FTO2R6fU/fB4iNH6FuDJaKaMrrNVhwJTQjFxbB9FBlBTemektrXbYya0OAqggMa Sh19fYVzYl4A4eC3ilK632dE2i5xpBuTSjdG0utxYqQ0JzPQ0FPJaoc6on95hxKs9kSPSG q5wG/2txVX3ps/Epac8GJkJ4WdYK8nREuSaiCgsMTqS8S740KQNcDrX1XasqzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWw4WpQz3m; Sun, 05 Oct 2025 13:13: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 595DDWBx075238; Sun, 5 Oct 2025 13:13:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDWDC075235; Sun, 5 Oct 2025 13:13:32 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:32 GMT Message-Id: <202510051313.595DDWDC075235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 53b6ea81fa20 - stable/14 - pw: Add a missing chown() when creating dirs in mkdir_home_parents() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 53b6ea81fa201a5699cf00e82a994becd858be2d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=53b6ea81fa201a5699cf00e82a994becd858be2d commit 53b6ea81fa201a5699cf00e82a994becd858be2d Author: Mark Johnston AuthorDate: 2025-09-18 22:39:11 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:00 +0000 pw: Add a missing chown() when creating dirs in mkdir_home_parents() mkdir_home_parents() effectively performs a mkdir -p of the root home directory. It chowns the home directory to 0, 0, but doesn't do so for the intermediate directories. Add an explicit chown() call for those too. Fix a long line while here. Reviewed by: bapt MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52587 (cherry picked from commit 41b2a80353e0dd04939cc260d5763854a264c158) --- usr.sbin/pw/pw_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 9f5cfb0f4473..007f750c7d1a 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -115,7 +115,11 @@ mkdir_home_parents(int dfd, const char *dir) *tmp = '\0'; if (fstatat(dfd, dirs, &st, 0) == -1) { if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) - err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); + err(EX_OSFILE, + "'%s' (home parent) is not a directory", + dirs); + if (fchownat(dfd, dirs, 0, 0, 0) != 0) + warn("chown(%s)", dirs); } *tmp = '/'; } From nobody Sun Oct 5 13:13:33 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWy36LKz69s8C; Sun, 05 Oct 2025 13:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWx5zZpz3q1V; Sun, 05 Oct 2025 13:13:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eqdNl5i4dc2z0kwxRj0k6MiAIxy/uUE4J1fafyci6rM=; b=eDSYP+MBBDxvuBukAYmenLRwruuzbnl9XPe0orFS/7qnXEiCi0IDuPGnraZsQ7VrfYfnP7 Ee1XhJxLfr4vy+UumjOBpWEzaBu+oWMAC/uPnZ5Cx3wH+rKRkGOp6kYT6UcwU6ROnIA5AE g21Vrp/3Wnb/QwOWypbmiVMIUxbaSWmYX9Fh1Ak23GAPYAoel3hbBWUb0vcKSBv8qkIwfr yJEPqFpzl8lTD4zeeGNkasbLek6O9sOfJwXiWIQQnGlr5/H4DPWNxuqQ5T5J70beU2KoiE gTMQXCGoNL8/FxGLqqL5HRpzm7FmsnAAqWM9lx7pDJIIODcTbgTyfzM5OvQx5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eqdNl5i4dc2z0kwxRj0k6MiAIxy/uUE4J1fafyci6rM=; b=eIKZYfDfG26HyU4O9kNtOP31wL0RGCgfY6y4dOr2ZfXb/VrSI8MNob6dM85oWb4lSzzqWU FOFMat2H3s5MtWPe8SOwOfS3jutZX6O+6YmsSmg+G0JDzW5gq1CK494Az6ONW8ct4XX2a3 VLqeeZsh4HpHDXrIW7qnkX2MWLXyvZdnXfot6O8c57RZzDzglalfT/pyN7B83LmXY45zAU 19KdjU3KNu9RYjlH7Y1VXeiM6+jgJL/TdECAtPX+IjDdh8YNnn1rIoKpBrGLkohNzk60eN /6V+rc177HZZxBJ5jusRmHIojNPGmwJJrtpTVLVFsG8zdLm0NXXZiQn7c3KfDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670013; a=rsa-sha256; cv=none; b=pB/0fpwMB2z4zqMDEkdN01BPDHDB4Uuq6eSL2TGvFEMu9qq0CDrHcOcI45B37AlWO/BZmw 38GOO3i5UKwOZudvdH8apqDjXq/xJM2wYIMxNFsa73ubLQm/ZO+0hFCVsohy+GRBFFw+dS EriFOEZEr/yiE6k60NkcGfJcVDMBlBMvZTwftsfxpXgcToaFC18tjqrUW+0QpGSayQVFIJ Qq+vCwOofPhZULIKucrCfdJsUd8KB89pVlKQDrnt1jvSYOhS/lDiggvGxjeSsmMtHAuKJp EwQ/MOKKD4JRWi84tYmYfO2sibzASxw3GL0KsU3Q+mJhJAs4RrjSf0LJ9sUKBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWx5Xfhz3n; Sun, 05 Oct 2025 13:13: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 595DDXY9075272; Sun, 5 Oct 2025 13:13:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDXpw075269; Sun, 5 Oct 2025 13:13:33 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:33 GMT Message-Id: <202510051313.595DDXpw075269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bdd021191274 - stable/14 - pw: Use copy_file_range() when copying skeleton files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bdd021191274d70bf9a2f752f45f76501321cdde Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bdd021191274d70bf9a2f752f45f76501321cdde commit bdd021191274d70bf9a2f752f45f76501321cdde Author: Mark Johnston AuthorDate: 2025-09-18 22:39:39 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:01 +0000 pw: Use copy_file_range() when copying skeleton files As a bonus, check for I/O errors and print them to standard error. Reviewed by: bapt, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52588 (cherry picked from commit a03d150a3d44c49344ebd0862defd1a5ad1f524e) --- usr.sbin/pw/cpdir.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c index 63068cab000c..3839a039495a 100644 --- a/usr.sbin/pw/cpdir.c +++ b/usr.sbin/pw/cpdir.c @@ -36,10 +36,10 @@ #include "pw.h" void -copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid, +copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, gid_t gid, int flags) { - char *p, lnk[MAXPATHLEN], copybuf[4096]; + char *p, lnk[MAXPATHLEN]; int len, homefd, srcfd, destfd; ssize_t sz; struct stat st; @@ -120,8 +120,12 @@ copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid, continue; } - while ((sz = read(srcfd, copybuf, sizeof(copybuf))) > 0) - write(destfd, copybuf, sz); + do { + sz = copy_file_range(srcfd, NULL, destfd, NULL, + SSIZE_MAX, 0); + } while (sz > 0); + if (sz < 0) + warn("copy_file_range"); close(srcfd); /* From nobody Sun Oct 5 13:13:34 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjWz2N6tz69s8H; Sun, 05 Oct 2025 13:13: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjWy6ctdz3qBj; Sun, 05 Oct 2025 13:13:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rvbiYQQlnlcum7NvUNakEf4EbbY2k7hnnvjiGQ/Yp7Y=; b=JbBMYFrYZmJ569KLqeBMbdej1OROUbGQiEn5DOPix5W20r7fdkzlXBMpIKUFkVPOVt/8A1 ehT9IyrzohI7FHidIBXJ71t+VkW2x9oOkwdE4SLAr8VXi9JPhz//ocfJxW3iAdSwDGlsEZ CktcUXdlENaa2kmArvr8xsRW8XTMzkDMQ+iLyoKWDf6LoWEcrYmM3YIoZNLC2MTy9J6ieW 1Q+bwQJuYoOGfUX+cKN/+oFu1x0wCxZ8cnPLlGToi/IkHfxGScL5UAJ39UrHFiN+J/jg0o psKiCVAMBUi0l7O5Crf1dWyS+hsXY8c7RL4MVe7ng3Mj4BNwI6um+azs2++EWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rvbiYQQlnlcum7NvUNakEf4EbbY2k7hnnvjiGQ/Yp7Y=; b=rN36nXG/+Wb7hRnN8fYO+2V7STu1NCtBIq3Wj0L84P/7nQmtYYhw3wEwcO7AA9Nnrv50gI yuc0AqgCMTNeb6XoeWm3HHntZ/JndO8NBvZRCI9z3h7tsfC0ztO4Jl4Rc9A2SKoDvBbbrq 6xhyUAMpxvWRSuQ6Kd5tpKt2aTSk0pZ7NgmrXtqLEiCgfB09HmVDnXK+aA3pod1iuwulpv j3F0anzBVG1sCc67TVvJxiT9QB91ZabN4ZCfSrKUqELDt6ak/tJZKZToA0OuHyeW24xcMP rmBjlqExwbLgf9at+tHc33V5RWGf8tItPjPpIrZwC5wuC64b7n6KYMVYHnuVHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670014; a=rsa-sha256; cv=none; b=mD/pHZipJcTATagaHzMLpEP4T5Z4HBA6J0pkOUyCvW9udymcKTKbw0KtvaCSTYOLu3JXDF 6USTFKHYu74sbbO7v5mBGAgTrUzG9ynFUcM4nfygYuhHP3H3xuxq+zukkfssQ1t1qI/LNL XpHv1c8xpmwE2ABqfOQ2QcsCBnWVq6grCLjpPoAchyRhpr+jU+JXZZzlftvLzV6jiavmtv b2y1XDz/sgzRFVZct9/vo1Ec5eLoSxyavNdbzFT18d6oB7udlcctNagPOXoL1pQXlAe7jx zOcpdDbvK+OAnz70Cn5FJgXMR5EEKV6U6ezKGe6q0dQrwGciI1zvPNQfcCENfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjWy692dz75; Sun, 05 Oct 2025 13:13: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 595DDYTa075312; Sun, 5 Oct 2025 13:13:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DDY2N075309; Sun, 5 Oct 2025 13:13:34 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:13:34 GMT Message-Id: <202510051313.595DDY2N075309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 806af8240801 - stable/14 - pw: Add a metalog output mode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 806af8240801ccc823dc790dae802b17d8e6fb19 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=806af8240801ccc823dc790dae802b17d8e6fb19 commit 806af8240801ccc823dc790dae802b17d8e6fb19 Author: Mark Johnston AuthorDate: 2025-09-18 22:40:00 +0000 Commit: Mark Johnston CommitDate: 2025-10-05 13:13:01 +0000 pw: Add a metalog output mode When creating OS images as a non-root user, it may be useful to pre-create users in the staged tree. The useradd operation adds files to the new user's home directory, copied from the skeleton directory (/usr/share/skel), which makes it inconvient for use in this scenario since the added files are not recorded in the mtree metalog. To cover this gap, this change adds a new -M option to pw's useradd operation, causing pw to add mtree entries for newly added files. Extend an existing regression test to validate this mode. Reviewed by: bapt, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D52590 (cherry picked from commit 182ed3c0755f1bf161d8be02016b5f6cf9b57556) --- usr.sbin/pw/cpdir.c | 43 +++++++++++++++++++++------------ usr.sbin/pw/pw.8 | 16 +++++++++++++ usr.sbin/pw/pw.c | 30 +++++++++++++++++++++-- usr.sbin/pw/pw.h | 5 ++++ usr.sbin/pw/pw_user.c | 9 ++++++- usr.sbin/pw/pw_utils.c | 46 ++++++++++++++++++++++++++++++++++++ usr.sbin/pw/pwupd.h | 1 + usr.sbin/pw/tests/pw_useradd_test.sh | 20 ++++++++++++---- 8 files changed, 148 insertions(+), 22 deletions(-) diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c index 3839a039495a..979323d64342 100644 --- a/usr.sbin/pw/cpdir.c +++ b/usr.sbin/pw/cpdir.c @@ -40,49 +40,48 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, gid_t gid, int flags) { char *p, lnk[MAXPATHLEN]; - int len, homefd, srcfd, destfd; + int len, srcfd, destfd; ssize_t sz; struct stat st; struct dirent *e; DIR *d; + mode_t pumask; if (*dir == '/') dir++; + pumask = umask(0); + umask(pumask); + if (mkdirat(rootfd, dir, mode) != 0) { - mode_t pumask; if (errno != EEXIST) { warn("mkdir(%s)", dir); return; } - pumask = umask(0); - umask(pumask); - if (fchmodat(rootfd, dir, mode & ~pumask, AT_SYMLINK_NOFOLLOW) == -1) warn("chmod(%s)", dir); } - if (fchownat(rootfd, dir, uid, gid, AT_SYMLINK_NOFOLLOW) == -1) warn("chown(%s)", dir); - if (flags > 0 && chflagsat(rootfd, dir, flags, AT_SYMLINK_NOFOLLOW) == -1) warn("chflags(%s)", dir); + metalog_emit(dir, (mode | S_IFDIR) & ~pumask, uid, gid, flags); if (skelfd == -1) return; - homefd = openat(rootfd, dir, O_DIRECTORY); if ((d = fdopendir(skelfd)) == NULL) { close(skelfd); - close(homefd); return; } while ((e = readdir(d)) != NULL) { + char path[MAXPATHLEN]; + if (strcmp(e->d_name, ".") == 0 || strcmp(e->d_name, "..") == 0) continue; @@ -92,19 +91,32 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, if (strncmp(p, "dot.", 4) == 0) /* Conversion */ p += 3; + (void)snprintf(path, sizeof(path), "%s/%s", dir, p); if (S_ISDIR(st.st_mode)) { - copymkdir(homefd, p, openat(skelfd, e->d_name, O_DIRECTORY), - st.st_mode & _DEF_DIRMODE, uid, gid, st.st_flags); + int fd; + + fd = openat(skelfd, e->d_name, O_DIRECTORY); + if (fd == -1) { + warn("openat(%s)", e->d_name); + continue; + } + copymkdir(rootfd, path, fd, st.st_mode & _DEF_DIRMODE, + uid, gid, st.st_flags); continue; } if (S_ISLNK(st.st_mode) && - (len = readlinkat(skelfd, e->d_name, lnk, sizeof(lnk) -1)) + (len = readlinkat(skelfd, e->d_name, lnk, sizeof(lnk) - 1)) != -1) { lnk[len] = '\0'; - symlinkat(lnk, homefd, p); - fchownat(homefd, p, uid, gid, AT_SYMLINK_NOFOLLOW); + if (symlinkat(lnk, rootfd, path) != 0) + warn("symlink(%s)", path); + else if (fchownat(rootfd, path, uid, gid, + AT_SYMLINK_NOFOLLOW) != 0) + warn("chown(%s)", path); + metalog_emit_symlink(path, lnk, st.st_mode & ~pumask, + uid, gid); continue; } @@ -113,7 +125,7 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, if ((srcfd = openat(skelfd, e->d_name, O_RDONLY)) == -1) continue; - destfd = openat(homefd, p, O_RDWR | O_CREAT | O_EXCL, + destfd = openat(rootfd, path, O_RDWR | O_CREAT | O_EXCL, st.st_mode); if (destfd == -1) { close(srcfd); @@ -135,6 +147,7 @@ copymkdir(int rootfd, char const *dir, int skelfd, mode_t mode, uid_t uid, warn("chown(%s)", p); if (fchflags(destfd, st.st_flags) != 0) warn("chflags(%s)", p); + metalog_emit(path, st.st_mode & ~pumask, uid, gid, st.st_flags); close(destfd); } closedir(d); diff --git a/usr.sbin/pw/pw.8 b/usr.sbin/pw/pw.8 index 5eae810b6732..f6d9ebca6308 100644 --- a/usr.sbin/pw/pw.8 +++ b/usr.sbin/pw/pw.8 @@ -30,6 +30,7 @@ .Nd create, remove, modify & display system users and groups .Sh SYNOPSIS .Nm +.Op Fl M Ar metalog .Op Fl R Ar rootdir .Op Fl V Ar etcdir .Cm useradd @@ -464,6 +465,21 @@ option, bearing the name of the new account. This can be overridden by the .Fl d option on the command line, if desired. +.It Fl M Ar metalog +Specify a path to a +.Xr mtree 5 +metalog file. +.Nm +will add entries for all files added to a user's home directory. +This is useful when building images as a non-root user, as the +metalog can be used as input to +.Xr tar 1 +or +.Xr makefs 8 . +Note that this option must precede the +.Ql useradd +string on the command line, otherwise it will be interpreted as the mode +option. .It Fl M Ar mode Create the user's home directory with the specified .Ar mode , diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c index 6f59e392bdd0..7cb5dd160e12 100644 --- a/usr.sbin/pw/pw.c +++ b/usr.sbin/pw/pw.c @@ -132,7 +132,11 @@ main(int argc, char *argv[]) while (argc > 1) { if (*argv[1] == '-') { /* - * Special case, allow pw -V [args] for scripts etc. + * Special case, allow pw -V [args] for + * scripts etc. + * + * The -M option before the keyword is handled + * differently from -M after a keyword. */ arg = argv[1][1]; if (arg == 'V' || arg == 'R') { @@ -164,6 +168,23 @@ main(int argc, char *argv[]) "%s%s", optarg, arg == 'R' ? _PATH_PWD : ""); conf.altroot = true; + } else if (mode == -1 && which == -1 && arg == 'M') { + int fd; + + optarg = &argv[1][2]; + if (*optarg == '\0') { + optarg = argv[2]; + ++argv; + --argc; + } + fd = open(optarg, + O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, + 0644); + if (fd == -1) + errx(EX_OSERR, + "Cannot open metalog `%s'", + optarg); + conf.metalog = fdopen(fd, "ae"); } else break; } else if (mode == -1 && (tmp = getindex(Modes, argv[1])) != -1) @@ -195,6 +216,10 @@ main(int argc, char *argv[]) if (conf.rootfd == -1) errx(EXIT_FAILURE, "Unable to open '%s'", conf.rootdir); + if (conf.metalog != NULL && (which != W_USER || mode != M_ADD)) + errx(EXIT_FAILURE, + "metalog can only be specified with 'useradd'"); + return (cmdfunc[which][mode](argc, argv, arg1)); } @@ -233,10 +258,11 @@ cmdhelp(int mode, int which) static const char *help[W_NUM][M_NUM] = { { - "usage: pw useradd [name] [switches]\n" + "usage: pw [-M metalog] useradd [name] [switches]\n" "\t-V etcdir alternate /etc location\n" "\t-R rootdir alternate root directory\n" "\t-C config configuration file\n" + "\t-M metalog mtree file, must precede 'useradd'\n" "\t-q quiet operation\n" " Adding users:\n" "\t-n name login name\n" diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index c3725693f91d..ceb843d79503 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -70,6 +70,11 @@ struct userconf *get_userconfig(const char *cfg); struct userconf *read_userconfig(char const * file); int write_userconfig(struct userconf *cnf, char const * file); +void metalog_emit(const char *path, mode_t mode, uid_t uid, gid_t gid, + int flags); +void metalog_emit_symlink(const char *path, const char *target, mode_t mode, + uid_t uid, gid_t gid); + int pw_group_add(int argc, char **argv, char *name); int pw_group_del(int argc, char **argv, char *name); int pw_group_mod(int argc, char **argv, char *name); diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 007f750c7d1a..413eac4882cc 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -86,10 +86,13 @@ mkdir_home_parents(int dfd, const char *dir) { struct stat st; char *dirs, *tmp; + mode_t pumask; + + pumask = umask(0); + umask(pumask); if (*dir != '/') errx(EX_DATAERR, "invalid base directory for home '%s'", dir); - dir++; if (fstatat(dfd, dir, &st, 0) != -1) { @@ -120,6 +123,9 @@ mkdir_home_parents(int dfd, const char *dir) dirs); if (fchownat(dfd, dirs, 0, 0, 0) != 0) warn("chown(%s)", dirs); + metalog_emit(dir, + (_DEF_DIRMODE | S_IFDIR) & ~pumask, 0, 0, + 0); } *tmp = '/'; } @@ -129,6 +135,7 @@ mkdir_home_parents(int dfd, const char *dir) err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); if (fchownat(dfd, dirs, 0, 0, 0) != 0) warn("chown(%s)", dirs); + metalog_emit(dirs, (_DEF_DIRMODE | S_IFDIR) & ~pumask, 0, 0, 0); } free(dirs); diff --git a/usr.sbin/pw/pw_utils.c b/usr.sbin/pw/pw_utils.c index 9be1656bcfe1..87dd421ca8a3 100644 --- a/usr.sbin/pw/pw_utils.c +++ b/usr.sbin/pw/pw_utils.c @@ -92,3 +92,49 @@ nis_update(void) { errx(i, "make exited with status %d", i); return (i); } + +static void +metalog_emit_record(const char *path, const char *target, mode_t mode, + uid_t uid, gid_t gid, int flags) +{ + const char *flagstr, *type; + int error; + + if (conf.metalog == NULL) + return; + + if (target != NULL) + type = "link"; + else if (S_ISDIR(mode)) + type = "dir"; + else if (S_ISREG(mode)) + type = "file"; + else + errx(1, "metalog_emit: unhandled file type for %s", path); + + flagstr = fflagstostr(flags & + (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)); + if (flagstr == NULL) + errx(1, "metalog_emit: fflagstostr failed"); + + error = fprintf(conf.metalog, + "./%s type=%s mode=0%03o uid=%u gid=%u%s%s%s%s\n", + path, type, mode & ACCESSPERMS, uid, gid, + target != NULL ? " link=" : "", target != NULL ? target : "", + *flagstr != '\0' ? " flags=" : "", *flagstr != '\0' ? flagstr : ""); + if (error < 0) + errx(1, "metalog_emit: write error"); +} + +void +metalog_emit(const char *path, mode_t mode, uid_t uid, gid_t gid, int flags) +{ + metalog_emit_record(path, NULL, mode, uid, gid, flags); +} + +void +metalog_emit_symlink(const char *path, const char *target, mode_t mode, + uid_t uid, gid_t gid) +{ + metalog_emit_record(path, target, mode, uid, gid, 0); +} diff --git a/usr.sbin/pw/pwupd.h b/usr.sbin/pw/pwupd.h index 7e62d9fe402c..18d2a2f41fcb 100644 --- a/usr.sbin/pw/pwupd.h +++ b/usr.sbin/pw/pwupd.h @@ -77,6 +77,7 @@ struct userconf { struct pwconf { char rootdir[MAXPATHLEN]; char etcpath[MAXPATHLEN]; + FILE *metalog; int fd; int rootfd; bool altroot; diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index 6413c063d482..75e96a64ba8e 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -1,4 +1,3 @@ - # Import helper functions . $(atf_get_srcdir)/helper_functions.shin @@ -357,15 +356,28 @@ user_add_skel_body() { echo "c" > ${HOME}/skel/c/d/dot.c mkdir ${HOME}/home ln -sf /nonexistent ${HOME}/skel/c/foo - atf_check -s exit:0 ${RPW} useradd foo -k /skel -m + atf_check -s exit:0 ${RPW} -M METALOG useradd foo -k /skel -m test -d ${HOME}/home/foo || atf_fail "Directory not created" test -f ${HOME}/home/foo/.a || atf_fail "File not created" atf_check -o file:${HOME}/skel/.a -s exit:0 cat ${HOME}/home/foo/.a atf_check -o file:${HOME}/skel/b -s exit:0 cat ${HOME}/home/foo/b - test -d ${HOME}/home/foo/c || atf_fail "Dotted directory in skel not copied" - test -d ${HOME}/home/foo/.plop || atf_fail "Directory in skell not created" + test -d ${HOME}/home/foo/c || atf_fail "Directory in skel not copied" + test -d ${HOME}/home/foo/.plop || atf_fail "Dotted directory in skel not created" atf_check -o inline:"/nonexistent\n" -s ignore readlink -f ${HOME}/home/foo/c/foo atf_check -o file:${HOME}/skel/c/d/dot.c -s exit:0 cat ${HOME}/home/foo/c/d/.c + + cat <<__EOF__ >METALOG.expected +./home/foo type=dir mode=0755 uid=1001 gid=1001 +./home/foo/.a type=file mode=0644 uid=1001 gid=1001 +./home/foo/.plop type=dir mode=0755 uid=1001 gid=1001 +./home/foo/b type=file mode=0644 uid=1001 gid=1001 +./home/foo/c type=dir mode=0755 uid=1001 gid=1001 +./home/foo/c/d type=dir mode=0755 uid=1001 gid=1001 +./home/foo/c/d/.c type=file mode=0644 uid=1001 gid=1001 +./home/foo/c/foo type=link mode=0755 uid=1001 gid=1001 link=/nonexistent +__EOF__ + atf_check -o save:METALOG.out sort METALOG + atf_check diff METALOG.out METALOG.expected } atf_test_case user_add_uid0 From nobody Sun Oct 5 13:20:14 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjgf62gjz69sVX; Sun, 05 Oct 2025 13:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjgf5XBFz3sGg; Sun, 05 Oct 2025 13:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JElOZjRmym73hlrZh2FSG1urpXWU+UaHkIVxNv02G34=; b=lPWGbBzhngHvS+jjWDUiYDXZY6P5v1p1HATo1DL50kA6QvOhrfBmU1Fq+Evt8h3PHSqs23 EJIfo5ai6tnXIlYROEAwEgcuGHoJSz/XyTVga3xKyme4YsDHHiR4J8hDGfNrhUF22CwHyu 6+ZyHOYLyLRTsxvVNyxeXw3gizpUYGh8slFXZPoUZf39hQ5zG7iqYac2c19OR7LGw2m9/D cLlvCMXbjEuMmi+Vr394vWezqEbzsfZudIgCyaEmPxVQjbmCZCnZQufhoLTDJ9z/c4kEM4 n+Z5N/TD0GyPwNRR63KDqJO/irs3d9ku3NOsIZR33ntG/IdKnu2aJQ0468qUig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JElOZjRmym73hlrZh2FSG1urpXWU+UaHkIVxNv02G34=; b=sjW6UyvdWi5siS/HZtfbzPT1gWFNE2sUleYD4JUbHcQssViI7Yx6NeKqR311kYy7bSMQrb fpud3BmgS1hMN8VUKnaKTlO70LxXCq0g0I6LMEd9byrCebhvGhm3+TQfIk2nLv5QTK0rkQ 3V/08umfsoqyBZBwkpAAnQjorDrHkSn78qA5e8iCXWsJRY69Now7IpJ3/1B8jLRVEVvx6S FS2IaGExp6jj+/vT7YpLh6y5x9vqptr/fLGNSyjAcJDCwUdWzB+6htKkkEIATJjOTGfeKz XgoZETwjYIpvjqvhu8X1ZwgbYLzX+ok9uN3Sm7QonOmgHn8SpznlmITfbMJSgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670414; a=rsa-sha256; cv=none; b=cNaUiuw9s0PePq+Rg0qXW7NbuAivGwOiWGPNPxWc+mHOznsTJiO3FZeuxGjbXbsWiUj6wR s4EqinSXBbQHFpAhZYWhzVpgFTutVKW4agWgZ3SUnLn+Lha3xPfaQfEbTMz0YQ0VAF/iyy h+oPE1KK6j6O0CACnHQ7gwwAweb0Fpqc/lMOo4SG6xfiO/LLOiap+Lq5FsWOQc/jZb/jvu 2/aN9kvf5YYRLnJj5O380NlGNMkONTtW9DSzNW1A/W/nN2JBmeq4kushu6GJ4auKRO2g70 eJpHuRzfaqL09Sma5aNfoVFFYX7Xv2n7AeT8QCqqc4z/oRBdnRcnJGuFhY97Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjgf4PmWz3s; Sun, 05 Oct 2025 13:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 595DKEm9083932; Sun, 5 Oct 2025 13:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DKEWM083923; Sun, 5 Oct 2025 13:20:14 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:20:14 GMT Message-Id: <202510051320.595DKEWM083923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: b7b48ba8420f - stable/14 - tcp: keep SYN-cache entry when sending of challenge ACK fails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: b7b48ba8420f6203ac7165b6b07c62929bb759e8 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b7b48ba8420f6203ac7165b6b07c62929bb759e8 commit b7b48ba8420f6203ac7165b6b07c62929bb759e8 Author: Michael Tuexen AuthorDate: 2025-10-02 06:57:14 +0000 Commit: Michael Tuexen CommitDate: 2025-10-05 13:19:37 +0000 tcp: keep SYN-cache entry when sending of challenge ACK fails Don't drop a SYN-cache entry just because a challenge ACK couldn't be sent. This might only be a temporary failure. Reviewed by: Nick Banks, glebius, jtl Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52840 (cherry picked from commit 7841b44f8491d69c75207d0f3a1eb34501d99edd) --- sys/netinet/tcp_syncache.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 012240f46ffb..ce2ab29f4008 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -130,7 +130,7 @@ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); static int syncache_respond(struct syncache *, const struct mbuf *, int); -static int syncache_send_challenge_ack(struct syncache *, struct mbuf *); +static void syncache_send_challenge_ack(struct syncache *, struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -703,10 +703,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m, "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - if (syncache_send_challenge_ack(sc, m) != 0) { - syncache_drop(sc, sch); - TCPSTAT_INC(tcps_sc_dropped); - } + syncache_send_challenge_ack(sc, m); } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -2062,22 +2059,16 @@ syncache_respond(struct syncache *sc, const struct mbuf *m0, int flags) return (error); } -static int +static void syncache_send_challenge_ack(struct syncache *sc, struct mbuf *m) { - int error; - if (tcp_challenge_ack_check(&sc->sc_challenge_ack_end, &sc->sc_challenge_ack_cnt)) { - error = syncache_respond(sc, m, TH_ACK); - if (error == 0) { + if (syncache_respond(sc, m, TH_ACK) == 0) { TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); } - } else { - error = 0; } - return (error); } /* From nobody Sun Oct 5 13:25:03 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjnD1Vzkz69tBh; Sun, 05 Oct 2025 13:25: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjnD0P3dz3t1D; Sun, 05 Oct 2025 13:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WLveArdW6txptTqudrihiwx865MNBabrdhn/dmyzOtc=; b=LndEc3jL+eeAc+rLdQL3jej0Lo+UthOs/HFs9pG1RiiIvt6biP4zt0W8eVe3i5q+OuZRrp 9EPAIV0AjTlPPqSFDmhwrGpvEUyWzDoM2sWpFayuuiNurIJCNs5Z2CnaO4Vpd4Am8WnZZ/ x8shO/FSpHud3Bkf7K7ymuKOVMepJJz8JwvFK7A6xpFaxpguu3XI3a0RozbuNPZ/A0YgBd XQLVBUTiCScKld0C8keqqM6Ehj3c1U1PUKDJ+fkqN1QOoAk6BvchKI/O4hawNJ1jjJGMLR Dzg2ZdPgTD7IP2TkY5/LoB2kWq7C7HuJmbQiIr9Rv0OKL3HWGOaiwHNqJT3HRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WLveArdW6txptTqudrihiwx865MNBabrdhn/dmyzOtc=; b=rBD8tSG6iVbsfUpGNBclbBfqPs6EfDBku65hgWO1zsNT9rfuKpVA+KJfETIO2JrWovjy81 Zs7q/kVj5wwmq4MFiP+zHelfywXKJFiGSnSaYyqPX6CkaPD8M4pc0mV84HlrzsOgLevNE+ mndYZgAbBleJFEUB3Ckbddf3ut+Wln8hdlDrxBR0rnXIgYEt3kZrdTsXWjTnyukEJ4+1gI yyyZt3Ptl+/1+kbJhqMjFOCF4IayUYVi5ieHkC11zRpLBgH95BwgFuWcpHMGDf63TXMBzh mwJj4IGgFo4I9Vcr8kJIvyoysYaI2DhfbGfZhmFeLCEoi/PFmKESbkBE9pjkig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670704; a=rsa-sha256; cv=none; b=oe8LCkp+cXFN4f5jjImUlZrnAE7/eJJfemjAEcK72Zwxy8wA5KurD6BEf/Jeh/dQLsrotU KBW2HOradNyGbqm5QsitbXUMjEO9VD2zXMoDBb0uz0eFzFy1DxCZNTbJmC5Gfb+bToVsW8 tRk/QjDKYe1EDKmwrMawiWTXq3kBjBvwgk6pkvK9IsOdEopyCzrCHyZe5zQp+R8Zz/5nE/ 58iMxmcGdBeVPnDSNXI2W7JueI2YOCGNWShrsgPW6HKMzuIOIuuoE/aBlKVIpHvpP29kCh nMi9oaD1049AcNxxRVCRfCbmmLJ93fQoypX28F8l093HdNOhhWGy1R7s7zrAvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjnC75pPzN1; Sun, 05 Oct 2025 13:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 595DP3al094060; Sun, 5 Oct 2025 13:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DP3pI094058; Sun, 5 Oct 2025 13:25:03 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:25:03 GMT Message-Id: <202510051325.595DP3pI094058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: b0501abb4cfb - stable/14 - tcp: cleanup syncache_expand() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: b0501abb4cfb8ffee7a7245ca197d290df912e22 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b0501abb4cfb8ffee7a7245ca197d290df912e22 commit b0501abb4cfb8ffee7a7245ca197d290df912e22 Author: Michael Tuexen AuthorDate: 2025-10-01 19:14:23 +0000 Commit: Michael Tuexen CommitDate: 2025-10-05 13:24:37 +0000 tcp: cleanup syncache_expand() Only validate SEG.SEQ and SEG.ACK when processing a real SYN-cache entry. In the SYN-cookie case, these conditions are always true, since the SYN-cache entry on the stack is constructed from the incoming TCP segment. While there, fix the logging messages. Reviewed by: Nick Banks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52816 (cherry picked from commit 3034fa3d4321fdc487428c9050711de9ce234567) --- sys/netinet/tcp_syncache.c | 52 ++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index ce2ab29f4008..4ab0d251698c 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1264,6 +1264,35 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, return (-1); /* Do not send RST */ } } + + /* + * SEG.ACK validation: + * SEG.ACK must match our initial send sequence number + 1. + */ + if (th->th_ack != sc->sc_iss + 1) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, " + "segment rejected\n", + s, __func__, th->th_ack, sc->sc_iss + 1); + goto failed; + } + + /* + * SEG.SEQ validation: + * The SEG.SEQ must be in the window starting at our + * initial receive sequence number + 1. + */ + if (SEQ_LEQ(th->th_seq, sc->sc_irs) || + SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd)) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, " + "segment rejected\n", + s, __func__, th->th_seq, sc->sc_irs + 1); + goto failed; + } + TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); sch->sch_length--; #ifdef TCP_OFFLOAD @@ -1276,29 +1305,6 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, SCH_UNLOCK(sch); } - /* - * Segment validation: - * ACK must match our initial sequence number + 1 (the SYN|ACK). - */ - if (th->th_ack != sc->sc_iss + 1) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, segment " - "rejected\n", s, __func__, th->th_ack, sc->sc_iss); - goto failed; - } - - /* - * The SEQ must fall in the window starting at the received - * initial receive sequence number + 1 (the SYN). - */ - if (SEQ_LEQ(th->th_seq, sc->sc_irs) || - SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, segment " - "rejected\n", s, __func__, th->th_seq, sc->sc_irs); - goto failed; - } - *lsop = syncache_socket(sc, *lsop, m); if (__predict_false(*lsop == NULL)) { From nobody Sun Oct 5 13:26:01 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjpL1Wm7z69tTm; Sun, 05 Oct 2025 13:26: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjpK6ZxZz3tCB; Sun, 05 Oct 2025 13:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VWJxwT8eT/EcFHzqPevizKdvDpWgWpoJigvwm6mzOSM=; b=f1DlK8uzsw+lnZx1ZC8Fklwy2ikVX/SLCSgGUU8gzu0WKFNpuIp3ShWwr6R+OUBfLTdGP6 1qZTCYTicQTXlIloOabm5tgTXJ/sexKTpmHHffaLeguUkBlU3qmBPYE3FDbg06P2i/RvAE MnGQ9CC3a4gSrMVHyuqIy7zeyr2r4UILcHe4ge4ZVk5i9rWe7iL0PgC9azXNAk+dET3Ajb hE438mhXzgHxL+fjY6KzrrJLYRKhGwb/Bqs3g0TZQhU7fwneSitT4zPoOwiYhYNrffLXmc N0yhU26BrHNqP0M00mEeK+14hQfHHc/TIfQ1byfN71kbgAt2EUg9tOg1IkrrPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759670761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VWJxwT8eT/EcFHzqPevizKdvDpWgWpoJigvwm6mzOSM=; b=U/QHk7aY0ic/PAqSz45DtAMQAmY/nxE5QNgHF5C7WArA/4NxzhlfUbRHjJX1BKsUBdwOWl Oiw+Qc7AA1pKkBSEUQP5Yf8xmQItr5F356mgmmiA+0gVH5lYWd0OcoQ6MQutNwPNEbXdrx bSddHiMIPYCcD2Lml5sfVLIdLmNRM6U+jeenVvQdfLMhbT9X/VTreqsriI5UZH+PV0lcJe 2Sxo+Hc6YwBZvumK74h76nM5JQTQdBBRvz0ejJb03e8hOpL37uhUyte3TMt8MqhW42B9Hu 9GHKrnVvGuCnzJJXiAwtxo+2iu2Bfwzdd7xebNpRuh4c86Z1ZziaBIEi7qeM3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759670761; a=rsa-sha256; cv=none; b=kXP0STg0ZwAzVvTkx37s1m7YL/R8V41j/RamGgr1UFn5zES7OaKY4DQ/u20gVvpsLCqWhm CMAiWTllf3ogx5H87RICPTe+9N+gcDOOMLo8+ZPRz64LxuGD2Ip/cmkCq7Gn0aYMZ+ZY/+ 1ZNa/fpQqxZgO46Moz5kevheuM6VR4Si8kB7561lCHng+wlNW6DUlfg1T1J2lVZfzKp/71 GbgUm3AfHjqas33b3h3gmWFqMAlk+6mRst1nNP1mMAQXn1dTexs1+FyLHPl1aJ0sq9eLiH TZ3foPet+fwySMTSJHmIAJ2e1uDT03eicpYyzkiXPRp3FTj6F2qnYp5mm+ZrkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjpK60yyzBV; Sun, 05 Oct 2025 13:26: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 595DQ1xk094479; Sun, 5 Oct 2025 13:26:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DQ11m094476; Sun, 5 Oct 2025 13:26:01 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:26:01 GMT Message-Id: <202510051326.595DQ11m094476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: a7dcd4c2a9fb - stable/14 - tcp: improve segment validation in SYN-RECEIVED List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: a7dcd4c2a9fb35cac756db04326827efbaa4589b Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a7dcd4c2a9fb35cac756db04326827efbaa4589b commit a7dcd4c2a9fb35cac756db04326827efbaa4589b Author: Michael Tuexen AuthorDate: 2025-10-02 14:51:09 +0000 Commit: Michael Tuexen CommitDate: 2025-10-05 13:25:35 +0000 tcp: improve segment validation in SYN-RECEIVED The validation of SEG.SEQ (first step in SEGMENT ARRIVES of RFC 9293) should be done before the validation of SEG.ACK (fifth step in SEGMENT ARRIVES in RFC 9293). Furthermore, when the SEG.SEQ validation fails, a challenge ACK should be sent instead of sending a RST-segment and moving the endpoint to CLOSED. Reported by: Tilnel on freebsd-net Reviewed by: Nick Banks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52849 (cherry picked from commit b7118461f9099876cb2c2923948f8fb647defd57) --- sys/netinet/tcp_syncache.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 4ab0d251698c..ee3b9b4994c9 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1265,19 +1265,6 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, } } - /* - * SEG.ACK validation: - * SEG.ACK must match our initial send sequence number + 1. - */ - if (th->th_ack != sc->sc_iss + 1) { - SCH_UNLOCK(sch); - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, " - "segment rejected\n", - s, __func__, th->th_ack, sc->sc_iss + 1); - goto failed; - } - /* * SEG.SEQ validation: * The SEG.SEQ must be in the window starting at our @@ -1285,11 +1272,26 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ if (SEQ_LEQ(th->th_seq, sc->sc_irs) || SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd)) { - SCH_UNLOCK(sch); if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, " - "segment rejected\n", + "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1); + syncache_send_challenge_ack(sc, m); + SCH_UNLOCK(sch); + free(s, M_TCPLOG); + return (-1); /* Do not send RST */; + } + + /* + * SEG.ACK validation: + * SEG.ACK must match our initial send sequence number + 1. + */ + if (th->th_ack != sc->sc_iss + 1) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, " + "segment rejected\n", + s, __func__, th->th_ack, sc->sc_iss + 1); goto failed; } From nobody Sun Oct 5 13:30:15 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjvC5skhz69tkT; Sun, 05 Oct 2025 13:30: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjvC4S7Kz3thG; Sun, 05 Oct 2025 13: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=1759671015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymFEETexMHqb+Gjg68syTz1anKOBu/sCbVoHxuWWR9w=; b=fBcOiKL7aYW/UNGv263onAa7e1Oxao2Ugf0V3Z9T5Ru0UFo5Tx9Gz6LeCJ/iRzZVIYhX/H CMMytQ3nAlxO3QKI/+pLUcc+4GL3nzmPVpmcZbfzc7/bDO7eRvUTvVkzj77MUYGHO1MM1e YS8TrOweJgpM6bzSy4M7cEaC3dWkIDfYSnr9NvuyhvZXd3O/GZAZN43/ESlFQ/Fj1B5Ism BreCJw0F2OwB2HVUMplIwHrJtS9W3N9jMT44NXvpCru5cWbDZaL1uhc6YZ3j3BCMzuyQiJ IhWpzIg7fO9xYX0snDfXqeVDlRqjbE2iSR4mUddAmIeQdRNPHFEktPvF9XcltA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759671015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ymFEETexMHqb+Gjg68syTz1anKOBu/sCbVoHxuWWR9w=; b=UHB8JhCbIeJLjV8hpxZZbuc+f4C+d/C5VoF9iLtytd8L6t5lGl+XtM/l+6Uam1o0XyDAj1 PVdv2NWNH6tzrhWDBoPuYpWjWcQJpc4wdxmJvxxYNb2rmxZQ4CfqkddK/6/kGlYwhtdEbx dDstiZzBVRYq5mD+kGP/YGIWQKAqp0dI4ZyE8cRzxGdoITAy3jusCLjpEpKqKKIszcaTYL eDke3wYeKHKrnmxQYKCMNhcWqJO9T996bBSjvk+ouxFqcTbKjcWSydszAz9ZklIBq/woRg xeysEoZR47EVIZWA8quw0h6AtmsXj42ISUx4OZZrIHFyESQPYiDqDOW03q+Mmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759671015; a=rsa-sha256; cv=none; b=Rj8Dlpek+F+RXppkaDfqzqonRP99ug+URiwLtqtKHcZHmR+6MyFohHA8Mggt2nJgnqMHCP OoWt1KOMjpoG/v8Y1X0AJdO66dehnP6DyUFMNqlYZXEgPybXLFEFe1a/7KMSlEhs/31wGX gSkNCMkIDIrDFtyMtXF0SFu3V0N3mO1r3TfQ02KnoxfiF+VoRZ9jcnT/mtzYSA/n2OTqKa G4Ft232+iy0Oo7kySzDoJXa4kd0sPIBr2CLXFG6cqQvE7wO8akJIreb9v9TSXmCO9q+qv2 jA5xZL0mO0INtjUCVGzGX2MbW+998GvicCNux+k24umOBYsyIxyGZEJXMl1EbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjvC3Qf3zN3; Sun, 05 Oct 2025 13: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 595DUFRT002779; Sun, 5 Oct 2025 13: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 595DUF8c002775; Sun, 5 Oct 2025 13:30:15 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:30:15 GMT Message-Id: <202510051330.595DUF8c002775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 0ca910a682c3 - stable/15 - tcp: cleanup syncache_expand() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 0ca910a682c332feee35b431a5097440bbf65bc7 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0ca910a682c332feee35b431a5097440bbf65bc7 commit 0ca910a682c332feee35b431a5097440bbf65bc7 Author: Michael Tuexen AuthorDate: 2025-10-01 19:14:23 +0000 Commit: Michael Tuexen CommitDate: 2025-10-05 13:29:55 +0000 tcp: cleanup syncache_expand() Only validate SEG.SEQ and SEG.ACK when processing a real SYN-cache entry. In the SYN-cookie case, these conditions are always true, since the SYN-cache entry on the stack is constructed from the incoming TCP segment. While there, fix the logging messages. Reviewed by: Nick Banks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52816 (cherry picked from commit 3034fa3d4321fdc487428c9050711de9ce234567) --- sys/netinet/tcp_syncache.c | 52 ++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 72e9dccea9a5..518cef66e7fa 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1260,6 +1260,35 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, return (-1); /* Do not send RST */ } } + + /* + * SEG.ACK validation: + * SEG.ACK must match our initial send sequence number + 1. + */ + if (th->th_ack != sc->sc_iss + 1) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, " + "segment rejected\n", + s, __func__, th->th_ack, sc->sc_iss + 1); + goto failed; + } + + /* + * SEG.SEQ validation: + * The SEG.SEQ must be in the window starting at our + * initial receive sequence number + 1. + */ + if (SEQ_LEQ(th->th_seq, sc->sc_irs) || + SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd)) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, " + "segment rejected\n", + s, __func__, th->th_seq, sc->sc_irs + 1); + goto failed; + } + TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); sch->sch_length--; #ifdef TCP_OFFLOAD @@ -1272,29 +1301,6 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, SCH_UNLOCK(sch); } - /* - * Segment validation: - * ACK must match our initial sequence number + 1 (the SYN|ACK). - */ - if (th->th_ack != sc->sc_iss + 1) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, segment " - "rejected\n", s, __func__, th->th_ack, sc->sc_iss); - goto failed; - } - - /* - * The SEQ must fall in the window starting at the received - * initial receive sequence number + 1 (the SYN). - */ - if (SEQ_LEQ(th->th_seq, sc->sc_irs) || - SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd)) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, segment " - "rejected\n", s, __func__, th->th_seq, sc->sc_irs); - goto failed; - } - *lsop = syncache_socket(sc, *lsop, m); if (__predict_false(*lsop == NULL)) { From nobody Sun Oct 5 13:30:58 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjw25tKZz69vDr; Sun, 05 Oct 2025 13:30: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjw25PLWz3tyq; Sun, 05 Oct 2025 13:30:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759671058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lODXA491Z4aHsXHqcvA9K6iASQN3E+hrokaJA1pap58=; b=F1Hb4OMLO8vcwhNQlPwvpIR6zqlg31IOBcLm1vGZ6cMaKsyKLN7s/YsIJyuvwHfna/AIyq tp6Pb8KA7n1CKzXOsc8J6r5OtUufOdOa3/2mGKNILW1t4gPtrLEX7lBqjYuXmJ0fVk/TQP u6yjAE3MB1P1Mqw24eDUHyr202H4F8MYrYYVbBFeFXXDmQCFRktnLgAe2aqCcmdPcfdGCZ nIX7abvU4gZHi2j88ocSwDbvUZBkblcBozssUKw5L/jl/CcakzzpLSkzYr4hy48M4P+Qmy b/tSN0/gUrPZEZ/4rZuXw1gEdkd9UbWMGE+9tLRe7chkPoxGTcrkE84APqq9fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759671058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lODXA491Z4aHsXHqcvA9K6iASQN3E+hrokaJA1pap58=; b=NuAPc8iWbay7jTI51SqZZW0aq4wNrebrGmYresaqIhk+nH7Ha0tfaOViI+rFEwjy707u7w cJOuLfypywMGR+tV3mPhpBdJVLmbupMQDG82DGMI8YPhe7BDaT7CE/UxMBHhSugIBG7rKh kCP7DAatE/XI9Oh5P7k1jQnpMTUb+ha+orqE5TjXZB5CFfl0/GmM/TBMb98bLCcB1vAy3D tRyDdif6P66Dplf1IjmKNFfYl7dMqvhsprL8+haThfx97jRiYRHbtBZawyKOv2Bm2iq+ID sSdNXWRrtjYeDeiahUFY7VzN9Tyt1H9P9mXonTMqRlGIGqLydYGSmAOqqd6nwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759671058; a=rsa-sha256; cv=none; b=xASIPYB2GX0b2tj7G2Lp3aYyfZEI+DPTcUXj4wHdsxDwbhNAdTxSCp0BMcg7M0ePfFumER xRIn2MbVfVqzMVusifgDxCVS3kTgoAFGR2wXEmRshaOURq6pBdmhBBfsqpDOVtxqN2Vf9p 7iZGIEGWmWiZZWtyLOgRSlqSZ4QqxjuuPQ2soJ1FhOCb0Q9mBYaIfQXn0EtBWcz7bDuJJb CFiLzex3i07GeRAq4IyneNz0afPXZiLNsq8TEz7Km6GUtJTbPopkNCTai9JeVTEpfcT9DY TdmedrrQBekcq2pECDb4EnOhRimhZIDTt5/PADMaRW631VuJtRSNz57vh/qWFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjw24VN5z1SG3; Sun, 05 Oct 2025 13:30: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 595DUwN6004843; Sun, 5 Oct 2025 13:30:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595DUwn1004840; Sun, 5 Oct 2025 13:30:58 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:30:58 GMT Message-Id: <202510051330.595DUwn1004840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 81ea2bdab13b - stable/15 - tcp: keep SYN-cache entry when sending of challenge ACK fails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 81ea2bdab13b04966d23bd6263e5ca9385544976 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=81ea2bdab13b04966d23bd6263e5ca9385544976 commit 81ea2bdab13b04966d23bd6263e5ca9385544976 Author: Michael Tuexen AuthorDate: 2025-10-02 06:57:14 +0000 Commit: Michael Tuexen CommitDate: 2025-10-05 13:30:34 +0000 tcp: keep SYN-cache entry when sending of challenge ACK fails Don't drop a SYN-cache entry just because a challenge ACK couldn't be sent. This might only be a temporary failure. Reviewed by: Nick Banks, glebius, jtl Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52840 (cherry picked from commit 7841b44f8491d69c75207d0f3a1eb34501d99edd) --- sys/netinet/tcp_syncache.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 518cef66e7fa..778ab0583735 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -122,7 +122,7 @@ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); static int syncache_respond(struct syncache *, const struct mbuf *, int); -static int syncache_send_challenge_ack(struct syncache *, struct mbuf *); +static void syncache_send_challenge_ack(struct syncache *, struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -695,10 +695,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m, "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - if (syncache_send_challenge_ack(sc, m) != 0) { - syncache_drop(sc, sch); - TCPSTAT_INC(tcps_sc_dropped); - } + syncache_send_challenge_ack(sc, m); } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -2061,22 +2058,16 @@ syncache_respond(struct syncache *sc, const struct mbuf *m0, int flags) return (error); } -static int +static void syncache_send_challenge_ack(struct syncache *sc, struct mbuf *m) { - int error; - if (tcp_challenge_ack_check(&sc->sc_challenge_ack_end, &sc->sc_challenge_ack_cnt)) { - error = syncache_respond(sc, m, TH_ACK); - if (error == 0) { + if (syncache_respond(sc, m, TH_ACK) == 0) { TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); } - } else { - error = 0; } - return (error); } /* From nobody Sun Oct 5 13:32:04 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfjxJ6VStz69vKx; Sun, 05 Oct 2025 13:32: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfjxJ5k2bz3tyb; Sun, 05 Oct 2025 13: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=1759671124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b3psnGyO5cOklFoA4DspdXlFog/DMLCPzTiZumSgMFM=; b=U6ySxJRhfYCV7yLCB05x+OtvdEKm1wbm42pU8ugnlv71L4drO+8cUHw6f+uso4+wDJmAY+ c6bfYo3eLXdeHUiunpXv18KM0PLIkRHghRP94NSXdYhLmTtE4s5pNdEmBnozgkjYnfzhAp T/DQIPOko0RUigc9XbpztlqBXv+L5QN4OPf7NQWTbo+hT3hYI4cCFGMv8s/lX6C3df6bru U4EO2hRF+RQfxzq4SiqaQRszW1RcTowAy39t+v8YGoZPcsIZCJGkX97PRL4uaJ5M+GasT7 rLAeLLDpbQp1T98OFNDcX8fOPFXfxM6JML4r+mGcDMdTUn5BDrV3wpFsTkb+1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759671124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b3psnGyO5cOklFoA4DspdXlFog/DMLCPzTiZumSgMFM=; b=DogNdS07nfM2o+Aoq9dIUGi6q+PD+/EO1vDG5LFaCBogg2/zpnPRrCdMV4DKy9mqFYl/N9 jILiv4GGqiLpHrQDkB2wiIbuQjbMdLSRk9LihTzwmM5mk5qVDHXRw8IZvpLCQ9h09XCMhZ 8M8wWWvHPNQrS5QRrOwfv7hhbaaWREHKSyNBgBb7m2oiQ1mdP7cpzN7+O/eg6m+GlZOj8F To0E8cV6/qRuNY07RVZ8HWHde9u2VSHCw539ge3VexbnQ3zk6h2oXLHsCGGitXz0HZ8HPW 1Ae8FfypAkMtip6JKphVshd4RHCk81EixfNNVBtnYVY/ZWoEIFx9LY5uZ1Kimw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759671124; a=rsa-sha256; cv=none; b=em2Op7oWE4jb7SPhQEg5ao4pPxRYGp0bNQi2WF+8pi+kejFu8sN3FqokWVufeNgfV3QuYO KgPU4RjOlOgzG/8AbAZqvnqfB5euaFWSPKUhlMg1gNbFh+dLksrxdNhOpwAnb2ti69H4Pq 0wj+QQbXNDxqVpMXzDKfdCzxle0NpNjkauyJUTkTZU6+oLShP1TaF3leoa1Pgsd2c7XPsh ScCVD+2fZqYKwlY9INO8OjcS0zJvSVuLECCmrsFkiQFi7o35CpeHXxq/dfNj45rMp9IDJl y26EHbHk5G3dafQhV5VbPDJeGrgl+NXxNXqrHaWkU7aiJKFxv2K15l9hX1LRLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfjxJ4jrbzTn; Sun, 05 Oct 2025 13: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 595DW4EV012128; Sun, 5 Oct 2025 13: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 595DW4g8012125; Sun, 5 Oct 2025 13:32:04 GMT (envelope-from git) Date: Sun, 5 Oct 2025 13:32:04 GMT Message-Id: <202510051332.595DW4g8012125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f846f0cc6002 - stable/15 - tcp: improve segment validation in SYN-RECEIVED List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: f846f0cc600236409e187c44481f68597b95f8ce Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f846f0cc600236409e187c44481f68597b95f8ce commit f846f0cc600236409e187c44481f68597b95f8ce Author: Michael Tuexen AuthorDate: 2025-10-02 14:51:09 +0000 Commit: Michael Tuexen CommitDate: 2025-10-05 13:31:21 +0000 tcp: improve segment validation in SYN-RECEIVED The validation of SEG.SEQ (first step in SEGMENT ARRIVES of RFC 9293) should be done before the validation of SEG.ACK (fifth step in SEGMENT ARRIVES in RFC 9293). Furthermore, when the SEG.SEQ validation fails, a challenge ACK should be sent instead of sending a RST-segment and moving the endpoint to CLOSED. Reported by: Tilnel on freebsd-net Reviewed by: Nick Banks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52849 (cherry picked from commit b7118461f9099876cb2c2923948f8fb647defd57) --- sys/netinet/tcp_syncache.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 778ab0583735..7f842512858d 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1258,19 +1258,6 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, } } - /* - * SEG.ACK validation: - * SEG.ACK must match our initial send sequence number + 1. - */ - if (th->th_ack != sc->sc_iss + 1) { - SCH_UNLOCK(sch); - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, " - "segment rejected\n", - s, __func__, th->th_ack, sc->sc_iss + 1); - goto failed; - } - /* * SEG.SEQ validation: * The SEG.SEQ must be in the window starting at our @@ -1278,11 +1265,26 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ if (SEQ_LEQ(th->th_seq, sc->sc_irs) || SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd)) { - SCH_UNLOCK(sch); if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, " - "segment rejected\n", + "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1); + syncache_send_challenge_ack(sc, m); + SCH_UNLOCK(sch); + free(s, M_TCPLOG); + return (-1); /* Do not send RST */; + } + + /* + * SEG.ACK validation: + * SEG.ACK must match our initial send sequence number + 1. + */ + if (th->th_ack != sc->sc_iss + 1) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: ACK %u != ISS+1 %u, " + "segment rejected\n", + s, __func__, th->th_ack, sc->sc_iss + 1); goto failed; } From nobody Sun Oct 5 19:52:38 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cftNR1h5Jz6BXNX; Sun, 05 Oct 2025 19:52: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cftNR1Nlsz3pXH; Sun, 05 Oct 2025 19:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759693959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B0WdC2fZMyxzMbpaSRpzvufkc8AsOC7rHmPocoLvj5c=; b=DjaCLSFZxlDdVct0fIchUCUxih94KNotmM84g/hcUfmNk2zYo3xC5UbwlSrpuUIcpdRyVc BnMEwy1qi/1LtRvkvllFke+pZSgo17rptwvg5WSURAukCcyx86rXUBG7OFZ+FVQnIVtPxf Blyjrg1gGdmdTd56V0s2sIeEUnAEKXh6mtWrY96aZFP6oPSfmJSKgBBH/QB2Mapw9CC+eJ LZ47ZLB6elzJihuhV3TcDiVRY8AZzky01Yvs5njtiEDerJQnoQTaSReAEKoP7ziT2SQTAH UZ2uiDFE8qwKasmSzzjdw7F+YzJPzh1czUdnxqgKvcxvMob5d81Jg6yjIzZYDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759693959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B0WdC2fZMyxzMbpaSRpzvufkc8AsOC7rHmPocoLvj5c=; b=yfbhxdrfGzxnHmuTjnt5mcQKkDgiGO7D1+Y/55qh+I1NH/YNkIZI+2xVI+82kC7gM1EUt4 X4TLTjkAgNIl1xwpDdsQojgoFMLS+L+k+/Sy6MapiiEA5bu4RuHnJfLGOH3FaDiNbva8ct zoy4vze3y3aw2ayU4884pez/V8MdVr3WSk2X2jisLmlc6yftMKAylyXGkxYuHAPulZHkrI c7nyO+FnZp+u/j1RnCzq+CvJKbbikWJW1hGAZyChj0N+ImdZmQzpkokc3p3YAymEMwEjtg 4j7+F5dUYTBcVDydGxJWbyhGT7o/f9rY16MtJ32ZKJF+FyHUFqGrY37SkSmpCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759693959; a=rsa-sha256; cv=none; b=QSoh1PQUX27WpMbFnLDAe7ocxz5Ip3UDGCm1Uzlt5ZrphlWVv42VNFXCyb0c28CFxMeKiP Ql70G6gQTIf93lGPMJUip30ZoQnBN7F4yezGD1DZ9FQV/xTuDctStK/XbZu1Ntfj9i1J+5 iwsySQ7qklfIEhNiJladKUf0sXTpn91PHTEKoUqdSm/CcqiFza8dpiysJWb1CvBvqc0C77 YfoazIbjQvKMJ8Qfw8q4Xse5GNxTroW+f7DHTI9YX6oLOCCAetJIf3KJpGxeV9YoawH5xR gDHLsSRBgECpGd+iC8p3Od8p4MAXEp7g6EBYVcvF0gXsMgMKJhMtESMZGGiMwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cftNR0shkzBWh; Sun, 05 Oct 2025 19:52: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 595JqdGX028729; Sun, 5 Oct 2025 19:52:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595Jqcv5028720; Sun, 5 Oct 2025 19:52:38 GMT (envelope-from git) Date: Sun, 5 Oct 2025 19:52:38 GMT Message-Id: <202510051952.595Jqcv5028720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 0cafc294bf12 - stable/15 - zfs: merge openzfs/zfs@2f50d6740 (zfs-2.4-release) into stable/15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0cafc294bf1223c9ecad5ff0fdf9c064b7ed3e94 Auto-Submitted: auto-generated The branch stable/15 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=0cafc294bf1223c9ecad5ff0fdf9c064b7ed3e94 commit 0cafc294bf1223c9ecad5ff0fdf9c064b7ed3e94 Merge: f846f0cc6002 2f50d67409e2 Author: Martin Matuska AuthorDate: 2025-10-05 19:48:10 +0000 Commit: Martin Matuska CommitDate: 2025-10-05 19:48:10 +0000 zfs: merge openzfs/zfs@2f50d6740 (zfs-2.4-release) into stable/15 OpenZFS 2.4.0 rc2 Notable upstream pull request merges: #15869 8604e67dc Add description of default sorting behavior to zfs_list.8 #16025 460858dfd dnode_next_offset: backtrack if lower level does not match #17019 c755aa486 Fix wrong dedup_table_size for legacy dedup #17543 -multiple zfs allow send:raw #17576 -multiple Add allocation profile export and zhack subcommand for import #17600 04d991dbc Update pam_zfs_key.c defaultt path for FreeBSD #17632 774a34f3f Synchronize the update of feature refcount #17645 b727163db zfs_vnops_os.c: Add support for the _PC_CLONE_BLKSIZE name #17665 2fc6bf82b zdb: Fix format strings on 32-bit systems #17673 5846a8515 Update compatibility.d files #17690 56e8ab4a3 zvol: reject suspend attempts when zvol is shutting down #17704 cfd640c3e Fix warnings about sha2_is_supported on FreeBSD/i386 #17705 ef9b7dde9 Fix a printf format specifier on FreeBSD/i386 #17706 b23eae62b Fix the build on 32-bit FreeBSD with GCC #17227 -multiple Detect a slow raidz child during reads #17708 9c6f72021 Fix atomic-alignment warnings in libspl on FreeBSD/i386 #17712 -multiple cmd: rename to zarcstat / zarcsummary #17717 3dc345851 Prevent scrubbing a read-only pool #17719 da33cfd43 vdev_disk_close: take disk write lock before destroying it #17722 b5d41deca FreeBSD: Satisfy ASSERT_VOP_IN_SEQC() #17729 efdb4bf07 Fix two infinite loops if dmu_prefetch_max set to zero #17730 95d677efd Fix ddle memleak in ddt_log_load #17732 5f7253ca1 Refactor `zhack label repair` and fix `-c` regression on nonzero TXG #17733 41c6eaac8 Fix type in dbrrd_closest() #17735 cac483dbd Fix time database update calculations #17742 8b548776f zfsprops(7): attempt to clarify the keylocation description #17748 1ca4cd8a3 Fix txg_log_time ZAP key typo #17755 9bcda0b5f Use "vdev" instead of "devices" when referring to vdevs #17758 954fe5e1b Add interface to interface spa_get_worst_case_min_alloc() function #17764 61a68554d zdb: Fix asize overflow in verify_livelist_allocs() #17765 9079f986a zvol: Fix blk-mq sync #17786 35ec4b14a zpool iostat: refresh pool list every interval #17780 d33d0cac5 Fix 'zpool add' safety check corner cases #17783 e1a6ec42d zdb: add ZFS_KEYFORMAT_RAW support for -K option #17800 f3295ec76 range_tree: drop duplicate zfs_ prefix from rs_set_fill_raw Obtained from: OpenZFS OpenZFS commit: 2f50d67409e26d559a67281d3e8f56f93af4a4c1 OpenZFS tag: zfs-2.4.0-rc2 .../openzfs/.github/PULL_REQUEST_TEMPLATE.md | 5 - .../.github/workflows/scripts/generate-ci-type.py | 2 +- .../.github/workflows/scripts/qemu-2-start.sh | 2 +- .../.github/workflows/scripts/qemu-3-deps-vm.sh | 11 +- .../.github/workflows/scripts/qemu-5-setup.sh | 25 +- .../.github/workflows/scripts/qemu-6-tests.sh | 2 +- sys/contrib/openzfs/.github/workflows/zfs-qemu.yml | 7 +- sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/Makefile.am | 4 + sys/contrib/openzfs/cmd/Makefile.am | 11 +- .../openzfs/cmd/{arcstat.in => zarcstat.in} | 22 +- .../openzfs/cmd/{arc_summary => zarcsummary} | 6 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 69 ++++- sys/contrib/openzfs/cmd/zdb/zdb.h | 2 +- sys/contrib/openzfs/cmd/zdb/zdb_il.c | 2 - sys/contrib/openzfs/cmd/zed/zed.d/Makefile.am | 24 +- ...eadman-slot_off.sh => deadman-sync-slot_off.sh} | 0 .../openzfs/cmd/zed/zed.d/pool_import-led.sh | 1 - .../openzfs/cmd/zed/zed.d/pool_import-sync-led.sh | 1 + ...{statechange-led.sh => statechange-sync-led.sh} | 0 ...ge-slot_off.sh => statechange-sync-slot_off.sh} | 0 .../openzfs/cmd/zed/zed.d/vdev_attach-led.sh | 1 - .../openzfs/cmd/zed/zed.d/vdev_attach-sync-led.sh | 1 + .../openzfs/cmd/zed/zed.d/vdev_clear-led.sh | 1 - .../openzfs/cmd/zed/zed.d/vdev_clear-sync-led.sh | 1 + sys/contrib/openzfs/cmd/zed/zed_exec.c | 111 +++++-- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 42 ++- sys/contrib/openzfs/cmd/zhack.c | 335 ++++++++++++++++---- sys/contrib/openzfs/cmd/zpool/Makefile.am | 5 +- .../openzfs/cmd/zpool/compatibility.d/openzfs-2.4 | 48 +++ sys/contrib/openzfs/cmd/zpool/zpool_iter.c | 125 +++++--- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 64 ++-- sys/contrib/openzfs/cmd/zpool/zpool_util.h | 3 +- sys/contrib/openzfs/cmd/zpool/zpool_vdev.c | 26 +- sys/contrib/openzfs/cmd/zstream/Makefile.am | 5 +- sys/contrib/openzfs/config/Shellcheck.am | 12 +- sys/contrib/openzfs/config/always-arch.m4 | 18 ++ .../openzfs/config/always-compiler-options.m4 | 83 +++-- sys/contrib/openzfs/config/kernel-blkdev.m4 | 9 +- .../openzfs/config/kernel-dentry-operations.m4 | 37 ++- sys/contrib/openzfs/config/kernel.m4 | 2 + sys/contrib/openzfs/config/user-statx.m4 | 6 +- sys/contrib/openzfs/config/zfs-build.m4 | 3 + sys/contrib/openzfs/contrib/debian/copyright | 4 +- sys/contrib/openzfs/contrib/debian/not-installed | 4 +- .../contrib/debian/openzfs-libnvpair3.install.in | 2 +- .../contrib/debian/openzfs-libpam-zfs.install | 2 +- .../contrib/debian/openzfs-libpam-zfs.postinst | 2 +- .../contrib/debian/openzfs-libuutil3.install.in | 2 +- .../contrib/debian/openzfs-libzfs-dev.install.in | 6 +- .../contrib/debian/openzfs-libzfs6.install.in | 4 +- .../debian/openzfs-libzfsbootenv1.install.in | 2 +- .../contrib/debian/openzfs-libzpool6.install.in | 2 +- .../contrib/debian/openzfs-zfs-test.install | 2 +- .../openzfs/contrib/debian/openzfs-zfs-zed.install | 2 +- .../contrib/debian/openzfs-zfsutils.install | 72 ++--- .../openzfs/contrib/debian/openzfs-zfsutils.links | 3 + sys/contrib/openzfs/contrib/debian/rules.in | 39 +-- .../usr/share/initramfs-tools/hooks/zdev | 2 +- .../contrib/dracut/90zfs/module-setup.sh.in | 3 +- .../openzfs/contrib/initramfs/hooks/zfsunlock.in | 9 + .../openzfs/contrib/pam_zfs_key/pam_zfs_key.c | 4 + .../contrib/pyzfs/libzfs_core/exceptions.py | 1 - .../pyzfs/libzfs_core/test/test_libzfs_core.py | 2 +- .../openzfs/include/os/freebsd/spl/sys/time.h | 11 + .../include/os/linux/kernel/linux/blkdev_compat.h | 18 -- .../include/os/linux/kernel/linux/dcache_compat.h | 26 -- .../openzfs/include/os/linux/spl/sys/rwlock.h | 2 +- .../openzfs/include/os/linux/spl/sys/stat.h | 2 +- .../openzfs/include/os/linux/spl/sys/time.h | 8 + sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 1 + sys/contrib/openzfs/include/sys/dmu.h | 6 +- sys/contrib/openzfs/include/sys/dsl_deleg.h | 1 + sys/contrib/openzfs/include/sys/fm/fs/zfs.h | 1 + sys/contrib/openzfs/include/sys/fs/zfs.h | 5 + sys/contrib/openzfs/include/sys/range_tree.h | 5 +- sys/contrib/openzfs/include/sys/spa.h | 1 + sys/contrib/openzfs/include/sys/spa_impl.h | 1 + sys/contrib/openzfs/include/sys/vdev_impl.h | 6 + sys/contrib/openzfs/include/sys/vdev_raidz.h | 3 + sys/contrib/openzfs/include/sys/vdev_raidz_impl.h | 2 + sys/contrib/openzfs/include/sys/zfs_file.h | 2 +- sys/contrib/openzfs/include/sys/zio.h | 3 +- sys/contrib/openzfs/include/sys/zvol.h | 2 +- sys/contrib/openzfs/include/zfs_deleg.h | 1 + sys/contrib/openzfs/lib/libspl/Makefile.am | 3 + .../openzfs/lib/libspl/include/os/linux/sys/stat.h | 2 +- sys/contrib/openzfs/lib/libspl/include/sys/time.h | 9 + sys/contrib/openzfs/lib/libzfs/libzfs.abi | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 14 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 5 + sys/contrib/openzfs/lib/libzpool/kernel.c | 6 +- sys/contrib/openzfs/man/Makefile.am | 19 +- sys/contrib/openzfs/man/man1/cstyle.1 | 2 +- .../openzfs/man/man1/{arcstat.1 => zarcstat.1} | 6 +- sys/contrib/openzfs/man/man1/zhack.1 | 22 +- sys/contrib/openzfs/man/man1/ztest.1 | 2 +- sys/contrib/openzfs/man/man4/spl.4 | 2 +- sys/contrib/openzfs/man/man4/zfs.4 | 82 ++++- sys/contrib/openzfs/man/man5/vdev_id.conf.5 | 2 +- sys/contrib/openzfs/man/man7/dracut.zfs.7 | 2 +- sys/contrib/openzfs/man/man7/vdevprops.7 | 41 ++- sys/contrib/openzfs/man/man7/zfsconcepts.7 | 2 +- sys/contrib/openzfs/man/man7/zfsprops.7 | 24 +- sys/contrib/openzfs/man/man7/zpool-features.7 | 2 +- sys/contrib/openzfs/man/man7/zpoolconcepts.7 | 2 +- sys/contrib/openzfs/man/man7/zpoolprops.7 | 2 +- sys/contrib/openzfs/man/man8/zdb.8 | 14 +- sys/contrib/openzfs/man/man8/zed.8.in | 34 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 5 +- sys/contrib/openzfs/man/man8/zfs-bookmark.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-clone.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-create.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-destroy.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-diff.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-hold.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-jail.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-list.8 | 47 +-- sys/contrib/openzfs/man/man8/zfs-load-key.8 | 2 +- .../openzfs/man/man8/zfs-mount-generator.8.in | 2 +- sys/contrib/openzfs/man/man8/zfs-mount.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-project.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-promote.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-rename.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-rewrite.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-set.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-share.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-snapshot.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-upgrade.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-userspace.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-wait.8 | 2 +- sys/contrib/openzfs/man/man8/zfs-zone.8 | 2 +- sys/contrib/openzfs/man/man8/zfs.8 | 2 +- sys/contrib/openzfs/man/man8/zfs_ids_to_path.8 | 2 +- sys/contrib/openzfs/man/man8/zgenhostid.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-attach.8 | 22 +- sys/contrib/openzfs/man/man8/zpool-checkpoint.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-clear.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-destroy.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-detach.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-events.8 | 10 + sys/contrib/openzfs/man/man8/zpool-export.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-get.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-history.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-initialize.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-iostat.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-labelclear.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-offline.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-reguid.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-reopen.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-replace.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-resilver.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-split.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-sync.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-trim.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 6 +- sys/contrib/openzfs/man/man8/zpool-wait.8 | 2 +- sys/contrib/openzfs/man/man8/zpool.8 | 2 +- sys/contrib/openzfs/man/man8/zstream.8 | 2 +- sys/contrib/openzfs/module/Kbuild.in | 2 +- .../openzfs/module/icp/algs/sha2/sha256_impl.c | 3 + .../openzfs/module/icp/algs/sha2/sha512_impl.c | 3 + .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 3 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 23 ++ .../openzfs/module/os/freebsd/zfs/zfs_znode_os.c | 6 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 6 +- .../openzfs/module/os/linux/zfs/zfs_file_os.c | 3 +- .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 6 + .../openzfs/module/os/linux/zfs/zpl_ctldir.c | 55 +++- .../openzfs/module/os/linux/zfs/zpl_super.c | 85 ++++- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 23 +- sys/contrib/openzfs/module/zcommon/zfs_deleg.c | 1 + sys/contrib/openzfs/module/zcommon/zpool_prop.c | 6 + sys/contrib/openzfs/module/zfs/ddt.c | 8 +- sys/contrib/openzfs/module/zfs/ddt_log.c | 30 +- sys/contrib/openzfs/module/zfs/dmu.c | 6 +- sys/contrib/openzfs/module/zfs/dnode.c | 65 +++- sys/contrib/openzfs/module/zfs/range_tree.c | 2 +- sys/contrib/openzfs/module/zfs/spa_config.c | 2 + sys/contrib/openzfs/module/zfs/spa_misc.c | 21 +- sys/contrib/openzfs/module/zfs/vdev.c | 132 +++++++- sys/contrib/openzfs/module/zfs/vdev_draid.c | 28 ++ sys/contrib/openzfs/module/zfs/vdev_file.c | 3 +- sys/contrib/openzfs/module/zfs/vdev_label.c | 2 + sys/contrib/openzfs/module/zfs/vdev_raidz.c | 345 +++++++++++++++++++++ sys/contrib/openzfs/module/zfs/zfeature.c | 5 + sys/contrib/openzfs/module/zfs/zfs_crrd.c | 7 +- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 23 +- sys/contrib/openzfs/module/zfs/zvol.c | 23 +- sys/contrib/openzfs/rpm/generic/zfs.spec.in | 6 +- sys/contrib/openzfs/scripts/mancheck.sh | 17 +- sys/contrib/openzfs/scripts/spdxcheck.pl | 4 +- sys/contrib/openzfs/scripts/zfs-helpers.sh | 7 + sys/contrib/openzfs/scripts/zfs-tests.sh | 9 +- sys/contrib/openzfs/tests/runfiles/common.run | 42 ++- sys/contrib/openzfs/tests/runfiles/linux.run | 6 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 4 +- .../tests/test-runner/bin/test-runner.py.in | 61 ++++ .../openzfs/tests/test-runner/bin/zts-report.py.in | 2 +- .../openzfs/tests/zfs-tests/cmd/crypto_test.c | 3 +- .../openzfs/tests/zfs-tests/include/commands.cfg | 6 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 56 +++- .../openzfs/tests/zfs-tests/include/tunables.cfg | 4 + .../openzfs/tests/zfs-tests/tests/Makefile.am | 31 +- .../functional/cli_root/zdb/zdb_encrypted_raw.ksh | 75 +++++ .../tests/functional/cli_root/zdb/zdb_tunables.ksh | 2 +- .../cli_root/zfs_send_delegation/cleanup.ksh | 43 +++ .../cli_root/zfs_send_delegation/setup.ksh | 50 +++ .../cli_root/zfs_send_delegation/zfs_send_test.ksh | 111 +++++++ .../tests/functional/cli_root/zhack/library.kshlib | 80 +++-- .../cli_root/zhack/zhack_label_repair_001.ksh | 15 +- .../cli_root/zhack/zhack_metaslab_leak.ksh | 70 +++++ .../functional/cli_root/zpool_add/zpool_add.kshlib | 42 +++ ...l_add_010_pos.ksh => zpool_add_warn_create.ksh} | 101 ++---- .../cli_root/zpool_add/zpool_add_warn_degraded.ksh | 204 ++++++++++++ .../cli_root/zpool_add/zpool_add_warn_removal.ksh | 126 ++++++++ .../functional/cli_root/zpool_iostat/cleanup.ksh | 30 ++ .../functional/cli_root/zpool_iostat/setup.ksh | 32 ++ .../cli_root/zpool_iostat/zpool_iostat.kshlib | 235 ++++++++++++++ .../zpool_iostat/zpool_iostat_interval_all.ksh | 90 ++++++ .../zpool_iostat/zpool_iostat_interval_some.ksh | 80 +++++ .../zpool_scrub/zpool_scrub_date_range_002.ksh | 76 +++++ .../{arcstat_001_pos.ksh => zarcstat_001_pos.ksh} | 2 +- ...summary_001_pos.ksh => zarcsummary_001_pos.ksh} | 10 +- ...summary_002_neg.ksh => zarcsummary_002_neg.ksh} | 6 +- .../cli_user/zfs_send_delegation_user/cleanup.ksh | 43 +++ .../cli_user/zfs_send_delegation_user/setup.ksh | 50 +++ .../zfs_send_delegation_user/zfs_send_usertest.ksh | 145 +++++++++ .../events/slow_vdev_degraded_sit_out.ksh | 106 +++++++ .../tests/functional/events/slow_vdev_sit_out.ksh | 102 ++++++ .../functional/events/slow_vdev_sit_out_neg.ksh | 116 +++++++ .../functional/events/zed_synchronous_zedlet.ksh | 149 +++++++++ .../functional/fault/auto_replace_001_pos.ksh | 2 +- .../functional/fault/auto_replace_002_pos.ksh | 2 +- .../tests/functional/fault/fault_limits.ksh | 2 +- .../functional/fault/suspend_on_probe_errors.ksh | 2 +- .../tests/functional/mount/mount_loopback.ksh | 111 +++++++ .../tests/functional/refreserv/refreserv_raidz.ksh | 46 +-- .../replacement/attach_resilver_sit_out.ksh | 189 +++++++++++ .../replacement/replace_resilver_sit_out.ksh | 199 ++++++++++++ .../zfs-tests/tests/functional/upgrade/setup.ksh | 2 +- .../functional/upgrade/upgrade_readonly_pool.ksh | 14 +- .../functional/zvol/zvol_misc/zvol_misc_fua.ksh | 40 ++- sys/modules/zfs/zfs_config.h | 15 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 253 files changed, 5084 insertions(+), 831 deletions(-) diff --cc sys/contrib/openzfs/cmd/zed/zed.d/pool_import-sync-led.sh index 000000000000,8b9c10c11ebb..8b9c10c11ebb mode 000000,120000..120000 --- a/sys/contrib/openzfs/cmd/zed/zed.d/pool_import-sync-led.sh +++ b/sys/contrib/openzfs/cmd/zed/zed.d/pool_import-sync-led.sh diff --cc sys/contrib/openzfs/cmd/zed/zed.d/vdev_attach-sync-led.sh index 000000000000,8b9c10c11ebb..8b9c10c11ebb mode 000000,120000..120000 --- a/sys/contrib/openzfs/cmd/zed/zed.d/vdev_attach-sync-led.sh +++ b/sys/contrib/openzfs/cmd/zed/zed.d/vdev_attach-sync-led.sh diff --cc sys/contrib/openzfs/cmd/zed/zed.d/vdev_clear-sync-led.sh index 000000000000,8b9c10c11ebb..8b9c10c11ebb mode 000000,120000..120000 --- a/sys/contrib/openzfs/cmd/zed/zed.d/vdev_clear-sync-led.sh +++ b/sys/contrib/openzfs/cmd/zed/zed.d/vdev_clear-sync-led.sh diff --cc sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.4 index 000000000000,3fbd91014c95..3fbd91014c95 mode 000000,100644..100644 --- a/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.4 +++ b/sys/contrib/openzfs/cmd/zpool/compatibility.d/openzfs-2.4 diff --cc sys/contrib/openzfs/contrib/debian/openzfs-zfsutils.links index 000000000000,54099e6573b0..54099e6573b0 mode 000000,100644..100644 --- a/sys/contrib/openzfs/contrib/debian/openzfs-zfsutils.links +++ b/sys/contrib/openzfs/contrib/debian/openzfs-zfsutils.links diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted_raw.ksh index 000000000000,85d267d5402f..85d267d5402f mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted_raw.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_encrypted_raw.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/cleanup.ksh index 000000000000,4a59e15cc693..4a59e15cc693 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/cleanup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/setup.ksh index 000000000000,0978193eddc4..0978193eddc4 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/setup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/zfs_send_test.ksh index 000000000000,d018f313fae1..d018f313fae1 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/zfs_send_test.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_send_delegation/zfs_send_test.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_metaslab_leak.ksh index 000000000000,0d2a39be6b5a..0d2a39be6b5a mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_metaslab_leak.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zhack/zhack_metaslab_leak.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_warn_degraded.ksh index 000000000000,313eb3666f27..313eb3666f27 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_warn_degraded.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_warn_degraded.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_warn_removal.ksh index 000000000000,782858e301ac..782858e301ac mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_warn_removal.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_warn_removal.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/cleanup.ksh index 000000000000,099b5426031d..099b5426031d mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/cleanup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/setup.ksh index 000000000000,3529a0ccc015..3529a0ccc015 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/setup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat.kshlib index 000000000000,ea4b0bd2756d..ea4b0bd2756d mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat.kshlib +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat.kshlib diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat_interval_all.ksh index 000000000000,8e040058ec3e..8e040058ec3e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat_interval_all.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat_interval_all.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat_interval_some.ksh index 000000000000,ab1f258aa1cd..ab1f258aa1cd mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat_interval_some.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_iostat/zpool_iostat_interval_some.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_date_range_002.ksh index 000000000000,9327df81a5c5..9327df81a5c5 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_date_range_002.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_scrub_date_range_002.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/cleanup.ksh index 000000000000,4a59e15cc693..4a59e15cc693 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/cleanup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/setup.ksh index 000000000000,0978193eddc4..0978193eddc4 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/setup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/zfs_send_usertest.ksh index 000000000000,f62f2b07929c..f62f2b07929c mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/zfs_send_usertest.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/zfs_send_usertest.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_degraded_sit_out.ksh index 000000000000,d5feb6936b4b..d5feb6936b4b mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_degraded_sit_out.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_degraded_sit_out.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_sit_out.ksh index 000000000000,37f616cf56ee..37f616cf56ee mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_sit_out.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_sit_out.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_sit_out_neg.ksh index 000000000000,457105a66453..457105a66453 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_sit_out_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/slow_vdev_sit_out_neg.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_synchronous_zedlet.ksh index 000000000000,6b732ea96d0c..6b732ea96d0c mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_synchronous_zedlet.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_synchronous_zedlet.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/mount/mount_loopback.ksh index 000000000000,86adef7ea032..86adef7ea032 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/mount/mount_loopback.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/mount/mount_loopback.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/replacement/attach_resilver_sit_out.ksh index 000000000000,6820aba184b7..6820aba184b7 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/replacement/attach_resilver_sit_out.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/replacement/attach_resilver_sit_out.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/replacement/replace_resilver_sit_out.ksh index 000000000000,4109dbaf45ac..4109dbaf45ac mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/replacement/replace_resilver_sit_out.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/replacement/replace_resilver_sit_out.ksh diff --cc sys/modules/zfs/zfs_config.h index 72167b752e53,000000000000..35d79f08ede1 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,879 -1,0 +1,882 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* __assign_str() has one arg */ +/* #undef HAVE_1ARG_ASSIGN_STR */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* backtrace() is available */ +/* #undef HAVE_BACKTRACE */ + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_file_open_by_path() exists */ +/* #undef HAVE_BDEV_FILE_OPEN_BY_PATH */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_nr_bytes() is available */ +/* #undef HAVE_BDEV_NR_BYTES */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* __blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS */ + +/* __blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS */ + +/* blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_FLAGS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() exists */ +/* #undef HAVE_BLKDEV_PUT */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* struct queue_limits has a features field */ +/* #undef HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_disk() exists and takes 2 args */ +/* #undef HAVE_BLK_ALLOC_DISK_2ARG */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue hardware context is cached in struct request */ +/* #undef HAVE_BLK_MQ_RQ_HCTX */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* backing_dev_info is available through queue gendisk */ +/* #undef HAVE_BLK_QUEUE_DISK_BDI */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* 3-arg dequeue_signal() takes a type argument */ +/* #undef HAVE_DEQUEUE_SIGNAL_3ARG_TYPE */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* dops->d_revalidate() takes 4 args */ +/* #undef HAVE_D_REVALIDATE_4ARGS */ + ++/* Define if d_set_d_op() is available */ ++/* #undef HAVE_D_SET_D_OP */ ++ +/* Define to 1 if you have the 'execvpe' function. */ +#define HAVE_EXECVPE 1 + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* file->f_version exists */ +/* #undef HAVE_FILE_F_VERSION */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* GENHD_FL_EXT_DEVT flag is available */ +/* #undef HAVE_GENHD_FL_EXT_DEVT */ + +/* GENHD_FL_NO_PART flag is available */ +/* #undef HAVE_GENHD_FL_NO_PART */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the 'gettid' function. */ +/* #undef HAVE_GETTID */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() returns struct dentry* */ +/* #undef HAVE_IOPS_MKDIR_DENTRY */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_get_pages2() is available */ +/* #undef HAVE_IOV_ITER_GET_PAGES2 */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* Define to 1 if you have the 'issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* iter_is_ubuf() is available */ +/* #undef HAVE_ITER_IS_UBUF */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel defines intptr_t */ +/* #undef HAVE_KERNEL_INTPTR_T */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* kernel has kmap_local_page */ +/* #undef HAVE_KMAP_LOCAL_PAGE */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [unwind] */ +/* #undef HAVE_LIBUNWIND */ + +/* libunwind has unw_get_elf_filename */ +/* #undef HAVE_LIBUNWIND_ELF */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* building against unsupported kernel version */ +/* #undef HAVE_LINUX_EXPERIMENTAL */ + - /* Define to 1 if you have the header file. */ - /* #undef HAVE_LINUX_STAT_H */ - +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Define to 1 if you have the 'mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* PG_error flag is available */ +/* #undef HAVE_MM_PAGE_FLAG_ERROR */ + +/* page_mapping() is available */ +/* #undef HAVE_MM_PAGE_MAPPING */ + +/* page_size() is available */ +/* #undef HAVE_MM_PAGE_SIZE */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* readahead_page() exists */ +/* #undef HAVE_PAGEMAP_READAHEAD_PAGE */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + *** 372 LINES SKIPPED *** From nobody Sun Oct 5 20:51:46 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfvhf5x8Kz6BfmG; Sun, 05 Oct 2025 20:51: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfvhf5Qmmz3vrW; Sun, 05 Oct 2025 20:51:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3vvKmv9gx15d21iYt2JdhQEXKGTqi3xOzG+A0vtj+Eo=; b=CWBaqG4hxVoaOihOZ06PXBxkHhbQbHxi/n6U2MJ/UNMnsz57PQZzyiySIswccI0PmAxfmT z/0mYWpsIQHiAuBeKpHd9UE64Ik4nFszuSuTtuuu4F0gk7asnjXK3oV2x5uK7A7F23T/4h Cgp/t2udFfdLlHtRcRavF6p0isug2kYpp3ROhZkC8bbNZYN8kPCr6HG9sSeI7s5hpz4jQ7 KzhT166epbXvNLpFW7NGXn1O0nS2TGjFB0+SnYqqfXDjx2HWZiUVZlyQBGG7yRhfRZqMY4 N6duGUqnVUu5lBzAxE563sN4xASVJ0ECMbmYHmKAmIZyZ9xYd+mU+luJbmLW3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3vvKmv9gx15d21iYt2JdhQEXKGTqi3xOzG+A0vtj+Eo=; b=hCSNMJEpZtIMvzRM14kfiAWVwojh8ECJ6JULAeUMXlHBHWO/orlzMuJUbniBsGQXFMYSXq OzeWlFRqSgy/mdatEBn0Vramypbko4vE65123vd19nrHTmt//xtWFaBQaP+Lm9C3h6n50t WFcrR4e7Cf9I6Y4xhCUn4CFsxVWiq95GuNg9NJ51ABCmOmk2zaaYWWU01lqyhH0VV7e8L/ 62ABbRrJSkBCutK+WkPzaVm5CpFksCZXp6T1NvTG91axvh1m1VcGjLB5+clv4VMiqxoC9p XxQOG0wWml3X52sqDKuoHoRI/24FeSh+06FiPPPngsimAnnxjVP2cwBBsbwlUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759697506; a=rsa-sha256; cv=none; b=gNHp93mZbL+VpG3bRNRficgwoz9li9w3ul3HEwnBcWVMybpwBYrKoopfYUDCvGBIMUOz1O 7sKVFe/9NxsquSDI+9r61na6JGQAsaoYIXDexhiKIr7bGpgRqXOB9T25RUqFGOr6hn+mgi iWir4S4dAHeAxPqZMKD0Ho770DPfuuglo+ljWlSfPSieuVfKTHT4pFrbzjZLf5ozxfFDRa +tfRRkOdkY7GrzWFHawUp0eNLCd30afPQ0KBRvKpQb9ONGIR5netmF1s/VjmgFr/hCvSC7 Aq8K8aj8V/F0iTQrYuFmHFAJ+z4XdTHO4TgWqlx45aguOFYA+wwDcbwdMsNNhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfvhf50CrzCkF; Sun, 05 Oct 2025 20:51: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 595KpkLB039907; Sun, 5 Oct 2025 20:51:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595Kpkgr039905; Sun, 5 Oct 2025 20:51:46 GMT (envelope-from git) Date: Sun, 5 Oct 2025 20:51:46 GMT Message-Id: <202510052051.595Kpkgr039905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 48cbd5698d9b - stable/15 - pf: fix possibe SCTP panic List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 48cbd5698d9b4d807fdb1f9c52e3431877c1f1ac Auto-Submitted: auto-generated The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=48cbd5698d9b4d807fdb1f9c52e3431877c1f1ac commit 48cbd5698d9b4d807fdb1f9c52e3431877c1f1ac Author: Kristof Provost AuthorDate: 2025-10-02 14:48:22 +0000 Commit: Kristof Provost CommitDate: 2025-10-05 20:47:34 +0000 pf: fix possibe SCTP panic While processing SCTP packets we can enqueue work for later, in the sctp_multihome_jobs queue. This deferred job includes a copy of the current struct pf_pdesc, which must contain a valid pcksum pointer (in case of NAT). However, jobs could be enqueued before we'd actually set this pointer in pf_setup_pdesc(). Set this pointer before we scan the SCTP chunk headers (and could enqueue deferred jobs.) While here sprinkle in a few more assertions to ensure we got this right. Reported-by: syzbot+974d0fb7e53c9aa31b90@syzkaller.appspotmail.com MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit dd2fc08d85431e10ad60e01e97b98e9dc23322bd) --- sys/netpfil/pf/pf.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index fb13f22bf0b1..8f151e3167f6 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3364,7 +3364,7 @@ pf_change_ap(struct pf_pdesc *pd, struct pf_addr *a, u_int16_t *p, u_int16_t po; uint8_t u = pd->virtual_proto == IPPROTO_UDP; - MPASS(pd->pcksum); + MPASS(pd->pcksum != NULL); if (pd->af == AF_INET) { MPASS(pd->ip_sum); } @@ -7600,6 +7600,7 @@ again: nj->pd.m = j->pd.m; nj->op = j->op; + MPASS(nj->pd.pcksum); TAILQ_INSERT_TAIL(&pd->sctp_multihome_jobs, nj, next); } PF_SCTP_ENDPOINTS_UNLOCK(); @@ -7719,6 +7720,7 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) job->pd.m = pd->m; job->op = op; + MPASS(job->pd.pcksum); TAILQ_INSERT_TAIL(&pd->sctp_multihome_jobs, job, next); break; } @@ -7752,6 +7754,7 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) job->pd.m = pd->m; job->op = op; + MPASS(job->pd.pcksum); TAILQ_INSERT_TAIL(&pd->sctp_multihome_jobs, job, next); break; } @@ -10579,17 +10582,21 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, REASON_SET(reason, PFRES_SHORT); return (-1); } - if (pf_scan_sctp(pd) != PF_PASS) { - *action = PF_DROP; - REASON_SET(reason, PFRES_SHORT); - return (-1); - } + /* * Placeholder. The SCTP checksum is 32-bits, but * pf_test_state() expects to update a 16-bit checksum. * Provide a dummy value which we'll subsequently ignore. + * Do this before pf_scan_sctp() so any jobs we enqueue + * have a pcksum set. */ pd->pcksum = &pd->sctp_dummy_sum; + + if (pf_scan_sctp(pd) != PF_PASS) { + *action = PF_DROP; + REASON_SET(reason, PFRES_SHORT); + return (-1); + } break; } case IPPROTO_ICMP: { From nobody Sun Oct 5 20:51:47 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfvhh1SqGz6BfPq; Sun, 05 Oct 2025 20:51: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfvhg6HX5z3vxW; Sun, 05 Oct 2025 20:51:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OOWie0OtHf3hVRKDQM2LybxEwhYbZCb7M52D/iJlFMg=; b=iq0BjbOxIsAcpgOREQH7nerOInMnTkZ3gEGTctawYKgoRZTyxP/qXxOPb/u7AdK1Yvt5Pt xSPSFgBR1eQHSMHp0HVYsop0B61qbEd3Y142HcXXuG9963z+5HS++hvfKxDj4YZ4iHEJw7 L/DT80RkxXSC2wPmDS7nrGwhN23fdTYx76br0MW4QtiPR24ac/dRtnIvmSQT/lTta5Htnj UtY6Rb8ElhXsr7DssN+Ve+Qspl45gylYfK/GaHNWCUas9TxBXzCNaCoWIl6HNkLivwUvx2 cgF/RjnBl1e6Twf4LNS9n0dt3Der26QZ8yDx72NQiLpOrcO3L8PDCQKk8wfC6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OOWie0OtHf3hVRKDQM2LybxEwhYbZCb7M52D/iJlFMg=; b=U68Gn9Cq1qPsKKGe758wbAcVXyoB/vNsytJRgk6o5um8w5my72aWHAbvgtovSdOMO+Wlqa ySkgjDa5Bdv0DNdGYFBdLITJIXdf8D0meSZVRo0k0DSCgnnevQME9A+ooebQLdcfC11dzM GrcJdsF+6hJ89Yk1DrK4d1d1/RfFeeZoxeYlvL78yokSLO/Vsd3nnuAV5fQOjMaBlQWLMP Wx7azL0lg6akqEE2AYkzTN8tRIzIROnPH9SXWlqck0+x258wnMsFI7mDoAZ0ugZI2zjlhI axXx9dBxxEd3SFIfDcPy9WtofWI4ohRAgl8piCDrZwzxi9RsZilKQlOHcdNqaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759697507; a=rsa-sha256; cv=none; b=RtrwjXefxbYPIE3gHfJ5GFGqgMkUMINAS7B2TBGB/K57/jppC/W4KkivVsQlMchGx7EX+K trNpFW/Us1Sn0mYdogcri6B/WF4PA1Kjz+EOwrnwxK5tdij8AfzuVCJLly+J6KGlEGpX54 EWDPAxs2DK72q+T7OTdj4nGIbH5t9GJJokfAP3tkAOMIozKhxgLISrrLfdC5LzJKQuM/Vr gNnqDEC9VLD9b58ZiUQ/zJLR6i1hC6zTEEn0n7+6Zetjf6tbIuCCZmlw1eOT4AOQH7vyJz l7XpP4CwEs4n6X2ranZyx7u767SkW9OsHs2VOiSsfQHjgnFW4+dIWOjEKcisLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfvhg5cNHzCLb; Sun, 05 Oct 2025 20:51: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 595KpliG039940; Sun, 5 Oct 2025 20:51:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595Kploo039937; Sun, 5 Oct 2025 20:51:47 GMT (envelope-from git) Date: Sun, 5 Oct 2025 20:51:47 GMT Message-Id: <202510052051.595Kploo039937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: dd4095f11b1e - stable/15 - pf: return PF_PASS/PF_DROP from pf_setup_pdesc() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: dd4095f11b1ea1305775e7595b0d3ed5efe1179c Auto-Submitted: auto-generated The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dd4095f11b1ea1305775e7595b0d3ed5efe1179c commit dd4095f11b1ea1305775e7595b0d3ed5efe1179c Author: Kristof Provost AuthorDate: 2025-10-02 14:55:07 +0000 Commit: Kristof Provost CommitDate: 2025-10-05 20:47:34 +0000 pf: return PF_PASS/PF_DROP from pf_setup_pdesc() We returned 'PF_DROP' instead of '-1' in one case, which would lead to us continuing the processing for an invalid packet. This also aligns us closer to OpenBSD, and reduces the odds of future similar mixups. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5d210f396e3f00698caa45077330dea8ffe979b5) --- sys/netpfil/pf/pf.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 8f151e3167f6..9637c25f7a76 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -10391,28 +10391,28 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, __func__); *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } h = mtod(pd->m, struct ip *); if (pd->m->m_pkthdr.len < ntohs(h->ip_len)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } if (pf_normalize_ip(reason, pd) != PF_PASS) { /* We do IP header normalization and packet reassembly here */ *m0 = pd->m; *action = PF_DROP; - return (-1); + return (PF_DROP); } *m0 = pd->m; h = mtod(pd->m, struct ip *); if (pf_walk_header(pd, h, reason) != PF_PASS) { *action = PF_DROP; - return (-1); + return (PF_DROP); } pd->src = (struct pf_addr *)&h->ip_src; @@ -10442,7 +10442,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, ", pullup failed", __func__); *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } h = mtod(pd->m, struct ip6_hdr *); @@ -10450,7 +10450,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, sizeof(struct ip6_hdr) + ntohs(h->ip6_plen)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } /* @@ -10459,12 +10459,12 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, */ if (htons(h->ip6_plen) == 0) { *action = PF_DROP; - return (-1); + return (PF_DROP); } if (pf_walk_header6(pd, h, reason) != PF_PASS) { *action = PF_DROP; - return (-1); + return (PF_DROP); } h = mtod(pd->m, struct ip6_hdr *); @@ -10486,13 +10486,13 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, PF_PASS) { *m0 = pd->m; *action = PF_DROP; - return (-1); + return (PF_DROP); } *m0 = pd->m; if (pd->m == NULL) { /* packet sits in reassembly queue, no error */ *action = PF_PASS; - return (-1); + return (PF_DROP); } /* Update pointers into the packet. */ @@ -10504,7 +10504,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, if (pf_walk_header6(pd, h, reason) != PF_PASS) { *action = PF_DROP; - return (-1); + return (PF_DROP); } if (m_tag_find(pd->m, PACKET_TAG_PF_REASSEMBLED, NULL) != NULL) { @@ -10534,7 +10534,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, reason, af)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } pd->hdrlen = sizeof(*th); pd->p_len = pd->tot_len - pd->off - (th->th_off << 2); @@ -10550,7 +10550,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, reason, af)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } pd->hdrlen = sizeof(*uh); if (uh->uh_dport == 0 || @@ -10558,7 +10558,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, ntohs(uh->uh_ulen) < sizeof(struct udphdr)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } pd->sport = &uh->uh_sport; pd->dport = &uh->uh_dport; @@ -10570,7 +10570,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, action, reason, af)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } pd->hdrlen = sizeof(pd->hdr.sctp); pd->p_len = pd->tot_len - pd->off; @@ -10580,7 +10580,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, if (pd->hdr.sctp.src_port == 0 || pd->hdr.sctp.dest_port == 0) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } /* @@ -10595,7 +10595,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, if (pf_scan_sctp(pd) != PF_PASS) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } break; } @@ -10604,7 +10604,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, action, reason, af)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } pd->pcksum = &pd->hdr.icmp.icmp_cksum; pd->hdrlen = ICMP_MINLEN; @@ -10618,7 +10618,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, action, reason, af)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } /* ICMP headers we look further into to match state */ switch (pd->hdr.icmp6.icmp6_type) { @@ -10644,7 +10644,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, action, reason, af)) { *action = PF_DROP; REASON_SET(reason, PFRES_SHORT); - return (-1); + return (PF_DROP); } pd->hdrlen = icmp_hlen; pd->pcksum = &pd->hdr.icmp6.icmp6_cksum; @@ -10667,7 +10667,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, MPASS(pd->pcksum != NULL); - return (0); + return (PF_PASS); } static __inline void @@ -10929,7 +10929,7 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0 PF_RULES_RLOCK(); if (pf_setup_pdesc(af, dir, &pd, m0, &action, &reason, - kif, default_actions) == -1) { + kif, default_actions) != PF_PASS) { if (action != PF_PASS) pd.act.log |= PF_LOG_FORCE; goto done; From nobody Sun Oct 5 20:51:48 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfvhj3HnPz6BfPr; Sun, 05 Oct 2025 20:51: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfvhj0Hg6z3w3f; Sun, 05 Oct 2025 20:51:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zcgh86PhGD9nYzG86Cdef856Xzie2RS67QsRqIyWvLI=; b=GPtWt6ChZLanZ+AiZmzy2BTWo/BVfjkmOb1UiJUcZn3dq0eGWkbpYeRddaVdZK8RC6k011 h7hM4Wnt55MqjJUDJyhq43Fwro2rY5U7GC83HtnGPeb5zTlQpFNlVFvpOLpCZbSy4Sq8J/ yVC2WUnsYbev6RW2LPVcJ1/vaYzTWkgaLMCAB4v8F6TN0Vpyz04KdZukyj1dXhVZE43X2Z zR+jUyJmbHNkWI8NdGu69NdK8jy2CCDcTdsWWaVviLyUJ5YTkTgPBscj4TxTfRw8vGVkVe HrvAr5wA5cY7XyG8XMuI9YpanMjuTrWY2VwFAfEwsARb9GeXGBCra88Rczk63Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zcgh86PhGD9nYzG86Cdef856Xzie2RS67QsRqIyWvLI=; b=I1C9SM0w8rI++VfrR2FGfEWlVcWQ1L5u1d3X1ikDazOynOLcUPydnazj5uxQqnZPUahDbd 0bLTj8eDRO/Pa3I/Xd+fgCgpV+8WaQiueVeZ7J6krZguS2wEwv0+f73Elxbh635qFxGhMY YA2XpmJpEc5quVK5r3Xh3PZHG+YCQdyOSpzP4glupQtmhhRGOwHQZSd97JbXN6XqRFHjx9 JIzR2WI4oRi1L+EHdmdAYshpuvJIHOa6wggCxUV0sTOFgtmvsm0HN+ax2eqVbRV9gaTowl 1ywv97JNGPzVseh55oIRCZKjoYe4TTUwggF1kcQHyyf40soxj8XFQ8IXwOoj4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759697509; a=rsa-sha256; cv=none; b=Cr5ASpzpi46OX598xDgD8aTAeZCDM+pHXFt7EpaXi4wW9QZwy9WOMGfvgldwNdbPJ8tD8C tYZO3w5+aAU95IuE9kS7qollB7lIBxqbmaP2CQv3ZdLWjbUg6eajvPy5pucuSDAKEINQPD B5FnvMrbJYjSg+wOkjuW1QR7+RQsOPWUb8PBqdEnpzY1igmcHXlFSDR6KzKizEdJTztwaL Faxy2Ix/raAFoBUpHhpSRfgfDlP/fDqOYGxTntS/6F6QpVEADRK5/q48uUgygE7JgcPQOy q7Nd/QRgAS/zQl7JgoO0N0p7Qk1Tql2EE2REkZ+Ayg1xRFturvWdwInZswH/VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfvhh6wCKzCpB; Sun, 05 Oct 2025 20:51: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 595KpmAV039973; Sun, 5 Oct 2025 20:51:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595KpmAG039970; Sun, 5 Oct 2025 20:51:48 GMT (envelope-from git) Date: Sun, 5 Oct 2025 20:51:48 GMT Message-Id: <202510052051.595KpmAG039970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ff566e6b9b8f - stable/15 - pf: fix 'natpass' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ff566e6b9b8fad0dc51184fa80e3b1269781f580 Auto-Submitted: auto-generated The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff566e6b9b8fad0dc51184fa80e3b1269781f580 commit ff566e6b9b8fad0dc51184fa80e3b1269781f580 Author: Kristof Provost AuthorDate: 2025-09-30 17:40:08 +0000 Commit: Kristof Provost CommitDate: 2025-10-05 20:47:34 +0000 pf: fix 'natpass' If an rdr (or nat) rule specifies 'pass' we don't run the filter rules, we just pass the traffic. Or at least, we did until that got unintentionally broken. Restore that behaviour and add a test case. MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52838 (cherry picked from commit b93394a38bc41f8afceaf0c03ed5d8b8b5a9aefb) --- sys/netpfil/pf/pf.c | 59 ++++++++++++++++++++++++--------------------- tests/sys/netpfil/pf/rdr.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 27 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9637c25f7a76..8d3d72148815 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5939,37 +5939,42 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, ctx.nat_pool = &(ctx.nr->rdr); } - ruleset = &pf_main_ruleset; - rv = pf_match_rule(&ctx, ruleset, match_rules); - if (rv == PF_TEST_FAIL) { - /* - * Reason has been set in pf_match_rule() already. - */ - goto cleanup; - } - - r = *ctx.rm; /* matching rule */ - ctx.a = *ctx.am; /* rule that defines an anchor containing 'r' */ - ruleset = *ctx.rsm; /* ruleset of the anchor defined by the rule 'a' */ - ctx.aruleset = ctx.arsm; /* ruleset of the 'a' rule itself */ + if (ctx.nr && ctx.nr->natpass) { + r = ctx.nr; + ruleset = *ctx.rsm; + } else { + ruleset = &pf_main_ruleset; + rv = pf_match_rule(&ctx, ruleset, match_rules); + if (rv == PF_TEST_FAIL) { + /* + * Reason has been set in pf_match_rule() already. + */ + goto cleanup; + } - REASON_SET(&ctx.reason, PFRES_MATCH); + r = *ctx.rm; /* matching rule */ + ctx.a = *ctx.am; /* rule that defines an anchor containing 'r' */ + ruleset = *ctx.rsm; /* ruleset of the anchor defined by the rule 'a' */ + ctx.aruleset = ctx.arsm; /* ruleset of the 'a' rule itself */ - /* apply actions for last matching pass/block rule */ - pf_rule_to_actions(r, &pd->act); - transerror = pf_rule_apply_nat(&ctx, r); - switch (transerror) { - case PFRES_MATCH: - /* Translation action found in rule and applied successfully */ - case PFRES_MAX: - /* No translation action found in rule */ - break; - default: - /* Translation action found in rule but failed to apply */ - REASON_SET(&ctx.reason, transerror); - goto cleanup; + /* apply actions for last matching pass/block rule */ + pf_rule_to_actions(r, &pd->act); + transerror = pf_rule_apply_nat(&ctx, r); + switch (transerror) { + case PFRES_MATCH: + /* Translation action found in rule and applied successfully */ + case PFRES_MAX: + /* No translation action found in rule */ + break; + default: + /* Translation action found in rule but failed to apply */ + REASON_SET(&ctx.reason, transerror); + goto cleanup; + } } + REASON_SET(&ctx.reason, PFRES_MATCH); + if (r->log) { if (ctx.rewrite) m_copyback(pd->m, pd->off, pd->hdrlen, pd->hdr.any); diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index f7c920bbfa8f..24b95b2047f4 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -281,8 +281,66 @@ srcport_pass_cleanup() pft_cleanup } +atf_test_case "natpass" "cleanup" +natpass_head() +{ + atf_set descr 'Test rdr pass' + atf_set require.user root +} + +natpass_body() +{ + pft_init + + epair=$(vnet_mkepair) + epair_link=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b ${epair_link}a + jexec alcatraz ifconfig lo0 inet 127.0.0.1/8 up + jexec alcatraz ifconfig ${epair}b inet 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair_link}a 198.51.100.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + vnet_mkjail srv ${epair_link}b + jexec srv ifconfig ${epair_link}b inet 198.51.100.2/24 up + jexec srv route add default 198.51.100.1 + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + atf_check -s exit:0 -o ignore \ + jexec alcatraz ping -c 1 198.51.100.2 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "rdr pass on ${epair}b proto udp from any to 192.0.2.1 port 80 -> 198.51.100.2" \ + "nat on ${epair}b inet from 198.51.100.0/24 to any -> 192.0.2.1" \ + "block in proto udp from any to any port 80" \ + "pass in proto icmp" + + echo "foo" | jexec srv nc -u -l 80 & + sleep 1 # Give the above a moment to start + + out=$(echo 1 | nc -u -w 1 192.0.2.1 80) + echo "out ${out}" + if [ "${out}" != "foo" ]; + then + jexec alcatraz pfctl -sn -vv + jexec alcatraz pfctl -ss -vv + atf_fail "rdr failed" + fi +} + +natpass_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { + atf_add_test_case "natpass" atf_add_test_case "tcp_v6_compat" atf_add_test_case "tcp_v6_pass" atf_add_test_case "srcport_compat" From nobody Sun Oct 5 20:51:49 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfvhk3ZWvz6BfPs; Sun, 05 Oct 2025 20:51: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfvhk0pX7z3wFP; Sun, 05 Oct 2025 20:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=POoV+NAKVtOtuakRvqGg0qjbfGc0S+Hd1n0RX++TNrc=; b=wpqmGWxjqZ2jt6+5O6RkDt3DMNNlWKBD96QyAI1hctQ7uUGru/TcE9VyWspT6JunGz8wWi vW7QSaDmxUSXGZfrjuHo11pnuKxaK8zaOTBbdkmR6AloWsT3Amzc8s9EEj1sw3vzUVs7TR /DZQGqNzeLyyu7TMZJ8z+UEuq76PrwTdG8o6LDrWu4zELgSRcfRpN9QN1Fs5SgmcI4Mx4E lkItobTs8Qhk7RkC6dIvujEAlmKpywJc48pEycMncpq5vpafzAGqfxuXnGWjF8URZ54xVd C+HDlaU0wOkdTXHjkSpZwCe1dk6XlMYCfW/V2aLFbTxfRsrrRcETyiXB9K5oCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=POoV+NAKVtOtuakRvqGg0qjbfGc0S+Hd1n0RX++TNrc=; b=Xcy/LzNFuNBCaLGt9XaxJwwau1E9W3TQSSKEPZ26GP417VZIYhGtFGPNm8r7UgB87aopZK Ko0Gwf9U+YoJBBHYNpDJFmhro3C3x5HsI9zZf68bk7r5IjCBuuAjsfDw/oLUQSURv+nx/J O1Vq870rup7cZfGTvDl3SXlC8nyH/RXhNAuOHysIyTsUBf3p4B2+RMX9yIx3o6FCH7HsLD 9KbGBD2FLIgSvBwiFiMNL1aexGhiPiMjNCGHzA6CshQ24kAGntsDKYpz+LTf5QtmXRdpG9 S6Mbsd5tEFwUUhyK+4SfyuHG67mB1yFQ6ozH9QUqDE6UyKFI5TfSc6j7cuhChg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759697510; a=rsa-sha256; cv=none; b=Hwv7V+n0bjinQrIEyNLBbk5lvJqX8N33g/p+4uJRUE+aJKBrCh2ZehpYGL30X45nAhoaan +Fm0IGeOgIxCXHUsv4IVP54R2taoDCFNE6IKxf9BCPZgaOHr2Agd+7NV5juZJSA43J4DL4 3o2KP5caFW5/4wCBEF0V4HGMDRGrx49s208e29lqpDlsyJbcO6ViSzL5QFAKxcafoOuAsh QcLYk8EDSSSPRdWRU+Nq4rBb6rp1YiBuSHmR5edW5jI/UcUB5rP4UK6VPWq1oE/STmt2Ax IaxpYraZ5GrJhSMAARmEZI0aMml7/x+wRcCcWA3MKLCGDsR4n+p5+nqIWaZY2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfvhk05rQzD5Z; Sun, 05 Oct 2025 20:51: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 595KpnKI040016; Sun, 5 Oct 2025 20:51:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595Kpngg040013; Sun, 5 Oct 2025 20:51:49 GMT (envelope-from git) Date: Sun, 5 Oct 2025 20:51:49 GMT Message-Id: <202510052051.595Kpngg040013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4c7dba0c93fc - stable/15 - atf_python: allow test scripts to pass jail options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4c7dba0c93fcec7f7db5d8a1aa8b98be07caff71 Auto-Submitted: auto-generated The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4c7dba0c93fcec7f7db5d8a1aa8b98be07caff71 commit 4c7dba0c93fcec7f7db5d8a1aa8b98be07caff71 Author: Kristof Provost AuthorDate: 2025-09-27 14:38:19 +0000 Commit: Kristof Provost CommitDate: 2025-10-05 20:47:34 +0000 atf_python: allow test scripts to pass jail options Test scripts based on atf_python can now pass jail command options via the 'opts' key in the 'vnetX' key of TOPOLOGY. Reviewed by: melifaro MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52761 (cherry picked from commit 2213e158886f72f45f288c94069a9a40c4f334ed) --- tests/atf_python/sys/net/vnet.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index c96eb5d671fc..f75a3eaa693e 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -283,14 +283,15 @@ class VnetFactory(object): time.sleep(0.1) return not_matched - def create_vnet(self, vnet_alias: str, ifaces: List[VnetInterface]): + def create_vnet(self, vnet_alias: str, ifaces: List[VnetInterface], opts: List[str]): vnet_name = "pytest:{}".format(convert_test_name(self.topology_id)) if self._vnets: # add number to distinguish jails vnet_name = "{}_{}".format(vnet_name, len(self._vnets) + 1) iface_cmds = " ".join(["vnet.interface={}".format(i.name) for i in ifaces]) - cmd = "/usr/sbin/jail -i -c name={} persist vnet {}".format( - vnet_name, iface_cmds + opt_cmds = " ".join(["{}".format(i) for i in opts]) + cmd = "/usr/sbin/jail -i -c name={} persist vnet {} {}".format( + vnet_name, iface_cmds, opt_cmds ) jid = 0 try: @@ -421,7 +422,10 @@ class VnetTestTemplate(BaseTest): idx = len(iface_map[iface_alias].vnet_aliases) iface_map[iface_alias].vnet_aliases.append(obj_name) vnet_ifaces.append(iface_map[iface_alias].ifaces[idx]) - vnet = vnet_factory.create_vnet(obj_name, vnet_ifaces) + opts = [] + if "opts" in obj_data: + opts = obj_data["opts"] + vnet = vnet_factory.create_vnet(obj_name, vnet_ifaces, opts) vnet_map[obj_name] = vnet # Allow reference to VNETs as attributes setattr(self, obj_name, vnet) From nobody Sun Oct 5 20:51:51 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfvhl4VMHz6BfjL; Sun, 05 Oct 2025 20:51: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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfvhl1ftWz3wS8; Sun, 05 Oct 2025 20:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JXeJvqIGZvhj30aar3/ZmmS/oV07RZR8S3AAfO5+tQU=; b=i77K/FX1yEmUgHL8fJqe8ISd+9ksXIW1drupFrMRhJomE9Fl13TkW+xbF4wpSHV1NBYMx6 012VCpoyxqvYtwUwOYgjWpIlkIE5N5kcYwBw/4r/SNNhuaoDtZRG08p+Ll1O3oD0f1RPCh wnXHa+UFaHWaR6eTtmallfwCEbK4Acg3EEvlfBmV7MQOjLwhFy/BbFY/INQN1ZmpQQw0HL 95cljgbmXG5ksd6Pe84ngo5lEhM8lIU7fqqMsYQXTBKjEis/dLzYSHSw/L2Zeydr+hSYAt VkBI/GZUSdZev4AQpsZSnVVjtCvnjTXO5zVn4blhTu/m5xDYp/b5IiU8DIJCcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JXeJvqIGZvhj30aar3/ZmmS/oV07RZR8S3AAfO5+tQU=; b=H3FCGVvBumiJhocjRfZW4F4fKsAspPXKed0AwRBXAQDsUP/QD/cv4JKyYWWSroC0xByvWN qmnxvxPVvwsNIVsOesMWUSRSiyof5l5FkSJqQC7cEGdT4GHT6iasOa3THKBCm4hymU/Lkf 3wSmVg3Z3373JSJyJPnpdv8vjcuLakjlL0mOC8plxCb1Abctah3vgnY9GS3zFWy/1lrQRM d6frsArkZeTyEGdAb5rZ2pUGAhxpFjgan4WonVO5bCQp1fPFU3qjoAkNyn5I9tzxKWGSqF uP+jHarx52gpjqRxyhPWK2sYZh+ZLfFK02McMqHDOXwfcSPL9WqnzumMRdElPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759697511; a=rsa-sha256; cv=none; b=gaA5XKQSSIef7FmlYxTiTLAwHu5Pbl1vUDvbFhN8Hu+Lc7cziz8bK1Jpjy/1pMui9me9DE WjCwG0fC+HeZoXymOZlmZAzn0osfHsvG2LVpI+WWXWguHEHWmQU7+XlNF/c06ZV8s6QksP w9zcEZMAUylu+YV7jaY1co+p4nu8rTC4YbXnFMgyLRqgglImMUYAJ458gla2Hi2piKy8xK K3U79fTMV3xRrII2EvHlqVJGO7cJ7Pi3NCsxQWcfJKjKRUhYOvCbLP8aujj4tb6RfRST4C xdrAHi7xzOk8dgpa+Kkjo04sLQXkMioS8E3Outm7yKVnGqfY0GbbyHugVzDe0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cfvhl1BbHzD3K; Sun, 05 Oct 2025 20:51: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 595KppVh040930; Sun, 5 Oct 2025 20:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595Kpp5S040927; Sun, 5 Oct 2025 20:51:51 GMT (envelope-from git) Date: Sun, 5 Oct 2025 20:51:51 GMT Message-Id: <202510052051.595Kpp5S040927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 3e79ec993dc7 - stable/15 - pf tests: fix intermittent mld test failures List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3e79ec993dc7f6a454705ff5e820aa977583a5f7 Auto-Submitted: auto-generated The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e79ec993dc7f6a454705ff5e820aa977583a5f7 commit 3e79ec993dc7f6a454705ff5e820aa977583a5f7 Author: Kristof Provost AuthorDate: 2025-09-27 14:41:30 +0000 Commit: Kristof Provost CommitDate: 2025-10-05 20:47:35 +0000 pf tests: fix intermittent mld test failures We can't reliably check for the absence of replies to our MLD queries (because a host may announce its multicast subscriptions), so enable pf logging and check for the relevant error message instead. PR: 289821 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52762 (cherry picked from commit a57f6ce4792f12bebdbe3e46d6d9d39da10055db) --- tests/sys/netpfil/pf/Makefile | 2 +- tests/sys/netpfil/pf/mld.py | 35 +++++++++++++++-------------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index d63431e64a96..720086bbbccd 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -71,7 +71,7 @@ ATF_TESTS_PYTEST+= tcp.py # Allow tests to run in parallel in their own jails TEST_METADATA+= execenv="jail" -TEST_METADATA+= execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA+= execenv_jail_params="vnet allow.raw_sockets allow.read_msgbuf" ${PACKAGE}FILES+= \ bsnmpd.conf \ diff --git a/tests/sys/netpfil/pf/mld.py b/tests/sys/netpfil/pf/mld.py index d118a34c8a7d..b3ef6c21b3de 100644 --- a/tests/sys/netpfil/pf/mld.py +++ b/tests/sys/netpfil/pf/mld.py @@ -32,23 +32,22 @@ from atf_python.sys.net.vnet import VnetTestTemplate class TestMLD(VnetTestTemplate): REQUIRED_MODULES = [ "pf" ] TOPOLOGY = { - "vnet1": {"ifaces": ["if1"]}, + "vnet1": {"ifaces": ["if1"], "opts": ["allow.read_msgbuf"]}, "vnet2": {"ifaces": ["if1"]}, "if1": {"prefixes6": [("2001:db8::2/64", "2001:db8::1/64")]}, } def vnet2_handler(self, vnet): ifname = vnet.iface_alias_map["if1"].name - #ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.print_output("/sbin/pfctl -e") ToolsHelper.pf_rules([ "pass", ]) ToolsHelper.print_output("/sbin/pfctl -x loud") - #ToolsHelper.print_output("echo \"j 230.0.0.1 %s\ns 3600\nq\" | /usr/sbin/mtest" % ifname) def find_mld_reply(self, pkt, ifname): pkt.show() - s = DelayedSend(pkt) + s = DelayedSend(pkt, ifname) found = False packets = self.sp.sniff(iface=ifname, timeout=5) @@ -66,7 +65,6 @@ class TestMLD(VnetTestTemplate): def test_router_alert(self): """Verify that we allow MLD packets with router alert extension header""" ifname = self.vnet.iface_alias_map["if1"].name - #ToolsHelper.print_output("/sbin/ifconfig %s inet6 -ifdisable" % ifname) ToolsHelper.print_output("/sbin/ifconfig") # Import in the correct vnet, so at to not confuse Scapy @@ -76,20 +74,17 @@ class TestMLD(VnetTestTemplate): self.sp = sp self.sc = sc - # A correct MLD query gets a reply - pkt = sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=1) \ - / sp.RouterAlert(value=0) \ + # MLD packets with an incorrect hop limit get dropped. + pkt = sp.Ether() \ + / sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=2) \ + / sp.IPv6ExtHdrHopByHop(options=[ \ + sp.RouterAlert(value=0) \ + ]) \ / sp.ICMPv6MLQuery2() - assert self.find_mld_reply(pkt, ifname) + # We can't reliably test this by checking for a reply, because + # the other jail may just send a spontaneous MLD reply. + self.find_mld_reply(pkt, ifname) - # The wrong extension header does not - pkt = sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=1) \ - / sp.IPv6ExtHdrRouting() \ - / sp.ICMPv6MLQuery2() - assert not self.find_mld_reply(pkt, ifname) - - # Neither does an incorrect hop limit - pkt = sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=2) \ - / sp.RouterAlert(value=0) \ - / sp.ICMPv6MLQuery2() - assert not self.find_mld_reply(pkt, ifname) + # Check if we logged dropping the MLD paacket + dmesg = ToolsHelper.get_output("/sbin/dmesg") + assert dmesg.find("Invalid MLD") != -1